From 6cb2f2488836da5288a0e7d0f46573caae1e0566 Mon Sep 17 00:00:00 2001 From: Pavel Boldin <pboldin@mirantis.com> Date: Sun, 12 Apr 2015 16:09:31 +0300 Subject: [PATCH] Update to MySQL 5.6.23 and wsrep 25.10 Amongst other things this fixes the (Heisen)bug caused by mixing mutexes and atomic operations to manage a variable in a thread safe manner. The wsrep patch was created by diffing original mysql-5.6.23 against [1] provided by galeracluster and fixing conflicts with existing patches. [1] http://releases.galeracluster.com/source/mysql-wsrep-5.6.23-25.10.tar.gz Related-Bug: #1462998 Related-Bug: #1438516 Change-Id: I3eff2760f8e0696a9798f9d2e99bfe78e8a6e314 --- debian/changelog | 11 + debian/patches/CVE-2014-0001.patch | 14 - debian/patches/mysql-5.6.16_wsrep_25.5.patch | 22742 -------- debian/patches/mysql-5.6.23_wsrep_25.10.patch | 43353 ++++++++++++++++ debian/patches/series | 3 +- debian/patches/wsrep_sst_mysqldump.patch | 29 +- mysql-wsrep-5.6/.gitignore | 3139 ++ mysql-wsrep-5.6/CMakeLists.txt | 173 +- mysql-wsrep-5.6/Docs/ChangeLog | 1374 +- mysql-wsrep-5.6/Docs/INFO_SRC | 12 +- mysql-wsrep-5.6/Docs/INSTALL-BINARY | 3132 +- mysql-wsrep-5.6/Docs/README-wsrep | 487 + mysql-wsrep-5.6/INSTALL-SOURCE | 12214 +++-- mysql-wsrep-5.6/README | 2 +- mysql-wsrep-5.6/VERSION | 2 +- mysql-wsrep-5.6/client/client_priv.h | 3 +- mysql-wsrep-5.6/client/mysql.cc | 19 +- mysql-wsrep-5.6/client/mysql_config_editor.cc | 44 +- mysql-wsrep-5.6/client/mysql_upgrade.c | 1 + mysql-wsrep-5.6/client/mysqladmin.cc | 70 +- mysql-wsrep-5.6/client/mysqlbinlog.cc | 191 +- mysql-wsrep-5.6/client/mysqlcheck.c | 9 +- mysql-wsrep-5.6/client/mysqldump.c | 109 +- mysql-wsrep-5.6/client/mysqlimport.c | 9 +- mysql-wsrep-5.6/client/mysqlshow.c | 8 +- mysql-wsrep-5.6/client/mysqlslap.c | 8 +- .../compiler_options.cmake | 59 +- .../build_configurations/feature_set.cmake | 1 - .../build_configurations/mysql_release.cmake | 1 + mysql-wsrep-5.6/cmake/compile_flags.cmake | 44 + .../cmake/cpack_source_ignore_files.cmake | 5 +- mysql-wsrep-5.6/cmake/dtrace.cmake | 27 +- mysql-wsrep-5.6/cmake/info_macros.cmake.in | 54 +- mysql-wsrep-5.6/cmake/info_src.cmake | 8 +- mysql-wsrep-5.6/cmake/install_macros.cmake | 19 +- mysql-wsrep-5.6/cmake/libutils.cmake | 2 +- mysql-wsrep-5.6/cmake/maintainer.cmake | 79 +- mysql-wsrep-5.6/cmake/make_dist.cmake.in | 61 +- mysql-wsrep-5.6/cmake/os/Darwin.cmake | 18 - mysql-wsrep-5.6/cmake/os/Linux.cmake | 1 - mysql-wsrep-5.6/cmake/os/Windows.cmake | 43 +- mysql-wsrep-5.6/cmake/os/WindowsCache.cmake | 7 +- mysql-wsrep-5.6/cmake/plugin.cmake | 7 - mysql-wsrep-5.6/cmake/ssl.cmake | 5 +- mysql-wsrep-5.6/config.h.cmake | 4 +- mysql-wsrep-5.6/configure.cmake | 48 +- mysql-wsrep-5.6/extra/mysql_waitpid.c | 6 +- mysql-wsrep-5.6/extra/replace.c | 4 +- mysql-wsrep-5.6/extra/yassl/CMakeLists.txt | 3 +- mysql-wsrep-5.6/extra/yassl/README | 66 +- mysql-wsrep-5.6/extra/yassl/certs/ca-cert.pem | 115 +- mysql-wsrep-5.6/extra/yassl/certs/ca-key.pem | 32 +- .../extra/yassl/certs/client-cert.der | Bin 699 -> 1198 bytes .../extra/yassl/certs/client-cert.pem | 110 +- .../extra/yassl/certs/client-key.der | Bin 318 -> 1192 bytes .../extra/yassl/certs/client-key.pem | 32 +- .../extra/yassl/certs/client-keyEnc.pem | 16 +- .../extra/yassl/certs/dsa-cert.pem | 88 +- mysql-wsrep-5.6/extra/yassl/certs/dsa1024.der | Bin 0 -> 448 bytes mysql-wsrep-5.6/extra/yassl/certs/dsa1024.pem | 12 + .../extra/yassl/certs/server-cert.pem | 194 +- .../extra/yassl/certs/server-key.pem | 32 +- .../extra/yassl/certs/server-keyEnc.pem | 34 +- .../extra/yassl/examples/client/client.cpp | 11 +- .../extra/yassl/examples/server/server.cpp | 23 +- .../extra/yassl/include/buffer.hpp | 18 +- .../extra/yassl/include/cert_wrapper.hpp | 7 +- .../extra/yassl/include/openssl/crypto.h | 1 + .../extra/yassl/include/openssl/des.h | 1 + .../extra/yassl/include/openssl/des_old.h | 1 + .../extra/yassl/include/openssl/engine.h | 1 + .../extra/yassl/include/openssl/err.h | 1 + .../extra/yassl/include/openssl/evp.h | 1 + .../include/openssl/generate_prefix_files.pl | 1 + .../extra/yassl/include/openssl/hmac.h | 1 + .../extra/yassl/include/openssl/lhash.h | 1 + .../extra/yassl/include/openssl/md4.h | 1 + .../extra/yassl/include/openssl/md5.h | 1 + .../extra/yassl/include/openssl/objects.h | 1 + .../extra/yassl/include/openssl/opensslv.h | 1 + .../extra/yassl/include/openssl/pem.h | 1 + .../extra/yassl/include/openssl/pkcs12.h | 1 + .../yassl/include/openssl/prefix_crypto.h | 1 + .../extra/yassl/include/openssl/rand.h | 1 + .../extra/yassl/include/openssl/rsa.h | 1 + .../extra/yassl/include/openssl/sha.h | 1 + .../extra/yassl/include/openssl/ssl.h | 4 +- .../extra/yassl/include/openssl/x509.h | 1 + .../extra/yassl/include/openssl/x509v3.h | 1 + .../extra/yassl/include/yassl_int.hpp | 21 + mysql-wsrep-5.6/extra/yassl/src/buffer.cpp | 113 +- .../extra/yassl/src/cert_wrapper.cpp | 14 +- .../extra/yassl/src/crypto_wrapper.cpp | 4 +- mysql-wsrep-5.6/extra/yassl/src/handshake.cpp | 29 +- mysql-wsrep-5.6/extra/yassl/src/ssl.cpp | 7 +- mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp | 246 +- mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp | 83 +- .../extra/yassl/taocrypt/CMakeLists.txt | 3 +- .../extra/yassl/taocrypt/include/asn.hpp | 16 +- .../extra/yassl/taocrypt/include/block.hpp | 6 +- .../extra/yassl/taocrypt/include/integer.hpp | 10 +- .../extra/yassl/taocrypt/include/misc.hpp | 9 +- .../extra/yassl/taocrypt/include/pwdbased.hpp | 8 +- .../extra/yassl/taocrypt/include/runtime.hpp | 17 +- .../extra/yassl/taocrypt/include/sha.hpp | 2 +- .../extra/yassl/taocrypt/src/aes.cpp | 85 +- .../extra/yassl/taocrypt/src/algebra.cpp | 9 +- .../extra/yassl/taocrypt/src/arc4.cpp | 52 +- .../extra/yassl/taocrypt/src/asn.cpp | 22 +- .../extra/yassl/taocrypt/src/blowfish.cpp | 43 +- .../extra/yassl/taocrypt/src/des.cpp | 52 +- .../extra/yassl/taocrypt/src/integer.cpp | 44 +- .../extra/yassl/taocrypt/src/md5.cpp | 50 +- .../extra/yassl/taocrypt/src/misc.cpp | 22 +- .../extra/yassl/taocrypt/src/rabbit.cpp | 17 +- .../extra/yassl/taocrypt/src/random.cpp | 3 +- .../extra/yassl/taocrypt/src/ripemd.cpp | 52 +- .../extra/yassl/taocrypt/src/rsa.cpp | 2 +- .../extra/yassl/taocrypt/src/sha.cpp | 54 +- .../extra/yassl/taocrypt/src/twofish.cpp | 50 +- .../extra/yassl/taocrypt/test/test.cpp | 14 +- .../extra/yassl/testsuite/cipher-test.sh | 130 + .../extra/yassl/testsuite/test.hpp | 42 +- mysql-wsrep-5.6/include/atomic/nolock.h | 4 +- mysql-wsrep-5.6/include/errmsg.h | 6 +- mysql-wsrep-5.6/include/my_aes.h | 120 +- mysql-wsrep-5.6/include/my_base.h | 10 +- mysql-wsrep-5.6/include/my_default.h | 3 +- mysql-wsrep-5.6/include/my_getopt.h | 3 +- mysql-wsrep-5.6/include/my_global.h | 51 +- mysql-wsrep-5.6/include/my_pthread.h | 27 +- mysql-wsrep-5.6/include/my_rnd.h | 1 + mysql-wsrep-5.6/include/mysql/plugin.h | 2 +- mysql-wsrep-5.6/include/mysql_version.h.in | 7 +- mysql-wsrep-5.6/include/queues.h | 1 + mysql-wsrep-5.6/include/t_ctype.h | 1 + .../include/welcome_copyright_notice.h | 4 +- mysql-wsrep-5.6/libmysql/CMakeLists.txt | 3 +- .../authentication_win/CMakeLists.txt | 3 +- mysql-wsrep-5.6/libmysql/errmsg.c | 4 +- mysql-wsrep-5.6/libmysql/libmysql.c | 28 +- mysql-wsrep-5.6/libmysqld/CMakeLists.txt | 36 +- mysql-wsrep-5.6/libmysqld/examples/test-run | 1 + mysql-wsrep-5.6/libmysqld/lib_sql.cc | 7 +- mysql-wsrep-5.6/man/comp_err.1 | 10 +- mysql-wsrep-5.6/man/innochecksum.1 | 6 +- mysql-wsrep-5.6/man/msql2mysql.1 | 22 +- mysql-wsrep-5.6/man/my_print_defaults.1 | 19 +- mysql-wsrep-5.6/man/myisam_ftdump.1 | 6 +- mysql-wsrep-5.6/man/myisamchk.1 | 118 +- mysql-wsrep-5.6/man/myisamlog.1 | 6 +- mysql-wsrep-5.6/man/myisampack.1 | 12 +- mysql-wsrep-5.6/man/mysql-stress-test.pl.1 | 6 +- mysql-wsrep-5.6/man/mysql-test-run.pl.1 | 10 +- mysql-wsrep-5.6/man/mysql.1 | 225 +- mysql-wsrep-5.6/man/mysql.server.1 | 12 +- mysql-wsrep-5.6/man/mysql_client_test.1 | 6 +- mysql-wsrep-5.6/man/mysql_config.1 | 6 +- mysql-wsrep-5.6/man/mysql_config_editor.1 | 24 +- .../man/mysql_convert_table_format.1 | 22 +- mysql-wsrep-5.6/man/mysql_find_rows.1 | 22 +- mysql-wsrep-5.6/man/mysql_fix_extensions.1 | 22 +- mysql-wsrep-5.6/man/mysql_install_db.1 | 240 +- mysql-wsrep-5.6/man/mysql_plugin.1 | 10 +- .../man/mysql_secure_installation.1 | 6 +- mysql-wsrep-5.6/man/mysql_setpermission.1 | 22 +- mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 | 8 +- mysql-wsrep-5.6/man/mysql_upgrade.1 | 459 +- mysql-wsrep-5.6/man/mysql_waitpid.1 | 8 +- mysql-wsrep-5.6/man/mysql_zap.1 | 8 +- mysql-wsrep-5.6/man/mysqlaccess.1 | 22 +- mysql-wsrep-5.6/man/mysqladmin.1 | 208 +- mysql-wsrep-5.6/man/mysqlbinlog.1 | 311 +- mysql-wsrep-5.6/man/mysqlbug.1 | 8 +- mysql-wsrep-5.6/man/mysqlcheck.1 | 222 +- mysql-wsrep-5.6/man/mysqld.8 | 6 +- mysql-wsrep-5.6/man/mysqld_multi.1 | 18 +- mysql-wsrep-5.6/man/mysqld_safe.1 | 85 +- mysql-wsrep-5.6/man/mysqldump.1 | 280 +- mysql-wsrep-5.6/man/mysqldumpslow.1 | 6 +- mysql-wsrep-5.6/man/mysqlhotcopy.1 | 26 +- mysql-wsrep-5.6/man/mysqlimport.1 | 204 +- mysql-wsrep-5.6/man/mysqlshow.1 | 204 +- mysql-wsrep-5.6/man/mysqlslap.1 | 214 +- mysql-wsrep-5.6/man/mysqltest.1 | 8 +- mysql-wsrep-5.6/man/ndb-common-options.1 | 134 +- mysql-wsrep-5.6/man/ndb_blob_tool.1 | 79 +- mysql-wsrep-5.6/man/ndb_config.1 | 235 +- mysql-wsrep-5.6/man/ndb_cpcd.1 | 6 +- mysql-wsrep-5.6/man/ndb_delete_all.1 | 31 +- mysql-wsrep-5.6/man/ndb_desc.1 | 43 +- mysql-wsrep-5.6/man/ndb_drop_index.1 | 20 +- mysql-wsrep-5.6/man/ndb_drop_table.1 | 18 +- mysql-wsrep-5.6/man/ndb_error_reporter.1 | 63 +- mysql-wsrep-5.6/man/ndb_index_stat.1 | 419 +- mysql-wsrep-5.6/man/ndb_mgm.1 | 38 +- mysql-wsrep-5.6/man/ndb_mgmd.8 | 283 +- mysql-wsrep-5.6/man/ndb_print_backup_file.1 | 13 +- mysql-wsrep-5.6/man/ndb_print_schema_file.1 | 15 +- mysql-wsrep-5.6/man/ndb_print_sys_file.1 | 15 +- mysql-wsrep-5.6/man/ndb_restore.1 | 431 +- mysql-wsrep-5.6/man/ndb_select_all.1 | 49 +- mysql-wsrep-5.6/man/ndb_select_count.1 | 32 +- mysql-wsrep-5.6/man/ndb_setup.py.1 | 199 +- mysql-wsrep-5.6/man/ndb_show_tables.1 | 24 +- mysql-wsrep-5.6/man/ndb_size.pl.1 | 46 +- mysql-wsrep-5.6/man/ndb_waiter.1 | 34 +- mysql-wsrep-5.6/man/ndbd.8 | 208 +- mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 | 40 +- mysql-wsrep-5.6/man/ndbinfo_select_all.1 | 64 +- mysql-wsrep-5.6/man/ndbmtd.8 | 8 +- mysql-wsrep-5.6/man/perror.1 | 6 +- mysql-wsrep-5.6/man/replace.1 | 6 +- mysql-wsrep-5.6/man/resolve_stack_dump.1 | 8 +- mysql-wsrep-5.6/man/resolveip.1 | 6 +- .../mysql-test/collections/default.daily | 4 + .../collections/default.experimental | 2 - .../mysql-test/collections/default.push | 2 +- .../collections/default.release.done | 2 +- .../mysql-test/collections/default.weekly | 2 + .../collections/disabled-gtid-on.list | 1 + .../binlog_tests/binlog_mysqlbinlog_fill.inc | 53 + .../binlog_mysqlbinlog_start_stop.inc | 35 +- .../binlog_tests/mysqlbinlog_start_stop_1.inc | 16 +- .../binlog_tests/mysqlbinlog_start_stop_2.inc | 19 +- .../extra/rpl_tests/grep_pattern.inc | 22 + .../extra/rpl_tests/rpl_auto_increment.test | 36 +- .../rpl_auto_increment_insert_view.test | 4 +- .../rpl_auto_increment_invoke_trigger.test | 4 +- .../rpl_autoinc_func_invokes_trigger.test | 4 +- .../extra/rpl_tests/rpl_binlog_error.inc | 483 + .../extra/rpl_tests/rpl_blackhole.test | 2 +- .../extra/rpl_tests/rpl_change_master.test | 8 +- .../extra/rpl_tests/rpl_charset.test | 16 +- .../rpl_tests/rpl_commit_after_flush.test | 4 +- .../extra/rpl_tests/rpl_conflicts.test | 7 +- .../extra/rpl_tests/rpl_crash_safe.inc | 5 +- .../extra/rpl_tests/rpl_crash_safe.test | 32 +- .../mysql-test/extra/rpl_tests/rpl_ddl.test | 8 +- .../extra/rpl_tests/rpl_deadlock.test | 2 - .../extra/rpl_tests/rpl_delete_no_where.test | 6 +- .../rpl_do_table_filter_insensitive.inc | 16 + .../rpl_do_table_filter_sensitive.inc | 16 + .../extra/rpl_tests/rpl_filters.test | 5 +- .../extra/rpl_tests/rpl_flsh_tbls.test | 2 +- .../extra/rpl_tests/rpl_foreign_key.test | 8 +- .../extra/rpl_tests/rpl_gtid_drop_table.inc | 48 + .../rpl_gtids_restart_slave_io_lost_trx.test | 112 + .../extra/rpl_tests/rpl_heartbeat_2slaves.inc | 133 + .../rpl_ignore_table_filter_insensitive.inc | 15 + .../rpl_ignore_table_filter_sensitive.inc | 15 + .../rpl_tests/rpl_implicit_commit_binlog.test | 4 +- .../extra/rpl_tests/rpl_insert_delayed.test | 12 +- .../extra/rpl_tests/rpl_insert_id.test | 42 +- .../extra/rpl_tests/rpl_insert_id_pk.test | 10 +- .../extra/rpl_tests/rpl_insert_ignore.test | 6 +- .../rpl_tests/rpl_insert_ignore_gtid_on.inc | 17 + .../extra/rpl_tests/rpl_kill_query.inc | 129 + .../extra/rpl_tests/rpl_loaddata.test | 10 +- .../extra/rpl_tests/rpl_loaddata_s.inc | 26 + .../extra/rpl_tests/rpl_loadfile.test | 4 +- .../mysql-test/extra/rpl_tests/rpl_log.test | 25 +- .../extra/rpl_tests/rpl_max_relay_size.test | 4 +- .../extra/rpl_tests/rpl_mts_crash_safe.inc | 4 - .../extra/rpl_tests/rpl_mts_crash_safe.test | 6 +- ...l_mts_execute_partial_trx_in_relay_log.inc | 36 + .../extra/rpl_tests/rpl_multi_query.test | 2 +- .../extra/rpl_tests/rpl_multi_update.test | 2 +- .../extra/rpl_tests/rpl_multi_update2.test | 11 +- .../extra/rpl_tests/rpl_multi_update3.test | 8 +- .../extra/rpl_tests/rpl_not_null.test | 16 +- .../extra/rpl_tests/rpl_parallel_load.test | 6 +- .../rpl_tests/rpl_parallel_load_innodb.test | 6 +- .../extra/rpl_tests/rpl_record_compare.test | 12 +- .../extra/rpl_tests/rpl_relayrotate.test | 2 +- .../extra/rpl_tests/rpl_row_001.test | 2 + .../extra/rpl_tests/rpl_row_UUID.test | 2 +- .../extra/rpl_tests/rpl_row_basic.test | 86 +- .../extra/rpl_tests/rpl_row_blob.test | 22 +- .../extra/rpl_tests/rpl_row_delayed_ins.test | 1 + .../rpl_tests/rpl_row_event_max_size.inc | 95 + .../extra/rpl_tests/rpl_row_func003.test | 10 +- .../extra/rpl_tests/rpl_row_idempotency.test | 30 +- .../rpl_row_show_relaylog_events.inc | 20 + .../extra/rpl_tests/rpl_row_sp002.test | 12 +- .../extra/rpl_tests/rpl_row_sp003.test | 9 +- .../extra/rpl_tests/rpl_row_sp006.test | 6 +- .../extra/rpl_tests/rpl_row_sp007.test | 4 +- .../extra/rpl_tests/rpl_set_null.test | 12 +- .../rpl_tests/rpl_show_relaylog_events.inc | 4 +- .../rpl_tests/rpl_stm_insert_delayed.inc | 10 + .../rpl_stm_mix_show_relaylog_events.inc | 20 + .../extra/rpl_tests/rpl_stop_slave.test | 4 + .../extra/rpl_tests/rpl_stress_test.inc | 2 +- .../extra/rpl_tests/rpl_sv_relay_space.test | 2 +- .../extra/rpl_tests/rpl_trig004.test | 7 +- .../extra/rpl_tests/rpl_truncate_helper.test | 10 +- .../mysql-test/include/begin_include_file.inc | 8 + .../mysql-test/include/change_file_perms.inc | 12 + .../mysql-test/include/check_ipv4_mapped.inc | 0 .../mysql-test/include/default_my.cnf | 1 + mysql-wsrep-5.6/mysql-test/include/eval.inc | 1 - .../mysql-test/include/func_aes_block.inc | 130 + .../include/get_file_permissions.inc | 9 + .../mysql-test/include/get_ndb_epochs.inc | 60 + .../mysql-test/include/gtid_step_assert.inc | 96 + .../mysql-test/include/gtid_step_reset.inc | 18 + .../mysql-test/include/gtid_utils.inc | 204 +- .../mysql-test/include/gtid_utils_end.inc | 10 +- .../mysql-test/include/have_QC_Disabled.inc | 0 .../mysql-test/include/have_perfschema.inc | 1 + .../mysql-test/include/have_util_nc.inc | 53 + .../mysql-test/include/install_semisync.inc | 1 - mysql-wsrep-5.6/mysql-test/include/linux.inc | 5 + .../mysql-test/include/master-slave.inc | 3 +- .../mysql-test/include/memcache_config.inc | 0 .../include/rpl_change_topology.inc | 10 + .../include/rpl_connection_master1.inc | 2 + .../mysql-test/include/rpl_end.inc | 14 + .../mysql-test/include/rpl_init.inc | 13 + .../mysql-test/include/rpl_stop_server.inc | 13 +- .../mysql-test/include/save_io_thread_pos.inc | 2 +- .../mysql-test/include/save_master_pos.inc | 9 +- .../mysql-test/include/show_all_binlogs.inc | 66 + .../include/show_all_relay_logs.inc | 70 + .../include/show_rpl_debug_info.inc | 19 +- .../mysql-test/include/shutdown_mysqld.inc | 0 .../mysql-test/include/start_mysqld.inc | 0 .../mysql-test/include/stop_dump_threads.inc | 5 +- .../mysql-test/include/subquery.inc | 16 + .../mysql-test/include/subquery_mat.inc | 47 + .../mysql-test/include/subquery_sj.inc | 80 + .../mysql-test/include/sync_slave_sql.inc | 43 +- .../include/sync_slave_sql_with_master.inc | 1 + .../mysql-test/include/truncate_file.inc | 6 +- .../mysql-test/include/uninstall_semisync.inc | 5 + .../wait_for_ndb_committed_to_binlog.inc | 57 + .../include/wait_for_slave_param.inc | 2 +- .../include/wait_for_slave_sql_error.inc | 20 +- .../include/wait_for_slave_sql_to_stop.inc | 1 + .../include/wait_show_condition.inc | 7 +- .../include/write_result_to_file.inc | 34 +- .../lib/My/SafeProcess/CMakeLists.txt | 2 +- mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm | 4 +- mysql-wsrep-5.6/mysql-test/lib/mtr_match.pm | 1 + mysql-wsrep-5.6/mysql-test/mysql-test-run.pl | 100 +- mysql-wsrep-5.6/mysql-test/purify.supp | 1 + .../mysql-test/r/alter_table.result | 24 +- .../mysql-test/r/bug17076131.result | 12 + .../mysql-test/r/check_auto_permission.result | 3 + mysql-wsrep-5.6/mysql-test/r/connect.result | 6 + .../mysql-test/r/count_distinct.result | 158 + mysql-wsrep-5.6/mysql-test/r/create.result | 4 +- .../mysql-test/r/ctype_binary.result | 7 + .../mysql-test/r/ctype_cp1251.result | 7 + .../mysql-test/r/ctype_cp932.result | 35 + .../mysql-test/r/ctype_latin1.result | 7 + .../mysql-test/r/ctype_ldml.result | 2 +- mysql-wsrep-5.6/mysql-test/r/ctype_uca.result | 14 + mysql-wsrep-5.6/mysql-test/r/ctype_ucs.result | 7 + .../mysql-test/r/ctype_utf8.result | 7 + .../mysql-test/r/ddl_i18n_koi8r.result | 192 +- .../mysql-test/r/ddl_i18n_utf8.result | 192 +- .../mysql-test/r/debug_sync.result | 32 +- mysql-wsrep-5.6/mysql-test/r/delayed.result | 5 + mysql-wsrep-5.6/mysql-test/r/derived.result | 226 + mysql-wsrep-5.6/mysql-test/r/distinct.result | 6 +- .../mysql-test/r/dynamic_tracing.result | 39 + .../mysql-test/r/events_bugs.result | 4 + .../mysql-test/r/file_contents.result | 2 +- mysql-wsrep-5.6/mysql-test/r/func_aes.result | 411 + .../mysql-test/r/func_aes_cfb1.result | 132 + .../mysql-test/r/func_aes_cfb128.result | 132 + .../mysql-test/r/func_aes_cfb8.result | 132 + .../mysql-test/r/func_aes_misc.result | 255 + .../mysql-test/r/func_aes_ofb.result | 132 + .../mysql-test/r/func_crypt.result | 23 + .../mysql-test/r/group_min_max.result | 82 +- .../mysql-test/r/group_min_max_innodb.result | 202 + .../mysql-test/r/have_cp1251.require | 2 +- .../mysql-test/r/have_cp866.require | 2 +- .../mysql-test/r/have_koi8r.require | 2 +- .../r/information_schema-big.result | 6 +- .../mysql-test/r/information_schema.result | 15 + .../mysql-test/r/innodb_mysql_lock.result | 5 +- .../mysql-test/r/innodb_mysql_sync.result | 181 + ...nodb_recovery_with_upper_case_names.result | 48 + mysql-wsrep-5.6/mysql-test/r/insert.result | 2 + mysql-wsrep-5.6/mysql-test/r/loaddata.result | 12 + mysql-wsrep-5.6/mysql-test/r/lock_sync.result | 94 +- .../mysql-test/r/log_errchk.result | 10 + .../mysql-test/r/lowercase_table4.result | 0 mysql-wsrep-5.6/mysql-test/r/myisam.result | 79 + .../mysql-test/r/mysql_config_editor.result | 2 +- .../mysql-test/r/mysql_upgrade.result | 100 + .../mysql-test/r/mysqlbinlog_debug.result | 7 + .../r/mysqlbinlog_mixed_or_statment.result | 26 + .../mysql-test/r/mysqlcheck.result | 3 - .../mysql-test/r/mysqld--help-notwin.result | 36 +- .../mysql-test/r/mysqld--help-win.result | 36 +- mysql-wsrep-5.6/mysql-test/r/mysqldump.result | 123 +- .../mysql-test/r/named_pipe.result | 0 mysql-wsrep-5.6/mysql-test/r/openssl_1.result | 6 +- .../mysql-test/r/outfile_loaddata.result | 24 +- mysql-wsrep-5.6/mysql-test/r/parser.result | 25 + mysql-wsrep-5.6/mysql-test/r/partition.result | 2 + .../mysql-test/r/partition_archive.result | 26 + .../r/partition_index_innodb.result | 116 + .../r/partition_index_myisam.result | 86 + .../mysql-test/r/partition_innodb.result | 173 + .../mysql-test/r/partition_pruning.result | 114 + mysql-wsrep-5.6/mysql-test/r/plugin.result | 70 + .../mysql-test/r/plugin_auth.result | 22 + .../mysql-test/r/plugin_auth_qa_3.result | 2 +- .../mysql-test/r/plugin_auth_sha256.result | 16 +- .../mysql-test/r/plugin_auth_sha256_2.result | 8 +- .../plugin_auth_sha256_server_default.result | 8 +- ...ugin_auth_sha256_server_default_tls.result | 8 +- .../mysql-test/r/query_cache.result | 56 + mysql-wsrep-5.6/mysql-test/r/shm.result | 0 .../mysql-test/r/show_processlist.result | 47 + mysql-wsrep-5.6/mysql-test/r/sp.result | 10 + .../mysql-test/r/sp_validation.result | 1 - mysql-wsrep-5.6/mysql-test/r/ssl.result | 4 +- mysql-wsrep-5.6/mysql-test/r/strict.result | 17 + .../mysql-test/r/subquery_all.result | 13 + .../mysql-test/r/subquery_all_bka.result | 13 + .../r/subquery_all_bka_nixbnl.result | 13 + .../mysql-test/r/subquery_mat.result | 53 + .../mysql-test/r/subquery_mat_all.result | 53 + .../mysql-test/r/subquery_mat_none.result | 53 + .../mysql-test/r/subquery_nomat_nosj.result | 13 + .../r/subquery_nomat_nosj_bka.result | 13 + .../r/subquery_nomat_nosj_bka_nixbnl.result | 13 + .../mysql-test/r/subquery_none.result | 13 + .../mysql-test/r/subquery_none_bka.result | 13 + .../r/subquery_none_bka_nixbnl.result | 13 + .../mysql-test/r/subquery_sj_all.result | 79 + .../mysql-test/r/subquery_sj_all_bka.result | 79 + .../r/subquery_sj_all_bka_nixbnl.result | 79 + .../r/subquery_sj_all_bkaunique.result | 79 + .../mysql-test/r/subquery_sj_dupsweed.result | 79 + .../r/subquery_sj_dupsweed_bka.result | 79 + .../r/subquery_sj_dupsweed_bka_nixbnl.result | 79 + .../r/subquery_sj_dupsweed_bkaunique.result | 79 + .../r/subquery_sj_firstmatch.result | 79 + .../r/subquery_sj_firstmatch_bka.result | 79 + .../subquery_sj_firstmatch_bka_nixbnl.result | 79 + .../r/subquery_sj_firstmatch_bkaunique.result | 79 + .../mysql-test/r/subquery_sj_loosescan.result | 79 + .../r/subquery_sj_loosescan_bka.result | 79 + .../r/subquery_sj_loosescan_bka_nixbnl.result | 79 + .../r/subquery_sj_loosescan_bkaunique.result | 79 + .../mysql-test/r/subquery_sj_mat.result | 79 + .../mysql-test/r/subquery_sj_mat_bka.result | 79 + .../r/subquery_sj_mat_bka_nixbnl.result | 79 + .../r/subquery_sj_mat_bkaunique.result | 79 + .../mysql-test/r/subquery_sj_mat_nosj.result | 79 + .../mysql-test/r/subquery_sj_none.result | 79 + .../mysql-test/r/subquery_sj_none_bka.result | 79 + .../r/subquery_sj_none_bka_nixbnl.result | 79 + .../r/subquery_sj_none_bkaunique.result | 79 + .../mysql-test/r/system_mysql_db.result | 2 +- mysql-wsrep-5.6/mysql-test/r/temp_pool.result | 19 + .../mysql-test/r/temporal_literal.result | 44 + mysql-wsrep-5.6/mysql-test/r/trigger.result | 17 + mysql-wsrep-5.6/mysql-test/r/type_date.result | 16 + .../mysql-test/r/type_datetime.result | 16 + .../r/type_temporal_fractional.result | 257 + .../mysql-test/r/type_timestamp.result | 16 + .../r/type_timestamp_explicit.result | 16 + mysql-wsrep-5.6/mysql-test/r/union.result | 34 + mysql-wsrep-5.6/mysql-test/r/user_var.result | 12 +- mysql-wsrep-5.6/mysql-test/r/variables.result | 4 + mysql-wsrep-5.6/mysql-test/r/view.result | 37 + mysql-wsrep-5.6/mysql-test/r/windows.result | 5 + .../mysql-test/std_data/bug17532932.MYD | 0 .../mysql-test/std_data/bug17532932.MYI | Bin 0 -> 1024 bytes .../mysql-test/std_data/bug17532932.frm | Bin 0 -> 8602 bytes .../mysql-test/std_data/cacert.pem | 92 +- .../mysql-test/std_data/checkDBI_DBD-mysql.pl | 0 .../mysql-test/std_data/client-cert.pem | 110 +- .../mysql-test/std_data/client-key.pem | 38 +- .../mysql-test/std_data/server-cert.pem | 105 +- .../mysql-test/std_data/server-key.pem | 32 +- .../mysql-test/std_data/server8k-cert.pem | 254 +- .../mysql-test/std_data/server8k-key.pem | 194 +- .../mysql-test/std_data/system_tap.stp | 168 + .../r/access_credential_control.result | 12 +- .../suite/binlog/r/binlog_error_action.result | 62 + .../binlog_gtid_mysqlbinlog_start_stop.result | 192 +- .../r/binlog_gtid_simple_recovery.result | 47 + .../suite/binlog/r/binlog_gtid_utils.result | 137 + .../binlog/r/binlog_mysqlbinlog_concat.result | 20 + .../r/binlog_mysqlbinlog_start_stop.result | 176 - ...qlbinlog_start_stop_slave_server_id.result | 153 + .../binlog/r/binlog_row_drop_tmp_tbl.result | 3 +- .../r/binlog_row_mix_innodb_myisam.result | 3 +- .../binlog/r/binlog_stm_drop_tmp_tbl.result | 3 +- .../r/binlog_stm_mix_innodb_myisam.result | 3 +- .../r/binlog_switch_inside_trans.result | 8 +- .../binlog/r/binlog_truncate_kill.result | 37 + .../suite/binlog/r/binlog_unsafe.result | 9 + .../suite/binlog/r/binlog_xa_handling.result | 10 + .../suite/binlog/t/binlog_error_action.test | 139 + .../suite/binlog/t/binlog_grant.test | 2 +- .../binlog/t/binlog_gtid_simple_recovery.test | 120 + .../suite/binlog/t/binlog_gtid_utils.test | 71 + .../suite/binlog/t/binlog_killed.test | 8 + .../binlog/t/binlog_mysqlbinlog_concat.test | 103 + ...ysqlbinlog_start_stop_slave_server_id.test | 54 + ...simplified_binlog_gtid_recovery-master.opt | 1 + .../binlog/t/binlog_switch_inside_trans.test | 6 +- .../suite/binlog/t/binlog_truncate_kill.test | 56 + .../suite/binlog/t/binlog_unsafe.test | 3 + .../suite/binlog/t/binlog_xa_handling.test | 22 + .../suite/funcs_1/r/is_columns_mysql.result | 2 +- .../r/is_columns_mysql_embedded.result | 2 +- .../suite/funcs_1/r/storedproc.result | 2 + .../innodb/include/checksum_not_strict.inc | 5 + .../suite/innodb/r/add_foreign_key.result | 31 + .../suite/innodb/r/blob-update-debug.result | 15 + .../suite/innodb/r/blob_redo.result | 42 + .../mysql-test/suite/innodb/r/checksum.result | 12 + .../suite/innodb/r/create-index.result | 9 + .../suite/innodb/r/foreign_key.result | 126 + .../innodb/r/index_tree_operation.result | 55 + .../innodb/r/innodb-alter-tempfile.result | 38 + .../suite/innodb/r/innodb-alter.result | 96 + .../suite/innodb/r/innodb-autoinc.result | 27 + .../suite/innodb/r/innodb-double-write.result | 254 + .../suite/innodb/r/innodb-lock.result | 13 + .../innodb/r/innodb-update-insert.result | 43 + .../suite/innodb/r/innodb-wl5980-alter.result | 144 + .../suite/innodb/r/innodb-wl5980-debug.result | 0 .../suite/innodb/r/innodb-wl5980-linux.result | 0 .../innodb/r/innodb-wl5980-windows.result | 0 .../mysql-test/suite/innodb/r/innodb.result | 2 +- .../r/innodb_blob_unrecoverable_crash.result | 23 + .../suite/innodb/r/innodb_bug14169459.result | 0 .../suite/innodb/r/innodb_bug34300.result | 3 +- .../suite/innodb/r/innodb_bug57904.result | 0 .../suite/innodb/r/innodb_bug60196.result | 0 .../suite/innodb/r/innodb_corrupt_bit.result | 1 + .../suite/innodb/r/innodb_ctype_ldml.result | 2 +- .../r/innodb_stats_external_pages.result | 19 + .../suite/innodb/r/insert_debug.result | 11 + .../mysql-test/suite/innodb/r/monitor.result | 549 + .../suite/innodb/r/monitor_debug.result | 20 + .../suite/innodb/r/sp_temp_table.result | 253 + .../suite/innodb/r/strict_mode.result | 242 + .../suite/innodb/t/add_foreign_key.test | 38 + .../suite/innodb/t/blob-update-debug.test | 17 + .../suite/innodb/t/blob_redo-master.opt | 1 + .../mysql-test/suite/innodb/t/blob_redo.test | 92 + .../mysql-test/suite/innodb/t/checksum.test | 15 + .../suite/innodb/t/create-index.test | 11 + .../suite/innodb/t/foreign_key.test | 87 + .../suite/innodb/t/index_tree_operation.test | 74 + .../suite/innodb/t/innodb-alter-tempfile.test | 72 + .../suite/innodb/t/innodb-alter.test | 40 + .../suite/innodb/t/innodb-autoinc.test | 14 + .../suite/innodb/t/innodb-double-write.test | 388 + .../suite/innodb/t/innodb-lock.test | 19 + .../innodb/t/innodb-multiple-tablespaces.test | 0 .../suite/innodb/t/innodb-update-insert.test | 38 + .../suite/innodb/t/innodb-wl5980-alter.test | 2 +- .../suite/innodb/t/innodb-wl5980-debug.test | 0 .../suite/innodb/t/innodb-wl5980-discard.test | 0 .../suite/innodb/t/innodb-wl5980-linux.test | 2 +- .../suite/innodb/t/innodb-wl5980-windows.test | 0 .../t/innodb_blob_unrecoverable_crash.test | 55 + .../suite/innodb/t/innodb_bug14169459.test | 0 .../suite/innodb/t/innodb_bug34300.test | 10 +- .../suite/innodb/t/innodb_bug57904.test | 0 .../suite/innodb/t/innodb_bug60196-master.opt | 0 .../suite/innodb/t/innodb_bug60196.test | 0 .../suite/innodb/t/innodb_corrupt_bit.test | 12 +- .../innodb/t/innodb_stats_external_pages.test | 83 + .../suite/innodb/t/insert_debug.test | 16 + .../mysql-test/suite/innodb/t/monitor.test | 387 + .../suite/innodb/t/monitor_debug.test | 40 + .../innodb/t/portability_wl5980_linux.zip | Bin .../innodb/t/portability_wl5980_windows.zip | Bin .../suite/innodb/t/sp_temp_table.test | 103 + .../suite/innodb/t/strict_mode.test | 249 + .../innodb_fts/r/fts_compatibility.result | 262 + .../innodb_fts/r/fts_compatibility_win.result | 262 + .../suite/innodb_fts/r/innodb-fts-ddl.result | 2 + .../suite/innodb_fts/r/innodb_fts_misc.result | 437 + .../innodb_fts/r/innodb_fts_misc_1.result | 3 + .../suite/innodb_fts/r/subexpr.result | 105 + .../suite/innodb_fts/t/fts_compatibility.test | 269 + .../innodb_fts/t/fts_compatibility_win.test | 263 + .../suite/innodb_fts/t/innodb_fts_misc.test | 152 + .../suite/innodb_fts/t/innodb_fts_misc_1.test | 3 + .../suite/innodb_fts/t/subexpr.test | 58 + .../suite/ndb/t/ndb_show_tables_result.inc | 0 .../suite/opt_trace/include/bugs.inc | 71 + .../suite/opt_trace/r/bugs_no_prot_all.result | 65 + .../opt_trace/r/bugs_no_prot_none.result | 65 + .../suite/opt_trace/r/bugs_ps_prot_all.result | 65 + .../opt_trace/r/bugs_ps_prot_none.result | 65 + .../suite/opt_trace/r/subquery_no_prot.result | 4 +- .../suite/opt_trace/r/subquery_ps_prot.result | 4 +- .../suite/opt_trace/validate_json.py | 0 .../suite/parts/r/partition_debug.result | 16 + .../parts/r/partition_exch_innodb.result | 0 .../parts/r/partition_exch_myisam.result | 0 .../r/partition_exch_myisam_innodb.result | 0 .../suite/parts/r/partition_exch_qa.result | 0 .../suite/parts/r/partition_exch_qa_10.result | 0 .../suite/parts/r/partition_exch_qa_11.result | 0 .../suite/parts/r/partition_exch_qa_14.result | 0 .../suite/parts/r/partition_exch_qa_3.result | 0 .../parts/r/partition_exch_qa_4_innodb.result | 0 .../parts/r/partition_exch_qa_4_myisam.result | 0 .../parts/r/partition_exch_qa_5_innodb.result | 0 .../parts/r/partition_exch_qa_5_myisam.result | 0 .../suite/parts/r/partition_exch_qa_6.result | 0 .../parts/r/partition_exch_qa_7_innodb.result | 0 .../parts/r/partition_exch_qa_7_myisam.result | 0 .../parts/r/partition_exch_qa_8_innodb.result | 0 .../parts/r/partition_exch_qa_8_myisam.result | 0 .../suite/parts/t/partition_debug.test | 18 + .../suite/perfschema/r/func_file_io.result | 1 + .../suite/perfschema/r/func_mutex.result | 1 + .../suite/perfschema/r/innodb_table_io.result | 3 - .../suite/perfschema/r/myisam_file_io.result | 1 + .../suite/perfschema/r/unary_digest.result | 47 + .../suite/perfschema/t/func_file_io.test | 1 + .../suite/perfschema/t/func_mutex.test | 1 + .../suite/perfschema/t/myisam_file_io.test | 1 + .../suite/perfschema/t/nesting.test | 1 + .../suite/perfschema/t/unary_digest.test | 98 + .../mysql-test/suite/rpl/r/rpl_000010.result | 2 + .../mysql-test/suite/rpl/r/rpl_000011.result | 3 + .../mysql-test/suite/rpl/r/rpl_000017.result | 1 + .../suite/rpl/r/rpl_4threads_deadlock.result | 54 + .../suite/rpl/r/rpl_DML_error.result | 4 + .../suite/rpl/r/rpl_LD_INFILE.result | 2 + .../mysql-test/suite/rpl/r/rpl_alter.result | 2 + .../suite/rpl/r/rpl_alter_db.result | 2 + .../suite/rpl/r/rpl_alter_repository.result | 5 + .../suite/rpl/r/rpl_auto_increment.result | 18 + .../rpl/r/rpl_auto_increment_11932.result | 1 + .../rpl/r/rpl_auto_increment_bug45679.result | 2 + .../rpl_auto_increment_update_failure.result | 28 + .../rpl/r/rpl_begin_commit_rollback.result | 3 + .../rpl/r/rpl_binlog_gcommit_options.result | 2 + .../mysql-test/suite/rpl/r/rpl_bit.result | 2 + .../mysql-test/suite/rpl/r/rpl_bit_npk.result | 3 + .../suite/rpl/r/rpl_blackhole.result | 12 + .../suite/rpl/r/rpl_bug31076.result | 1 + .../suite/rpl/r/rpl_bug37426.result | 2 + .../suite/rpl/r/rpl_bug41902.result | 1 + .../mysql-test/suite/rpl/r/rpl_charset.result | 8 + .../suite/rpl/r/rpl_charset_sjis.result | 2 + .../suite/rpl/r/rpl_check_gtid.result | 32 + .../suite/rpl/r/rpl_checksum_cache.result | 7 + .../mysql-test/suite/rpl/r/rpl_colSize.result | 21 + .../suite/rpl/r/rpl_commit_after_flush.result | 2 + .../suite/rpl/r/rpl_concurrency_error.result | 2 + .../rpl/r/rpl_conditional_comments.result | 3 + .../suite/rpl/r/rpl_corruption.result | 3 + .../suite/rpl/r/rpl_crash_safe_master.result | 6 + .../suite/rpl/r/rpl_create_database.result | 4 + .../rpl/r/rpl_create_drop_temp_table.result | 13 + .../rpl/r/rpl_create_if_not_exists.result | 5 + .../suite/rpl/r/rpl_current_user.result | 8 + .../suite/rpl/r/rpl_deadlock_innodb.result | 11 - .../suite/rpl/r/rpl_delete_no_where.result | 3 + .../suite/rpl/r/rpl_do_db_filter.result | 2 + .../r/rpl_do_table_filter_insensitive.result | 2 + .../r/rpl_do_table_filter_sensitive.result | 2 + .../mysql-test/suite/rpl/r/rpl_drop.result | 1 + .../suite/rpl/r/rpl_drop_db_fail.result | 20 + .../suite/rpl/r/rpl_drop_temp_gtid.result | 35 + .../suite/rpl/r/rpl_drop_view.result | 2 + .../suite/rpl/r/rpl_dual_pos_advance.result | 4 + .../suite/rpl/r/rpl_err_ignoredtable.result | 4 + .../mysql-test/suite/rpl/r/rpl_events.result | 3 + .../suite/rpl/r/rpl_extra_row_data.result | 2 + .../suite/rpl/r/rpl_filter_database.result | 3 + .../rpl/r/rpl_filter_tables_not_exist.result | 7 + .../suite/rpl/r/rpl_filter_warnings.result | 21 + .../suite/rpl/r/rpl_flush_logs.result | 7 + .../suite/rpl/r/rpl_flushlog_loop.result | 4 + .../suite/rpl/r/rpl_foreign_key_innodb.result | 4 + .../suite/rpl/r/rpl_free_items.result | 2 + .../suite/rpl/r/rpl_function_defaults.result | 2 + .../suite/rpl/r/rpl_general_log.result | 2 + .../suite/rpl/r/rpl_geometry.result | 1 + .../suite/rpl/r/rpl_get_lock.result | 2 + .../mysql-test/suite/rpl/r/rpl_grant.result | 12 + .../suite/rpl/r/rpl_grant_plugin.result | 4 + .../rpl/r/rpl_group_commit_deadlock.result | 2 + .../r/rpl_gtid_binary_log_as_relay_log.result | 23 + .../suite/rpl/r/rpl_gtid_binlog_errors.result | 270 + ...pl_gtid_do_table_filter_insensitive.result | 40 + .../rpl_gtid_do_table_filter_sensitive.result | 40 + .../suite/rpl/r/rpl_gtid_drop_table.result | 204 + .../rpl/r/rpl_gtid_empty_transaction.result | 111 + .../suite/rpl/r/rpl_gtid_execution.result | 112 +- .../suite/rpl/r/rpl_gtid_failover.result | 4 + .../rpl/r/rpl_gtid_heartbeat_2slave.result | 53 + ...tid_ignore_table_filter_insensitive.result | 40 + ..._gtid_ignore_table_filter_sensitive.result | 40 + .../suite/rpl/r/rpl_gtid_loaddata_s.result | 21 + .../suite/rpl/r/rpl_gtid_mode.result | 4 + .../suite/rpl/r/rpl_gtid_parallel.result | 1 + .../r/rpl_gtid_purged_fail_to_connect.result | 4 +- .../rpl/r/rpl_gtid_purged_maintained.result | 13 +- .../rpl/r/rpl_gtid_row_event_max_size.result | 70 + .../rpl_gtid_row_show_relaylog_events.result | 203 + .../suite/rpl/r/rpl_gtid_server_sighup.result | 41 + .../r/rpl_gtid_sql_until_before_after.result | 1 + .../rpl/r/rpl_gtid_stm_insert_delayed.result | 84 + ...l_gtid_stm_mix_show_relaylog_events.result | 182 + .../rpl/r/rpl_gtid_stress_failover.result | 1 + .../r/rpl_gtid_validate_slave_gtids.result | 28 + ...rpl_gtids_restart_slave_io_lost_trx.result | 74 + .../suite/rpl/r/rpl_heartbeat.result | 2 + .../suite/rpl/r/rpl_heartbeat_2slaves.result | 2 + .../suite/rpl/r/rpl_heartbeat_basic.result | 10 + .../suite/rpl/r/rpl_idempotency.result | 5 + .../suite/rpl/r/rpl_ignore_db_filter.result | 2 + .../suite/rpl/r/rpl_ignore_revoke.result | 3 + ...rpl_ignore_table_filter_insensitive.result | 2 + .../rpl_ignore_table_filter_sensitive.result | 2 + .../suite/rpl/r/rpl_incident.result | 1 + .../suite/rpl/r/rpl_init_slave.result | 3 + .../suite/rpl/r/rpl_innodb_bug28430.result | 1 + .../suite/rpl/r/rpl_innodb_bug30888.result | 1 + .../mysql-test/suite/rpl/r/rpl_insert.result | 2 + .../suite/rpl/r/rpl_insert_id.result | 21 + .../suite/rpl/r/rpl_insert_id_pk.result | 5 + .../suite/rpl/r/rpl_insert_ignore.result | 4 + .../suite/rpl/r/rpl_insert_on_update.result | 12 + .../suite/rpl/r/rpl_invoked_features.result | 3 + .../suite/rpl/r/rpl_kill_query.result | 124 + .../suite/rpl/r/rpl_killed_ddl.result | 1 + .../rpl/r/rpl_known_bugs_detection.result | 2 + .../r/rpl_lcase_tblnames_rewrite_db.result | 1 + .../suite/rpl/r/rpl_loaddata.result | 5 + .../suite/rpl/r/rpl_loaddata_charset.result | 2 + .../suite/rpl/r/rpl_loaddata_fatal.result | 2 + .../suite/rpl/r/rpl_loaddata_m.result | 2 + .../suite/rpl/r/rpl_loaddata_map.result | 2 + .../suite/rpl/r/rpl_loaddata_s.result | 2 + .../suite/rpl/r/rpl_loaddata_simple.result | 2 + .../suite/rpl/r/rpl_loaddata_symlink.result | 2 + .../suite/rpl/r/rpl_loaddatalocal.result | 13 + .../suite/rpl/r/rpl_loadfile.result | 3 + .../mysql-test/suite/rpl/r/rpl_locale.result | 2 + .../mysql-test/suite/rpl/r/rpl_log_pos.result | 2 + .../rpl/r/rpl_lost_events_on_rotate.result | 1 + .../rpl/r/rpl_manual_change_index_file.result | 5 + .../suite/rpl/r/rpl_many_optimize.result | 1 + .../suite/rpl/r/rpl_master_pos_wait.result | 1 + .../rpl/r/rpl_migration_crash_safe.result | 2 + .../suite/rpl/r/rpl_misc_functions.result | 3 + .../suite/rpl/r/rpl_mix_found_rows.result | 6 + .../suite/rpl/r/rpl_mix_insert_delayed.result | 6 + .../suite/rpl/r/rpl_mixed_bit_pk.result | 2 + .../suite/rpl/r/rpl_mixed_ddl_dml.result | 3 + .../r/rpl_mixed_drop_create_temp_table.result | 27 +- .../r/rpl_mixed_implicit_commit_binlog.result | 2 + .../suite/rpl/r/rpl_mts_debug.result | 3 + ...ecute_partial_trx_with_auto_pos_off.result | 26 + ...xecute_partial_trx_with_auto_pos_on.result | 26 + ...mts_gtids_restart_slave_io_lost_trx.result | 74 + ...rpl_mts_slave_hang_with_partial_trx.result | 28 + .../suite/rpl/r/rpl_multi_delete.result | 1 + .../suite/rpl/r/rpl_multi_delete2.result | 1 + .../suite/rpl/r/rpl_multi_engine.result | 5 + .../suite/rpl/r/rpl_multi_update.result | 1 + .../suite/rpl/r/rpl_multi_update2.result | 4 + .../suite/rpl/r/rpl_multi_update3.result | 4 + .../suite/rpl/r/rpl_multi_update4.result | 2 + .../suite/rpl/r/rpl_mysql_upgrade.result | 2 + .../rpl/r/rpl_mysqlbinlog_gtid_on.result | 1 + .../suite/rpl/r/rpl_name_const.result | 1 + .../r/rpl_nondeterministic_functions.result | 1 + .../suite/rpl/r/rpl_not_null_innodb.result | 8 + .../suite/rpl/r/rpl_not_null_myisam.result | 8 + .../suite/rpl/r/rpl_optimize.result | 1 + .../mysql-test/suite/rpl/r/rpl_packet.result | 9 + .../suite/rpl/r/rpl_parallel.result | 18 + .../rpl/r/rpl_parallel_change_master.result | 2 + .../rpl/r/rpl_parallel_conf_limits.result | 2 + .../suite/rpl/r/rpl_parallel_conflicts.result | 2 + .../suite/rpl/r/rpl_parallel_ddl.result | 3 + .../suite/rpl/r/rpl_parallel_innodb.result | 18 + .../suite/rpl/r/rpl_parallel_multi_db.result | 6 + .../rpl_parallel_seconds_behind_master.result | 8 +- .../rpl/r/rpl_parallel_start_stop.result | 9 + .../rpl/r/rpl_parallel_temp_query.result | 4 + .../rpl/r/rpl_parallel_worker_error.result | 16 + .../mysql-test/suite/rpl/r/rpl_ps.result | 3 + .../suite/rpl/r/rpl_rbr_to_sbr.result | 1 + .../rpl/r/rpl_read_old_relay_log_info.result | 1 + .../suite/rpl/r/rpl_read_only.result | 5 + .../r/rpl_recovery_empty_sqlthd_pos.result | 25 + ...l_recovery_replicate_same_server_id.result | 26 + .../suite/rpl/r/rpl_relay_space_innodb.result | 1 + .../suite/rpl/r/rpl_relay_space_myisam.result | 1 + .../suite/rpl/r/rpl_relayrotate.result | 1 + .../suite/rpl/r/rpl_replicate_do.result | 5 + ...pl_replicate_event_after_sync_stage.result | 31 + .../rpl/r/rpl_replicate_ignore_db.result | 3 + .../suite/rpl/r/rpl_report_port.result | 1 + .../suite/rpl/r/rpl_rewrite_db_filter.result | 2 + .../suite/rpl/r/rpl_rewrt_db.result | 9 + .../suite/rpl/r/rpl_rotate_gtid.result | 39 + .../suite/rpl/r/rpl_rotate_logs.result | 6 + .../rpl/r/rpl_rotate_purge_deadlock.result | 2 + .../suite/rpl/r/rpl_rotate_row_trans.result | 39 + .../mysql-test/suite/rpl/r/rpl_row_001.result | 1 + .../suite/rpl/r/rpl_row_4_bytes.result | 2 + .../mysql-test/suite/rpl/r/rpl_row_NOW.result | 2 + .../suite/rpl/r/rpl_row_USER.result | 2 + .../suite/rpl/r/rpl_row_UUID.result | 1 + .../suite/rpl/r/rpl_row_basic_11bugs.result | 17 + .../suite/rpl/r/rpl_row_basic_2myisam.result | 42 + .../suite/rpl/r/rpl_row_basic_3innodb.result | 42 + .../rpl/r/rpl_row_basic_8partition.result | 9 + .../rpl/r/rpl_row_basic_allow_batching.result | 42 + .../suite/rpl/r/rpl_row_blob_innodb.result | 5 + .../suite/rpl/r/rpl_row_blob_myisam.result | 5 + .../suite/rpl/r/rpl_row_colSize.result | 2 + .../suite/rpl/r/rpl_row_conflicts.result | 6 + .../suite/rpl/r/rpl_row_corrupt.result | 14 + .../suite/rpl/r/rpl_row_corruption.result | 4 + .../suite/rpl/r/rpl_row_crash_safe.result | 477 +- .../suite/rpl/r/rpl_row_create_select.result | 31 + .../suite/rpl/r/rpl_row_drop.result | 5 + .../r/rpl_row_drop_create_temp_table.result | 29 +- .../suite/rpl/r/rpl_row_event_max_size.result | 4 + .../suite/rpl/r/rpl_row_find_row.result | 8 + .../suite/rpl/r/rpl_row_flsh_tbls.result | 1 + .../suite/rpl/r/rpl_row_func001.result | 2 + .../suite/rpl/r/rpl_row_func002.result | 2 + .../suite/rpl/r/rpl_row_func003.result | 1 + .../suite/rpl/r/rpl_row_hash_scan.result | 18 + .../rpl/r/rpl_row_hash_scan_sanity.result | 23 + .../suite/rpl/r/rpl_row_idempotency.result | 30 + .../rpl/r/rpl_row_ignorable_event.result | 1 + .../suite/rpl/r/rpl_row_img_misc.result | 2 + .../suite/rpl/r/rpl_row_img_sanity.result | 48 + .../r/rpl_row_implicit_commit_binlog.result | 2 + .../suite/rpl/r/rpl_row_inexist_tbl.result | 1 + .../suite/rpl/r/rpl_row_insert_delayed.result | 6 + .../mysql-test/suite/rpl/r/rpl_row_log.result | 4 + .../suite/rpl/r/rpl_row_log_innodb.result | 4 + .../suite/rpl/r/rpl_row_max_relay_size.result | 2 + .../suite/rpl/r/rpl_row_merge_engine.result | 3 + .../suite/rpl/r/rpl_row_mts_crash_safe.result | 2737 +- .../rpl/r/rpl_row_mts_rec_crash_safe.result | 2737 +- .../r/rpl_row_mts_show_relaylog_events.result | 2 + .../rpl/r/rpl_row_rec_comp_innodb.result | 6 + .../rpl/r/rpl_row_rec_comp_myisam.result | 8 + .../rpl/r/rpl_row_record_find_myisam.result | 1 + .../rpl/r/rpl_row_show_relaylog_events.result | 2 + .../suite/rpl/r/rpl_row_sp001.result | 5 + .../suite/rpl/r/rpl_row_sp002_innodb.result | 6 + .../suite/rpl/r/rpl_row_sp003.result | 3 + .../suite/rpl/r/rpl_row_sp005.result | 3 + .../suite/rpl/r/rpl_row_sp006_InnoDB.result | 3 + .../suite/rpl/r/rpl_row_sp007_innodb.result | 2 + .../suite/rpl/r/rpl_row_sp008.result | 2 + .../suite/rpl/r/rpl_row_sp009.result | 4 + .../suite/rpl/r/rpl_row_sp010.result | 3 + .../suite/rpl/r/rpl_row_sp011.result | 2 + .../suite/rpl/r/rpl_row_sp012.result | 2 + .../suite/rpl/r/rpl_row_tbl_metadata.result | 13 + .../suite/rpl/r/rpl_row_trig001.result | 3 + .../suite/rpl/r/rpl_row_trig002.result | 4 + .../suite/rpl/r/rpl_row_trig003.result | 1 + .../suite/rpl/r/rpl_row_trig004.result | 2 + .../suite/rpl/r/rpl_row_trunc_temp.result | 2 + .../suite/rpl/r/rpl_row_unsafe_funcs.result | 2 + .../suite/rpl/r/rpl_row_until.result | 4 + .../suite/rpl/r/rpl_row_utf16.result | 1 + .../suite/rpl/r/rpl_row_utf32.result | 1 + .../suite/rpl/r/rpl_row_view01.result | 4 + .../suite/rpl/r/rpl_row_wide_table.result | 2 + .../rpl/r/rpl_sbm_previous_gtid_event.result | 61 + .../rpl/r/rpl_seconds_behind_master.result | 5 + .../suite/rpl/r/rpl_semi_sync.result | 15 +- .../suite/rpl/r/rpl_semi_sync_deadlock.result | 4 +- .../suite/rpl/r/rpl_semi_sync_event.result | 1 + .../rpl/r/rpl_semi_sync_future_logpos.result | 32 + ...rpl_semi_sync_group_commit_deadlock.result | 2 + ...semi_sync_non_group_commit_deadlock.result | 2 + .../rpl/r/rpl_semi_sync_shutdown_hang.result | 24 + .../r/rpl_semi_sync_uninstall_plugin.result | 39 + .../suite/rpl/r/rpl_sequential.result | 18 + .../suite/rpl/r/rpl_server_id2.result | 1 + .../suite/rpl/r/rpl_server_id_ignore.result | 3 + .../suite/rpl/r/rpl_server_uuid.result | 25 +- .../suite/rpl/r/rpl_session_var.result | 4 + .../suite/rpl/r/rpl_set_charset.result | 2 + .../suite/rpl/r/rpl_set_null_innodb.result | 6 + .../suite/rpl/r/rpl_set_null_myisam.result | 6 + .../suite/rpl/r/rpl_show_errors.result | 1 + .../suite/rpl/r/rpl_show_slave_running.result | 1 + .../r/rpl_show_slave_status_deadlock.result | 33 + .../suite/rpl/r/rpl_skip_error.result | 9 + .../suite/rpl/r/rpl_skip_incident.result | 2 + .../rpl/r/rpl_skip_slave_err_warnings.result | 13 + .../suite/rpl/r/rpl_slave_grp_exec.result | 6 + .../suite/rpl/r/rpl_slave_load_in.result | 2 + .../suite/rpl/r/rpl_slave_skip.result | 7 + .../suite/rpl/r/rpl_slave_status.result | 3 + .../suite/rpl/r/rpl_slow_query_log.result | 7 + .../mysql-test/suite/rpl/r/rpl_sp.result | 28 + .../mysql-test/suite/rpl/r/rpl_sp004.result | 4 + .../suite/rpl/r/rpl_sp_effects.result | 10 + .../suite/rpl/r/rpl_spec_variables.result | 8 + .../suite/rpl/r/rpl_sporadic_master.result | 3 + ...l_thread_killed_waiting_commit_lock.result | 38 + .../mysql-test/suite/rpl/r/rpl_ssl.result | 22 +- .../mysql-test/suite/rpl/r/rpl_ssl1.result | 5 + .../suite/rpl/r/rpl_stm_000001.result | 6 + .../r/rpl_stm_auto_increment_bug33029.result | 4 + .../suite/rpl/r/rpl_stm_conflicts.result | 3 + .../r/rpl_stm_drop_create_temp_table.result | 27 +- .../suite/rpl/r/rpl_stm_flsh_tbls.result | 1 + .../suite/rpl/r/rpl_stm_found_rows.result | 3 + .../r/rpl_stm_implicit_commit_binlog.result | 2 + .../suite/rpl/r/rpl_stm_insert_delayed.result | 6 + .../rpl/r/rpl_stm_loaddata_concurrent.result | 5 + .../suite/rpl/r/rpl_stm_loadfile.result | 2 + .../mysql-test/suite/rpl/r/rpl_stm_log.result | 4 + .../suite/rpl/r/rpl_stm_max_relay_size.result | 2 + ...pl_stm_mix_mts_show_relaylog_events.result | 2 + .../r/rpl_stm_mix_show_relaylog_events.result | 2 + .../rpl/r/rpl_stm_mixed_crash_safe.result | 391 +- .../rpl/r/rpl_stm_mixed_mts_crash_safe.result | 2737 +- .../r/rpl_stm_mixed_mts_rec_crash_safe.result | 2737 +- ...m_mixed_mts_rec_crash_safe_checksum.result | 2737 +- ..._stm_mixed_mts_rec_crash_safe_small.result | 799 +- .../suite/rpl/r/rpl_stm_mixing_engines.result | 3 + .../suite/rpl/r/rpl_stm_multi_query.result | 1 + .../suite/rpl/r/rpl_stm_no_op.result | 10 + .../rpl/r/rpl_stm_relay_ign_space.result | 3 + .../suite/rpl/r/rpl_stm_sql_mode.result | 1 + .../suite/rpl/r/rpl_stm_until.result | 3 + .../r/rpl_stm_until_pos_middle_gtid.result | 27 + .../suite/rpl/r/rpl_stm_user_variables.result | 9 + .../suite/rpl/r/rpl_stop_slave.result | 11 +- .../rpl/r/rpl_switch_stm_row_mixed.result | 14 + .../mysql-test/suite/rpl/r/rpl_sync.result | 3 + .../suite/rpl/r/rpl_temp_table.result | 1 + .../suite/rpl/r/rpl_temp_table_mix_row.result | 8 + .../rpl/r/rpl_temporal_fractional.result | 6 + .../suite/rpl/r/rpl_temporary.result | 10 + .../suite/rpl/r/rpl_temporary_errors.result | 2 + .../rpl/r/rpl_timestamp_upgrage_55.result | 26 + .../suite/rpl/r/rpl_timezone.result | 10 + .../suite/rpl/r/rpl_tmp_table_and_DDL.result | 1 + .../mysql-test/suite/rpl/r/rpl_trigger.result | 40 + .../suite/rpl/r/rpl_trunc_temp.result | 3 + .../suite/rpl/r/rpl_truncate_2myisam.result | 10 + .../suite/rpl/r/rpl_truncate_3innodb.result | 10 + .../suite/rpl/r/rpl_typeconv.result | 1 + .../suite/rpl/r/rpl_typeconv_innodb.result | 2 + .../rpl/r/rpl_unknown_ignorable_event.result | 28 + .../mysql-test/suite/rpl/r/rpl_user.result | 6 + .../suite/rpl/r/rpl_user_variables.result | 17 + .../suite/rpl/r/rpl_variables.result | 5 + .../suite/rpl/r/rpl_variables_stm.result | 3 + .../mysql-test/suite/rpl/r/rpl_view.result | 16 +- .../suite/rpl/r/rpl_view_multi.result | 4 + .../mysql-test/suite/rpl/t/rpl_000010.test | 5 +- .../mysql-test/suite/rpl/t/rpl_000011.test | 6 +- .../mysql-test/suite/rpl/t/rpl_000017.test | 2 +- .../suite/rpl/t/rpl_4threads_deadlock.test | 120 + .../mysql-test/suite/rpl/t/rpl_DML_error.test | 8 +- .../mysql-test/suite/rpl/t/rpl_LD_INFILE.test | 5 +- .../mysql-test/suite/rpl/t/rpl_alter.test | 4 +- .../mysql-test/suite/rpl/t/rpl_alter_db.test | 4 +- .../suite/rpl/t/rpl_alter_repository.test | 11 +- .../suite/rpl/t/rpl_auto_increment_11932.test | 2 +- .../rpl/t/rpl_auto_increment_bug33029.test | 1 + .../rpl/t/rpl_auto_increment_bug45679.test | 4 +- .../t/rpl_auto_increment_update_failure.test | 16 +- .../rpl/t/rpl_begin_commit_rollback.test | 6 +- .../suite/rpl/t/rpl_binlog_corruption.test | 1 + .../suite/rpl/t/rpl_binlog_errors.test | 482 +- .../rpl/t/rpl_binlog_gcommit_options.test | 5 +- .../suite/rpl/t/rpl_binlog_index.test | 1 + .../mysql-test/suite/rpl/t/rpl_bit.test | 4 +- .../mysql-test/suite/rpl/t/rpl_bit_npk.test | 6 +- .../mysql-test/suite/rpl/t/rpl_blackhole.test | 4 +- .../mysql-test/suite/rpl/t/rpl_bug31076.test | 2 +- .../mysql-test/suite/rpl/t/rpl_bug37426.test | 4 +- .../mysql-test/suite/rpl/t/rpl_bug41902.test | 2 +- .../suite/rpl/t/rpl_charset_sjis.test | 4 +- .../suite/rpl/t/rpl_check_gtid.test | 24 +- .../mysql-test/suite/rpl/t/rpl_checksum.test | 1 + .../suite/rpl/t/rpl_checksum_cache.test | 19 +- .../suite/rpl/t/rpl_circular_for_4_hosts.test | 1 + .../mysql-test/suite/rpl/t/rpl_colSize.test | 68 +- .../suite/rpl/t/rpl_concurrency_error.test | 4 +- .../suite/rpl/t/rpl_conditional_comments.test | 6 +- .../suite/rpl/t/rpl_corruption.test | 6 +- .../suite/rpl/t/rpl_crash_safe_master.test | 13 +- .../suite/rpl/t/rpl_create_database.test | 8 +- .../rpl/t/rpl_create_drop_temp_table.test | 74 + .../suite/rpl/t/rpl_create_if_not_exists.test | 10 +- .../suite/rpl/t/rpl_critical_errors.test | 2 +- .../suite/rpl/t/rpl_current_user.test | 21 +- .../suite/rpl/t/rpl_deadlock_innodb.test | 1 + .../suite/rpl/t/rpl_delayed_slave.test | 6 +- .../suite/rpl/t/rpl_do_db_filter.test | 2 +- .../mysql-test/suite/rpl/t/rpl_do_grant.test | 1 + .../t/rpl_do_table_filter_insensitive.test | 10 +- .../rpl/t/rpl_do_table_filter_sensitive.test | 11 +- .../mysql-test/suite/rpl/t/rpl_drop.test | 2 +- .../mysql-test/suite/rpl/t/rpl_drop_db.test | 1 + .../suite/rpl/t/rpl_drop_db_fail.test | 31 + .../mysql-test/suite/rpl/t/rpl_drop_temp.test | 1 + .../suite/rpl/t/rpl_drop_temp_gtid.test | 53 + .../mysql-test/suite/rpl/t/rpl_drop_view.test | 4 +- .../suite/rpl/t/rpl_dual_pos_advance.test | 22 +- .../suite/rpl/t/rpl_err_ignoredtable.test | 8 +- .../mysql-test/suite/rpl/t/rpl_events.test | 6 +- .../rpl/t/rpl_extra_col_master_innodb.test | 1 + .../rpl/t/rpl_extra_col_master_myisam.test | 1 + .../rpl/t/rpl_extra_col_slave_innodb.test | 1 + .../rpl/t/rpl_extra_col_slave_myisam.test | 1 + .../suite/rpl/t/rpl_extra_row_data.test | 4 +- .../suite/rpl/t/rpl_failed_optimize.test | 4 + .../suite/rpl/t/rpl_filter_database.test | 6 +- .../rpl/t/rpl_filter_tables_not_exist.test | 15 +- .../suite/rpl/t/rpl_filter_warnings-slave.opt | 1 + .../suite/rpl/t/rpl_filter_warnings.test | 49 + .../suite/rpl/t/rpl_flush_logs.test | 13 +- .../suite/rpl/t/rpl_flushlog_loop.test | 12 +- .../suite/rpl/t/rpl_free_items.test | 4 +- .../suite/rpl/t/rpl_function_defaults.test | 4 +- .../suite/rpl/t/rpl_general_log.test | 4 +- .../mysql-test/suite/rpl/t/rpl_geometry.test | 2 +- .../mysql-test/suite/rpl/t/rpl_get_lock.test | 4 +- .../mysql-test/suite/rpl/t/rpl_grant.test | 25 +- .../suite/rpl/t/rpl_grant_plugin.test | 8 +- .../t/rpl_gtid_binary_log_as_relay_log.test | 57 + .../rpl/t/rpl_gtid_binlog_errors-master.opt | 1 + .../suite/rpl/t/rpl_gtid_binlog_errors.test | 6 + ...tid_do_table_filter_insensitive-master.opt | 1 + ...gtid_do_table_filter_insensitive-slave.opt | 1 + .../rpl_gtid_do_table_filter_insensitive.test | 9 + ..._gtid_do_table_filter_sensitive-master.opt | 1 + ...l_gtid_do_table_filter_sensitive-slave.opt | 1 + .../t/rpl_gtid_do_table_filter_sensitive.test | 9 + .../suite/rpl/t/rpl_gtid_drop_table.cnf | 11 + .../suite/rpl/t/rpl_gtid_drop_table.test | 338 + .../rpl/t/rpl_gtid_empty_transaction.cnf | 25 + .../rpl/t/rpl_gtid_empty_transaction.test | 301 + .../suite/rpl/t/rpl_gtid_execution-master.opt | 2 +- .../suite/rpl/t/rpl_gtid_execution-slave.opt | 2 +- .../suite/rpl/t/rpl_gtid_execution.test | 7 +- .../suite/rpl/t/rpl_gtid_failover.test | 12 +- .../suite/rpl/t/rpl_gtid_heartbeat_2slave.cnf | 12 + .../rpl/t/rpl_gtid_heartbeat_2slave.test | 10 + ...ignore_table_filter_insensitive-master.opt | 1 + ..._ignore_table_filter_insensitive-slave.opt | 1 + ..._gtid_ignore_table_filter_insensitive.test | 8 + ...d_ignore_table_filter_sensitive-master.opt | 1 + ...id_ignore_table_filter_sensitive-slave.opt | 1 + ...pl_gtid_ignore_table_filter_sensitive.test | 9 + .../suite/rpl/t/rpl_gtid_loaddata_s-slave.opt | 1 + .../suite/rpl/t/rpl_gtid_loaddata_s.test | 7 + .../mysql-test/suite/rpl/t/rpl_gtid_mode.test | 9 +- .../suite/rpl/t/rpl_gtid_parallel.test | 1 + ...rpl_gtid_purged_fail_to_connect-master.opt | 2 +- .../rpl_gtid_purged_fail_to_connect-slave.opt | 2 +- .../t/rpl_gtid_purged_fail_to_connect.test | 7 +- .../rpl/t/rpl_gtid_purged_maintained.test | 9 +- .../t/rpl_gtid_row_event_max_size-master.opt | 1 + .../t/rpl_gtid_row_event_max_size-slave.opt | 1 + .../rpl/t/rpl_gtid_row_event_max_size.test | 10 + .../t/rpl_gtid_row_show_relaylog_events.test | 15 + .../suite/rpl/t/rpl_gtid_server_sighup.test | 135 + .../t/rpl_gtid_sql_until_before_after.test | 2 +- .../rpl/t/rpl_gtid_stm_insert_delayed.test | 2 + ...rpl_gtid_stm_mix_show_relaylog_events.test | 15 + .../suite/rpl/t/rpl_gtid_stress_failover.test | 27 +- .../rpl/t/rpl_gtid_validate_slave_gtids.test | 128 + .../rpl_gtids_restart_slave_io_lost_trx.test | 12 + .../mysql-test/suite/rpl/t/rpl_heartbeat.test | 4 +- .../suite/rpl/t/rpl_heartbeat_2slaves.test | 133 +- .../suite/rpl/t/rpl_heartbeat_basic.test | 23 +- .../suite/rpl/t/rpl_heartbeat_ssl.test | 1 + .../suite/rpl/t/rpl_idempotency.test | 10 +- .../suite/rpl/t/rpl_ignore_db_filter.test | 2 +- .../suite/rpl/t/rpl_ignore_revoke.test | 6 +- .../suite/rpl/t/rpl_ignore_table.test | 1 + .../rpl_ignore_table_filter_insensitive.test | 11 +- .../t/rpl_ignore_table_filter_sensitive.test | 11 +- .../mysql-test/suite/rpl/t/rpl_incident.test | 3 +- .../suite/rpl/t/rpl_init_slave.test | 6 +- .../suite/rpl/t/rpl_innodb_bug28430.test | 2 +- .../suite/rpl/t/rpl_innodb_bug30888.test | 2 +- .../mysql-test/suite/rpl/t/rpl_insert.test | 5 +- .../suite/rpl/t/rpl_insert_on_update.test | 40 + .../suite/rpl/t/rpl_invoked_features.test | 9 +- .../suite/rpl/t/rpl_kill_query-slave.opt | 2 + .../suite/rpl/t/rpl_kill_query.test | 93 + .../suite/rpl/t/rpl_killed_ddl.test | 2 +- .../suite/rpl/t/rpl_known_bugs_detection.test | 4 +- .../rpl/t/rpl_lcase_tblnames_rewrite_db.test | 2 +- .../mysql-test/suite/rpl/t/rpl_loaddata.test | 1 + .../suite/rpl/t/rpl_loaddata_charset.test | 4 +- .../suite/rpl/t/rpl_loaddata_fatal.test | 5 +- .../suite/rpl/t/rpl_loaddata_m.test | 4 +- .../suite/rpl/t/rpl_loaddata_map.test | 4 +- .../suite/rpl/t/rpl_loaddata_s.test | 24 +- .../suite/rpl/t/rpl_loaddata_simple.test | 4 +- .../rpl/t/rpl_loaddata_symlink-master.sh | 2 + .../suite/rpl/t/rpl_loaddata_symlink-slave.sh | 2 + .../suite/rpl/t/rpl_loaddata_symlink.test | 4 +- .../suite/rpl/t/rpl_loaddatalocal.test | 18 +- .../mysql-test/suite/rpl/t/rpl_loadfile.test | 2 +- .../mysql-test/suite/rpl/t/rpl_locale.test | 4 +- .../mysql-test/suite/rpl/t/rpl_log_pos.test | 5 +- .../rpl/t/rpl_lost_events_on_rotate.test | 2 +- .../rpl/t/rpl_manual_change_index_file.test | 11 +- .../suite/rpl/t/rpl_many_optimize.test | 2 +- .../suite/rpl/t/rpl_master_pos_wait.test | 2 +- .../suite/rpl/t/rpl_migration_crash_safe.test | 4 +- .../suite/rpl/t/rpl_misc_functions-slave.sh | 2 + .../suite/rpl/t/rpl_misc_functions.test | 6 +- .../suite/rpl/t/rpl_mix_found_rows.test | 12 +- .../suite/rpl/t/rpl_mix_insert_delayed.test | 1 + .../suite/rpl/t/rpl_mixed_bit_pk.test | 4 +- .../suite/rpl/t/rpl_mixed_ddl_dml.test | 6 +- .../mysql-test/suite/rpl/t/rpl_mts_debug.test | 7 +- ...te_partial_trx_with_auto_pos_off-slave.opt | 1 + ...execute_partial_trx_with_auto_pos_off.test | 21 + ...ute_partial_trx_with_auto_pos_on-slave.opt | 1 + ..._execute_partial_trx_with_auto_pos_on.test | 21 + ..._gtids_restart_slave_io_lost_trx-slave.opt | 1 + ...l_mts_gtids_restart_slave_io_lost_trx.test | 13 + ..._mts_slave_hang_with_partial_trx-slave.opt | 1 + .../rpl_mts_slave_hang_with_partial_trx.test | 77 + .../suite/rpl/t/rpl_multi_delete.test | 2 +- .../suite/rpl/t/rpl_multi_delete2.test | 2 +- .../suite/rpl/t/rpl_multi_engine.test | 10 +- .../suite/rpl/t/rpl_multi_update2.test | 1 + .../suite/rpl/t/rpl_multi_update4.test | 5 +- .../suite/rpl/t/rpl_mysql_upgrade.test | 4 +- .../suite/rpl/t/rpl_mysqlbinlog_gtid_on.test | 4 +- .../suite/rpl/t/rpl_name_const.test | 2 +- .../rpl/t/rpl_nondeterministic_functions.test | 2 +- .../mysql-test/suite/rpl/t/rpl_optimize.test | 2 +- .../mysql-test/suite/rpl/t/rpl_packet.test | 17 +- .../rpl/t/rpl_parallel_change_master.test | 5 +- .../suite/rpl/t/rpl_parallel_conf_limits.test | 4 +- .../suite/rpl/t/rpl_parallel_conflicts.test | 4 +- .../suite/rpl/t/rpl_parallel_ddl.test | 6 +- .../suite/rpl/t/rpl_parallel_multi_db.test | 12 +- .../t/rpl_parallel_seconds_behind_master.test | 31 +- .../suite/rpl/t/rpl_parallel_start_stop.test | 18 +- .../rpl/t/rpl_parallel_switch_sequential.test | 1 + .../suite/rpl/t/rpl_parallel_temp_query.test | 8 +- .../rpl/t/rpl_parallel_worker_error.test | 58 + .../suite/rpl/t/rpl_plugin_load.test | 4 +- .../mysql-test/suite/rpl/t/rpl_ps.test | 8 +- .../suite/rpl/t/rpl_rbr_to_sbr.test | 2 +- .../rpl/t/rpl_read_old_relay_log_info.test | 3 +- .../mysql-test/suite/rpl/t/rpl_read_only.test | 10 +- .../t/rpl_recovery_empty_sqlthd_pos-slave.opt | 1 + .../rpl/t/rpl_recovery_empty_sqlthd_pos.test | 64 + ...ecovery_replicate_same_server_id-slave.opt | 1 + ...rpl_recovery_replicate_same_server_id.test | 84 + .../suite/rpl/t/rpl_replicate_do.test | 10 +- .../rpl_replicate_event_after_sync_stage.test | 66 + .../suite/rpl/t/rpl_replicate_ignore_db.test | 7 +- .../suite/rpl/t/rpl_report_port.test | 2 +- .../mysql-test/suite/rpl/t/rpl_rewrt_db.test | 18 +- .../suite/rpl/t/rpl_rotate_gtid.test | 95 + .../suite/rpl/t/rpl_rotate_logs.test | 12 +- .../rpl/t/rpl_rotate_purge_deadlock.test | 8 +- .../suite/rpl/t/rpl_rotate_row_trans.test | 94 + .../suite/rpl/t/rpl_row_4_bytes.test | 4 +- .../mysql-test/suite/rpl/t/rpl_row_NOW.test | 4 +- .../mysql-test/suite/rpl/t/rpl_row_USER.test | 4 +- .../suite/rpl/t/rpl_row_basic_11bugs.test | 34 +- .../suite/rpl/t/rpl_row_basic_8partition.test | 18 +- .../suite/rpl/t/rpl_row_colSize.test | 4 +- .../suite/rpl/t/rpl_row_corrupt-master.opt | 1 + .../suite/rpl/t/rpl_row_corrupt-slave.opt | 1 + .../suite/rpl/t/rpl_row_corrupt.test | 36 + .../suite/rpl/t/rpl_row_corruption.test | 8 +- .../suite/rpl/t/rpl_row_create_select.test | 29 + .../suite/rpl/t/rpl_row_create_table.test | 38 +- .../mysql-test/suite/rpl/t/rpl_row_drop.test | 10 +- .../suite/rpl/t/rpl_row_event_max_size.test | 94 +- .../suite/rpl/t/rpl_row_find_row.test | 16 +- .../suite/rpl/t/rpl_row_func001.test | 4 +- .../suite/rpl/t/rpl_row_func002.test | 10 +- .../suite/rpl/t/rpl_row_hash_scan.test | 37 +- .../suite/rpl/t/rpl_row_hash_scan_sanity.test | 42 +- .../suite/rpl/t/rpl_row_ignorable_event.test | 2 +- .../suite/rpl/t/rpl_row_img_eng_full.test | 1 + .../suite/rpl/t/rpl_row_img_misc.test | 4 +- .../suite/rpl/t/rpl_row_img_sanity.test | 32 +- .../suite/rpl/t/rpl_row_inexist_tbl.test | 2 +- .../suite/rpl/t/rpl_row_insert_delayed.test | 1 + .../suite/rpl/t/rpl_row_lcase_tblnames.test | 1 + .../suite/rpl/t/rpl_row_merge_engine.test | 6 +- .../suite/rpl/t/rpl_row_mts_crash_safe.test | 1 + .../suite/rpl/t/rpl_row_mysqlbinlog.test | 1 + .../suite/rpl/t/rpl_row_rec_comp_myisam.test | 4 +- .../rpl/t/rpl_row_record_find_myisam.test | 2 +- .../rpl/t/rpl_row_show_relaylog_events.test | 19 +- .../mysql-test/suite/rpl/t/rpl_row_sp001.test | 12 +- .../mysql-test/suite/rpl/t/rpl_row_sp005.test | 6 +- .../mysql-test/suite/rpl/t/rpl_row_sp008.test | 4 +- .../mysql-test/suite/rpl/t/rpl_row_sp009.test | 8 +- .../mysql-test/suite/rpl/t/rpl_row_sp010.test | 6 +- .../mysql-test/suite/rpl/t/rpl_row_sp011.test | 4 +- .../mysql-test/suite/rpl/t/rpl_row_sp012.test | 4 +- .../rpl/t/rpl_row_tabledefs_2myisam.test | 2 +- .../rpl/t/rpl_row_tabledefs_3innodb.test | 2 +- .../suite/rpl/t/rpl_row_tbl_metadata.test | 22 +- .../suite/rpl/t/rpl_row_trig001.test | 6 +- .../suite/rpl/t/rpl_row_trig002.test | 8 +- .../suite/rpl/t/rpl_row_trig003.test | 2 +- .../suite/rpl/t/rpl_row_trunc_temp.test | 4 +- .../suite/rpl/t/rpl_row_unsafe_funcs.test | 4 +- .../mysql-test/suite/rpl/t/rpl_row_until.test | 9 +- .../mysql-test/suite/rpl/t/rpl_row_utf16.test | 2 +- .../mysql-test/suite/rpl/t/rpl_row_utf32.test | 2 +- .../suite/rpl/t/rpl_row_view01.test | 8 +- .../suite/rpl/t/rpl_row_wide_table.test | 4 +- .../t/rpl_sbm_previous_gtid_event-slave.opt | 1 + .../rpl/t/rpl_sbm_previous_gtid_event.test | 111 + .../rpl/t/rpl_seconds_behind_master.test | 10 +- .../mysql-test/suite/rpl/t/rpl_semi_sync.test | 36 +- .../suite/rpl/t/rpl_semi_sync_deadlock.test | 6 +- .../suite/rpl/t/rpl_semi_sync_event.test | 2 +- .../t/rpl_semi_sync_future_logpos-master.opt | 1 + .../t/rpl_semi_sync_future_logpos-slave.opt | 1 + .../rpl/t/rpl_semi_sync_future_logpos.test | 66 + .../t/rpl_semi_sync_shutdown_hang-master.opt | 1 + .../t/rpl_semi_sync_shutdown_hang-slave.opt | 1 + .../rpl/t/rpl_semi_sync_shutdown_hang.test | 64 + .../rpl_semi_sync_uninstall_plugin-master.opt | 1 + .../rpl_semi_sync_uninstall_plugin-slave.opt | 1 + .../rpl/t/rpl_semi_sync_uninstall_plugin.test | 145 + .../suite/rpl/t/rpl_server_id2-master.opt | 1 + .../suite/rpl/t/rpl_server_id2-slave.opt | 2 +- .../suite/rpl/t/rpl_server_id2.test | 4 +- .../rpl/t/rpl_server_id_ignore-master.opt | 1 + .../rpl/t/rpl_server_id_ignore-slave.opt | 2 +- .../suite/rpl/t/rpl_server_id_ignore.test | 6 +- .../suite/rpl/t/rpl_server_uuid.cnf | 9 + .../suite/rpl/t/rpl_server_uuid.test | 69 +- .../suite/rpl/t/rpl_session_var.test | 8 +- .../suite/rpl/t/rpl_set_charset.test | 4 +- .../suite/rpl/t/rpl_show_errors.test | 2 +- .../suite/rpl/t/rpl_show_slave_running.test | 2 +- .../rpl/t/rpl_show_slave_status_deadlock.test | 69 + .../suite/rpl/t/rpl_skip_error.test | 18 +- .../suite/rpl/t/rpl_skip_incident.test | 4 +- .../t/rpl_skip_slave_err_warnings-slave.opt | 1 + .../rpl/t/rpl_skip_slave_err_warnings.test | 38 + .../suite/rpl/t/rpl_slave_grp_exec.test | 12 +- .../suite/rpl/t/rpl_slave_load_in.test | 4 +- .../suite/rpl/t/rpl_slave_skip.test | 15 +- .../suite/rpl/t/rpl_slave_status.test | 6 +- .../suite/rpl/t/rpl_slow_query_log.test | 14 +- .../mysql-test/suite/rpl/t/rpl_sp.test | 56 +- .../mysql-test/suite/rpl/t/rpl_sp004.test | 8 +- .../suite/rpl/t/rpl_sp_effects.test | 20 +- .../suite/rpl/t/rpl_spec_variables.test | 16 +- .../suite/rpl/t/rpl_sporadic_master.test | 7 +- ...hread_killed_waiting_commit_lock-slave.opt | 1 + ...sql_thread_killed_waiting_commit_lock.test | 122 + .../mysql-test/suite/rpl/t/rpl_ssl.test | 33 +- .../mysql-test/suite/rpl/t/rpl_ssl1.test | 10 +- .../suite/rpl/t/rpl_stm_000001.test | 13 +- .../t/rpl_stm_auto_increment_bug33029.test | 8 +- .../suite/rpl/t/rpl_stm_found_rows.test | 6 +- .../suite/rpl/t/rpl_stm_insert_delayed.test | 12 +- .../suite/rpl/t/rpl_stm_lcase_tblnames.test | 1 + .../rpl/t/rpl_stm_loaddata_concurrent.test | 2 + .../t/rpl_stm_mix_show_relaylog_events.test | 20 +- .../rpl/t/rpl_stm_mixed_mts_crash_safe.test | 1 + .../suite/rpl/t/rpl_stm_mixing_engines.test | 6 +- .../mysql-test/suite/rpl/t/rpl_stm_no_op.test | 20 +- .../suite/rpl/t/rpl_stm_relay_ign_space.test | 6 +- .../suite/rpl/t/rpl_stm_sql_mode.test | 2 +- .../mysql-test/suite/rpl/t/rpl_stm_until.test | 5 +- .../rpl/t/rpl_stm_until_pos_middle_gtid.test | 91 + .../suite/rpl/t/rpl_stm_user_variables.test | 18 +- .../suite/rpl/t/rpl_stop_slave.test | 33 +- .../suite/rpl/t/rpl_switch_stm_row_mixed.test | 28 +- .../mysql-test/suite/rpl/t/rpl_sync.test | 6 +- .../suite/rpl/t/rpl_temp_table.test | 2 +- .../suite/rpl/t/rpl_temp_table_mix_row.test | 16 +- .../suite/rpl/t/rpl_temporal_fractional.test | 12 +- .../mysql-test/suite/rpl/t/rpl_temporary.test | 27 +- .../suite/rpl/t/rpl_temporary_errors.test | 4 +- .../suite/rpl/t/rpl_timestamp_upgrage_55.test | 75 + .../mysql-test/suite/rpl/t/rpl_timezone.test | 20 +- .../suite/rpl/t/rpl_tmp_table_and_DDL.test | 2 +- .../mysql-test/suite/rpl/t/rpl_trigger.test | 26 +- .../suite/rpl/t/rpl_trunc_temp.test | 6 +- .../mysql-test/suite/rpl/t/rpl_typeconv.test | 3 +- .../suite/rpl/t/rpl_typeconv_innodb.test | 4 +- .../rpl/t/rpl_unknown_ignorable_event.test | 69 + .../mysql-test/suite/rpl/t/rpl_user.test | 12 +- .../suite/rpl/t/rpl_user_variables.test | 32 +- .../mysql-test/suite/rpl/t/rpl_variables.test | 6 +- .../suite/rpl/t/rpl_variables_stm.test | 6 +- .../mysql-test/suite/rpl/t/rpl_view.test | 31 +- .../suite/rpl/t/rpl_view_multi.test | 8 +- .../suite/rpl_ndb/r/rpl_ndb_UUID.result | 1 + .../suite/rpl_ndb/r/rpl_ndb_blob2.result | 5 + .../rpl_ndb/r/rpl_ndb_delete_nowhere.result | 3 + .../suite/rpl_ndb/r/rpl_ndb_func003.result | 1 + .../rpl_ndb/r/rpl_ndb_insert_ignore.result | 2 + .../rpl_ndb/r/rpl_ndb_multi_update2.result | 4 + .../rpl_ndb/r/rpl_ndb_multi_update3.result | 4 + .../rpl_ndb/r/rpl_ndb_relayrotate.result | 1 + .../suite/rpl_ndb/r/rpl_ndb_row_001.result | 1 + .../suite/rpl_ndb/r/rpl_ndb_row_basic.result | 41 + .../suite/rpl_ndb/r/rpl_ndb_sp003.result | 3 + .../suite/rpl_ndb/r/rpl_ndb_sp006.result | 3 + .../suite/rpl_ndb/r/rpl_ndb_trig004.result | 2 + .../r/binlog_error_action_basic.result | 45 + .../binlog_gtid_simple_recovery_basic.result | 27 + .../r/binlogging_impossible_mode_basic.result | 67 + .../r/block_encryption_mode_basic.result | 200 + .../suite/sys_vars/r/debug_sync_basic.result | 6 +- .../sys_vars/r/general_log_file_basic.result | 1 + ...odb_fil_make_page_dirty_debug_basic.result | 26 + .../innodb_ft_result_cache_limit_basic.result | 10 +- ...nnodb_saved_page_number_debug_basic.result | 26 + .../r/innodb_thread_sleep_delay_basic.result | 30 + .../r/log_slow_admin_statements_func.result | 32 +- .../suite/sys_vars/r/secure_auth_func.result | 2 + ...mplified_binlog_gtid_recovery_basic.result | 33 + .../r/slow_query_log_file_basic.result | 1 + .../r/sort_buffer_size_basic_32.result | 0 .../suite/sys_vars/r/sql_log_bin_basic.result | 7 +- .../suite/sys_vars/r/sql_mode_basic.result | 16 + .../sys_vars/r/timed_mutexes_basic.result | 46 + .../sys_vars/t/binlog_error_action_basic.test | 69 + .../t/binlog_gtid_simple_recovery_basic.test | 21 + .../t/binlogging_impossible_mode_basic.test | 69 + .../t/block_encryption_mode_basic.test | 225 + .../sys_vars/t/general_log_file_basic.test | 2 +- ...nnodb_fil_make_page_dirty_debug_basic.test | 34 + .../t/innodb_ft_result_cache_limit_basic.test | 5 +- .../innodb_saved_page_number_debug_basic.test | 35 + .../t/innodb_thread_sleep_delay_basic.test | 18 + .../t/log_slow_admin_statements_func.test | 40 +- .../sys_vars/t/pfs_digests_size_basic.test | 1 + .../pfs_session_connect_attrs_size_basic.test | 1 + ...simplified_binlog_gtid_recovery_basic.test | 21 + .../sys_vars/t/slow_query_log_file_basic.test | 2 +- .../suite/sys_vars/t/sql_log_bin_basic.test | 6 +- mysql-wsrep-5.6/mysql-test/t/alter_table.test | 22 - .../mysql-test/t/bug17076131-master.opt | 2 + mysql-wsrep-5.6/mysql-test/t/bug17076131.test | 28 + .../mysql-test/t/check_auto_permission.test | 60 + .../mysql-test/t/count_distinct.test | 140 + mysql-wsrep-5.6/mysql-test/t/ctype_cp932.test | 29 + mysql-wsrep-5.6/mysql-test/t/ctype_uca.test | 48 + mysql-wsrep-5.6/mysql-test/t/derived.test | 168 + .../mysql-test/t/dynamic_tracing.test | 152 + .../mysql-test/t/file_contents.test | 20 +- mysql-wsrep-5.6/mysql-test/t/func_aes.test | 225 + .../mysql-test/t/func_aes_cfb1.test | 20 + .../mysql-test/t/func_aes_cfb128.test | 20 + .../mysql-test/t/func_aes_cfb8.test | 20 + .../mysql-test/t/func_aes_misc.test | 180 + .../mysql-test/t/func_aes_ofb.test | 20 + .../mysql-test/t/group_min_max.test | 44 + .../mysql-test/t/group_min_max_innodb.test | 119 + .../mysql-test/t/information_schema-big.test | 2 + .../mysql-test/t/information_schema.test | 17 + .../mysql-test/t/innodb_mysql_sync.test | 199 + ..._recovery_with_upper_case_names-master.opt | 1 + ...innodb_recovery_with_upper_case_names.test | 63 + mysql-wsrep-5.6/mysql-test/t/loaddata.test | 21 + mysql-wsrep-5.6/mysql-test/t/lock_sync.test | 115 +- mysql-wsrep-5.6/mysql-test/t/log_errchk.test | 65 + .../mysql-test/t/long_tmpdir-master.sh | 2 + .../t/lowercase_mixed_tmpdir-master.sh | 2 + .../t/lowercase_mixed_tmpdir_innodb-master.sh | 2 + .../mysql-test/t/lowercase_table4-master.opt | 0 .../mysql-test/t/lowercase_table4.test | 0 mysql-wsrep-5.6/mysql-test/t/myisam.test | 70 + .../mysql-test/t/mysql_upgrade.test | 53 + .../mysql-test/t/mysqlbinlog_debug.test | 24 + .../t/mysqlbinlog_mixed_or_statment.test | 44 + mysql-wsrep-5.6/mysql-test/t/mysqlcheck.test | 3 - mysql-wsrep-5.6/mysql-test/t/mysqldump.test | 39 + mysql-wsrep-5.6/mysql-test/t/openssl_1.test | 6 +- .../mysql-test/t/outfile_loaddata.test | 4 + mysql-wsrep-5.6/mysql-test/t/parser.test | 25 + .../mysql-test/t/partition_archive.test | 17 + .../mysql-test/t/partition_index_innodb.test | 146 + .../mysql-test/t/partition_index_myisam.test | 113 + .../mysql-test/t/partition_innodb.test | 189 + .../mysql-test/t/partition_pruning.test | 48 + mysql-wsrep-5.6/mysql-test/t/plugin.test | 117 + mysql-wsrep-5.6/mysql-test/t/plugin_auth.test | 34 + mysql-wsrep-5.6/mysql-test/t/query_cache.test | 51 + .../mysql-test/t/show_processlist.test | 62 + .../mysql-test/t/sp_validation.test | 1 - .../mysql-test/t/temp_pool-master.opt | 1 + mysql-wsrep-5.6/mysql-test/t/temp_pool.test | 33 + .../mysql-test/t/temporal_literal.test | 28 + mysql-wsrep-5.6/mysql-test/t/trigger.test | 30 + .../t/type_temporal_fractional.test | 147 + mysql-wsrep-5.6/mysql-test/t/union.test | 30 + mysql-wsrep-5.6/mysql-test/t/view.test | 37 + mysql-wsrep-5.6/mysql-test/t/windows.test | 16 + mysql-wsrep-5.6/mysql-test/valgrind.supp | 224 +- mysql-wsrep-5.6/mysys/CMakeLists.txt | 4 +- mysql-wsrep-5.6/mysys/mf_arr_appstr.c | 1 + mysql-wsrep-5.6/mysys/mf_iocache2.c | 7 + mysql-wsrep-5.6/mysys/mf_qsort2.c | 1 + mysql-wsrep-5.6/mysys/mf_same.c | 1 + mysql-wsrep-5.6/mysys/mf_soundex.c | 1 + mysql-wsrep-5.6/mysys/mf_wcomp.c | 1 + mysql-wsrep-5.6/mysys/mulalloc.c | 1 + mysql-wsrep-5.6/mysys/my_alarm.c | 1 + mysql-wsrep-5.6/mysys/my_crc32.c | 1 + mysql-wsrep-5.6/mysys/my_div.c | 1 + mysql-wsrep-5.6/mysys/my_fopen.c | 3 + mysql-wsrep-5.6/mysys/my_fstream.c | 3 +- mysql-wsrep-5.6/mysys/my_getpagesize.c | 1 + mysql-wsrep-5.6/mysys/my_handler_errors.h | 3 +- mysql-wsrep-5.6/mysys/my_libwrap.c | 1 + mysql-wsrep-5.6/mysys/my_memmem.c | 1 + mysql-wsrep-5.6/mysys/my_pread.c | 77 +- mysql-wsrep-5.6/mysys/my_pthread.c | 2 - mysql-wsrep-5.6/mysys/my_redel.c | 14 +- mysql-wsrep-5.6/mysys/my_sync.c | 8 +- mysql-wsrep-5.6/mysys/my_thr_init.c | 65 +- mysql-wsrep-5.6/mysys/my_wincond.c | 24 +- mysql-wsrep-5.6/mysys/my_write.c | 89 +- mysql-wsrep-5.6/mysys/ptr_cmp.c | 15 +- mysql-wsrep-5.6/mysys/test_dir.c | 1 + mysql-wsrep-5.6/mysys/test_xml.c | 1 + mysql-wsrep-5.6/mysys/thr_alarm.c | 29 +- mysql-wsrep-5.6/mysys_ssl/CMakeLists.txt | 15 +- mysql-wsrep-5.6/mysys_ssl/my_aes.cc | 293 +- mysql-wsrep-5.6/mysys_ssl/my_aes_impl.h | 31 + mysql-wsrep-5.6/mysys_ssl/my_aes_openssl.cc | 213 + mysql-wsrep-5.6/mysys_ssl/my_aes_yassl.cc | 240 + mysql-wsrep-5.6/mysys_ssl/my_default.cc | 13 +- mysql-wsrep-5.6/mysys_ssl/my_getopt.cc | 5 +- mysql-wsrep-5.6/mysys_ssl/my_rnd.cc | 60 +- mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs | 4 +- .../packaging/deb-precise/changelog | 25 + mysql-wsrep-5.6/packaging/deb-precise/compat | 1 + mysql-wsrep-5.6/packaging/deb-precise/control | 188 + .../packaging/deb-precise/copyright | 41 + .../deb-precise/extra/apparmor-profile | 42 + .../packaging/deb-precise/extra/my.cnf | 57 + .../deb-precise/extra/mysql_embedded.1 | 1 + .../deb-precise/libmysqlclient-dev.dirs | 17 + .../deb-precise/libmysqlclient-dev.install | 29 + .../deb-precise/libmysqlclient18.install | 19 + .../deb-precise/libmysqld-dev.install | 20 + .../deb-precise/mysql-client.install | 18 + .../packaging/deb-precise/mysql-common.dirs | 16 + .../deb-precise/mysql-common.install | 30 + .../deb-precise/mysql-community-bench.dirs | 17 + .../deb-precise/mysql-community-bench.install | 19 + .../mysql-community-client.install | 60 + .../deb-precise/mysql-community-server.config | 92 + .../deb-precise/mysql-community-server.dirs | 19 + .../mysql-community-server.install | 82 + .../mysql-community-server.mysql.init | 139 + .../mysql-community-server.postinst | 102 + .../deb-precise/mysql-community-server.postrm | 154 + .../mysql-community-server.preinst | 123 + .../deb-precise/mysql-community-server.prerm | 24 + .../mysql-community-server.templates | 41 + .../mysql-community-source.install | 20 + .../deb-precise/mysql-community-test.dirs | 17 + .../deb-precise/mysql-community-test.install | 20 + .../deb-precise/mysql-community-test.links | 17 + .../deb-precise/mysql-server.install | 18 + .../deb-precise/mysql-testsuite.install | 18 + .../patches/fix-man-page-links.patch | 14 + .../patches/fix-mysql_install_db.patch | 167 + .../packaging/deb-precise/patches/series | 17 + mysql-wsrep-5.6/packaging/deb-precise/rules | 189 + .../packaging/deb-precise/source/format | 1 + .../deb-precise/source/include-binaries | 18 + mysql-wsrep-5.6/packaging/deb-precise/watch | 2 + .../packaging/deb-trusty/changelog | 25 + mysql-wsrep-5.6/packaging/deb-trusty/compat | 1 + mysql-wsrep-5.6/packaging/deb-trusty/control | 188 + .../packaging/deb-trusty/copyright | 41 + .../deb-trusty/extra/apparmor-profile | 42 + .../packaging/deb-trusty/extra/my.cnf | 57 + .../deb-trusty/extra/mysql_embedded.1 | 1 + .../deb-trusty/libmysqlclient-dev.install | 29 + .../deb-trusty/libmysqlclient18.install | 19 + .../deb-trusty/libmysqld-dev.install | 20 + .../packaging/deb-trusty/mysql-client.install | 18 + .../packaging/deb-trusty/mysql-common.dirs | 16 + .../packaging/deb-trusty/mysql-common.install | 30 + .../deb-trusty/mysql-community-bench.install | 19 + .../deb-trusty/mysql-community-client.install | 60 + .../deb-trusty/mysql-community-server.config | 92 + .../deb-trusty/mysql-community-server.dirs | 19 + .../deb-trusty/mysql-community-server.install | 82 + .../mysql-community-server.mysql.init | 139 + .../mysql-community-server.postinst | 102 + .../deb-trusty/mysql-community-server.postrm | 154 + .../deb-trusty/mysql-community-server.preinst | 123 + .../deb-trusty/mysql-community-server.prerm | 24 + .../mysql-community-server.templates | 41 + .../deb-trusty/mysql-community-source.install | 20 + .../deb-trusty/mysql-community-test.install | 20 + .../deb-trusty/mysql-community-test.links | 17 + .../packaging/deb-trusty/mysql-server.install | 18 + .../deb-trusty/mysql-testsuite.install | 18 + .../patches/fix-man-page-links.patch | 14 + .../patches/fix-mysql_install_db.patch | 167 + .../packaging/deb-trusty/patches/series | 17 + mysql-wsrep-5.6/packaging/deb-trusty/rules | 189 + .../packaging/deb-trusty/source/format | 1 + .../deb-trusty/source/include-binaries | 18 + mysql-wsrep-5.6/packaging/deb-trusty/watch | 2 + .../packaging/deb-wheezy/changelog | 25 + mysql-wsrep-5.6/packaging/deb-wheezy/compat | 1 + mysql-wsrep-5.6/packaging/deb-wheezy/control | 188 + .../packaging/deb-wheezy/copyright | 41 + .../packaging/deb-wheezy/extra/my.cnf | 57 + .../deb-wheezy/extra/mysql_embedded.1 | 1 + .../deb-wheezy/libmysqlclient-dev.dirs | 17 + .../deb-wheezy/libmysqlclient-dev.install | 29 + .../deb-wheezy/libmysqlclient18.install | 19 + .../deb-wheezy/libmysqld-dev.install | 20 + .../packaging/deb-wheezy/mysql-client.install | 18 + .../packaging/deb-wheezy/mysql-common.dirs | 16 + .../packaging/deb-wheezy/mysql-common.install | 30 + .../deb-wheezy/mysql-community-bench.dirs | 17 + .../deb-wheezy/mysql-community-bench.install | 19 + .../deb-wheezy/mysql-community-client.install | 60 + .../deb-wheezy/mysql-community-server.config | 92 + .../deb-wheezy/mysql-community-server.dirs | 19 + .../deb-wheezy/mysql-community-server.install | 82 + .../mysql-community-server.mysql.init | 139 + .../mysql-community-server.postinst | 102 + .../deb-wheezy/mysql-community-server.postrm | 154 + .../deb-wheezy/mysql-community-server.preinst | 123 + .../deb-wheezy/mysql-community-server.prerm | 24 + .../mysql-community-server.templates | 41 + .../deb-wheezy/mysql-community-source.install | 20 + .../deb-wheezy/mysql-community-test.dirs | 17 + .../deb-wheezy/mysql-community-test.install | 20 + .../deb-wheezy/mysql-community-test.links | 17 + .../packaging/deb-wheezy/mysql-server.install | 18 + .../deb-wheezy/mysql-testsuite.install | 18 + .../patches/fix-man-page-links.patch | 14 + .../patches/fix-mysql_install_db.patch | 167 + .../packaging/deb-wheezy/patches/series | 17 + mysql-wsrep-5.6/packaging/deb-wheezy/rules | 186 + .../packaging/deb-wheezy/source/format | 1 + .../deb-wheezy/source/include-binaries | 18 + mysql-wsrep-5.6/packaging/deb-wheezy/watch | 2 + .../packaging/rpm-fedora/CMakeLists.txt | 3 +- .../mysql-5.6-libmysqlclient-symbols.patch | 164 +- .../mysql-5.6.16-mysql-install.patch | 39 + .../packaging/rpm-fedora/mysql-systemd-start | 22 +- .../packaging/rpm-fedora/mysql.spec.in | 301 +- .../packaging/rpm-oel/CMakeLists.txt | 4 +- .../packaging/rpm-oel/filter-requires.sh | 2 +- .../mysql-5.6-libmysqlclient-symbols.patch | 960 + .../rpm-oel/mysql-5.6.16-mysql-install.patch | 39 + .../packaging/rpm-oel/mysql-systemd-start | 22 +- mysql-wsrep-5.6/packaging/rpm-oel/mysql.init | 8 +- .../packaging/rpm-oel/mysql.spec.in | 327 +- .../packaging/rpm-sles/CMakeLists.txt | 28 + .../packaging/rpm-sles/filter-provides.sh | 6 + .../packaging/rpm-sles/filter-requires.sh | 6 + mysql-wsrep-5.6/packaging/rpm-sles/my.cnf | 31 + .../packaging/rpm-sles/my_config.h | 30 + .../packaging/rpm-sles/mysql-systemd-start | 66 + mysql-wsrep-5.6/packaging/rpm-sles/mysql.conf | 1 + mysql-wsrep-5.6/packaging/rpm-sles/mysql.init | 252 + .../packaging/rpm-sles/mysql.spec.in | 1660 + .../packaging/rpm-sles/mysqld.service | 48 + .../packaging/solaris/CMakeLists.txt | 6 +- mysql-wsrep-5.6/plugin/auth/CMakeLists.txt | 4 +- .../plugin/innodb_memcached/CMakeLists.txt | 6 +- .../daemon_memcached/CMakeLists.txt | 4 +- .../daemon_memcached/daemon/memcached.c | 16 + .../daemon/memcached_mysql.cc | 15 +- .../daemon_memcached/daemon/memcached_mysql.h | 4 +- .../include/memcached/protocol_binary.h | 1 + .../innodb_memcache/CMakeLists.txt | 4 +- .../innodb_memcache/src/innodb_api.c | 37 +- .../innodb_memcache/src/innodb_engine.c | 33 +- mysql-wsrep-5.6/plugin/semisync/semisync.cc | 1 + mysql-wsrep-5.6/plugin/semisync/semisync.h | 1 + .../plugin/semisync/semisync_master.cc | 43 +- .../plugin/semisync/semisync_master_plugin.cc | 7 +- .../plugin/semisync/semisync_slave_plugin.cc | 1 + mysql-wsrep-5.6/scripts/CMakeLists.txt | 28 +- mysql-wsrep-5.6/scripts/fill_help_tables.sql | 4375 +- mysql-wsrep-5.6/scripts/msql2mysql.sh | 4 +- mysql-wsrep-5.6/scripts/mysql_config.pl.in | 4 +- mysql-wsrep-5.6/scripts/mysql_config.sh | 15 +- .../scripts/mysql_convert_table_format.sh | 4 +- mysql-wsrep-5.6/scripts/mysql_find_rows.sh | 4 +- .../scripts/mysql_fix_extensions.sh | 3 +- .../scripts/mysql_install_db.pl.in | 139 +- mysql-wsrep-5.6/scripts/mysql_install_db.sh | 4 +- .../scripts/mysql_setpermission.sh | 10 +- .../scripts/mysql_system_tables.sql | 4 +- .../scripts/mysql_system_tables_data.sql | 10 +- .../scripts/mysql_system_tables_fix.sql | 25 +- .../scripts/mysql_test_data_timezone.sql | 1 + mysql-wsrep-5.6/scripts/mysql_zap.sh | 4 +- mysql-wsrep-5.6/scripts/mysqlaccess.sh | 6 +- mysql-wsrep-5.6/scripts/mysqlbug.sh | 4 +- mysql-wsrep-5.6/scripts/mysqld_safe.sh | 2 +- mysql-wsrep-5.6/scripts/mysqlhotcopy.sh | 2 + mysql-wsrep-5.6/sql-bench/compare-results.sh | 0 .../sql-bench/graph-compare-results.sh | 2 + mysql-wsrep-5.6/sql-common/client.c | 61 +- .../sql-common/client_authentication.cc | 7 +- mysql-wsrep-5.6/sql-common/my_time.c | 12 +- mysql-wsrep-5.6/sql-common/pack.c | 1 + mysql-wsrep-5.6/sql/CMakeLists.txt | 10 +- mysql-wsrep-5.6/sql/binlog.cc | 300 +- mysql-wsrep-5.6/sql/binlog.h | 10 +- mysql-wsrep-5.6/sql/debug_sync.cc | 212 +- mysql-wsrep-5.6/sql/event_scheduler.cc | 4 +- mysql-wsrep-5.6/sql/field.cc | 15 +- mysql-wsrep-5.6/sql/field.h | 2 +- mysql-wsrep-5.6/sql/global_threads.h | 32 +- mysql-wsrep-5.6/sql/ha_partition.cc | 253 +- mysql-wsrep-5.6/sql/ha_partition.h | 22 +- mysql-wsrep-5.6/sql/handler.cc | 12 +- mysql-wsrep-5.6/sql/handler.h | 13 +- mysql-wsrep-5.6/sql/item.cc | 60 +- mysql-wsrep-5.6/sql/item.h | 23 +- mysql-wsrep-5.6/sql/item_create.cc | 107 +- mysql-wsrep-5.6/sql/item_func.cc | 39 +- mysql-wsrep-5.6/sql/item_func.h | 4 +- mysql-wsrep-5.6/sql/item_row.cc | 26 +- mysql-wsrep-5.6/sql/item_row.h | 1 + mysql-wsrep-5.6/sql/item_strfunc.cc | 352 +- mysql-wsrep-5.6/sql/item_strfunc.h | 20 + mysql-wsrep-5.6/sql/item_subselect.cc | 21 +- mysql-wsrep-5.6/sql/item_sum.cc | 66 +- mysql-wsrep-5.6/sql/item_sum.h | 30 +- mysql-wsrep-5.6/sql/item_timefunc.h | 3 + mysql-wsrep-5.6/sql/key.cc | 84 +- mysql-wsrep-5.6/sql/key.h | 5 +- mysql-wsrep-5.6/sql/log.cc | 53 +- mysql-wsrep-5.6/sql/log_event.cc | 625 +- mysql-wsrep-5.6/sql/log_event.h | 182 +- mysql-wsrep-5.6/sql/log_event_old.cc | 1 + mysql-wsrep-5.6/sql/mysqld.cc | 87 +- mysql-wsrep-5.6/sql/mysqld.h | 19 +- mysql-wsrep-5.6/sql/opt_range.cc | 216 +- mysql-wsrep-5.6/sql/parse_file.h | 2 +- mysql-wsrep-5.6/sql/replication.h | 41 +- mysql-wsrep-5.6/sql/rpl_constants.h | 2 + mysql-wsrep-5.6/sql/rpl_gtid.h | 25 +- mysql-wsrep-5.6/sql/rpl_gtid_execution.cc | 8 +- mysql-wsrep-5.6/sql/rpl_gtid_set.cc | 45 +- mysql-wsrep-5.6/sql/rpl_handler.cc | 14 +- mysql-wsrep-5.6/sql/rpl_handler.h | 5 +- mysql-wsrep-5.6/sql/rpl_info_table_access.cc | 15 +- mysql-wsrep-5.6/sql/rpl_info_table_access.h | 6 +- mysql-wsrep-5.6/sql/rpl_master.cc | 250 +- mysql-wsrep-5.6/sql/rpl_master.h | 4 +- mysql-wsrep-5.6/sql/rpl_reporting.cc | 6 +- mysql-wsrep-5.6/sql/rpl_rli.cc | 7 +- mysql-wsrep-5.6/sql/rpl_rli.h | 14 +- mysql-wsrep-5.6/sql/rpl_rli_pdb.cc | 19 +- mysql-wsrep-5.6/sql/rpl_rli_pdb.h | 8 + mysql-wsrep-5.6/sql/rpl_slave.cc | 524 +- mysql-wsrep-5.6/sql/rpl_utility.cc | 69 +- mysql-wsrep-5.6/sql/rpl_utility.h | 2 +- mysql-wsrep-5.6/sql/scheduler.cc | 7 +- mysql-wsrep-5.6/sql/share/charsets/Index.xml | 1 + .../sql/share/charsets/armscii8.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/ascii.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/cp1250.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/cp1256.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/cp1257.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/cp850.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/cp852.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/cp866.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/dec8.xml | 1 + .../sql/share/charsets/geostd8.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/greek.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/hebrew.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/hp8.xml | 1 + .../sql/share/charsets/keybcs2.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/koi8r.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/koi8u.xml | 1 + .../sql/share/charsets/languages.html | 1 + mysql-wsrep-5.6/sql/share/charsets/latin1.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/latin2.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/latin5.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/latin7.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/macce.xml | 1 + .../sql/share/charsets/macroman.xml | 1 + mysql-wsrep-5.6/sql/share/charsets/swe7.xml | 1 + mysql-wsrep-5.6/sql/share/errmsg-utf8.txt | 13 + mysql-wsrep-5.6/sql/signal_handler.cc | 18 - mysql-wsrep-5.6/sql/sp_head.cc | 19 +- mysql-wsrep-5.6/sql/sp_head.h | 21 +- mysql-wsrep-5.6/sql/sp_instr.cc | 36 +- mysql-wsrep-5.6/sql/sp_instr.h | 13 +- mysql-wsrep-5.6/sql/sql_acl.cc | 103 +- mysql-wsrep-5.6/sql/sql_admin.cc | 37 +- mysql-wsrep-5.6/sql/sql_alter.h | 4 +- mysql-wsrep-5.6/sql/sql_base.cc | 221 +- mysql-wsrep-5.6/sql/sql_class.cc | 26 +- mysql-wsrep-5.6/sql/sql_class.h | 25 +- mysql-wsrep-5.6/sql/sql_cursor.cc | 12 +- mysql-wsrep-5.6/sql/sql_db.cc | 2 +- mysql-wsrep-5.6/sql/sql_delete.cc | 3 +- mysql-wsrep-5.6/sql/sql_executor.cc | 13 +- mysql-wsrep-5.6/sql/sql_executor.h | 4 +- mysql-wsrep-5.6/sql/sql_insert.cc | 6 +- mysql-wsrep-5.6/sql/sql_lex.cc | 69 +- mysql-wsrep-5.6/sql/sql_lex.h | 5 +- mysql-wsrep-5.6/sql/sql_load.cc | 73 +- mysql-wsrep-5.6/sql/sql_optimizer.cc | 50 +- mysql-wsrep-5.6/sql/sql_parse.cc | 186 +- mysql-wsrep-5.6/sql/sql_parse.h | 3 + mysql-wsrep-5.6/sql/sql_partition.cc | 70 +- mysql-wsrep-5.6/sql/sql_partition.h | 4 +- mysql-wsrep-5.6/sql/sql_plugin.cc | 84 +- mysql-wsrep-5.6/sql/sql_plugin.h | 1 + mysql-wsrep-5.6/sql/sql_priv.h | 29 +- mysql-wsrep-5.6/sql/sql_reload.cc | 66 +- mysql-wsrep-5.6/sql/sql_resolver.cc | 2 +- mysql-wsrep-5.6/sql/sql_select.cc | 2 +- mysql-wsrep-5.6/sql/sql_show.cc | 190 +- mysql-wsrep-5.6/sql/sql_show.h | 1 + mysql-wsrep-5.6/sql/sql_state.c | 1 + mysql-wsrep-5.6/sql/sql_string.cc | 36 + mysql-wsrep-5.6/sql/sql_string.h | 3 + mysql-wsrep-5.6/sql/sql_table.cc | 267 +- mysql-wsrep-5.6/sql/sql_table.h | 8 +- mysql-wsrep-5.6/sql/sql_tmp_table.cc | 23 +- mysql-wsrep-5.6/sql/sql_tmp_table.h | 2 +- mysql-wsrep-5.6/sql/sql_trigger.cc | 91 +- mysql-wsrep-5.6/sql/sql_trigger.h | 7 +- mysql-wsrep-5.6/sql/sql_truncate.cc | 49 +- mysql-wsrep-5.6/sql/sql_truncate.h | 10 +- mysql-wsrep-5.6/sql/sql_union.cc | 19 +- mysql-wsrep-5.6/sql/sql_update.cc | 3 +- mysql-wsrep-5.6/sql/sql_view.cc | 62 +- mysql-wsrep-5.6/sql/sql_yacc.cc | 5060 +- mysql-wsrep-5.6/sql/sql_yacc.h | 4 +- mysql-wsrep-5.6/sql/sql_yacc.yy | 44 +- mysql-wsrep-5.6/sql/string_service.cc | 9 +- mysql-wsrep-5.6/sql/sys_vars.cc | 104 +- mysql-wsrep-5.6/sql/sys_vars.h | 4 +- mysql-wsrep-5.6/sql/table.cc | 71 +- mysql-wsrep-5.6/sql/udf_example.cc | 5 +- .../storage/archive/archive_test.c | 1 + .../storage/federated/ha_federated.cc | 14 +- mysql-wsrep-5.6/storage/heap/_check.c | 1 + mysql-wsrep-5.6/storage/heap/_rectest.c | 1 + mysql-wsrep-5.6/storage/heap/hp_block.c | 5 +- mysql-wsrep-5.6/storage/heap/hp_create.c | 4 +- mysql-wsrep-5.6/storage/heap/hp_extra.c | 1 + mysql-wsrep-5.6/storage/heap/hp_hash.c | 4 +- mysql-wsrep-5.6/storage/heap/hp_rfirst.c | 1 + mysql-wsrep-5.6/storage/heap/hp_rlast.c | 1 + mysql-wsrep-5.6/storage/heap/hp_rnext.c | 1 + mysql-wsrep-5.6/storage/heap/hp_rprev.c | 1 + mysql-wsrep-5.6/storage/heap/hp_rrnd.c | 1 + mysql-wsrep-5.6/storage/heap/hp_rsame.c | 1 + mysql-wsrep-5.6/storage/heap/hp_scan.c | 1 + mysql-wsrep-5.6/storage/heap/hp_update.c | 1 + .../storage/innobase/CMakeLists.txt | 56 +- .../storage/innobase/api/api0api.cc | 90 +- .../storage/innobase/btr/btr0btr.cc | 136 + .../storage/innobase/btr/btr0cur.cc | 119 +- .../storage/innobase/buf/buf0buddy.cc | 2 +- .../storage/innobase/buf/buf0buf.cc | 53 +- .../storage/innobase/buf/buf0dblwr.cc | 54 +- .../storage/innobase/buf/buf0flu.cc | 48 +- .../storage/innobase/buf/buf0lru.cc | 41 +- .../storage/innobase/dict/dict0crea.cc | 44 +- .../storage/innobase/dict/dict0dict.cc | 494 +- .../storage/innobase/dict/dict0load.cc | 5 +- .../storage/innobase/dict/dict0mem.cc | 222 +- .../storage/innobase/dict/dict0stats.cc | 649 +- .../storage/innobase/fil/fil0fil.cc | 139 +- .../storage/innobase/fts/fts0ast.cc | 184 +- .../storage/innobase/fts/fts0blex.cc | 456 +- .../storage/innobase/fts/fts0blex.l | 8 +- .../storage/innobase/fts/fts0fts.cc | 683 +- .../storage/innobase/fts/fts0opt.cc | 26 +- .../storage/innobase/fts/fts0pars.cc | 75 +- .../storage/innobase/fts/fts0pars.y | 22 +- .../storage/innobase/fts/fts0que.cc | 153 +- .../storage/innobase/fts/fts0sql.cc | 5 +- .../storage/innobase/fts/fts0tlex.cc | 83 +- .../storage/innobase/fts/fts0tlex.l | 6 +- .../storage/innobase/handler/ha_innodb.cc | 374 +- .../storage/innobase/handler/ha_innodb.h | 7 - .../storage/innobase/handler/handler0alter.cc | 159 +- .../storage/innobase/handler/i_s.cc | 251 +- .../storage/innobase/ibuf/ibuf0ibuf.cc | 11 +- .../storage/innobase/include/btr0cur.h | 13 +- .../storage/innobase/include/btr0cur.ic | 4 +- .../storage/innobase/include/buf0buf.h | 21 +- .../storage/innobase/include/buf0buf.ic | 24 +- .../storage/innobase/include/buf0dblwr.h | 7 +- .../storage/innobase/include/db0err.h | 7 +- .../storage/innobase/include/dict0crea.h | 34 +- .../storage/innobase/include/dict0dict.h | 26 +- .../storage/innobase/include/dict0mem.h | 221 +- .../storage/innobase/include/dict0types.h | 1 + .../storage/innobase/include/fil0fil.h | 44 +- .../storage/innobase/include/fts0ast.h | 76 +- .../storage/innobase/include/fts0fts.h | 1 + .../storage/innobase/include/fts0pars.h | 6 +- .../storage/innobase/include/fts0priv.ic | 26 +- .../storage/innobase/include/ha_prototypes.h | 2 +- .../storage/innobase/include/lock0lock.h | 15 +- .../storage/innobase/include/log0log.h | 6 +- .../storage/innobase/include/log0recv.h | 8 +- .../storage/innobase/include/os0file.h | 4 +- .../storage/innobase/include/os0once.h | 125 + .../storage/innobase/include/os0sync.h | 60 +- .../storage/innobase/include/os0sync.ic | 6 +- .../storage/innobase/include/row0log.h | 13 +- .../storage/innobase/include/row0merge.h | 2 +- .../storage/innobase/include/row0mysql.h | 8 + .../storage/innobase/include/sync0rw.h | 4 +- .../storage/innobase/include/sync0rw.ic | 40 +- .../storage/innobase/include/sync0sync.h | 2 + .../storage/innobase/include/sync0sync.ic | 15 +- .../storage/innobase/include/trx0roll.h | 4 +- .../storage/innobase/include/univ.i | 8 +- .../storage/innobase/include/ut0ut.h | 15 +- .../storage/innobase/lock/lock0lock.cc | 190 +- .../storage/innobase/log/log0log.cc | 19 +- .../storage/innobase/log/log0recv.cc | 38 +- .../storage/innobase/os/os0file.cc | 68 +- .../storage/innobase/os/os0sync.cc | 4 +- .../storage/innobase/os/os0thread.cc | 3 + .../storage/innobase/page/page0zip.cc | 171 +- .../storage/innobase/pars/lexyy.cc | 54 +- .../storage/innobase/pars/pars0pars.cc | 5 +- .../storage/innobase/rem/rem0cmp.cc | 33 +- .../storage/innobase/row/row0ftsort.cc | 23 +- .../storage/innobase/row/row0ins.cc | 60 +- .../storage/innobase/row/row0log.cc | 373 +- .../storage/innobase/row/row0merge.cc | 4 +- .../storage/innobase/row/row0mysql.cc | 220 +- .../storage/innobase/row/row0purge.cc | 48 +- .../storage/innobase/row/row0quiesce.cc | 13 +- .../storage/innobase/row/row0sel.cc | 16 +- .../storage/innobase/row/row0uins.cc | 5 +- .../storage/innobase/row/row0umod.cc | 15 +- .../storage/innobase/row/row0upd.cc | 85 +- .../storage/innobase/row/row0vers.cc | 43 +- .../storage/innobase/srv/srv0conc.cc | 2 +- .../storage/innobase/srv/srv0mon.cc | 9 +- .../storage/innobase/srv/srv0srv.cc | 16 +- .../storage/innobase/srv/srv0start.cc | 65 +- .../storage/innobase/sync/sync0arr.cc | 6 +- .../storage/innobase/sync/sync0rw.cc | 13 +- .../storage/innobase/sync/sync0sync.cc | 17 +- .../storage/innobase/trx/trx0i_s.cc | 2 +- .../storage/innobase/trx/trx0roll.cc | 24 +- .../storage/innobase/trx/trx0sys.cc | 22 +- .../storage/innobase/trx/trx0trx.cc | 15 +- mysql-wsrep-5.6/storage/innobase/ut/ut0ut.cc | 6 +- .../storage/myisam/ftbench/Ecompare.pl | 1 + .../storage/myisam/ftbench/Ecreate.pl | 1 + .../storage/myisam/ftbench/Ereport.pl | 1 + .../storage/myisam/ftbench/ft-test-run.sh | 1 + mysql-wsrep-5.6/storage/myisam/ha_myisam.cc | 1 - mysql-wsrep-5.6/storage/myisam/mi_delete.c | 2 - mysql-wsrep-5.6/storage/myisam/mi_key.c | 6 +- mysql-wsrep-5.6/storage/myisam/mi_open.c | 8 +- mysql-wsrep-5.6/storage/myisam/mi_rfirst.c | 1 + mysql-wsrep-5.6/storage/myisam/mi_rkey.c | 3 + mysql-wsrep-5.6/storage/myisam/mi_rlast.c | 1 + .../storage/myisam/mi_rnext_same.c | 12 +- mysql-wsrep-5.6/storage/myisam/mi_rrnd.c | 1 + mysql-wsrep-5.6/storage/myisam/mi_rsamepos.c | 1 + mysql-wsrep-5.6/storage/myisam/mi_test_all.sh | 1 + mysql-wsrep-5.6/storage/myisam/mi_unique.c | 3 - mysql-wsrep-5.6/storage/myisam/mi_update.c | 3 - mysql-wsrep-5.6/storage/myisam/mi_write.c | 3 - mysql-wsrep-5.6/storage/myisam/myisamdef.h | 8 +- mysql-wsrep-5.6/storage/myisam/rt_index.h | 1 + mysql-wsrep-5.6/storage/myisam/rt_key.c | 1 + mysql-wsrep-5.6/storage/myisam/rt_key.h | 1 + mysql-wsrep-5.6/storage/myisam/rt_mbr.h | 1 + mysql-wsrep-5.6/storage/myisam/sp_defs.h | 1 + mysql-wsrep-5.6/storage/myisam/sp_key.c | 2 +- .../storage/myisammrg/myrg_delete.c | 1 + .../storage/myisammrg/myrg_locking.c | 1 + .../storage/myisammrg/myrg_panic.c | 1 + .../storage/myisammrg/myrg_range.c | 1 + .../storage/myisammrg/myrg_records.c | 1 + .../storage/myisammrg/myrg_rfirst.c | 1 + .../storage/myisammrg/myrg_rlast.c | 1 + .../storage/myisammrg/myrg_rnext.c | 1 + .../storage/myisammrg/myrg_rnext_same.c | 1 + .../storage/myisammrg/myrg_rprev.c | 1 + mysql-wsrep-5.6/storage/myisammrg/myrg_rrnd.c | 1 + .../storage/myisammrg/myrg_rsame.c | 1 + .../storage/myisammrg/myrg_update.c | 1 + .../storage/myisammrg/myrg_write.c | 1 + mysql-wsrep-5.6/storage/ndb/CMakeLists.txt | 14 +- .../ndb/config/type_mgmapiclient.cmake | 1 + .../ndb/config/type_ndbapiclient.cmake | 1 + .../storage/ndb/config/type_util.cmake | 1 + .../storage/ndb/docs/doxygen/Doxyfile.mgmapi | 1 + .../storage/ndb/docs/doxygen/Doxyfile.ndb | 1 + .../storage/ndb/docs/doxygen/Doxyfile.ndbapi | 1 + .../storage/ndb/docs/doxygen/Doxyfile.odbc | 1 + .../storage/ndb/docs/doxygen/postdoxy.pl | 1 + .../kernel/signaldata/AlterIndxImpl.hpp | 1 + .../kernel/signaldata/BuildIndxImpl.hpp | 1 + .../kernel/signaldata/CreateIndxImpl.hpp | 1 + .../kernel/signaldata/CreateNodegroupImpl.hpp | 1 + .../include/kernel/signaldata/DictSignal.hpp | 1 + .../include/kernel/signaldata/DihScanTab.hpp | 1 + .../kernel/signaldata/DropIndxImpl.hpp | 1 + .../kernel/signaldata/DropNodegroup.hpp | 1 + .../kernel/signaldata/DropNodegroupImpl.hpp | 1 + .../include/kernel/signaldata/EnableCom.hpp | 1 + .../include/kernel/signaldata/HashMapImpl.hpp | 1 + .../include/kernel/signaldata/LqhTransReq.hpp | 1 + .../kernel/signaldata/StopForCrash.hpp | 1 + .../include/kernel/signaldata/TabCommit.hpp | 1 + .../storage/ndb/src/CMakeLists.txt | 5 +- .../storage/ndb/src/common/CMakeLists.txt | 1 + .../debugger/signaldata/AlterIndxImpl.cpp | 1 + .../common/debugger/signaldata/BuildIndx.cpp | 1 + .../debugger/signaldata/BuildIndxImpl.cpp | 1 + .../debugger/signaldata/CreateIndxImpl.cpp | 1 + .../common/debugger/signaldata/CreateTab.cpp | 1 + .../debugger/signaldata/CreateTable.cpp | 1 + .../debugger/signaldata/DropIndxImpl.cpp | 1 + .../common/debugger/signaldata/DropTable.cpp | 1 + .../debugger/signaldata/DropTrigImpl.cpp | 1 + .../common/debugger/signaldata/GetTabInfo.cpp | 1 + .../ndb/src/kernel/blocks/RestoreProxy.cpp | 1 + .../ndb/src/kernel/blocks/RestoreProxy.hpp | 1 + .../src/kernel/blocks/backup/BackupProxy.cpp | 1 + .../src/kernel/blocks/backup/BackupProxy.hpp | 1 + .../ndb/src/kernel/error/CMakeLists.txt | 1 + .../storage/ndb/src/kernel/vm/GlobalData.cpp | 1 + .../ndb/src/kernel/vm/SimulatedBlock_mt.cpp | 1 + .../src/kernel/vm/SimulatedBlock_nonmt.cpp | 1 + .../kernel/vm/TransporterCallbackKernel.hpp | 1 + .../src/kernel/vm/TransporterCallback_mt.cpp | 1 + .../kernel/vm/TransporterCallback_nonmt.cpp | 1 + .../storage/ndb/src/mgmclient/CMakeLists.txt | 4 + .../storage/ndb/src/mgmsrv/CMakeLists.txt | 4 + .../ndb/test/ndbapi/bank/CMakeLists.txt | 1 + .../ndb/test/ndbapi/testSingleUserMode.cpp | 1 + .../ndb/test/run-test/16node-tests.txt | 1 + .../ndb/test/run-test/atrt-analyze-result.sh | 1 + .../ndb/test/run-test/atrt-mysql-test-run | 1 + .../storage/ndb/test/run-test/atrt-testBackup | 1 + .../storage/ndb/test/run-test/basic.txt | 1 + .../storage/ndb/test/run-test/make-config.sh | 1 + .../ndb/test/run-test/make-html-reports.sh | 1 + .../storage/ndb/test/run-test/make-index.sh | 1 + .../storage/ndb/test/run-test/ndb-autotest.sh | 1 + .../storage/ndb/test/run-test/upgrade-boot.sh | 1 + mysql-wsrep-5.6/storage/ndb/test/src/getarg.c | 1 + .../storage/perfschema/gen_pfs_lex_token.cc | 96 +- .../storage/perfschema/ha_perfschema.cc | 10 +- .../storage/perfschema/ha_perfschema.h | 37 +- mysql-wsrep-5.6/storage/perfschema/pfs.cc | 4 +- .../storage/perfschema/pfs_digest.cc | 62 +- .../perfschema/table_events_statements.cc | 2 +- .../storage/perfschema/table_helper.h | 4 +- .../storage/perfschema/table_threads.cc | 18 +- mysql-wsrep-5.6/strings/CMakeLists.txt | 3 +- mysql-wsrep-5.6/strings/ctype-bin.c | 3 +- mysql-wsrep-5.6/strings/ctype-eucjpms.c | 3 +- mysql-wsrep-5.6/strings/ctype-mb.c | 4 +- mysql-wsrep-5.6/strings/ctype-tis620.c | 23 +- mysql-wsrep-5.6/strings/ctype-uca.c | 16 +- mysql-wsrep-5.6/strings/ctype-ujis.c | 3 +- mysql-wsrep-5.6/strings/decimal.c | 4 +- mysql-wsrep-5.6/strings/t_ctype.h | 1 + .../support-files/MacOSX/Description.plist.sh | 1 + .../support-files/MacOSX/Info.plist.sh | 1 + mysql-wsrep-5.6/support-files/MacOSX/MySQLCOM | 1 + .../support-files/MacOSX/ReadMe.txt | 634 +- .../MacOSX/StartupItem.Description.plist | 1 + .../MacOSX/StartupItem.Info.plist | 1 + .../MacOSX/StartupItem.postinstall | 1 + .../MacOSX/StartupParameters.plist.sh | 1 + .../support-files/MacOSX/mwar-wrapper | 1 + .../support-files/MacOSX/mwcc-wrapper | 1 + .../support-files/MacOSX/postflight.sh | 1 + .../support-files/MacOSX/preflight.sh | 1 + .../support-files/RHEL4-SElinux/mysql.fc | 1 + .../support-files/RHEL4-SElinux/mysql.te | 1 + mysql-wsrep-5.6/support-files/build-tags | 4 +- .../support-files/dtrace/locktime.d | 42 +- .../support-files/dtrace/query-execandqc.d | 38 +- .../dtrace/query-filesort-time.d | 40 +- .../support-files/dtrace/query-network-time.d | 40 +- .../support-files/dtrace/query-parse-time.d | 38 +- .../support-files/dtrace/query-rowops.d | 40 +- .../support-files/dtrace/query-time.d | 38 +- .../support-files/dtrace/statement-time.d | 40 +- .../dtrace/statement-type-aggregate.d | 44 +- mysql-wsrep-5.6/support-files/mysql.m4 | 1 + mysql-wsrep-5.6/support-files/mysql.spec.sh | 61 +- mysql-wsrep-5.6/tests/connect_test.c | 1 + mysql-wsrep-5.6/tests/deadlock_test.c | 1 + mysql-wsrep-5.6/tests/drop_test.pl | 1 + mysql-wsrep-5.6/tests/export.pl | 1 + mysql-wsrep-5.6/tests/fork2_test.pl | 1 + mysql-wsrep-5.6/tests/fork_big.pl | 1 + mysql-wsrep-5.6/tests/fork_big2.pl | 1 + mysql-wsrep-5.6/tests/index_corrupt.pl | 1 + mysql-wsrep-5.6/tests/insert_and_repair.pl | 1 + mysql-wsrep-5.6/tests/insert_test.c | 1 + mysql-wsrep-5.6/tests/list_test.c | 1 + mysql-wsrep-5.6/tests/lock_test.pl | 1 + mysql-wsrep-5.6/tests/mysql_client_fw.c | 13 +- mysql-wsrep-5.6/tests/mysql_client_test.c | 102 +- mysql-wsrep-5.6/tests/pmail.pl | 1 + mysql-wsrep-5.6/tests/rename_test.pl | 1 + mysql-wsrep-5.6/tests/select_test.c | 1 + mysql-wsrep-5.6/tests/showdb_test.c | 1 + mysql-wsrep-5.6/tests/ssl_test.c | 1 + mysql-wsrep-5.6/tests/table_types.pl | 1 + mysql-wsrep-5.6/tests/test_delayed_insert.pl | 1 + mysql-wsrep-5.6/tests/truncate.pl | 1 + mysql-wsrep-5.6/unittest/examples/simple-t.c | 1 + mysql-wsrep-5.6/unittest/gunit/CMakeLists.txt | 18 +- .../unittest/gunit/debug_sync-t.cc | 205 + .../unittest/gunit/item_param-t.cc | 51 + .../unittest/gunit/my_fileutils-t.cc | 0 .../unittest/gunit/mysys_my_pwrite-t.cc | 267 + .../unittest/gunit/mysys_my_write-t.cc | 258 + mysql-wsrep-5.6/unittest/gunit/stdcxx-t.cc | 8 +- mysql-wsrep-5.6/unittest/gunit/test_utils.cc | 8 + .../unittest/gunit/yassl/CMakeLists.txt | 3 +- mysql-wsrep-5.6/vio/CMakeLists.txt | 3 +- mysql-wsrep-5.6/vio/viosslfactories.c | 5 +- mysql-wsrep-5.6/win/create_def_file.js | 1 + mysql-wsrep-5.6/zlib/CMakeLists.txt | 3 +- 2070 files changed, 119680 insertions(+), 61935 deletions(-) delete mode 100644 debian/patches/CVE-2014-0001.patch delete mode 100644 debian/patches/mysql-5.6.16_wsrep_25.5.patch create mode 100644 debian/patches/mysql-5.6.23_wsrep_25.10.patch create mode 100644 mysql-wsrep-5.6/.gitignore create mode 100644 mysql-wsrep-5.6/Docs/README-wsrep create mode 100644 mysql-wsrep-5.6/cmake/compile_flags.cmake create mode 100644 mysql-wsrep-5.6/extra/yassl/certs/dsa1024.der create mode 100644 mysql-wsrep-5.6/extra/yassl/certs/dsa1024.pem create mode 100644 mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh create mode 100644 mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_fill.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/grep_pattern.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_do_table_filter_insensitive.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_do_table_filter_sensitive.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_drop_table.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtids_restart_slave_io_lost_trx.test create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_heartbeat_2slaves.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ignore_table_filter_insensitive.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ignore_table_filter_sensitive.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_ignore_gtid_on.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_kill_query.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loaddata_s.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_execute_partial_trx_in_relay_log.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_event_max_size.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_show_relaylog_events.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stm_insert_delayed.inc create mode 100644 mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stm_mix_show_relaylog_events.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/change_file_perms.inc mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/include/check_ipv4_mapped.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/func_aes_block.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/get_file_permissions.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/get_ndb_epochs.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/gtid_step_assert.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/gtid_step_reset.inc mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/include/have_QC_Disabled.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/have_util_nc.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/linux.inc mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/include/memcache_config.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/rpl_connection_master1.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/show_all_binlogs.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/show_all_relay_logs.inc mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/include/shutdown_mysqld.inc mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/include/start_mysqld.inc create mode 100644 mysql-wsrep-5.6/mysql-test/include/wait_for_ndb_committed_to_binlog.inc create mode 100644 mysql-wsrep-5.6/mysql-test/r/bug17076131.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/check_auto_permission.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/ctype_cp932.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/dynamic_tracing.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/func_aes.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/func_aes_cfb1.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/func_aes_cfb128.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/func_aes_cfb8.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/func_aes_misc.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/func_aes_ofb.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/innodb_recovery_with_upper_case_names.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/log_errchk.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/r/lowercase_table4.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/mysqlbinlog_debug.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/mysqlbinlog_mixed_or_statment.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/r/named_pipe.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/partition_index_innodb.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/partition_index_myisam.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/r/shm.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/show_processlist.result create mode 100644 mysql-wsrep-5.6/mysql-test/r/temp_pool.result create mode 100644 mysql-wsrep-5.6/mysql-test/std_data/bug17532932.MYD create mode 100644 mysql-wsrep-5.6/mysql-test/std_data/bug17532932.MYI create mode 100644 mysql-wsrep-5.6/mysql-test/std_data/bug17532932.frm mode change 100644 => 100755 mysql-wsrep-5.6/mysql-test/std_data/checkDBI_DBD-mysql.pl create mode 100644 mysql-wsrep-5.6/mysql-test/std_data/system_tap.stp create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_simple_recovery.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_utils.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_concat.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_stop_slave_server_id.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_truncate_kill.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_xa_handling.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_simple_recovery.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_utils.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_concat.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_start_stop_slave_server_id.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_truncate_kill.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_xa_handling.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/include/checksum_not_strict.inc create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/add_foreign_key.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/blob-update-debug.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/blob_redo.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/checksum.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/create-index.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/foreign_key.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/index_tree_operation.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter-tempfile.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-double-write.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-update-insert.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-debug.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-linux.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-windows.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug14169459.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug57904.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug60196.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_stats_external_pages.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/insert_debug.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/monitor.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/monitor_debug.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/sp_temp_table.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/strict_mode.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/add_foreign_key.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob-update-debug.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob_redo-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob_redo.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/checksum.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/create-index.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/foreign_key.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/index_tree_operation.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter-tempfile.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-double-write.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-update-insert.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-alter.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-debug.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-discard.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-linux.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-windows.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug14169459.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug57904.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60196-master.opt mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60196.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_stats_external_pages.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/insert_debug.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/monitor.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/monitor_debug.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/portability_wl5980_linux.zip mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/portability_wl5980_windows.zip create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/sp_temp_table.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/strict_mode.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility_win.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/subexpr.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility_win.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/subexpr.test mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/ndb/t/ndb_show_tables_result.inc mode change 100644 => 100755 mysql-wsrep-5.6/mysql-test/suite/opt_trace/validate_json.py mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_innodb.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_myisam.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_10.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_11.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_14.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_3.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_6.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/perfschema/r/unary_digest.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/perfschema/t/unary_digest.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_4threads_deadlock.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_drop_temp_table.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_db_fail.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_temp_gtid.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_warnings.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binary_log_as_relay_log.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binlog_errors.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_do_table_filter_insensitive.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_do_table_filter_sensitive.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_drop_table.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_heartbeat_2slave.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_ignore_table_filter_insensitive.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_ignore_table_filter_sensitive.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_loaddata_s.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_row_event_max_size.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_row_show_relaylog_events.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_server_sighup.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stm_insert_delayed.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stm_mix_show_relaylog_events.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_validate_slave_gtids.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtids_restart_slave_io_lost_trx.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_on_update.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_kill_query.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_execute_partial_trx_with_auto_pos_off.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_execute_partial_trx_with_auto_pos_on.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_gtids_restart_slave_io_lost_trx.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_slave_hang_with_partial_trx.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_worker_error.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_recovery_empty_sqlthd_pos.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_recovery_replicate_same_server_id.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_event_after_sync_stage.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_gtid.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_row_trans.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_corrupt.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_create_select.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sbm_previous_gtid_event.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_future_logpos.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_shutdown_hang.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_slave_status_deadlock.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_slave_err_warnings.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sql_thread_killed_waiting_commit_lock.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_until_pos_middle_gtid.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_timestamp_upgrage_55.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_unknown_ignorable_event.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_4threads_deadlock.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_drop_temp_table.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db_fail.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_gtid.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binary_log_as_relay_log.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binlog_errors-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binlog_errors.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_drop_table.cnf create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_drop_table.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.cnf create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_heartbeat_2slave.cnf create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_heartbeat_2slave.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_loaddata_s-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_loaddata_s.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_show_relaylog_events.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_server_sighup.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stm_insert_delayed.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stm_mix_show_relaylog_events.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_validate_slave_gtids.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtids_restart_slave_io_lost_trx.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_insert_on_update.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_kill_query-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_kill_query.test mode change 100644 => 100755 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh mode change 100644 => 100755 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh mode change 100644 => 100755 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_off-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_off.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_on-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_on.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_gtids_restart_slave_io_lost_trx-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_gtids_restart_slave_io_lost_trx.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_slave_hang_with_partial_trx-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_slave_hang_with_partial_trx.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_worker_error.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_empty_sqlthd_pos-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_empty_sqlthd_pos.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_replicate_same_server_id-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_replicate_same_server_id.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_event_after_sync_stage.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_gtid.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_row_trans.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_create_select.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_previous_gtid_event-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_previous_gtid_event.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_slave_status_deadlock.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_slave_err_warnings-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_slave_err_warnings.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sql_thread_killed_waiting_commit_lock-slave.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sql_thread_killed_waiting_commit_lock.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_until_pos_middle_gtid.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_timestamp_upgrage_55.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_unknown_ignorable_event.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlog_error_action_basic.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlog_gtid_simple_recovery_basic.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlogging_impossible_mode_basic.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/block_encryption_mode_basic.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/simplified_binlog_gtid_recovery_basic.result mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlog_error_action_basic.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlog_gtid_simple_recovery_basic.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlogging_impossible_mode_basic.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/block_encryption_mode_basic.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_fil_make_page_dirty_debug_basic.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_saved_page_number_debug_basic.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/simplified_binlog_gtid_recovery_basic.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/bug17076131-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/t/bug17076131.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/check_auto_permission.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/ctype_cp932.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/dynamic_tracing.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/func_aes.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/func_aes_cfb1.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/func_aes_cfb128.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/func_aes_cfb8.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/func_aes_misc.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/func_aes_ofb.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/innodb_recovery_with_upper_case_names-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/t/innodb_recovery_with_upper_case_names.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/log_errchk.test mode change 100644 => 100755 mysql-wsrep-5.6/mysql-test/t/long_tmpdir-master.sh mode change 100644 => 100755 mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir-master.sh mode change 100644 => 100755 mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/t/lowercase_table4-master.opt mode change 100755 => 100644 mysql-wsrep-5.6/mysql-test/t/lowercase_table4.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/mysqlbinlog_debug.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/mysqlbinlog_mixed_or_statment.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/partition_index_innodb.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/partition_index_myisam.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/show_processlist.test create mode 100644 mysql-wsrep-5.6/mysql-test/t/temp_pool-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/t/temp_pool.test create mode 100644 mysql-wsrep-5.6/mysys_ssl/my_aes_impl.h create mode 100644 mysql-wsrep-5.6/mysys_ssl/my_aes_openssl.cc create mode 100644 mysql-wsrep-5.6/mysys_ssl/my_aes_yassl.cc create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/changelog create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/compat create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/control create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/copyright create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/extra/apparmor-profile create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/extra/my.cnf create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/extra/mysql_embedded.1 create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient18.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/libmysqld-dev.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-client.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-common.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-common.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-client.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.config create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.install create mode 100755 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.mysql.init create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.postinst create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.postrm create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.preinst create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.prerm create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.templates create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-source.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.links create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-server.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/mysql-testsuite.install create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/patches/fix-man-page-links.patch create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/patches/fix-mysql_install_db.patch create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/patches/series create mode 100755 mysql-wsrep-5.6/packaging/deb-precise/rules create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/source/format create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/source/include-binaries create mode 100644 mysql-wsrep-5.6/packaging/deb-precise/watch create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/changelog create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/compat create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/control create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/copyright create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/extra/apparmor-profile create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/extra/my.cnf create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/extra/mysql_embedded.1 create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient-dev.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient18.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/libmysqld-dev.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-client.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-bench.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-client.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.config create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.install create mode 100755 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.mysql.init create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.postinst create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.postrm create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.preinst create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.prerm create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.templates create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-source.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.links create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-server.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/mysql-testsuite.install create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-man-page-links.patch create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-mysql_install_db.patch create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/patches/series create mode 100755 mysql-wsrep-5.6/packaging/deb-trusty/rules create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/source/format create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/source/include-binaries create mode 100644 mysql-wsrep-5.6/packaging/deb-trusty/watch create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/changelog create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/compat create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/control create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/copyright create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/extra/my.cnf create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/extra/mysql_embedded.1 create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient18.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/libmysqld-dev.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-client.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-client.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.config create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.install create mode 100755 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.mysql.init create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.postinst create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.postrm create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.preinst create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.prerm create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.templates create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-source.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.dirs create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.links create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-server.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/mysql-testsuite.install create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-man-page-links.patch create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-mysql_install_db.patch create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/patches/series create mode 100755 mysql-wsrep-5.6/packaging/deb-wheezy/rules create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/source/format create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/source/include-binaries create mode 100644 mysql-wsrep-5.6/packaging/deb-wheezy/watch create mode 100644 mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6.16-mysql-install.patch create mode 100644 mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6-libmysqlclient-symbols.patch create mode 100644 mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6.16-mysql-install.patch create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/CMakeLists.txt create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/filter-provides.sh create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/filter-requires.sh create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/my.cnf create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/my_config.h create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/mysql-systemd-start create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/mysql.conf create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/mysql.init create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/mysql.spec.in create mode 100644 mysql-wsrep-5.6/packaging/rpm-sles/mysqld.service mode change 100644 => 100755 mysql-wsrep-5.6/sql-bench/compare-results.sh mode change 100644 => 100755 mysql-wsrep-5.6/sql-bench/graph-compare-results.sh create mode 100644 mysql-wsrep-5.6/storage/innobase/include/os0once.h create mode 100644 mysql-wsrep-5.6/unittest/gunit/debug_sync-t.cc create mode 100644 mysql-wsrep-5.6/unittest/gunit/item_param-t.cc mode change 100755 => 100644 mysql-wsrep-5.6/unittest/gunit/my_fileutils-t.cc create mode 100644 mysql-wsrep-5.6/unittest/gunit/mysys_my_pwrite-t.cc create mode 100644 mysql-wsrep-5.6/unittest/gunit/mysys_my_write-t.cc diff --git a/debian/changelog b/debian/changelog index 90d81c31..53896f0e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +mysql-wsrep-5.6 (5.6.23-1~u14.04+mos1) mos7.0; urgency=medium + + * Update to MySQL 5.6.23: + - remove d/p/CVE-2014-0001.patch as it was merged. + * Update to wsrep 25.10 (Closes: #1438516): + - fix misuse of thread-safe functions in innodb-wsrep, + - patch obtained by diffing mysql-5.6.23 against mysql-wsrep-5.6.23-25.10 + and resolving conflicts. + + -- Pavel Boldin <pboldin@mirantis.com> Sun, 12 Apr 2015 17:40:48 +0300 + mysql-wsrep-5.6 (5.6.16-2~u14.04+mos2) mos6.1; urgency=low * Fix version according to Fuel versioning policy: diff --git a/debian/patches/CVE-2014-0001.patch b/debian/patches/CVE-2014-0001.patch deleted file mode 100644 index 93c75317..00000000 --- a/debian/patches/CVE-2014-0001.patch +++ /dev/null @@ -1,14 +0,0 @@ -Description: Fix buffer overflow in client/mysql.cc via a long server version string. -Origin: https://bugzilla.redhat.com/show_bug.cgi?id=1054592 - ---- a/client/mysql.cc -+++ b/client/mysql.cc -@@ -1315,7 +1315,7 @@ int main(int argc,char *argv[]) - - put_info("Welcome to the MySQL monitor. Commands end with ; or \\g.", - INFO_INFO); -- sprintf((char*) glob_buffer.ptr(), -+ snprintf((char*) glob_buffer.ptr(), glob_buffer.alloced_length(), - "Your MySQL connection id is %lu\nServer version: %s\n", - mysql_thread_id(&mysql), server_version_string(&mysql)); - put_info((char*) glob_buffer.ptr(),INFO_INFO); diff --git a/debian/patches/mysql-5.6.16_wsrep_25.5.patch b/debian/patches/mysql-5.6.16_wsrep_25.5.patch deleted file mode 100644 index 89f194fb..00000000 --- a/debian/patches/mysql-5.6.16_wsrep_25.5.patch +++ /dev/null @@ -1,22742 +0,0 @@ -=== modified file 'CMakeLists.txt' ---- old/CMakeLists.txt 2013-12-18 10:17:16 +0000 -+++ new/CMakeLists.txt 2014-03-11 21:17:40 +0000 -@@ -193,6 +193,7 @@ - INCLUDE(install_macros) - INCLUDE(install_layout) - INCLUDE(mysql_add_executable) -+INCLUDE(wsrep) - - # Handle options - OPTION(DISABLE_SHARED -@@ -326,6 +327,11 @@ - 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) -+ 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) -@@ -453,6 +459,9 @@ - ADD_SUBDIRECTORY(mysys) - ADD_SUBDIRECTORY(mysys_ssl) - ADD_SUBDIRECTORY(libmysql) -+IF(WITH_WSREP) -+ADD_SUBDIRECTORY(wsrep) -+ENDIF() - - IF(WITH_UNIT_TESTS) - ADD_SUBDIRECTORY(unittest) -@@ -551,7 +560,7 @@ - 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") -@@ -559,6 +568,7 @@ - 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 - -=== added file 'Docs/README-wsrep' ---- old/Docs/README-wsrep 1970-01-01 00:00:00 +0000 -+++ new/Docs/README-wsrep 2013-09-01 09:27:10 +0000 -@@ -0,0 +1,487 @@ -+Codership Oy -+http://www.codership.com -+<info@codership.com> -+ -+DISCLAIMER -+ -+THIS SOFTWARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -+IN NO EVENT SHALL CODERSHIP OY BE HELD LIABLE TO ANY PARTY FOR ANY DAMAGES -+RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE. -+ -+Trademark Information. -+ -+MySQL is a trademark or registered trademark of Oracle and/or its affiliates. -+Other trademarks are the property of their respective owners. -+ -+Licensing Information. -+ -+Please see file COPYING that came with this distribution -+ -+Source code can be found at -+wsrep API: https://launchpad.net/wsrep -+MySQL patch: https://launchpad.net/codership-mysql -+ -+ -+ABOUT THIS DOCUMENT -+ -+This document covers installation and configuration issues specific to this -+wsrep-patched MySQL distribution by Codership. It does not cover the use or -+administration of MySQL server per se. The reader is assumed to know how to -+install, configure, administer and use standard MySQL server version 5.1.xx. -+ -+ -+ MYSQL-5.5.x/wsrep-23.x -+ -+CONTENTS: -+========= -+1. WHAT IS WSREP PATCH FOR MYSQL -+2. INSTALLATION -+3. FIRST TIME SETUP -+ 3.1 CONFIGURATION FILES -+ 3.2 DATABASE PRIVILEGES -+ 3.3 CHECK AND CORRECT FIREWALL SETTINGS -+ 3.4 SELINUX -+ 3.5 APPARMOR -+ 3.6 CONNECT TO CLUSTER -+4. UPGRADING FROM MySQL 5.1.x -+5. CONFIGURATION OPTIONS -+ 5.1 MANDATORY MYSQL OPTIONS -+ 5.2 WSREP OPTIONS -+6. ONLINE SCHEMA UPGRADE -+ 6.1 TOTAL ORDER ISOLATION (TOI) -+ 6.2 ROLLING SCHEMA UPGRADE (RSU) -+7. LIMITATIONS -+ -+ -+1. WHAT IS WSREP PATCH FOR MYSQL/INNODB -+ -+Wsrep API developed by Codership Oy is a modern generic (database-agnostic) -+replication API for transactional databases with a goal to make database -+replication/logging subsystem completely modular and pluggable. It is developed -+with flexibility and completeness in mind to satisfy broad range of modern -+replication scenarios. It is equally suitable for synchronous and asynchronous, -+master-slave and multi-master replication. -+ -+wsrep stands for Write Set REPlication. -+ -+Wsrep patch for MySQL/InnoDB allows MySQL server to load and use various wsrep -+API implementations ("wsrep providers") with different qualities of service. -+Without wsrep provider MySQL-wsrep server will function like a regular -+standalone server. -+ -+ -+2. INSTALLATION -+ -+In the examples below mysql authentication options are omitted for brevity. -+ -+2.1 Download and install mysql-wsrep package. -+ -+Download binary package for your Linux distribution from -+https://launchpad.net/codership-mysql/ -+ -+2.1.1 On Debian and Debian-derived distributions. -+ -+Upgrade from mysql-server-5.0 to mysql-wsrep is not supported yet, please -+upgrade to mysql-server-5.1 first. -+ -+If you're installing over an existing mysql installation, mysql-server-wsrep -+will conflict with mysql-server-5.1 package, so remove it first: -+ -+$ sudo apt-get remove mysql-server-5.1 mysql-server-core-5.1 -+ -+mysql-server-wsrep requires psmisc and mysql-client-5.1.47 (or later). -+MySQL 5.1 packages can be found from backports repositories. -+For further information about configuring and using Debian or Ubuntu -+backports, see: -+ -+* http://backports.debian.org -+ -+* https://help.ubuntu.com/community/UbuntuBackports -+ -+For example, installation of required packages on Debian Lenny: -+ -+$ sudo apt-get install psmisc -+$ sudo apt-get -t lenny-backports install mysql-client-5.1 -+ -+Now you should be able to install mysql-wsrep package: -+ -+$ sudo dpkg -i <mysql-server-wsrep DEB> -+ -+2.1.2 On CentOS and similar RPM-based distributions. -+ -+If you're migrating from existing MySQL installation, there are two variants: -+ -+ a) If you're already using official MySQL-server-community 5.1.x RPM from -+ Oracle: -+ -+ # rpm -e mysql-server -+ -+ b) If you're upgrading from the stock mysql-5.0.77 on CentOS: -+ -+ 1) Make sure that the following packages are not installed: -+ # rpm --nodeps --allmatches -e mysql-server mysql-test mysql-bench -+ -+ 2) Install *official* MySQL-shared-compat-5.1.x from -+ http://dev.mysql.com/downloads/mysql/5.1.html -+ -+Actual installation: -+ -+ # rpm -Uvh <MySQL-server-wsrep RPM> -+ -+ If this fails due to unsatisfied dependencies, install missing packages -+ (e.g. yum install perl-DBI) and retry. -+ -+Additional packages to consider (if not yet installed): -+ * galera (multi-master replication provider, https://launchpad.net/galera) -+ * MySQL-client-community (for connecting to server and mysqldump-based SST) -+ * rsync (for rsync-based SST) -+ * xtrabackup and nc (for xtrabackup-based SST) -+ -+2.2 Upgrade system tables. -+ -+If you're upgrading a previous MySQL installation, it might be advisable to -+upgrade system tables. To do that start mysqld and run mysql_upgrade command. -+Consult MySQL documentation in case of errors. Normally they are not critical -+and can be ignored unless specific functionality is needed. -+ -+ -+3. FIRST TIME SETUP -+ -+Unless you're upgrading an already installed mysql-wsrep package, you will need -+to set up a few things to prepare server for operation. -+ -+3.1 CONFIGURATION FILES -+ -+* Make sure system-wide my.cnf does not bind mysqld to 127.0.0.1. That is, if -+ you have the following line in [mysqld] section, comment it out: -+ -+ #bind-address = 127.0.0.1 -+ -+* Make sure system-wide my.cnf contains "!includedir /etc/mysql/conf.d/" line. -+ -+* Edit /etc/mysql/conf.d/wsrep.cnf and set wsrep_provider option by specifying -+ a path to provider library. If you don't have a provider, leave it as it is. -+ -+* When a new node joins the cluster it'll have to receive a state snapshot from -+ one of the peers. This requires a privileged MySQL account with access from -+ the rest of the cluster. Edit /etc/mysql/conf.d/wsrep.cnf and set mysql -+ login/password pair for SST, for example: -+ -+ wsrep_sst_auth=wsrep_sst:wspass -+ -+* See CONFIGURATION section below about other configuration parameters that you -+ might want to change at this point. -+ -+3.2 DATABASE PRIVILEGES -+ -+Restart MySQL server and connect to it as root to grant privileges to SST -+account (empty users confuse MySQL authentication matching rules, we need to -+delete them too): -+ -+$ mysql -e "SET wsrep_on=OFF; DELETE FROM mysql.user WHERE user='';" -+$ mysql -e "SET wsrep_on=OFF; GRANT ALL ON *.* TO wsrep_sst@'%' IDENTIFIED BY 'wspass'"; -+ -+3.3 CHECK AND CORRECT FIREWALL SETTINGS. -+ -+MySQL-wsrep server needs to be accessible from other cluster members through -+its client listening socket and through wsrep provider socket. See your -+distribution and wsrep provider documentation for details. For example on -+CentOS you might need to do something along these lines: -+ -+# iptables --insert RH-Firewall-1-INPUT 1 --proto tcp --source <my IP>/24 --destination <my IP>/32 --dport 3306 -j ACCEPT -+# iptables --insert RH-Firewall-1-INPUT 1 --proto tcp --source <my IP>/24 --destination <my IP>/32 --dport 4567 -j ACCEPT -+ -+If there is a NAT firewall between the nodes, it must be configured to allow -+direct connections between the nodes (e.g. via port forwarding). -+ -+3.4 SELINUX -+ -+If you have SELinux enabled, it may block mysqld from doing required operations. -+You'll need to either disable it or configure to allow mysqld to run external -+programs and open listen sockets at unprivileged ports (i.e. things that -+an unprivileged user can do). See SELinux documentation about it. -+ -+To quickly disable SELinux: -+1) run 'setenforce 0' as root. -+2) set 'SELINUX=permissive' in /etc/selinux/config -+ -+3.5 APPARMOR -+ -+AppArmor automatically comes with Ubuntu and may also prevent mysqld to from -+opening additional ports or run scripts. See AppArmor documentation about its -+configuration. To disable AppArmor for mysqld: -+ -+$ cd /etc/apparmor.d/disable/ -+$ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld -+$ sudo service apparmor restart -+ -+ -+3.6 CONNECT TO CLUSTER -+ -+Now you're ready to connect to cluster by setting wsrep_cluster_address variable -+and monitor status of wsrep provider: -+ -+mysql> SET GLOBAL wsrep_cluster_address='<cluster address string>'; -+mysql> SHOW STATUS LIKE 'wsrep%'; -+ -+ -+4 UPGRADING FROM MySQL 5.1.x -+ -+!!! THESE INSTRUCTIONS ARE PRELIMINARY AND INCOMPLETE !!! -+ -+1) BEFORE UPGRADE (while running 5.1.x): -+ - comment out 'wsrep_provider' setting from configuration files -+ (my.cnf and/or wsrep.cnf) -+ - If performing a rolling upgrade on a running cluster, set -+ wsrep_sst_method=mysqldump. -+ You might also need to configure wsrep_sst_receive_address and -+ wsrep_sst_auth appropriately. mysqldump is the only way to transfer data -+ from 5.1.x to 5.5.x reliably. -+ - remove innodb_plugin settings from configuration files. -+ -+2) Perform upgrade as usual: -+ http://dev.mysql.com/doc/refman/5.5/en/upgrading-from-previous-series.html -+ Don't forget to run 'mysql_upgrade' command. -+ -+3) AFTER UPGRADING individual node: -+ - uncomment 'wsrep_provider' line in configuration file. -+ - restart the server and join the cluster. -+ -+4) AFTER UPGRADING the whole cluster: -+ - revert to usual wsrep SST settings if not 'mysqldump'. -+ -+ -+5. CONFIGURATION OPTIONS -+ -+5.1 MANDATORY MYSQL OPTIONS -+ -+binlog_format=ROW -+ This option is required to use row-level replication as opposed to -+ statement-level. For performance and consistency considerations don't change -+ that. As a side effect, binlog, if turned on, can be ROW only. In future this -+ option won't have special meaning. -+ -+innodb_autoinc_lock_mode=2 -+ This is a required parameter. Without it INSERTs into tables with -+ AUTO_INCREMENT column may fail. -+ autoinc lock modes 0 and 1 can cause unresolved deadlock, and make -+ system unresponsive. -+ -+innodb_locks_unsafe_for_binlog=1 -+ This option is required for parallel applying. -+ -+5.2 WSREP OPTIONS -+ -+All options are optional except for wsrep_provider, wsrep_cluster_address, and -+wsrep_sst_auth. -+ -+wsrep_provider=none -+ A full path to the library that implements WSREP interface. If none is -+ specified, the server behaves like a regular mysqld. -+ -+wsrep_provider_options= -+ Provider-specific option string. Check wsrep provider documentation or -+ http://www.codership.com/wiki -+ -+wsrep_cluster_address= -+ Provider-specific cluster address string. This is used to connect a node to -+ the desired cluster. This option can be given either on mysqld startup or set -+ during runtime. See wsrep provider documentation for possible values. -+ -+wsrep_cluster_name="my_wsrep_cluster" -+ Logical cluster name, must be the same for all nodes of the cluster. -+ -+wsrep_node_address= -+ An option to explicitly specify the network address of the node in the form -+ <address>[:port] if autoguessing for some reason does not produce desirable -+ results (multiple network interfaces, NAT, etc.) -+ If not explicitly overridden by wsrep_sst_receive_address, the <address> part -+ will be used to listen for SST (see below). And the whole <address>[:port] -+ will be passed to wsrep provider to be used as a base address in its -+ communications. -+ -+wsrep_node_name= -+ Human readable node name (for easier log reading only). Defaults to hostname. -+ -+wsrep_slave_threads=1 -+ Number of threads dedicated to processing of writesets from other nodes. -+ For best performance should be few per CPU core. -+ -+wsrep_dbug_option -+ Options for the built-in DBUG library (independent from what MySQL uses). -+ Empty by default. Not currently in use. -+ -+wsrep_debug=0 -+ Enable debug-level logging. -+ -+wsrep_convert_LOCK_to_trx=0 -+ Implicitly convert locking sessions into transactions inside mysqld. By -+ itself it does not mean support for locking sessions, but it prevents the -+ database from going into logically inconsistent state. Note however, that -+ loading large database dump with LOCK statements might result in abnormally -+ large transactions and cause an out-of-memory condition -+ -+wsrep_retry_autocommit=1 -+ Retry autocommit queries and single statement transactions should they fail -+ certification test. This is analogous to rescheduling an autocommit query -+ should it go into deadlock with other transactions in the database lock -+ manager. -+ -+wsrep_auto_increment_control=1 -+ Automatically adjust auto_increment_increment and auto_increment_offset -+ variables based on the number of nodes in the cluster. Significantly reduces -+ certification conflict rate for INSERTS. -+ -+wsrep_drupal_282555_workaround=1 -+ MySQL seems to have an obscure bug when INSERT into table with -+ AUTO_INCREMENT column with NULL value for that column can fail with a -+ duplicate key error. When this option is on, it retries such INSERTs. -+ Required for stable Drupal operation. Documented at: -+ http://bugs.mysql.com/bug.php?id=41984 -+ http://drupal.org/node/282555 -+ -+wsrep_causal_reads=0 -+ Enforce strict READ COMMITTED semantics on reads and transactions. May -+ result in additional latencies. It is a session variable. -+ -+wsrep_OSU_method=TOI -+ Online Schema Upgrade (OSU) can be performed with two alternative methods: -+ Total Order Isolation (TOI) runs DDL statement in all cluster nodes in -+ same total order sequence locking the affected table for the duration of the -+ operation. This may result in the whole cluster being blocked for the -+ duration of the operation. -+ Rolling Schema Upgrade (RSU) executes the DDL statement only locally, thus -+ blocking only one cluster node. During the DDL processing, the node -+ is not replicating and may be unable to process replication events (due to -+ table lock). Once DDL operation is complete, the node will catch up and sync -+ with the cluster to become fully operational again. The DDL statement or -+ its effects are not replicated, so it is user's responsibility to manually -+ perform this operation on each of the nodes. -+ -+wsrep_forced_binlog_format=none -+ Force every transaction to use given binlog format. When this variable is -+ set to something else than NONE, all transactions will use the given forced -+ format, regardless of what the client session has specified in binlog_format. -+ Valid choices for wsrep_forced_binlog_format are: ROW, STATEMENT, MIXED and -+ special value NONE, meaning that there is no forced binlog format in effect. -+ This variable was intruduced to support STATEMENT format replication during -+ rolling schema upgrade processing. However, in most cases ROW replication -+ is valid for asymmetrict schema replication. -+ -+State snapshot transfer options. -+ -+When a new node joins the cluster it has to synchronize its initial state with -+the other cluster members by transferring state snapshot from one of them. -+The options below govern how this happens and should be set up before attempting -+to join or start a cluster. -+ -+wsrep_sst_method=rsync -+ What method to use to copy database state to a newly joined node. Supported -+ methods: -+ - mysqldump: slow (except for small datasets) but most tested. -+ - rsync: much faster on large datasets. -+ - rsync_wan: same as rsync but with deltaxfer to minimize network traffic. -+ - xtrabackup: very fast and practically non-blocking SST method based on -+ Percona's xtrabackup tool. -+ -+ (for xtrabackup to work the following settings must be present in my.cnf -+ on all nodes: -+ [mysqld] -+ wsrep_sst_auth=root:<root password> -+ datadir=<path to data dir> -+ [client] -+ socket=<path to socket> -+ ) -+ -+wsrep_sst_receive_address= -+ Address (hostname:port) at which this node wants to receive state snapshot. -+ Defaults to mysqld bind address, and if that is not specified (0.0.0.0) - -+ to the first IP of eth0 + mysqld bind port. -+ NOTE: check that your firewall allows connections to this address from other -+ cluster nodes. -+ -+wsrep_sst_auth= -+ Authentication information needed for state transfer. Depends on the state -+ transfer method. For mysqldump-based SST it is -+ <mysql_root_user>:<mysql_root_password> -+ and should be the same on all nodes - it is used to authenticate with both -+ state snapshot receiver and state snapshot donor. -+ -+wsrep_sst_donor= -+ A name of the node which should serve as state snapshot donor. This allows -+ to control which node will serve state snapshot request. By default the -+ most suitable node is chosen by wsrep provider. This is the same as given in -+ wsrep_node_name. -+ -+ -+6. ONLINE SCHEMA UPGRADE -+ -+ Schema upgrades mean any data definition statements (DDL statemnents) run -+ for the database. They change the database structure and are non- -+ transactional. -+ -+ Release 22.3 brings a new method for performing schema upgrades. User can -+ now choose whether to use the traditional total order isolation or new -+ rolling schema upgrade method. The OSU method choice is done by global -+ parameter: 'wsrep_OSU_method'. -+ -+6.1 Total Order Isolation (TOI) -+ -+ With earlier releases, DDL processing happened always by Total Order -+ Isolation (TOI) method. With TOI, the DDL was scheduled to be processed in -+ same transaction seqeuncing 'slot' in each cluster node. -+ The processing is secured by locking the affected table from any other use. -+ With TOI method, the whole cluster has part of the database locked for the -+ duration of the DDL processing. -+ -+6.2 Rolling Schema Upgrade (RSU) -+ -+ Rolling schema upgrade is new DDL processing method, where DDL will be -+ processed locally for the node. The node is disconnected of the replication -+ for the duration of the DDL processing, so that there is only DDL statement -+ processing in the node and it does not block the rest of the cluster. When -+ the DDL processing is complete, the node applies delayed replication events -+ and synchronizes back with the cluster. -+ The DDL can then be executed cluster-wide by running the same DDL statement -+ for each node in turn. When this rolling schema upgrade proceeds, part of -+ the cluster will have old schema structure and part of the cluster will have -+ new schema structure. -+ -+ -+7. LIMITATIONS -+ -+1) Currently replication works only with InnoDB storage engine. Any writes to -+ tables of other types, including system (mysql.*) tables are not replicated. -+ However, DDL statements are replicated in statement level, and changes -+ to mysql.* tables will get replicated that way. -+ So, you can safely issue: CREATE USER..., -+ but issuing: INSERT INTO mysql.user..., will not be replicated. -+ -+2) DELETE operation is unsupported on tables without primary key. Also rows in -+ tables without primary key may appear in different order on different nodes. -+ As a result SELECT...LIMIT... may return slightly different sets. -+ -+3) Unsupported queries: -+ * LOCK/UNLOCK TABLES cannot be supported in multi-master setups. -+ * lock functions (GET_LOCK(), RELEASE_LOCK()... ) -+ -+4) Query log cannot be directed to table. If you enable query logging, -+ you must forward the log to a file: -+ log_output = FILE -+ Use general_log and general_log_file to choose query logging and the -+ log file name -+ -+5) Maximum allowed transaction size is defined by wsrep_max_ws_rows and -+ wsrep_max_ws_size. Anything bigger (e.g. huge LOAD DATA) will be rejected. -+ -+6) Due to cluster level optimistic concurrency control, transaction issuing -+ COMMIT may still be aborted at that stage. There can be two transactions. -+ writing to same rows and committing in separate cluster nodes, and only one -+ of the them can successfully commit. The failing one will be aborted. -+ For cluster level aborts, MySQL/galera cluster gives back deadlock error. -+ code (Error: 1213 SQLSTATE: 40001 (ER_LOCK_DEADLOCK)). -+ -+7) XA transactions can not be supported due to possible rollback on commit. -+ - -=== modified file 'cmake/configure.pl' ---- old/cmake/configure.pl 2013-02-26 05:45:28 +0000 -+++ new/cmake/configure.pl 2013-07-02 22:16:00 +0000 -@@ -223,6 +223,16 @@ - $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=" . - -=== modified file 'cmake/install_macros.cmake' ---- old/cmake/install_macros.cmake 2013-06-25 06:54:02 +0000 -+++ new/cmake/install_macros.cmake 2014-03-08 05:20:50 +0000 -@@ -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}) -@@ -232,6 +258,7 @@ - INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) - SET(INSTALL_LOCATION ${ARG_DESTINATION} ) - INSTALL_DEBUG_SYMBOLS("${TARGETS}") -+ INSTALL_DSYM_DIRECTORIES("${TARGETS}") - SET(INSTALL_LOCATION) - ENDFUNCTION() - - -=== modified file 'cmake/os/FreeBSD.cmake' ---- old/cmake/os/FreeBSD.cmake 2010-06-23 14:19:19 +0000 -+++ new/cmake/os/FreeBSD.cmake 2013-09-01 09:27:10 +0000 -@@ -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 "") - -=== added file 'cmake/wsrep.cmake' ---- old/cmake/wsrep.cmake 1970-01-01 00:00:00 +0000 -+++ new/cmake/wsrep.cmake 2014-03-11 16:56:46 +0000 -@@ -0,0 +1,59 @@ -+# 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 "5") -+ -+# Obtain patch revision number -+SET(WSREP_PATCH_REVNO $ENV{WSREP_REV}) -+IF(NOT WSREP_PATCH_REVNO) -+ EXECUTE_PROCESS( -+ COMMAND bzr revno -+ OUTPUT_VARIABLE WSREP_PATCH_REVNO -+ RESULT_VARIABLE RESULT -+ ) -+STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_PATCH_REVNO "${WSREP_PATCH_REVNO}") -+#FILE(WRITE "wsrep_config" "Debug: WSREP_PATCH_REVNO result: ${RESULT}\n") -+ENDIF() -+IF(NOT WSREP_PATCH_REVNO) -+ SET(WSREP_PATCH_REVNO "XXXX") -+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}.r${WSREP_PATCH_REVNO}" -+) -+ -+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) -+ENDIF() -+ -+# - -=== modified file 'include/my_md5.h' ---- old/include/my_md5.h 2013-03-20 05:56:02 +0000 -+++ new/include/my_md5.h 2013-07-03 10:10:34 +0000 -@@ -43,7 +43,11 @@ - *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 - -=== modified file 'include/thr_lock.h' ---- old/include/thr_lock.h 2011-09-07 10:08:09 +0000 -+++ new/include/thr_lock.h 2014-01-09 15:46:55 +0000 -@@ -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 @@ - { - 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; - - - -=== modified file 'mysql-test/r/information_schema.result' ---- old/mysql-test/r/information_schema.result 2012-10-25 09:54:03 +0000 -+++ new/mysql-test/r/information_schema.result 2013-01-06 18:49:20 +0000 -@@ -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 --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; - -=== modified file 'mysql-test/r/show_check.result' ---- old/mysql-test/r/show_check.result 2013-01-30 17:19:19 +0000 -+++ new/mysql-test/r/show_check.result 2013-07-02 22:16:00 +0000 -@@ -101,19 +101,19 @@ - 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 - -=== modified file 'mysql-test/suite/innodb/r/innodb-autoinc.result' ---- old/mysql-test/suite/innodb/r/innodb-autoinc.result 2012-08-27 10:23:48 +0000 -+++ new/mysql-test/suite/innodb/r/innodb-autoinc.result 2013-01-06 18:49:20 +0000 -@@ -201,6 +201,7 @@ - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -234,6 +235,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -273,6 +275,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -286,6 +289,7 @@ - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -+wsrep_auto_increment_control ON - INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL); - INSERT INTO t1 VALUES (250),(NULL); - SELECT * FROM t1; -@@ -319,6 +323,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -334,6 +339,7 @@ - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -+wsrep_auto_increment_control ON - INSERT INTO t1 VALUES (-2); - Warnings: - Warning 1264 Out of range value for column 'c1' at row 1 -@@ -374,6 +380,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -389,6 +396,7 @@ - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -+wsrep_auto_increment_control ON - INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL); - Warnings: - Warning 1264 Out of range value for column 'c1' at row 1 -@@ -423,6 +431,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -438,6 +447,7 @@ - Variable_name Value - auto_increment_increment 2 - auto_increment_offset 10 -+wsrep_auto_increment_control ON - INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); - SELECT * FROM t1; - c1 -@@ -456,6 +466,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -471,6 +482,7 @@ - Variable_name Value - auto_increment_increment 2 - auto_increment_offset 10 -+wsrep_auto_increment_control ON - INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); - ERROR HY000: Failed to read auto-increment value from storage engine - SELECT * FROM t1; -@@ -484,6 +496,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -499,6 +512,7 @@ - Variable_name Value - auto_increment_increment 5 - auto_increment_offset 7 -+wsrep_auto_increment_control ON - INSERT INTO t1 VALUES (NULL),(NULL), (NULL); - ERROR HY000: Failed to read auto-increment value from storage engine - SELECT * FROM t1; -@@ -512,6 +526,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -531,6 +546,7 @@ - Variable_name Value - auto_increment_increment 3 - auto_increment_offset 3 -+wsrep_auto_increment_control ON - INSERT INTO t1 VALUES (NULL),(NULL), (NULL); - SELECT * FROM t1; - c1 -@@ -548,6 +564,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - DROP TABLE IF EXISTS t1; - Warnings: - Note 1051 Unknown table 'test.t1' -@@ -566,6 +583,7 @@ - Variable_name Value - auto_increment_increment 65535 - auto_increment_offset 65535 -+wsrep_auto_increment_control ON - INSERT INTO t1 VALUES (NULL),(NULL); - ERROR 22003: Out of range value for column 't1' at row 167 - SELECT * FROM t1; -@@ -579,6 +597,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - 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); -@@ -866,6 +885,7 @@ - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -+wsrep_auto_increment_control ON - CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; - INSERT INTO t1 VALUES (1, NULL); - INSERT INTO t1 VALUES (-1, 'innodb'); - -=== modified file 'mysql-test/suite/perfschema/r/dml_setup_instruments.result' ---- old/mysql-test/suite/perfschema/r/dml_setup_instruments.result 2013-10-11 15:31:42 +0000 -+++ new/mysql-test/suite/perfschema/r/dml_setup_instruments.result 2013-12-11 10:24:00 +0000 -@@ -34,6 +34,7 @@ - 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 - -=== modified file 'mysql-test/suite/perfschema/t/dml_setup_instruments.test' ---- old/mysql-test/suite/perfschema/t/dml_setup_instruments.test 2012-04-03 11:53:52 +0000 -+++ new/mysql-test/suite/perfschema/t/dml_setup_instruments.test 2012-12-20 16:13:02 +0000 -@@ -36,7 +36,8 @@ - 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 - -=== modified file 'mysql-test/suite/rpl/r/rpl_auto_increment.result' ---- old/mysql-test/suite/rpl/r/rpl_auto_increment.result 2013-05-29 10:37:30 +0000 -+++ new/mysql-test/suite/rpl/r/rpl_auto_increment.result 2013-08-21 19:07:07 +0000 -@@ -40,6 +40,7 @@ - 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); - -=== modified file 'mysys/thr_lock.c' ---- old/mysys/thr_lock.c 2011-09-07 10:08:09 +0000 -+++ new/mysys/thr_lock.c 2014-01-09 15:46:55 +0000 -@@ -82,7 +82,24 @@ - 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 @@ - 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 *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 @@ - } - 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 @@ - 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 @@ - { - 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 @@ - /* 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 @@ - 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); - -=== modified file 'mysys_ssl/my_default.cc' ---- old/mysys_ssl/my_default.cc 2013-03-20 05:56:02 +0000 -+++ new/mysys_ssl/my_default.cc 2013-10-11 17:08:12 +0000 -@@ -111,6 +111,11 @@ - - 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,}; -+#endif /* WITH_WREP */ - /* Set to TRUE, if --no-defaults is found. */ - static my_bool found_no_defaults= FALSE; - -@@ -895,6 +900,11 @@ - 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)) - { - -=== modified file 'mysys_ssl/my_md5.cc' ---- old/mysys_ssl/my_md5.cc 2012-06-28 13:48:07 +0000 -+++ new/mysys_ssl/my_md5.cc 2013-09-04 17:36:53 +0000 -@@ -66,3 +66,34 @@ - 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 - -=== modified file 'plugin/innodb_memcached/daemon_memcached/CMakeLists.txt' ---- old/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt 2013-12-03 02:09:33 +0000 -+++ new/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt 2014-03-11 21:17:40 +0000 -@@ -78,7 +78,7 @@ - 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) - -=== modified file 'scripts/CMakeLists.txt' ---- old/scripts/CMakeLists.txt 2014-01-06 06:03:08 +0000 -+++ new/scripts/CMakeLists.txt 2014-03-11 21:17:40 +0000 -@@ -323,6 +323,15 @@ - 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() - # On Unix, most of the files end up in the bin directory - SET(mysql_config_COMPONENT COMPONENT Development) - SET(BIN_SCRIPTS -@@ -339,6 +348,7 @@ - mysqldumpslow - mysqld_multi - mysqld_safe -+ ${WSREP_BINARIES} - ) - FOREACH(file ${BIN_SCRIPTS}) - IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) - -=== modified file 'scripts/mysqld_safe.sh' ---- old/scripts/mysqld_safe.sh 2013-09-21 02:32:44 +0000 -+++ new/scripts/mysqld_safe.sh 2013-12-11 10:24:00 +0000 -@@ -144,7 +144,7 @@ - } - - 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 @@ - 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 @@ - --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 @@ - 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 @@ - # 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 @@ - 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 - - -=== added file 'scripts/wsrep_sst_common.sh' ---- old/scripts/wsrep_sst_common.sh 1970-01-01 00:00:00 +0000 -+++ new/scripts/wsrep_sst_common.sh 2014-03-08 05:20:50 +0000 -@@ -0,0 +1,133 @@ -+# Copyright (C) 2012 Codership Oy -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; version 2 of the License. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; 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="" -+ -+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 -+ ;; -+ '--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') -+ readonly 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') -+ readonly 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 -+ -+# 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 -+} -+ - -=== added file 'scripts/wsrep_sst_mysqldump.sh' ---- old/scripts/wsrep_sst_mysqldump.sh 1970-01-01 00:00:00 +0000 -+++ new/scripts/wsrep_sst_mysqldump.sh 2013-09-04 17:36:53 +0000 -@@ -0,0 +1,126 @@ -+#!/bin/sh -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 -+if ! mysql --version | grep 'Distrib 5.6' >/dev/null -+then -+ mysql --version >&2 -+ wsrep_log_error "this operation requires MySQL client version 5.6.x" -+ exit $EINVAL -+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" -+ -+# 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 $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 \ -+ (echo $STOP_WSREP && echo $RESET_MASTER && $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 -+ -+# - -=== added file 'scripts/wsrep_sst_rsync.sh' ---- old/scripts/wsrep_sst_rsync.sh 1970-01-01 00:00:00 +0000 -+++ new/scripts/wsrep_sst_rsync.sh 2014-02-28 00:37:33 +0000 -@@ -0,0 +1,320 @@ -+#!/bin/bash -ue -+ -+# Copyright (C) 2010 Codership Oy -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; version 2 of the License. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; 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 -+ -+. $(dirname $0)/wsrep_sst_common -+ -+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=$(cat $pid_file) -+ local rsync_port=$2 -+ -+ if [ "$OS" == "Darwin" -o "$OS" == "FreeBSD" ]; then -+ # no netstat --program(-p) option in Darwin and FreeBSD -+ check_pid $pid_file && \ -+ lsof -i -Pn 2>/dev/null | \ -+ grep "(LISTEN)" | grep ":$rsync_port" | grep -w '^rsync[[:space:]]\+'"$rsync_pid" >/dev/null -+ else -+ check_pid $pid_file && \ -+ netstat -lnpt 2>/dev/null | \ -+ grep LISTEN | grep \:$rsync_port | grep $rsync_pid/rsync >/dev/null -+ fi -+} -+ -+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 -+ SCRIPT_DIR="$(cd $(dirname "$0"); pwd -P)" -+ WSREP_LOG_DIR=$($SCRIPT_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 -+ 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 --port $RSYNC_PORT --config "$RSYNC_CONF" -+ -+ until check_pid_and_port $RSYNC_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 - -=== added file 'scripts/wsrep_sst_xtrabackup-v2.sh' ---- old/scripts/wsrep_sst_xtrabackup-v2.sh 1970-01-01 00:00:00 +0000 -+++ new/scripts/wsrep_sst_xtrabackup-v2.sh 2014-03-12 14:45:00 +0000 -@@ -0,0 +1,875 @@ -+#!/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="" -+ -+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=$(du --block-size=1 -c **/*.ibd **/*.MYI **/*.MYI ibdata1 | 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$\|.*\.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 "") -+} -+ -+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 -+ -+ 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 -+} -+ -+recv_joiner() -+{ -+ local dir=$1 -+ local msg=$2 -+ -+ pushd ${dir} 1>/dev/null -+ set +e -+ timeit "$msg" "$tcmd | $strmcmd; 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 [ ! -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` ]];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} $disver $impts --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log" -+INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $iopts \$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 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 ${TMPDIR} -+ XTRABACKUP_PID="${TMPDIR}/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" 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 -+ 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 [[ $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} \ -+ --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 [ $? -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 - -=== added file 'scripts/wsrep_sst_xtrabackup.sh' ---- old/scripts/wsrep_sst_xtrabackup.sh 1970-01-01 00:00:00 +0000 -+++ new/scripts/wsrep_sst_xtrabackup.sh 2014-03-12 14:45:00 +0000 -@@ -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=$(du --block-size=1 -c **/*.ibd **/*.MYI **/*.MYI ibdata1 | 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 - -=== modified file 'sql/CMakeLists.txt' ---- old/sql/CMakeLists.txt 2014-01-06 06:03:08 +0000 -+++ new/sql/CMakeLists.txt 2014-03-11 21:17:40 +0000 -@@ -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 @@ - ${ZLIB_INCLUDE_DIR} - ${SSL_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/sql -+ ${WSREP_INCLUDES} - ) - - SET(GEN_SOURCES -@@ -171,7 +176,24 @@ - - 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 @@ - 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_DEPENDENCIES(sqlgunitlib GenError) - -- - IF(WIN32) - SET(MYSQLD_SOURCE main.cc nt_servc.cc nt_servc.h message.rc) - ELSE() - -=== modified file 'sql/binlog.cc' ---- old/sql/binlog.cc 2014-01-06 05:23:19 +0000 -+++ new/sql/binlog.cc 2014-03-11 21:17:40 +0000 -@@ -60,7 +60,11 @@ - 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; -@@ -775,7 +779,9 @@ - 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); - } - -@@ -861,7 +867,11 @@ - 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; -@@ -877,7 +887,16 @@ - 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; -@@ -892,10 +911,24 @@ - 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 cache not empty (%lu bytes) at connection close %lu", -+ len, thd->thread_id); -+ 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()); -@@ -1646,7 +1679,11 @@ - 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 -@@ -5023,7 +5060,11 @@ - 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; -@@ -5098,7 +5139,13 @@ - 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 - /* -@@ -5245,6 +5292,15 @@ - { - 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); -@@ -5724,6 +5780,9 @@ - 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(); -@@ -6179,7 +6238,13 @@ - 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; - -@@ -6765,6 +6830,16 @@ - 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. -+ */ -+ DBUG_RETURN(ha_commit_low(thd, all)); -+ } -+#endif /* WITH_WSREP */ -+ - /* - These values are used while flushing a transaction, so clear - everything. -@@ -6959,6 +7034,24 @@ - */ - 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))) -@@ -6967,7 +7060,12 @@ - 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")) -@@ -6988,6 +7086,9 @@ - sizeof(xev->xid)); - if (!x || my_hash_insert(&xids, x)) - goto err2; -+#ifdef WITH_WSREP -+ cur_xid_seqno= xev->xid; -+#endif /* WITH_WSREP */ - } - - /* -@@ -7032,6 +7133,11 @@ - 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; - -@@ -7056,7 +7162,9 @@ - - // 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 -@@ -7249,7 +7357,12 @@ - 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 -@@ -7537,9 +7650,16 @@ - 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 -@@ -7783,7 +7903,7 @@ - */ - 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)) - { - /* -@@ -7812,8 +7932,8 @@ - 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()) - { - /* -@@ -7829,7 +7949,14 @@ - 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) - { -@@ -7975,7 +8102,7 @@ - "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 - -@@ -8285,7 +8412,12 @@ - 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 -@@ -8315,7 +8447,13 @@ - 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; - - /** -@@ -8381,7 +8519,13 @@ - 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; - - /** -@@ -8499,7 +8643,11 @@ - 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); - - /* -@@ -8768,7 +8916,12 @@ - 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) - { -@@ -8872,6 +9025,64 @@ - } - - #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(); -+ } -+ 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 }; - -=== modified file 'sql/events.cc' ---- old/sql/events.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/events.cc 2014-03-11 21:17:40 +0000 -@@ -1183,7 +1183,19 @@ - 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); -+} -+#endif /* WITH_WSREP */ - /** - @} (End of group Event_Scheduler) - */ - -=== modified file 'sql/ha_partition.cc' ---- old/sql/ha_partition.cc 2013-11-20 12:44:46 +0000 -+++ new/sql/ha_partition.cc 2014-03-11 21:17:40 +0000 -@@ -375,7 +375,13 @@ - // 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 - -=== modified file 'sql/ha_partition.h' ---- old/sql/ha_partition.h 2013-10-21 06:44:47 +0000 -+++ new/sql/ha_partition.h 2014-02-26 14:44:13 +0000 -@@ -1238,6 +1238,9 @@ - ------------------------------------------------------------------------- - virtual void append_create_info(String *packet) - */ -+#ifdef WITH_WSREP -+ virtual int wsrep_db_type() const; -+#endif /* WITH_WSREP */ - }; - - #endif /* HA_PARTITION_INCLUDED */ - -=== modified file 'sql/handler.cc' ---- old/sql/handler.cc 2013-12-28 16:38:40 +0000 -+++ new/sql/handler.cc 2014-03-11 21:17:40 +0000 -@@ -60,7 +60,9 @@ - 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. -@@ -1218,10 +1220,27 @@ - { - 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 -@@ -1232,7 +1251,6 @@ - } - } - } -- - DBUG_RETURN(error); - } - -@@ -1407,7 +1425,12 @@ - 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); -@@ -1481,7 +1504,19 @@ - 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) - { -@@ -1511,7 +1546,10 @@ - } - /* Free resources and perform other cleanup even for 'empty' transactions. */ - if (all) -- thd->transaction.cleanup(); -+ 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 -@@ -1626,7 +1664,7 @@ - - /* Always cleanup. Even if nht==0. There may be savepoints. */ - if (is_real_trans) -- thd->transaction.cleanup(); -+ thd->transaction.cleanup(); - if (all) - thd->transaction_rollback_request= FALSE; - -@@ -1797,7 +1835,13 @@ - 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 -@@ -1866,7 +1910,9 @@ - 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 -@@ -2102,8 +2148,35 @@ - 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); - } -@@ -3328,7 +3401,12 @@ - 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); -@@ -4613,7 +4691,9 @@ - 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)) - { - /* -@@ -7009,7 +7089,13 @@ - 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 - } - - -@@ -7110,6 +7196,17 @@ - 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, -@@ -7430,6 +7527,64 @@ - 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 - -=== modified file 'sql/handler.h' ---- old/sql/handler.h 2013-12-28 16:38:40 +0000 -+++ new/sql/handler.h 2014-03-11 21:17:40 +0000 -@@ -392,6 +392,7 @@ - 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 @@ - 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); - -@@ -3325,6 +3331,9 @@ - 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; -@@ -3433,6 +3442,10 @@ - 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); -@@ -3464,6 +3477,9 @@ - #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); - -=== modified file 'sql/item_func.cc' ---- old/sql/item_func.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/item_func.cc 2013-12-11 10:24:00 +0000 -@@ -2616,7 +2616,19 @@ - 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)); - } - -=== modified file 'sql/lock.cc' ---- old/sql/lock.cc 2012-11-30 14:35:31 +0000 -+++ new/sql/lock.cc 2013-02-12 21:54:12 +0000 -@@ -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 @@ - /* 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 @@ - { - 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 @@ - 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 @@ - 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); - } - - -=== modified file 'sql/log.cc' ---- old/sql/log.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/log.cc 2014-03-11 21:17:40 +0000 -@@ -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 @@ - } - } - -- - /* 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) -@@ -2402,6 +2404,7 @@ - - /********* 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. -@@ -2517,8 +2520,14 @@ - 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); - -=== modified file 'sql/log.h' ---- old/sql/log.h 2014-01-06 05:23:19 +0000 -+++ new/sql/log.h 2014-03-11 21:17:40 +0000 -@@ -104,6 +104,14 @@ - 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 @@ - 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_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); - - -=== modified file 'sql/log_event.cc' ---- old/sql/log_event.cc 2013-12-17 16:56:45 +0000 -+++ new/sql/log_event.cc 2014-03-11 21:17:40 +0000 -@@ -47,6 +47,9 @@ - #include "sql_show.h" // append_identifier - #include <mysql/psi/mysql_statement.h> - -+#if WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif - #endif /* MYSQL_CLIENT */ - - #include <base64.h> -@@ -3533,6 +3536,14 @@ - 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)); - -@@ -10951,6 +10962,18 @@ - 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) - { - /* -@@ -11898,7 +11921,12 @@ - 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; -@@ -12593,8 +12621,23 @@ - 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); - -=== modified file 'sql/mdl.cc' ---- old/sql/mdl.cc 2013-10-31 21:42:33 +0000 -+++ new/sql/mdl.cc 2014-01-09 15:46:55 +0000 -@@ -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 @@ - 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 @@ - 0 - }; - -- - /** - Check if request for the metadata lock can be satisfied given its - current state. -@@ -1734,6 +1787,9 @@ - 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 @@ - { - 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 @@ - } - - -+#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 @@ - 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 */ - -=== modified file 'sql/mdl.h' ---- old/sql/mdl.h 2012-12-19 16:23:13 +0000 -+++ new/sql/mdl.h 2013-11-04 23:09:13 +0000 -@@ -577,6 +577,9 @@ - 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 @@ - 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 @@ - - 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 @@ - 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); - -=== modified file 'sql/mysqld.cc' ---- old/sql/mysqld.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/mysqld.cc 2014-03-11 21:17:40 +0000 -@@ -71,6 +71,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" - -@@ -486,6 +492,10 @@ - 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; - ulong gtid_mode; - const char *gtid_mode_names[]= -@@ -747,6 +757,23 @@ - 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; -@@ -1403,6 +1430,11 @@ - /* 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) - { -@@ -1505,6 +1537,33 @@ - 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); -@@ -1654,8 +1713,14 @@ - } - } - #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 */ -@@ -1750,6 +1815,23 @@ - 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); -@@ -1996,6 +2078,20 @@ - 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*/ - -@@ -2444,6 +2540,9 @@ - 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 -@@ -2540,6 +2639,9 @@ - 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")); -@@ -2559,7 +2661,11 @@ - @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"); - -@@ -3787,6 +3893,13 @@ - 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 - -@@ -3846,7 +3959,11 @@ - 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(); -@@ -4253,6 +4370,27 @@ - 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; - } - -@@ -4584,7 +4722,6 @@ - return false; - } - -- - static int init_server_components() - { - DBUG_ENTER("init_server_components"); -@@ -4682,7 +4819,11 @@ - 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."); - -@@ -4765,10 +4906,67 @@ - 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) -@@ -4826,6 +5024,7 @@ - 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))) -@@ -4834,7 +5033,7 @@ - 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) - { -@@ -4929,16 +5128,34 @@ - &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"); -@@ -5029,8 +5246,6 @@ - init_update_queries(); - DBUG_RETURN(0); - } -- -- - #ifndef EMBEDDED_LIBRARY - - static void create_shutdown_thread() -@@ -5052,6 +5267,422 @@ - - #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)) -+ { -+ mysql_mutex_unlock(&LOCK_thread_count); -+ 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() -@@ -5188,6 +5819,9 @@ - return 1; - } - #endif -+#ifdef WITH_WSREP -+ wsrep_filter_new_cluster (&argc, argv); -+#endif /* WITH_WSREP */ - - orig_argc= argc; - orig_argv= argv; -@@ -5521,6 +6155,14 @@ - 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 -@@ -5599,6 +6241,31 @@ - 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 -@@ -5660,6 +6327,9 @@ - #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 -@@ -5925,6 +6595,9 @@ - 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; -@@ -6064,7 +6737,11 @@ - 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 */ -@@ -6116,7 +6793,11 @@ - 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; -@@ -6336,6 +7017,9 @@ - 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 - { -@@ -6515,7 +7199,11 @@ - 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; - } -@@ -6710,7 +7398,11 @@ - 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; - } -@@ -8013,6 +8705,20 @@ - #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} - }; - -@@ -8340,6 +9046,10 @@ - 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; - } - -@@ -8540,6 +9250,14 @@ - 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: - /* -@@ -9293,6 +10011,9 @@ - - /* 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); -@@ -9356,6 +10077,12 @@ - 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_RELAYLOG_LOCK_commit; - PSI_mutex_key key_RELAYLOG_LOCK_commit_queue; - PSI_mutex_key key_RELAYLOG_LOCK_done; -@@ -9440,6 +10167,18 @@ - { &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_log_throttle_qni, "LOCK_log_throttle_qni", PSI_FLAG_GLOBAL}, - { &key_gtid_ensure_index_mutex, "Gtid_state", PSI_FLAG_GLOBAL}, - { &key_LOCK_thread_created, "LOCK_thread_created", PSI_FLAG_GLOBAL } -@@ -9494,6 +10233,12 @@ - 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; -@@ -9538,6 +10283,15 @@ - { &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} - }; - -=== modified file 'sql/mysqld.h' ---- old/sql/mysqld.h 2014-01-06 06:03:08 +0000 -+++ new/sql/mysqld.h 2014-03-11 21:17:40 +0000 -@@ -65,7 +65,11 @@ - 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); -@@ -299,6 +303,10 @@ - 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; -@@ -645,6 +653,14 @@ - 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, -@@ -753,4 +769,9 @@ - - 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 */ - -=== modified file 'sql/protocol.cc' ---- old/sql/protocol.cc 2012-11-07 13:41:30 +0000 -+++ new/sql/protocol.cc 2013-01-06 18:49:20 +0000 -@@ -485,6 +485,14 @@ - - 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; - -=== modified file 'sql/rpl_gtid_cache.cc' ---- old/sql/rpl_gtid_cache.cc 2013-10-09 11:17:06 +0000 -+++ new/sql/rpl_gtid_cache.cc 2013-12-11 10:24:00 +0000 -@@ -147,7 +147,22 @@ - 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); - -=== modified file 'sql/rpl_slave.cc' ---- old/sql/rpl_slave.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/rpl_slave.cc 2014-03-11 21:17:40 +0000 -@@ -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" -@@ -3483,6 +3486,94 @@ - 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; -@@ -5635,6 +5726,18 @@ - } - #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))); -@@ -5798,6 +5901,16 @@ - 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" - -=== modified file 'sql/set_var.h' ---- old/sql/set_var.h 2014-01-06 06:03:08 +0000 -+++ new/sql/set_var.h 2014-03-11 21:17:40 +0000 -@@ -256,6 +256,9 @@ - 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 @@ - - 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); - -=== modified file 'sql/sp.cc' ---- old/sql/sp.cc 2013-08-12 05:34:44 +0000 -+++ new/sql/sp.cc 2013-10-08 19:45:08 +0000 -@@ -2734,3 +2734,37 @@ - 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 */ - -=== modified file 'sql/sql_acl.cc' ---- old/sql/sql_acl.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/sql_acl.cc 2014-03-11 21:17:40 +0000 -@@ -2285,6 +2285,9 @@ - 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))) -@@ -2292,7 +2295,12 @@ - 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)); -@@ -2373,7 +2381,7 @@ - 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; -@@ -2381,6 +2389,9 @@ - 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)); -@@ -2388,6 +2399,18 @@ - - 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); - -@@ -2658,13 +2681,26 @@ - 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 */ - } - - - -=== modified file 'sql/sql_alter.cc' ---- old/sql/sql_alter.cc 2012-08-02 20:43:29 +0000 -+++ new/sql/sql_alter.cc 2013-01-06 18:49:20 +0000 -@@ -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,20 @@ - - 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(thd, -+ lex->name.str ? select_lex->db : NULL, -+ lex->name.str ? lex->name.str : NULL, -+ first_table)) -+ { -+ WSREP_WARN("ALTER TABLE isolation failure"); -+ DBUG_RETURN(TRUE); -+ } -+#endif /* WITH_WSREP */ - result= mysql_alter_table(thd, select_lex->db, lex->name.str, - &create_info, - first_table, -@@ -312,6 +329,8 @@ - select_lex->order_list.first, - lex->ignore); - -+#ifdef WITH_WSREP -+#endif /* WITH_WSREP */ - DBUG_RETURN(result); - } - - -=== modified file 'sql/sql_base.cc' ---- old/sql/sql_base.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sql_base.cc 2013-12-11 10:24:00 +0000 -@@ -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 -@@ -4181,7 +4184,7 @@ - */ - bool log_on= mysql_bin_log.is_open() && thd->variables.sql_log_bin; - ulong binlog_format= thd->variables.binlog_format; -- if ((log_on == FALSE) || (binlog_format == BINLOG_FORMAT_ROW) || -+ if ((log_on == FALSE) || (WSREP_BINLOG_FORMAT(binlog_format) == BINLOG_FORMAT_ROW) || - (table_list->table->s->table_category == TABLE_CATEGORY_LOG) || - (table_list->table->s->table_category == TABLE_CATEGORY_RPL_INFO) || - (table_list->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) || -@@ -5120,6 +5123,22 @@ - 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 && -@@ -5851,7 +5870,7 @@ - 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 && -+ if (WSREP_BINLOG_FORMAT(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); - } -@@ -9175,9 +9194,13 @@ - else - table_cache_manager.assert_owner_all_and_tdc(); - -+#ifdef WITH_WSREP -+ /* if thd was BF aborted, exclusive locks were canceled */ -+#else - DBUG_ASSERT(remove_type == TDC_RT_REMOVE_UNUSED || - thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, - MDL_EXCLUSIVE)); -+#endif /* WITH_WSREP */ - - key_length= create_table_def_key(thd, key, db, table_name, false); - - -=== modified file 'sql/sql_builtin.cc.in' ---- old/sql/sql_builtin.cc.in 2011-09-07 10:08:09 +0000 -+++ new/sql/sql_builtin.cc.in 2012-12-20 16:13:02 +0000 -@@ -23,7 +23,11 @@ - 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_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 - }; - -=== modified file 'sql/sql_class.cc' ---- old/sql/sql_class.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sql_class.cc 2014-01-26 15:09:40 +0000 -@@ -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 @@ - 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 @@ - 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 @@ - } - - -+#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 @@ - 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), -@@ -1000,6 +1187,22 @@ - set_command(COM_CONNECT); - *scramble= '\0'; - -+#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(); - -@@ -1032,6 +1235,13 @@ - 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; -@@ -1378,6 +1588,22 @@ - 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) -@@ -1570,6 +1796,13 @@ - 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 - } - - -@@ -1863,7 +2096,19 @@ - (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); - } -@@ -2428,6 +2673,13 @@ - 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; -@@ -4196,8 +4448,13 @@ - - 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; - } - -=== modified file 'sql/sql_class.h' ---- old/sql/sql_class.h 2013-12-03 09:53:16 +0000 -+++ new/sql/sql_class.h 2014-03-11 21:17:40 +0000 -@@ -69,6 +69,18 @@ - #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; - -@@ -544,6 +556,11 @@ - my_bool sysdate_is_now; - my_bool binlog_rows_query_log_events; - -+#ifdef WITH_WSREP -+ my_bool wsrep_on; -+ my_bool wsrep_causal_reads; -+ ulong wsrep_retry_autocommit; -+#endif - double long_query_time_double; - - my_bool pseudo_slave_mode; -@@ -2315,7 +2332,8 @@ - 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 -@@ -3108,6 +3126,45 @@ - 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 -@@ -3143,7 +3200,11 @@ - // 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: -@@ -3651,7 +3712,7 @@ - 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(); - -@@ -3693,7 +3754,7 @@ - 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(); - -=== modified file 'sql/sql_connect.cc' ---- old/sql/sql_connect.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/sql_connect.cc 2014-03-11 21:17:40 +0000 -@@ -57,6 +57,9 @@ - #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 @@ - { - 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 @@ - 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 @@ - (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 @@ - - 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 @@ - 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 - - -=== modified file 'sql/sql_delete.cc' ---- old/sql/sql_delete.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sql_delete.cc 2013-12-11 10:24:00 +0000 -@@ -450,7 +450,11 @@ - /* 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) -@@ -895,7 +899,11 @@ - /* - 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 */ -@@ -1066,7 +1074,11 @@ - } - 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) - -=== modified file 'sql/sql_insert.cc' ---- old/sql/sql_insert.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sql_insert.cc 2013-12-11 10:24:00 +0000 -@@ -1124,7 +1124,11 @@ - 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 @@ - 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 @@ - 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 @@ - 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 @@ - /* 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 @@ - /* suppress_use */ FALSE, - errcode); - } -+#ifdef WITH_WSREP -+ ha_wsrep_fake_trx_id(thd); -+#endif - return result; - } - -@@ -4368,6 +4394,18 @@ - { - 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); - -=== modified file 'sql/sql_lex.cc' ---- old/sql/sql_lex.cc 2013-12-16 07:40:11 +0000 -+++ new/sql/sql_lex.cc 2014-03-11 21:17:40 +0000 -@@ -1507,6 +1507,17 @@ - } - 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). - -=== modified file 'sql/sql_parse.cc' ---- old/sql/sql_parse.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sql_parse.cc 2014-01-09 15:46:55 +0000 -@@ -107,6 +107,12 @@ - - #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 @@ - 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; -@@ -915,7 +925,18 @@ - 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) -@@ -954,7 +975,6 @@ - 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: -@@ -970,12 +990,47 @@ - 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); -+ } -+ if (WSREP(thd) && packet_length == packet_error) -+#else - if (packet_length == packet_error) -+#endif /* WITH_WSREP */ - { - 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); -@@ -1028,6 +1083,33 @@ - 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); - -@@ -1035,6 +1117,22 @@ - - 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); -@@ -1110,6 +1208,33 @@ - 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(); -+ 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. - -@@ -1138,7 +1263,42 @@ - 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(); -@@ -1321,6 +1481,37 @@ - - 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 -@@ -1331,7 +1522,11 @@ - 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()) -@@ -1403,10 +1598,19 @@ - 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")); -@@ -1748,6 +1952,26 @@ - 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 && -@@ -1760,6 +1984,9 @@ - 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); -@@ -2258,6 +2485,13 @@ - 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. -@@ -2490,7 +2724,6 @@ - #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, -@@ -2499,6 +2732,45 @@ - - 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); - -@@ -2539,7 +2811,13 @@ - - /* 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(); - } -@@ -2609,6 +2887,9 @@ - &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: -@@ -2626,12 +2907,22 @@ - 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_causal_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; -@@ -2931,7 +3222,7 @@ - */ - 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); -@@ -3047,6 +3338,15 @@ - } - 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); -@@ -3080,6 +3380,7 @@ - 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 -@@ -3172,8 +3473,11 @@ - goto error; - } - -+ WSREP_TO_ISOLATION_BEGIN(0, 0, first_table) - if (mysql_rename_tables(thd, first_table, 0)) -+ { - goto error; -+ } - break; - } - #ifndef EMBEDDED_LIBRARY -@@ -3199,6 +3503,10 @@ - goto error; - #else - { -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && wsrep_causal_wait(thd)) goto error; -+#endif /* WITH_WSREP */ -+ - /* - Access check: - SHOW CREATE TABLE require any privileges on the table level (ie -@@ -3261,6 +3569,10 @@ - case SQLCOM_CHECKSUM: - { - DBUG_ASSERT(first_table == all_tables && first_table != 0); -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && wsrep_causal_wait(thd)) goto error; -+#endif /* WITH_WSREP */ -+ - if (check_table_access(thd, SELECT_ACL, all_tables, - FALSE, UINT_MAX, FALSE)) - goto error; /* purecov: inspected */ -@@ -3461,6 +3773,15 @@ - DBUG_ASSERT(first_table == all_tables && first_table != 0); - if ((res= insert_precheck(thd, all_tables))) - break; -+#ifdef WITH_WSREP -+ if (lex->sql_command == SQLCOM_INSERT_SELECT && -+ 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 -@@ -3627,6 +3948,18 @@ - 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); -@@ -3664,7 +3997,6 @@ - - if (!mysql_change_db(thd, &db_str, FALSE)) - my_ok(thd); -- - break; - } - -@@ -3827,6 +4159,7 @@ - #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; -@@ -3851,6 +4184,7 @@ - #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; - } -@@ -3874,6 +4208,7 @@ - res= 1; - break; - } -+ WSREP_TO_ISOLATION_BEGIN(db->str, NULL, NULL) - res= mysql_upgrade_db(thd, db); - if (!res) - my_ok(thd); -@@ -3901,6 +4236,7 @@ - #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; - } -@@ -3930,6 +4266,7 @@ - if (res) - break; - -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - switch (lex->sql_command) { - case SQLCOM_CREATE_EVENT: - { -@@ -3964,6 +4301,7 @@ - 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))) -@@ -3978,6 +4316,7 @@ - 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 -@@ -3992,6 +4331,7 @@ - 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); -@@ -4003,6 +4343,7 @@ - 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; -@@ -4013,6 +4354,7 @@ - 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; -@@ -4027,6 +4369,7 @@ - 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; -@@ -4093,6 +4436,7 @@ - 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, -@@ -4106,6 +4450,7 @@ - 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); -@@ -4121,6 +4466,7 @@ - } - 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, -@@ -4249,7 +4595,13 @@ - #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: -@@ -4263,7 +4615,13 @@ - (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) -@@ -4280,7 +4638,20 @@ - /* 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: -@@ -4294,7 +4665,13 @@ - (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) -@@ -4311,7 +4688,17 @@ - /* 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: -@@ -4377,6 +4764,7 @@ - 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: { -@@ -4593,6 +4981,7 @@ - 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) -@@ -4664,6 +5053,7 @@ - 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; -@@ -4784,6 +5174,7 @@ - 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; - } -@@ -4792,12 +5183,14 @@ - 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; -@@ -4805,6 +5198,7 @@ - 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; - } -@@ -4825,7 +5219,13 @@ - 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 -@@ -4837,7 +5237,13 @@ - 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 -@@ -4857,11 +5263,13 @@ - 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; -@@ -5003,6 +5411,9 @@ - /* 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) -@@ -5048,6 +5459,22 @@ - { - 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()); - } -@@ -5864,6 +6291,26 @@ - 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; - /* -@@ -6089,6 +6536,99 @@ - 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); -+ } -+ 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 -@@ -7114,8 +7654,14 @@ - 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. - -=== modified file 'sql/sql_parse.h' ---- old/sql/sql_parse.h 2012-05-31 23:23:37 +0000 -+++ new/sql/sql_parse.h 2013-01-14 18:03:14 +0000 -@@ -207,6 +207,22 @@ - { - 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); - - -=== modified file 'sql/sql_partition_admin.cc' ---- old/sql/sql_partition_admin.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/sql_partition_admin.cc 2014-03-11 21:17:40 +0000 -@@ -767,6 +767,19 @@ - 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); - - -=== modified file 'sql/sql_plugin.cc' ---- old/sql/sql_plugin.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/sql_plugin.cc 2014-03-11 21:17:40 +0000 -@@ -2759,7 +2759,11 @@ - 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= - -=== modified file 'sql/sql_prepare.cc' ---- old/sql/sql_prepare.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sql_prepare.cc 2013-12-11 10:24:00 +0000 -@@ -3584,7 +3584,9 @@ - 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 @@ - 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(); - - -=== modified file 'sql/sql_reload.cc' ---- old/sql/sql_reload.cc 2012-05-30 10:03:45 +0000 -+++ new/sql/sql_reload.cc 2013-01-06 18:49:20 +0000 -@@ -229,7 +229,18 @@ - 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) - -=== modified file 'sql/sql_show.cc' ---- old/sql/sql_show.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sql_show.cc 2013-12-11 10:24:00 +0000 -@@ -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 -@@ -7792,7 +7795,8 @@ - { - {"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} - }; - - -=== modified file 'sql/sql_table.cc' ---- old/sql/sql_table.cc 2013-11-14 05:04:27 +0000 -+++ new/sql/sql_table.cc 2014-03-11 21:17:40 +0000 -@@ -5225,6 +5225,60 @@ - 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 -@@ -5398,6 +5452,11 @@ - - err: - DBUG_RETURN(res); -+#ifdef WITH_WSREP -+ error: -+ thd->wsrep_TOI_pre_query= NULL; -+ DBUG_RETURN(TRUE); -+#endif /* WITH_WSREP */ - } - - - -=== modified file 'sql/sql_trigger.cc' ---- old/sql/sql_trigger.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/sql_trigger.cc 2014-03-11 21:17:40 +0000 -@@ -434,8 +434,14 @@ - 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); -@@ -2497,3 +2503,55 @@ - - 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 */ - -=== modified file 'sql/sql_truncate.cc' ---- old/sql/sql_truncate.cc 2012-12-10 18:02:18 +0000 -+++ new/sql/sql_truncate.cc 2014-02-28 06:51:51 +0000 -@@ -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 */ - - - /** -@@ -440,6 +443,12 @@ - { - 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); - -@@ -517,7 +526,6 @@ - - if (! (res= truncate_table(thd, first_table))) - my_ok(thd); -- - DBUG_RETURN(res); - } - - -=== modified file 'sql/sql_update.cc' ---- old/sql/sql_update.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sql_update.cc 2013-12-11 10:24:00 +0000 -@@ -987,7 +987,11 @@ - */ - 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) -@@ -2202,7 +2206,11 @@ - 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 -@@ -2434,7 +2442,11 @@ - - 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) - -=== modified file 'sql/sys_vars.cc' ---- old/sql/sys_vars.cc 2013-10-30 23:22:43 +0000 -+++ new/sql/sys_vars.cc 2013-12-11 10:24:00 +0000 -@@ -3178,6 +3178,10 @@ - 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; - } - /* -@@ -4172,6 +4176,246 @@ - "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", "Enable \"strictly synchronous\" semantics for read operations", -+ SESSION_VAR(wsrep_causal_reads), -+ CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+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)); -+#endif /* WITH_WSREP */ - - static bool fix_host_cache_size(sys_var *, THD *, enum_var_type) - { - -=== modified file 'sql/table.cc' ---- old/sql/table.cc 2014-01-06 06:03:08 +0000 -+++ new/sql/table.cc 2014-03-11 21:17:40 +0000 -@@ -5303,8 +5303,17 @@ - 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 -@@ -5370,8 +5379,17 @@ - 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 -@@ -5423,9 +5441,15 @@ - 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; - -=== modified file 'sql/transaction.cc' ---- old/sql/transaction.cc 2013-12-28 16:38:40 +0000 -+++ new/sql/transaction.cc 2014-03-11 21:17:40 +0000 -@@ -102,6 +102,9 @@ - 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 @@ - (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 @@ - thd->tx_read_only= false; - } - -+#ifdef WITH_WSREP -+ thd->wsrep_PA_safe= true; -+ if (WSREP_CLIENT(thd) && wsrep_causal_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 @@ - 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 @@ - /* 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 @@ - { - 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 @@ - 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 @@ - */ - 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 @@ - - 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 @@ - - 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 @@ - 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; -@@ -663,6 +717,12 @@ - - thd->transaction.savepoints= sv; - -+ /* -+ Release metadata locks that were acquired during this savepoint unit -+ unless binlogging is on. Releasing locks with binlogging on can break -+ replication as it allows other connections to drop these tables before -+ rollback to savepoint is written to the binlog. -+ */ - if (!res && mdl_can_safely_rollback_to_savepoint) - thd->mdl_context.rollback_to_savepoint(sv->mdl_savepoint); - -@@ -871,9 +931,15 @@ - } - 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 +958,9 @@ - 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)); - } - -=== added file 'sql/wsrep_applier.cc' ---- old/sql/wsrep_applier.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_applier.cc 2013-11-10 11:44:07 +0000 -@@ -0,0 +1,363 @@ -+/* 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" -+ -+/* -+ 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) -+ { -+ 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: %zd", -+ (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); -+ -+ 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 */ -+ -+ 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; -+} - -=== added file 'sql/wsrep_applier.h' ---- old/sql/wsrep_applier.h 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_applier.h 2013-11-02 17:14:27 +0000 -@@ -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 */ - -=== added file 'sql/wsrep_binlog.cc' ---- old/sql/wsrep_binlog.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_binlog.cc 2014-03-06 16:29:47 +0000 -@@ -0,0 +1,358 @@ -+/* 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)); -+ } -+} -+ -+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; -+} - -=== added file 'sql/wsrep_binlog.h' ---- old/sql/wsrep_binlog.h 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_binlog.h 2013-10-05 11:11:40 +0000 -@@ -0,0 +1,53 @@ -+/* 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); -+ -+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 */ - -=== added file 'sql/wsrep_check_opts.cc' ---- old/sql/wsrep_check_opts.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_check_opts.cc 2014-02-27 11:52:26 +0000 -@@ -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); -+} -+ - -=== added file 'sql/wsrep_hton.cc' ---- old/sql/wsrep_hton.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_hton.cc 2014-03-06 16:29:47 +0000 -@@ -0,0 +1,569 @@ -+/* 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) -+{ -+ if (thd->wsrep_exec_mode == 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); -+ } -+} -+ -+/* -+ 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", rcode); -+ 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_CONN_FAIL: -+ WSREP_ERROR("connection failure"); -+ DBUG_RETURN(WSREP_TRX_ERROR); -+ default: -+ WSREP_ERROR("unknown connection failure"); -+ 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; - -=== added file 'sql/wsrep_mysqld.cc' ---- old/sql/wsrep_mysqld.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_mysqld.cc 2014-03-13 09:13:20 +0000 -@@ -0,0 +1,1484 @@ -+/* 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" -+ -+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 = 2; // 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 -+ -+/* -+ * 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 = 2; -+ -+// 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: -+ 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: -+ // 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 */ -+ 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: -+ 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(); -+ } -+} -+ -+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; -+ return 0; -+ } -+ 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); -+ 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) + 2]= { 0, }; -+ strncpy(arg, argv[i], sizeof(arg) - 1); -+ char* underscore; -+ while (NULL != (underscore= strchr(arg, '_'))) *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_causal_wait (THD* thd) -+{ -+ if (thd->variables.wsrep_causal_reads && thd->variables.wsrep_on && -+ !thd->in_active_multi_stmt_transaction() && -+ thd->wsrep_conflict_state != REPLAYING) -+ { -+ // This allows autocommit SELECTs and a first SELECT after SET AUTOCOMMIT=0 -+ // TODO: modify to check if thd has locked any rows. -+ wsrep_gtid_t gtid; -+ wsrep_status_t ret= wsrep->causal_read (wsrep, >id); -+ -+ if (unlikely(WSREP_OK != ret)) -+ { -+ const char* msg; -+ int err; -+ -+ // Possibly relevant error codes: -+ // ER_CHECKREAD, ER_ERROR_ON_READ, ER_INVALID_DEFAULT, ER_EMPTY_QUERY, -+ // ER_FUNCTION_NOT_DEFINED, ER_NOT_ALLOWED_COMMAND, ER_NOT_SUPPORTED_YET, -+ // ER_FEATURE_DISABLED, ER_QUERY_INTERRUPTED -+ -+ switch (ret) -+ { -+ case WSREP_NOT_IMPLEMENTED: -+ msg= "consistent reads by wsrep backend. " -+ "Please unset wsrep_causal_reads variable."; -+ err= ER_NOT_SUPPORTED_YET; -+ break; -+ default: -+ msg= "Causal 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: -+ { -+ *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: -+ { -+ 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); -+} -+ -+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; -+ 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)&& -+ 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 { -+ /* 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; -+ } -+ 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"); -+ 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; -+ } -+ if (!ret) -+ { -+ thd->wsrep_exec_mode= TOTAL_ORDER; -+ } -+ } -+ 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; -+} - -=== added file 'sql/wsrep_mysqld.h' ---- old/sql/wsrep_mysqld.h 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_mysqld.h 2014-03-06 16:29:47 +0000 -@@ -0,0 +1,307 @@ -+/* 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; -+ -+enum enum_wsrep_OSU_method { WSREP_OSU_TOI, WSREP_OSU_RSU }; -+ -+// 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_causal_wait(THD* thd); -+extern int wsrep_check_opts (int argc, char* const* argv); -+extern void wsrep_prepend_PATH (const char* path); -+ -+/* Other global variables */ -+extern wsrep_seqno_t wsrep_locked_seqno; -+ -+#define WSREP_ON \ -+ (global_system_variables.wsrep_on) -+ -+#define WSREP(thd) \ -+ (WSREP_ON && (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); -+ -+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 */ - -=== added file 'sql/wsrep_notify.cc' ---- old/sql/wsrep_notify.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_notify.cc 2013-10-02 14:02:46 +0000 -@@ -0,0 +1,108 @@ -+/* 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); -+ -+ 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); -+ } -+} -+ - -=== added file 'sql/wsrep_priv.h' ---- old/sql/wsrep_priv.h 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_priv.h 2013-10-05 11:11:40 +0000 -@@ -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 */ - -=== added file 'sql/wsrep_sst.cc' ---- old/sql/wsrep_sst.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_sst.cc 2014-03-08 05:20:50 +0000 -@@ -0,0 +1,1091 @@ -+/* 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[]; -+ -+#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_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[cmd_len]; -+ 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_PARENT" '%d'" -+ " %s '%s' ", -+ method, addr_in, (sst_auth_real) ? sst_auth_real : "", -+ sst_dir, wsrep_defaults_file, (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[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[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[cmd_len]; -+ -+ 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_GTID" '%s:%lld'" -+ "%s", -+ user, pswd, host, port, mysqld_port, mysqld_unix_port, 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); -+ -+ return ret; -+} -+ -+wsrep_seqno_t wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; -+ -+static int run_sql_command(THD *thd, const char *query) -+{ -+ thd->set_query((char *)query, strlen(query)); -+ -+ Parser_state ps; -+ if (ps.init(thd, thd->query(), thd->query_length())) -+ { -+ WSREP_ERROR("SST query: %s failed", query); -+ return -1; -+ } -+ -+ mysql_parse(thd, thd->query(), thd->query_length(), &ps); -+ if (thd->is_error()) -+ { -+ int const err= thd->get_stmt_da()->sql_errno(); -+ WSREP_WARN ("error executing '%s': %d (%s)%s", -+ query, err, thd->get_stmt_da()->message(), -+ err == ER_UNKNOWN_SYSTEM_VARIABLE ? -+ ". Was mysqld built with --with-innodb-disallow-writes ?" : ""); -+ thd->clear_error(); -+ return -1; -+ } -+ return 0; -+} -+ -+static int sst_flush_tables(THD* thd) -+{ -+ WSREP_INFO("Flushing tables for SST..."); -+ -+ int err; -+ int not_used; -+ if (run_sql_command(thd, "FLUSH TABLES WITH READ LOCK")) -+ { -+ WSREP_ERROR("Failed to flush and lock tables"); -+ err = -1; -+ } -+ else -+ { -+ /* make sure logs are flushed after global read lock acquired */ -+ err= reload_acl_and_cache(thd, REFRESH_ENGINE_LOG | REFRESH_BINARY_LOG, -+ (TABLE_LIST*) 0, ¬_used); -+ } -+ -+ if (err) -+ { -+ WSREP_ERROR("Failed to flush tables: %d (%s)", err, strerror(err)); -+ } -+ else -+ { -+ WSREP_INFO("Tables flushed."); -+ const char base_name[]= "tables_flushed"; -+ ssize_t const full_len= strlen(mysql_real_data_home) + strlen(base_name)+2; -+ char real_name[full_len]; -+ sprintf(real_name, "%s/%s", mysql_real_data_home, base_name); -+ char tmp_name[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)); -+ } -+ } -+ } -+ -+ 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[cmd_len]; -+ 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' " -+ " %s '%s' " -+ WSREP_SST_OPT_GTID" '%s:%lld'" -+ "%s", -+ method, addr, sst_auth_real, mysqld_unix_port, -+ mysql_real_data_home, wsrep_defaults_file, -+ binlog_opt, binlog_opt_val, -+ uuid, (long long) seqno, -+ bypass ? " "WSREP_SST_OPT_BYPASS : ""); -+ my_free(binlog_opt_val); -+ -+ if (ret < 0 || ret >= cmd_len) -+ { -+ WSREP_ERROR("sst_donate_other(): snprintf() failed: %d", ret); -+ return (ret < 0 ? ret : -EMSGSIZE); -+ } -+ -+ if (!bypass && wsrep_sst_donor_rejects_queries) sst_reject_queries(FALSE); -+ -+ pthread_t tmp; -+ sst_thread_arg arg(cmd_str); -+ mysql_mutex_lock (&arg.lock); -+ ret = pthread_create (&tmp, NULL, sst_donor_thread, &arg); -+ if (ret) -+ { -+ WSREP_ERROR("sst_donate_other(): pthread_create() failed: %d (%s)", -+ ret, strerror(ret)); -+ return ret; -+ } -+ mysql_cond_wait (&arg.cond, &arg.lock); -+ -+ WSREP_INFO("sst_donor_thread signaled with %d", arg.err); -+ return arg.err; -+} -+ -+wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx, -+ const void* msg, size_t msg_len, -+ const wsrep_gtid_t* current_gtid, -+ const char* state, size_t state_len, -+ bool bypass) -+{ -+ /* This will be reset when sync callback is called. -+ * Should we set wsrep_ready to FALSE here too? */ -+// wsrep_notify_status(WSREP_MEMBER_DONOR); -+ local_status.set(WSREP_MEMBER_DONOR); -+ -+ const char* method = (char*)msg; -+ size_t method_len = strlen (method); -+ const char* data = method + method_len + 1; -+ -+ char uuid_str[37]; -+ wsrep_uuid_print (¤t_gtid->uuid, uuid_str, sizeof(uuid_str)); -+ -+ int ret; -+ if (!strcmp (WSREP_SST_MYSQLDUMP, method)) -+ { -+ ret = sst_donate_mysqldump(data, ¤t_gtid->uuid, uuid_str, -+ current_gtid->seqno, bypass); -+ } -+ else -+ { -+ ret = sst_donate_other(method, data, uuid_str, current_gtid->seqno,bypass); -+ } -+ -+ return (ret > 0 ? WSREP_CB_SUCCESS : WSREP_CB_FAILURE); -+} -+ -+void wsrep_SE_init_grab() -+{ -+ if (mysql_mutex_lock (&LOCK_wsrep_sst_init)) abort(); -+} -+ -+void wsrep_SE_init_wait() -+{ -+ while (SE_initialized == false) -+ { -+ mysql_cond_wait (&COND_wsrep_sst_init, &LOCK_wsrep_sst_init); -+ } -+ mysql_mutex_unlock (&LOCK_wsrep_sst_init); -+} -+ -+void wsrep_SE_init_done() -+{ -+ mysql_cond_signal (&COND_wsrep_sst_init); -+ mysql_mutex_unlock (&LOCK_wsrep_sst_init); -+} -+ -+void wsrep_SE_initialized() -+{ -+ SE_initialized = true; -+} - -=== added file 'sql/wsrep_sst.h' ---- old/sql/wsrep_sst.h 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_sst.h 2013-10-02 14:02:46 +0000 -@@ -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 */ - -=== added file 'sql/wsrep_thd.cc' ---- old/sql/wsrep_thd.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_thd.cc 2014-01-09 15:46:55 +0000 -@@ -0,0 +1,553 @@ -+/* 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"); -+ } -+} -+ -+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; -+} - -=== added file 'sql/wsrep_thd.h' ---- old/sql/wsrep_thd.h 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_thd.h 2014-01-09 15:46:55 +0000 -@@ -0,0 +1,36 @@ -+/* 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 my_bool wsrep_thd_is_BF(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 */ - -=== added file 'sql/wsrep_utils.cc' ---- old/sql/wsrep_utils.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_utils.cc 2014-03-13 09:13:20 +0000 -@@ -0,0 +1,520 @@ -+/* 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() -+ -+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; -+ } -+ -+ err_ = posix_spawnattr_setflags (&attr, POSIX_SPAWN_SETSIGDEF | -+ 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 && strlen(my_bind_addr_str)) -+ { -+ 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; -+ } -+ -+ // try to find the address of the first one -+#if (TARGET_OS_LINUX == 1) -+ const char cmd[] = "/sbin/ifconfig | " -+// "grep -m1 -1 -E '^[a-z]?eth[0-9]' | tail -n 1 | " -+ "grep -E '^[[:space:]]+inet addr:' | grep -m1 -v 'inet addr:127' | " -+ "sed 's/:/ /' | awk '{ print $3 }'"; -+#elif defined(__sun__) -+ const char cmd[] = "/sbin/ifconfig -a | " -+ "/usr/gnu/bin/grep -m1 -1 -E 'net[0-9]:' | tail -n 1 | awk '{ print $2 }'"; -+#elif defined(__APPLE__) || defined(__FreeBSD__) -+ const char cmd[] = "/sbin/route -nv get 8.8.8.8 | tail -n1 | awk '{print $(NF)}'"; -+#else -+ char *cmd; -+#error "OS not supported" -+#endif -+ wsp::process proc (cmd, "r"); -+ -+ if (NULL != proc.pipe()) { -+ char* ret; -+ -+ ret = fgets (buf, buf_len, proc.pipe()); -+ -+ if (proc.wait()) return 0; -+ -+ if (NULL == ret) { -+ WSREP_ERROR("Failed to read output of: '%s'", cmd); -+ return 0; -+ } -+ } -+ else { -+ WSREP_ERROR("Failed to execute: '%s'", cmd); -+ return 0; -+ } -+ -+ // clear possible \n at the end of ip string left by fgets() -+ ip_len = strlen (buf); -+ if (ip_len > 0 && '\n' == buf[ip_len - 1]) { -+ ip_len--; -+ buf[ip_len] = '\0'; -+ } -+ -+ if (INADDR_NONE == inet_addr(buf)) { -+ if (strlen(buf) != 0) { -+ WSREP_WARN("Shell command returned invalid address: '%s'", buf); -+ } -+ return 0; -+ } -+ -+ return ip_len; -+} -+ -+size_t wsrep_guess_address(char* buf, size_t buf_len) -+{ -+ size_t addr_len = wsrep_guess_ip (buf, buf_len); -+ -+ if (addr_len && addr_len < buf_len) { -+ addr_len += snprintf (buf + addr_len, buf_len - addr_len, -+ ":%u", mysqld_port); -+ } -+ -+ return addr_len; -+} -+ -+/* -+ * 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)); -+} - -=== added file 'sql/wsrep_utils.h' ---- old/sql/wsrep_utils.h 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_utils.h 2013-10-02 14:02:46 +0000 -@@ -0,0 +1,208 @@ -+/* 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); -+size_t wsrep_guess_address(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 */ - -=== added file 'sql/wsrep_var.cc' ---- old/sql/wsrep_var.cc 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_var.cc 2014-01-03 19:49:19 +0000 -@@ -0,0 +1,597 @@ -+/* 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; -+} -+ -+void wsrep_causal_reads_update (sys_var *self, THD* thd, enum_var_type var_type) -+{ -+ if (var_type == OPT_GLOBAL) { -+ thd->variables.wsrep_causal_reads = global_system_variables.wsrep_causal_reads; -+ } -+} -+ -+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; -+ } -+} - -=== added file 'sql/wsrep_var.h' ---- old/sql/wsrep_var.h 1970-01-01 00:00:00 +0000 -+++ new/sql/wsrep_var.h 2013-10-11 17:08:12 +0000 -@@ -0,0 +1,83 @@ -+/* 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 void wsrep_causal_reads_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 */ - -=== modified file 'storage/innobase/dict/dict0dict.cc' ---- old/storage/innobase/dict/dict0dict.cc 2013-12-11 14:13:33 +0000 -+++ new/storage/innobase/dict/dict0dict.cc 2014-03-11 21:17:40 +0000 -@@ -3236,7 +3236,29 @@ - - 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 - -=== modified file 'storage/innobase/handler/ha_innodb.cc' ---- old/storage/innobase/handler/ha_innodb.cc 2013-12-29 11:40:21 +0000 -+++ new/storage/innobase/handler/ha_innodb.cc 2014-03-11 21:17:40 +0000 -@@ -95,6 +95,9 @@ - #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 @@ - # 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 @@ - /*===========================*/ - 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 @@ - #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 @@ - { - 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 @@ - 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 -@@ -1789,6 +1847,9 @@ - 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; - -@@ -2818,6 +2879,12 @@ - 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); - -@@ -3380,10 +3447,30 @@ - /*================*/ - 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 */ - } - - /*****************************************************************//** -@@ -4040,7 +4127,11 @@ - case 8192: - return(1536); - default: -+#ifdef WITH_WSREP -+ return(3500); -+#else - return(3500); -+#endif - } - } - -@@ -5140,6 +5231,96 @@ - { - return((uint) (field->ptr - table->record[0])); - } -+#ifdef WITH_WSREP -+UNIV_INTERN -+void -+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 */ -+{ -+ CHARSET_INFO* charset; -+ enum_field_types mysql_tp; -+ -+ 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]; -+ 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); -+ -+ tmp_length = charset->coll->strnxfrm(charset, str, str_length, -+ str_length, tmp_str, tmp_length, 0); -+ DBUG_ASSERT(tmp_length <= str_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; -+} -+#endif // WITH_WSREP - - /*************************************************************//** - InnoDB uses this function to compare two data fields for which the data type -@@ -5649,6 +5830,264 @@ - /*******************************************************************//** - 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( -+/*===============================*/ -+ 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; -+ -+ 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 (record[key_part->null_offset] -+ & key_part->null_bit) { -+ *buff = 1; -+ part_is_null = TRUE; -+ } else { -+ *buff = 0; -+ } -+ buff++; -+ } -+ 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) { -+ buff += key_len + 2; -+ -+ 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); -+ wsrep_innobase_mysql_sort( -+ mysql_type, cs->number, sorted, true_len); -+ -+ if (wsrep_protocol_version > 1) { -+ memcpy(buff, sorted, true_len); -+ /* 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. */ -+ buff += 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) { -+ buff += key_len + 2; -+ -+ 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); -+ wsrep_innobase_mysql_sort( -+ mysql_type, cs->number, sorted, true_len); -+ -+ memcpy(buff, sorted, true_len); -+ -+ /* Note that we always reserve the maximum possible -+ length of the BLOB prefix in the key value. */ -+ if (wsrep_protocol_version > 1) { -+ buff += true_len; -+ } else { -+ buff += key_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) { -+ buff += key_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); -+ wsrep_innobase_mysql_sort( -+ mysql_type, cs->number, sorted, true_len); -+ memcpy(buff, sorted, true_len); -+ } else { -+ memcpy(buff, src_start, true_len); -+ } -+ buff += true_len; -+ -+ /* Pad the unused space with spaces. */ -+ -+#ifdef REMOVED -+ if (true_len < key_len) { -+ ulint pad_len = key_len - true_len; -+ ut_a(!(pad_len % cs->mbminlen)); -+ -+ cs->cset->fill(cs, buff, pad_len, -+ 0x20 /* space */); -+ buff += pad_len; -+ } -+#endif /* REMOVED */ -+ } -+ } -+ -+ 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( -@@ -6476,6 +6915,9 @@ - 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); - -@@ -6509,8 +6951,20 @@ - 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 -@@ -6544,6 +6998,21 @@ - */ - ; - } else if (src_table == prebuilt->table) { -+#ifdef WITH_WSREP -+ 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. */ - -@@ -6554,6 +7023,20 @@ - /* We will need an IX lock on the destination table. */ - prebuilt->sql_stat_start = TRUE; - } else { -+#ifdef WITH_WSREP -+ 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. */ - -@@ -6583,6 +7066,9 @@ - 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. */ - -@@ -6661,6 +7147,32 @@ - case SQLCOM_REPLACE_SELECT: - goto set_max_autoinc; - -+#ifdef WITH_WSREP -+ /* workaround for LP bug #355000, retrying the insert */ -+ case SQLCOM_INSERT: -+ 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; - } -@@ -6719,6 +7231,20 @@ - 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)); -@@ -6729,7 +7255,88 @@ - - 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. -@@ -7138,6 +7745,20 @@ - - 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); - } - -@@ -7185,6 +7806,18 @@ - - 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)); - } -@@ -8344,7 +8977,390 @@ - - 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]; -+ 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 ", -+ (shared) ? "Shared" : "Exclusive", -+ wsrep_thd_thread_id(thd), (long long)trx->id, key_len, -+ table_share->table_name.str); -+ 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]; -+ KEY *key_info = table->key_info; -+ ibool is_null; -+ -+ len = wsrep_store_key_val_for_row( -+ table, 0, key, key_info->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 && !hasPK; ++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); -+ } -+ 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( -+ table, i, key0, key_info->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( -+ table, i, key1, key_info->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 -@@ -12078,11 +13094,18 @@ - /* 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 */ - } - } - -@@ -13513,6 +14536,9 @@ - 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); - } - -@@ -15525,6 +16551,291 @@ - 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); -+ 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, -@@ -16236,6 +17547,40 @@ - 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.", -@@ -16444,6 +17789,9 @@ - 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), - -=== modified file 'storage/innobase/handler/ha_innodb.h' ---- old/storage/innobase/handler/ha_innodb.h 2013-06-10 20:44:22 +0000 -+++ new/storage/innobase/handler/ha_innodb.h 2013-08-27 17:07:50 +0000 -@@ -102,6 +102,10 @@ - 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); -@@ -447,6 +451,38 @@ - __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; - -=== modified file 'storage/innobase/handler/handler0alter.cc' ---- old/storage/innobase/handler/handler0alter.cc 2013-12-20 05:52:30 +0000 -+++ new/storage/innobase/handler/handler0alter.cc 2014-03-11 21:17:40 +0000 -@@ -46,6 +46,10 @@ - #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" - - -=== modified file 'storage/innobase/include/dict0mem.h' ---- old/storage/innobase/include/dict0mem.h 2013-12-11 14:13:33 +0000 -+++ new/storage/innobase/include/dict0mem.h 2014-03-11 21:17:40 +0000 -@@ -467,6 +467,9 @@ - - /** 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{ - -=== modified file 'storage/innobase/include/ha_prototypes.h' ---- old/storage/innobase/include/ha_prototypes.h 2013-11-14 02:16:21 +0000 -+++ new/storage/innobase/include/ha_prototypes.h 2014-03-11 21:17:40 +0000 -@@ -273,6 +273,20 @@ - /*================*/ - 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_is_BF(void *thd_ptr, my_bool sync); -+int wsrep_trx_order_before(void *thd1, void *thd2); -+void wsrep_innobase_mysql_sort(int mysql_type, uint charset_number, -+ unsigned char* str, unsigned int str_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 */ - -=== modified file 'storage/innobase/include/lock0lock.h' ---- old/storage/innobase/include/lock0lock.h 2013-06-10 20:44:22 +0000 -+++ new/storage/innobase/include/lock0lock.h 2014-01-09 15:46:55 +0000 -@@ -897,9 +897,6 @@ - #if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION|LOCK_CONV_BY_OTHER)&LOCK_MODE_MASK - # error - #endif --#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION|LOCK_CONV_BY_OTHER)&LOCK_TYPE_MASK --# error --#endif - /* @} */ - - /** Checks if this is a waiting lock created by lock->trx itself. -@@ -979,6 +976,16 @@ - 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 - -=== modified file 'storage/innobase/include/rem0rec.h' ---- old/storage/innobase/include/rem0rec.h 2013-12-16 06:59:20 +0000 -+++ new/storage/innobase/include/rem0rec.h 2014-03-11 21:17:40 +0000 -@@ -981,6 +981,15 @@ - 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 - -=== modified file 'storage/innobase/include/srv0srv.h' ---- old/storage/innobase/include/srv0srv.h 2013-11-29 12:56:54 +0000 -+++ new/storage/innobase/include/srv0srv.h 2014-03-11 21:17:40 +0000 -@@ -257,6 +257,10 @@ - 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 @@ - # 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 - -=== modified file 'storage/innobase/include/sync0sync.ic' ---- old/storage/innobase/include/sync0sync.ic 2013-06-10 20:44:22 +0000 -+++ new/storage/innobase/include/sync0sync.ic 2013-08-21 19:07:07 +0000 -@@ -204,8 +204,10 @@ - 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. */ - - -=== modified file 'storage/innobase/include/trx0sys.h' ---- old/storage/innobase/include/trx0sys.h 2013-06-10 20:44:22 +0000 -+++ new/storage/innobase/include/trx0sys.h 2013-11-07 12:24:22 +0000 -@@ -41,6 +41,9 @@ - #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 @@ - 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 @@ - 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 @@ - 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 */ - -=== modified file 'storage/innobase/include/trx0sys.ic' ---- old/storage/innobase/include/trx0sys.ic 2013-06-10 20:44:22 +0000 -+++ new/storage/innobase/include/trx0sys.ic 2013-11-04 22:43:00 +0000 -@@ -445,7 +445,10 @@ - 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 - -=== modified file 'storage/innobase/include/trx0trx.h' ---- old/storage/innobase/include/trx0trx.h 2013-12-11 08:05:55 +0000 -+++ new/storage/innobase/include/trx0trx.h 2014-03-11 21:17:40 +0000 -@@ -1004,6 +1004,9 @@ - /*------------------------------*/ - 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) */ - -=== modified file 'storage/innobase/lock/lock0lock.cc' ---- old/storage/innobase/lock/lock0lock.cc 2013-06-10 20:44:22 +0000 -+++ new/storage/innobase/lock/lock0lock.cc 2014-02-25 11:33:04 +0000 -@@ -50,6 +50,10 @@ - #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 -@@ -950,6 +954,9 @@ - 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 -@@ -1020,6 +1027,44 @@ - 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 (for_locking && -+ wsrep_thd_is_BF(trx->mysql_thd, FALSE) && -+ wsrep_thd_is_BF(lock2->trx->mysql_thd, TRUE)) { -+ -+ if (wsrep_debug) { -+ fprintf(stderr, "\n BF-BF lock conflict \n"); -+ 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) -+ { -+ /* exclusive lock conflicts are not accepted */ -+ fprintf(stderr, "BF-BF X lock conflict\n"); -+ lock_rec_print(stderr, lock2); -+ 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); - } - -@@ -1050,7 +1095,11 @@ - /* 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))); -@@ -1519,6 +1568,11 @@ - 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. -@@ -1567,6 +1621,57 @@ - } - #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. -@@ -1595,7 +1700,14 @@ - 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); - } - } -@@ -1724,6 +1836,27 @@ - } - - /*============== 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 -@@ -1733,6 +1866,10 @@ - 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 */ -@@ -1804,9 +1941,78 @@ - - 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); - } -@@ -1840,6 +2046,9 @@ - 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 -@@ -1899,9 +2108,20 @@ - /* 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 */ - } else { - ut_ad(lock->type_mode & LOCK_WAIT); - ut_ad(lock->type_mode & LOCK_CONV_BY_OTHER); -@@ -2008,7 +2228,19 @@ - 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 */ - -@@ -2059,9 +2291,15 @@ - } - - 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 */ -@@ -2124,9 +2362,13 @@ - 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 { -@@ -2179,6 +2421,9 @@ - que_thr_t* thr) /*!< in: query thread */ - { - trx_t* trx; -+#ifdef WITH_WSREP -+ lock_t* c_lock(NULL); -+#endif - lock_t* lock; - dberr_t err = DB_SUCCESS; - -@@ -2223,10 +2468,15 @@ - /* 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 -@@ -2234,9 +2484,16 @@ - - ut_ad(lock == NULL); - enqueue_waiting: -+#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, lock, index, thr); -+#else - err = lock_rec_enqueue_waiting( - mode, block, heap_no, lock, index, thr); -- -+#endif /* WITH_WSREP */ - } else if (!impl) { - /* Set the requested lock on the record, note that - we already own the transaction mutex. */ -@@ -3731,9 +3988,19 @@ - /* 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); - } - -@@ -3864,6 +4131,11 @@ - 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) { -@@ -3881,6 +4153,11 @@ - - 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); - } - -@@ -3997,11 +4274,20 @@ - 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); - -@@ -4039,6 +4325,9 @@ - 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 -@@ -4083,7 +4372,46 @@ - 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)) { - -@@ -4240,12 +4568,15 @@ - 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; - -@@ -4284,7 +4615,14 @@ - - /* 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() -@@ -4356,6 +4694,13 @@ - && !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); - } - } -@@ -4417,9 +4762,18 @@ - 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); - -@@ -4457,7 +4811,11 @@ - 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); - } -@@ -5585,6 +5943,7 @@ - - if (!lock_rec_get_gap(lock) && !lock_get_wait(lock)) { - -+#ifndef WITH_WSREP - enum lock_mode mode; - - if (lock_get_mode(lock) == LOCK_S) { -@@ -5594,6 +5953,7 @@ - } - 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)) { - -@@ -5897,6 +6257,9 @@ - lock_t* lock; - dberr_t err; - ulint next_rec_heap_no; -+#ifdef WITH_WSREP -+ lock_t *c_lock; -+#endif - - ut_ad(block->frame == page_align(rec)); - ut_ad(!dict_index_is_online_ddl(index) -@@ -5953,17 +6316,29 @@ - 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, NULL, index, thr); -+#else - err = lock_rec_enqueue_waiting( - LOCK_X | LOCK_GAP | LOCK_INSERT_INTENTION, - block, next_rec_heap_no, NULL, index, thr); -+#endif /* WITH_WSREP */ - - trx_mutex_exit(trx); - } else { -@@ -6068,6 +6443,11 @@ - implicit lock. Because cannot lock at this moment.*/ - - if (rec_get_deleted_flag(rec, rec_offs_comp(offsets)) -+#ifdef WITH_WSREP -+ && !wsrep_thd_is_BF(impl_trx->mysql_thd, FALSE) -+ /* BF-BF conflict is possible if advancing into -+ lock_rec_other_has_conflicting*/ -+#endif /* WITH_WSREP */ - && lock_rec_other_has_conflicting( - static_cast<enum lock_mode> - (LOCK_X | LOCK_REC_NOT_GAP), block, - -=== modified file 'storage/innobase/lock/lock0wait.cc' ---- old/storage/innobase/lock/lock0wait.cc 2013-04-18 14:25:27 +0000 -+++ new/storage/innobase/lock/lock0wait.cc 2014-01-09 15:46:55 +0000 -@@ -184,6 +184,28 @@ - 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 @@ - - 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 @@ - 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(); - -=== modified file 'storage/innobase/os/os0file.cc' ---- old/storage/innobase/os/os0file.cc 2013-12-04 10:28:27 +0000 -+++ new/storage/innobase/os/os0file.cc 2014-03-11 21:17:40 +0000 -@@ -87,6 +87,12 @@ - /* 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,9 @@ - /*========================*/ - { - FILE* file = NULL; -- int fd = innobase_mysql_tmpfile(); -+ int fd; -+ WAIT_ALLOW_WRITES(); -+ fd = innobase_mysql_tmpfile(); - - ut_ad(!srv_read_only_mode); - -@@ -1089,6 +1097,7 @@ - return(TRUE); - #else - int rcode; -+ WAIT_ALLOW_WRITES(); - - rcode = mkdir(pathname, 0770); - -@@ -1215,6 +1224,8 @@ - - #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 +1393,8 @@ - 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 +1686,8 @@ - #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 +1867,7 @@ - goto loop; - #else - int ret; -+ WAIT_ALLOW_WRITES(); - - ret = unlink(name); - -@@ -1916,6 +1932,7 @@ - goto loop; - #else - int ret; -+ WAIT_ALLOW_WRITES(); - - ret = unlink(name); - -@@ -1969,6 +1986,7 @@ - return(FALSE); - #else - int ret; -+ WAIT_ALLOW_WRITES(); - - ret = rename(oldpath, newpath); - -@@ -2180,6 +2198,7 @@ - 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 +2293,7 @@ - return(FALSE); - #else - int ret; -+ WAIT_ALLOW_WRITES(); - - #if defined(HAVE_DARWIN_THREADS) - # ifndef F_FULLFSYNC -@@ -2955,6 +2975,7 @@ - return(FALSE); - #else - ssize_t ret; -+ WAIT_ALLOW_WRITES(); - - ret = os_file_pwrite(file, buf, n, offset); - - -=== modified file 'storage/innobase/rem/rem0rec.cc' ---- old/storage/innobase/rem/rem0rec.cc 2013-12-16 06:59:20 +0000 -+++ new/storage/innobase/rem/rem0rec.cc 2014-03-11 21:17:40 +0000 -@@ -33,6 +33,9 @@ - #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 @@ - } - # 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); -+ wsrep_innobase_mysql_sort( -+ (int)(col_f->prtype & DATA_MYSQL_TYPE_MASK), -+ (uint)dtype_get_charset_coll(col_f->prtype), -+ 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); -+ wsrep_innobase_mysql_sort( -+ (int) -+ (col_f->prtype & DATA_MYSQL_TYPE_MASK), -+ (uint) -+ dtype_get_charset_coll(col_f->prtype), -+ 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 - -=== modified file 'storage/innobase/row/row0ins.cc' ---- old/storage/innobase/row/row0ins.cc 2013-06-25 03:50:18 +0000 -+++ new/storage/innobase/row/row0ins.cc 2014-02-16 22:08:57 +0000 -@@ -918,6 +918,14 @@ - 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 -@@ -1269,6 +1277,18 @@ - - 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: %lu\n", err); -+ } else -+#endif - err = row_update_cascade_for_mysql(thr, cascade, - foreign->foreign_table); - -@@ -1601,7 +1621,14 @@ - - 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 -@@ -1978,6 +2005,10 @@ - lock_type, block, rec, index, offsets, thr); - } else { - -+#ifdef WITH_WSREP -+ /* appliers don't need dupkey checks */ -+ if (!wsrep_thd_is_BF(thr_get_trx(thr)->mysql_thd, 0)) -+#endif /* WITH_WSREP */ - err = row_ins_set_shared_rec_lock( - lock_type, block, rec, index, offsets, thr); - } - -=== modified file 'storage/innobase/row/row0upd.cc' ---- old/storage/innobase/row/row0upd.cc 2013-06-25 03:50:18 +0000 -+++ new/storage/innobase/row/row0upd.cc 2014-01-09 15:46:55 +0000 -@@ -51,6 +51,9 @@ - #include "pars0sym.h" - #include "eval0eval.h" - #include "buf0lru.h" -+#ifdef WITH_WSREP -+extern my_bool wsrep_debug; -+#endif - - - /* What kind of latch and lock can we assume when the control comes to -@@ -170,6 +173,50 @@ - 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; -+ dict_foreign_t* foreign; -+ ibool froze_data_dict = FALSE; -+ ibool is_referenced = FALSE; -+ -+ if (!UT_LIST_GET_FIRST(table->foreign_list)) { -+ -+ return(FALSE); -+ } -+ -+ if (trx->dict_operation_lock_mode == 0) { -+ row_mysql_freeze_data_dictionary(trx); -+ froze_data_dict = TRUE; -+ } -+ -+ foreign = UT_LIST_GET_FIRST(table->foreign_list); -+ -+ while (foreign) { -+ if (foreign->foreign_index == index) { -+ -+ is_referenced = TRUE; -+ goto func_exit; -+ } -+ -+ foreign = UT_LIST_GET_NEXT(foreign_list, foreign); -+ } -+ -+func_exit: -+ 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. -@@ -287,7 +334,6 @@ - } - - err = DB_SUCCESS; -- - func_exit: - if (got_s_lock) { - row_mysql_unfreeze_data_dictionary(trx); -@@ -299,6 +345,126 @@ - - 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; -+ -+ if (UT_LIST_GET_FIRST(table->foreign_list) == NULL) { -+ -+ 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); -+ } -+ -+ foreign = UT_LIST_GET_FIRST(table->foreign_list); -+ -+ while (foreign) { -+ /* 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); -+ } -+ -+ if (foreign->referenced_table) { -+ mutex_enter(&(dict_sys->mutex)); -+ -+ (foreign->referenced_table -+ ->n_foreign_key_checks_running)++; -+ -+ mutex_exit(&(dict_sys->mutex)); -+ } -+ -+ /* 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) { -+ mutex_enter(&(dict_sys->mutex)); -+ -+ ut_a(foreign->referenced_table -+ ->n_foreign_key_checks_running > 0); -+ -+ (foreign->referenced_table -+ ->n_foreign_key_checks_running)--; -+ -+ mutex_exit(&(dict_sys->mutex)); -+ } -+ -+ if (err != DB_SUCCESS) { -+ -+ goto func_exit; -+ } -+ } -+ -+ foreign = UT_LIST_GET_NEXT(foreign_list, foreign); -+ } -+ -+ 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. -@@ -1673,6 +1839,9 @@ - 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); - -@@ -1800,6 +1969,9 @@ - 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); - -@@ -1817,6 +1989,37 @@ - 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; - } -@@ -1973,6 +2176,9 @@ - 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; -@@ -1986,6 +2192,9 @@ - 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)); - -@@ -2062,6 +2271,34 @@ - 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); -@@ -2289,11 +2526,18 @@ - 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)); -@@ -2310,8 +2554,16 @@ - /* 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 ! */ -@@ -2319,6 +2571,32 @@ - 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); - -@@ -2351,6 +2629,10 @@ - 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; - -@@ -2445,7 +2727,11 @@ - - 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; -@@ -2490,7 +2776,11 @@ - 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) { - - -=== modified file 'storage/innobase/srv/srv0conc.cc' ---- old/storage/innobase/srv/srv0conc.cc 2012-11-16 20:48:21 +0000 -+++ new/storage/innobase/srv/srv0conc.cc 2013-10-11 07:10:49 +0000 -@@ -42,6 +42,10 @@ - #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 @@ - 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 @@ - - 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 @@ - - 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 @@ - 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 @@ - /* 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 @@ - - 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 @@ - /* 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 @@ - - 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 @@ - 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 @@ - 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 @@ - /*==============================*/ - { - 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 */ - - -=== modified file 'storage/innobase/srv/srv0srv.cc' ---- old/storage/innobase/srv/srv0srv.cc 2013-11-29 12:56:54 +0000 -+++ new/storage/innobase/srv/srv0srv.cc 2014-03-11 21:17:40 +0000 -@@ -71,6 +71,10 @@ - #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 @@ - 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_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); - -@@ -1735,7 +1751,20 @@ - - 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, - -=== modified file 'storage/innobase/trx/trx0roll.cc' ---- old/storage/innobase/trx/trx0roll.cc 2013-06-10 20:44:22 +0000 -+++ new/storage/innobase/trx/trx0roll.cc 2013-10-10 14:15:10 +0000 -@@ -43,6 +43,9 @@ - #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" - -@@ -382,6 +385,11 @@ - - 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); - } - -@@ -1020,6 +1028,11 @@ - 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 */ - } - - /***********************************************************************//** - -=== modified file 'storage/innobase/trx/trx0sys.cc' ---- old/storage/innobase/trx/trx0sys.cc 2013-10-03 09:47:17 +0000 -+++ new/storage/innobase/trx/trx0sys.cc 2014-01-30 10:56:16 +0000 -@@ -44,6 +44,10 @@ - #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 @@ - 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 @@ - 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 @@ - 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 @@ - 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. */ - -=== modified file 'storage/innobase/trx/trx0trx.cc' ---- old/storage/innobase/trx/trx0trx.cc 2013-12-11 08:05:55 +0000 -+++ new/storage/innobase/trx/trx0trx.cc 2014-03-11 21:17:40 +0000 -@@ -158,7 +158,10 @@ - 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 @@ - 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_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 @@ - - 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_sys_update_mysql_binlog_offset( - trx->mysql_log_file_name, - trx->mysql_log_offset, -- TRX_SYS_MYSQL_LOG_INFO, mtr); -+ TRX_SYS_MYSQL_LOG_INFO, -+#ifdef WITH_WSREP -+ sys_header, -+#endif /* WITH_WSREP */ -+ mtr); - - trx->mysql_log_file_name = NULL; - } -@@ -1312,6 +1336,11 @@ - 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; -@@ -1496,6 +1525,10 @@ - - 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: -@@ -2222,6 +2255,10 @@ - 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: -@@ -2244,6 +2281,10 @@ - { - 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: -@@ -2278,6 +2319,10 @@ - - 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; - - -=== modified file 'support-files/CMakeLists.txt' ---- old/support-files/CMakeLists.txt 2012-10-10 13:05:43 +0000 -+++ new/support-files/CMakeLists.txt 2013-06-25 21:51:49 +0000 -@@ -93,4 +93,12 @@ - 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() - -=== modified file 'support-files/build-tags' ---- old/support-files/build-tags 2013-06-14 14:57:08 +0000 -+++ new/support-files/build-tags 2013-08-21 19:07:07 +0000 -@@ -10,3 +10,7 @@ - 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 -\ No newline at end of file - -=== modified file 'support-files/mysql.server.sh' ---- old/support-files/mysql.server.sh 2013-04-09 08:33:35 +0000 -+++ new/support-files/mysql.server.sh 2013-09-23 19:04:40 +0000 -@@ -379,6 +379,12 @@ - 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"` - -=== modified file 'support-files/mysql.spec.sh' ---- old/support-files/mysql.spec.sh 2013-10-30 03:15:35 +0000 -+++ new/support-files/mysql.spec.sh 2014-03-11 16:56:46 +0000 -@@ -69,6 +69,14 @@ - # - - # ---------------------------------------------------------------------------- -+# wsrep builds -+# ---------------------------------------------------------------------------- -+%if %{defined with_wsrep} -+%define mysql_version @VERSION@_wsrep_@WSREP_API_VERSION@.@WSREP_PATCH_VERSION@ -+%define wsrep_version @WSREP_VERSION@ -+%endif -+ -+# ---------------------------------------------------------------------------- - # Commercial builds - # ---------------------------------------------------------------------------- - %if %{undefined commercial} -@@ -116,6 +124,13 @@ - %endif - - # ---------------------------------------------------------------------------- -+# Packager -+# ---------------------------------------------------------------------------- -+%if %{undefined mysql_packager} -+%define mysql_packager MySQL Build Team <build@mysql.com> -+%endif -+ -+# ---------------------------------------------------------------------------- - # Distribution support - # ---------------------------------------------------------------------------- - %if %{undefined distro_specific} -@@ -283,6 +298,10 @@ - ############################################################################## - - %package -n MySQL-server%{product_suffix} -+%if %{defined with_wsrep} -+Version: %{mysql_version} -+#Release: %{wsrep_version}.%{release} -+%endif - Summary: MySQL: a very fast and reliable SQL database server - Group: Applications/Databases - Requires: %{distro_requires} -@@ -319,6 +338,9 @@ - This package includes the MySQL server binary as well as related utilities - to run and administer a MySQL server. - -+%if %{defined with_wsrep} -+Built with wsrep patch %{wsrep_version}. -+%endif - If you want to access and work with the database, you have to install - package "MySQL-client%{product_suffix}" as well! - -@@ -409,6 +431,7 @@ - and applications need to dynamically load and use MySQL. - - # ---------------------------------------------------------------------------- -+%if %{undefined with_wsrep} - %package -n MySQL-embedded%{product_suffix} - Summary: MySQL - Embedded library - Group: Applications/Databases -@@ -438,6 +461,7 @@ - client/server version. - - For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ -+%endif - - ############################################################################## - %prep -@@ -518,6 +542,9 @@ - -DFEATURE_SET="%{feature_set}" \ - %{ssl_option} \ - -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ -+%if %{defined with_wsrep} -+ -DWITH_WSREP=1 ${MEMCACHED_OPT} \ -+%endif - -DMYSQL_SERVER_SUFFIX="%{server_suffix}" - echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG - make ${MAKE_JFLAG} VERBOSE=1 -@@ -534,6 +561,9 @@ - -DFEATURE_SET="%{feature_set}" \ - %{ssl_option} \ - -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ -+%if %{defined with_wsrep} -+ -DWITH_WSREP=1 ${MEMCACHED_OPT} \ -+%endif - -DMYSQL_SERVER_SUFFIX="%{server_suffix}" - echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG - make ${MAKE_JFLAG} VERBOSE=1 -@@ -579,11 +609,20 @@ - - # 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 -+ -+%if %{defined with_wsrep} -+# Create a wsrep_sst_rsync_wan symlink. -+install -d $RBR%{_bindir} -+ln -sf wsrep_sst_rsync $RBR%{_bindir}/wsrep_sst_rsync_wan -+%endif - - # 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 -+%if %{defined with_wsrep} -+touch $RBR%{_sysconfdir}/wsrep.cnf -+%endif - - # Install SELinux files in datadir - install -m 600 $MBD/%{src_dir}/support-files/RHEL4-SElinux/mysql.{fc,te} \ -@@ -1053,6 +1092,11 @@ - %doc %{src_dir}/Docs/INFO_SRC* - %doc release/Docs/INFO_BIN* - %doc release/support-files/my-default.cnf -+%if %{defined with_wsrep} -+%doc %{src_dir}/Docs/README-wsrep -+%doc release/support-files/wsrep.cnf -+%doc release/support-files/wsrep_notify -+%endif - - %if 0%{?commercial} - %doc %attr(644, root, root) %{_infodir}/mysql.info* -@@ -1088,6 +1132,9 @@ - %doc %attr(644, root, man) %{_mandir}/man1/resolveip.1* - - %ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf -+%if %{defined with_wsrep} -+%ghost %config(noreplace,missingok) %{_sysconfdir}/wsrep.cnf -+%endif - - %attr(755, root, root) %{_bindir}/innochecksum - %attr(755, root, root) %{_bindir}/my_print_defaults -@@ -1114,6 +1161,14 @@ - %attr(755, root, root) %{_bindir}/replace - %attr(755, root, root) %{_bindir}/resolve_stack_dump - %attr(755, root, root) %{_bindir}/resolveip -+%if %{defined with_wsrep} -+%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 -+%endif - - %attr(755, root, root) %{_sbindir}/mysqld - %attr(755, root, root) %{_sbindir}/mysqld-debug -@@ -1194,8 +1249,10 @@ - %defattr(-, root, root, 0755) - %attr(-, root, root) %{_datadir}/mysql-test - %attr(755, root, root) %{_bindir}/mysql_client_test -+%if %{undefined with_wsrep} - %attr(755, root, root) %{_bindir}/mysql_client_test_embedded - %attr(755, root, root) %{_bindir}/mysqltest_embedded -+%endif - %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* -@@ -1203,11 +1260,13 @@ - %doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1* - - # ---------------------------------------------------------------------------- -+%if %{undefined with_wsrep} - %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 -+%endif - - ############################################################################## - # The spec file changelog only includes changes made to the spec file -@@ -1263,6 +1322,10 @@ - - - Removal all traces of the readline library from mysql (BUG 13738013) - -+* Wed Dec 07 2011 Alexey Yurchenko <alexey.yurchenko@codership.com> -+ -+- wsrep-related cleanups. -+ - * Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@oracle.com> - - - Fix duplicate mentioning of "mysql_plugin" and its manual page, -@@ -1321,7 +1384,6 @@ - - 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. - -=== added file 'support-files/wsrep.cnf.sh' ---- old/support-files/wsrep.cnf.sh 1970-01-01 00:00:00 +0000 -+++ new/support-files/wsrep.cnf.sh 2013-09-01 09:27:10 +0000 -@@ -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= - -=== added file 'support-files/wsrep_notify.sh' ---- old/support-files/wsrep_notify.sh 1970-01-01 00:00:00 +0000 -+++ new/support-files/wsrep_notify.sh 2013-01-08 07:41:24 +0000 -@@ -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 -+# - -=== modified file 'vio/viossl.c' ---- old/vio/viossl.c 2014-01-06 06:03:08 +0000 -+++ new/vio/viossl.c 2014-03-11 21:17:40 +0000 -@@ -392,7 +392,9 @@ - SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout); - SSL_set_fd(ssl, sd); - #ifndef HAVE_YASSL -+# if defined SSL_OP_NO_COMPRESSION - SSL_set_options(ssl, SSL_OP_NO_COMPRESSION); -+# endif - #endif - - /* - -=== added directory 'wsrep' -=== added file 'wsrep/CMakeLists.txt' ---- old/wsrep/CMakeLists.txt 1970-01-01 00:00:00 +0000 -+++ new/wsrep/CMakeLists.txt 2013-04-19 12:34:09 +0000 -@@ -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}) - -=== added file 'wsrep/Makefile.am' ---- old/wsrep/Makefile.am 1970-01-01 00:00:00 +0000 -+++ new/wsrep/Makefile.am 2013-08-22 01:04:29 +0000 -@@ -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 -+ - -=== added file 'wsrep/wsrep_api.h' ---- old/wsrep/wsrep_api.h 1970-01-01 00:00:00 +0000 -+++ new/wsrep/wsrep_api.h 2014-03-11 14:18:00 +0000 -@@ -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 */ - -=== added file 'wsrep/wsrep_dummy.c' ---- old/wsrep/wsrep_dummy.c 1970-01-01 00:00:00 +0000 -+++ new/wsrep/wsrep_dummy.c 2013-11-02 17:14:27 +0000 -@@ -0,0 +1,391 @@ -+/* 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> -+ -+/*! Dummy backend context. */ -+typedef struct wsrep_dummy -+{ -+ wsrep_log_cb_t log_fn; -+} 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); -+ 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); -+ 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 __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static char* dummy_options_get (wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+ return NULL; -+} -+ -+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; -+ -+ return 0; -+} -+ - -=== added file 'wsrep/wsrep_gtid.c' ---- old/wsrep/wsrep_gtid.c 1970-01-01 00:00:00 +0000 -+++ new/wsrep/wsrep_gtid.c 2013-08-27 17:07:50 +0000 -@@ -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, >id->uuid)) > 0 && -+ offset < str_len && str[offset] == ':') { -+ ++offset; -+ if (offset < str_len) -+ { -+ errno = 0; -+ gtid->seqno = strtoll(str + offset, &endptr, 0); -+ -+ if (errno == 0) { -+ offset = endptr - str; -+ return offset; -+ } -+ } -+ } -+ *gtid = WSREP_GTID_UNDEFINED; -+ return -EINVAL; -+} -+ -+/*! -+ * Write GTID to string -+ * @return length of GTID stirng representation of -EMSGSIZE if string is too -+ * short -+ */ -+int -+wsrep_gtid_print(const wsrep_gtid_t* gtid, char* str, size_t str_len) -+{ -+ unsigned int offset, ret; -+ if ((offset = wsrep_uuid_print(>id->uuid, str, str_len)) > 0) -+ { -+ ret = snprintf(str + offset, str_len - offset, -+ ":%" PRId64, gtid->seqno); -+ if (ret <= str_len - offset) { -+ return (offset + ret); -+ } -+ -+ } -+ -+ return -EMSGSIZE; -+} - -=== added file 'wsrep/wsrep_loader.c' ---- old/wsrep/wsrep_loader.c 1970-01-01 00:00:00 +0000 -+++ new/wsrep/wsrep_loader.c 2013-09-18 14:56:00 +0000 -@@ -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[msg_len]; -+ -+#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[msg_len + 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); -+ } -+} -+ - -=== added file 'wsrep/wsrep_uuid.c' ---- old/wsrep/wsrep_uuid.c 1970-01-01 00:00:00 +0000 -+++ new/wsrep/wsrep_uuid.c 2013-08-28 11:07:11 +0000 -@@ -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; -+ } -+} - diff --git a/debian/patches/mysql-5.6.23_wsrep_25.10.patch b/debian/patches/mysql-5.6.23_wsrep_25.10.patch new file mode 100644 index 00000000..39ff8b92 --- /dev/null +++ b/debian/patches/mysql-5.6.23_wsrep_25.10.patch @@ -0,0 +1,43353 @@ +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, >id); ++ ++ if (unlikely(WSREP_OK != ret)) ++ { ++ const char* msg; ++ int err; ++ ++ // Possibly relevant error codes: ++ // ER_CHECKREAD, ER_ERROR_ON_READ, ER_INVALID_DEFAULT, ER_EMPTY_QUERY, ++ // ER_FUNCTION_NOT_DEFINED, ER_NOT_ALLOWED_COMMAND, ER_NOT_SUPPORTED_YET, ++ // ER_FEATURE_DISABLED, ER_QUERY_INTERRUPTED ++ ++ switch (ret) ++ { ++ case WSREP_NOT_IMPLEMENTED: ++ msg= "synchronous reads by wsrep backend. " ++ "Please unset wsrep_causal_reads variable."; ++ err= ER_NOT_SUPPORTED_YET; ++ break; ++ default: ++ msg= "Synchronous wait failed."; ++ err= ER_LOCK_WAIT_TIMEOUT; // NOTE: the above msg won't be displayed ++ // with ER_LOCK_WAIT_TIMEOUT ++ } ++ ++ my_error(err, MYF(0), msg); ++ ++ return true; ++ } ++ } ++ ++ return false; ++} ++ ++/* ++ * Helpers to deal with TOI key arrays ++ */ ++typedef struct wsrep_key_arr ++{ ++ wsrep_key_t* keys; ++ size_t keys_len; ++} wsrep_key_arr_t; ++ ++ ++static void wsrep_keys_free(wsrep_key_arr_t* key_arr) ++{ ++ for (size_t i= 0; i < key_arr->keys_len; ++i) ++ { ++ my_free((void*)key_arr->keys[i].key_parts); ++ } ++ my_free(key_arr->keys); ++ key_arr->keys= 0; ++ key_arr->keys_len= 0; ++} ++ ++ ++/*! ++ * @param db Database string ++ * @param table Table string ++ * @param key Array of wsrep_key_t ++ * @param key_len In: number of elements in key array, Out: number of ++ * elements populated ++ * ++ * @return true if preparation was successful, otherwise false. ++ */ ++ ++static bool wsrep_prepare_key_for_isolation(const char* db, ++ const char* table, ++ wsrep_buf_t* key, ++ size_t* key_len) ++{ ++ if (*key_len < 2) return false; ++ ++ switch (wsrep_protocol_version) ++ { ++ case 0: ++ *key_len= 0; ++ break; ++ case 1: ++ case 2: ++ case 3: ++ { ++ *key_len= 0; ++ if (db) ++ { ++ // sql_print_information("%s.%s", db, table); ++ if (db) ++ { ++ key[*key_len].ptr= db; ++ key[*key_len].len= strlen(db); ++ ++(*key_len); ++ if (table) ++ { ++ key[*key_len].ptr= table; ++ key[*key_len].len= strlen(table); ++ ++(*key_len); ++ } ++ } ++ } ++ break; ++ } ++ default: ++ return false; ++ } ++ ++ return true; ++} ++ ++/* Prepare key list from db/table and table_list */ ++static bool wsrep_prepare_keys_for_isolation(THD* thd, ++ const char* db, ++ const char* table, ++ const TABLE_LIST* table_list, ++ wsrep_key_arr_t* ka) ++{ ++ ka->keys= 0; ++ ka->keys_len= 0; ++ ++ extern TABLE* find_temporary_table(THD*, const TABLE_LIST*); ++ ++ if (db || table) ++ { ++ TABLE_LIST tmp_table; ++ MDL_request mdl_request; ++ ++ memset(&tmp_table, 0, sizeof(tmp_table)); ++ tmp_table.table_name= (char*)table; ++ tmp_table.db= (char*)db; ++ tmp_table.mdl_request.init(MDL_key::GLOBAL, (db) ? db : "", ++ (table) ? table : "", ++ MDL_INTENTION_EXCLUSIVE, MDL_STATEMENT); ++ ++ if (!table || !find_temporary_table(thd, &tmp_table)) ++ { ++ if (!(ka->keys= (wsrep_key_t*)my_malloc(sizeof(wsrep_key_t), MYF(0)))) ++ { ++ WSREP_ERROR("Can't allocate memory for key_array"); ++ goto err; ++ } ++ ka->keys_len= 1; ++ if (!(ka->keys[0].key_parts= (wsrep_buf_t*) ++ my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) ++ { ++ WSREP_ERROR("Can't allocate memory for key_parts"); ++ goto err; ++ } ++ ka->keys[0].key_parts_num= 2; ++ if (!wsrep_prepare_key_for_isolation( ++ db, table, ++ (wsrep_buf_t*)ka->keys[0].key_parts, ++ &ka->keys[0].key_parts_num)) ++ { ++ WSREP_ERROR("Preparing keys for isolation failed"); ++ goto err; ++ } ++ } ++ } ++ ++ for (const TABLE_LIST* table= table_list; table; table= table->next_global) ++ { ++ if (!find_temporary_table(thd, table)) ++ { ++ wsrep_key_t* tmp; ++ tmp= (wsrep_key_t*)my_realloc( ++ ka->keys, (ka->keys_len + 1) * sizeof(wsrep_key_t), MYF(0)); ++ if (!tmp) ++ { ++ WSREP_ERROR("Can't allocate memory for key_array"); ++ goto err; ++ } ++ ka->keys= tmp; ++ if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*) ++ my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) ++ { ++ WSREP_ERROR("Can't allocate memory for key_parts"); ++ goto err; ++ } ++ ka->keys[ka->keys_len].key_parts_num= 2; ++ ++ka->keys_len; ++ if (!wsrep_prepare_key_for_isolation( ++ table->db, table->table_name, ++ (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts, ++ &ka->keys[ka->keys_len - 1].key_parts_num)) ++ { ++ WSREP_ERROR("Preparing keys for isolation failed"); ++ goto err; ++ } ++ } ++ } ++ return true; ++err: ++ wsrep_keys_free(ka); ++ return false; ++} ++ ++ ++bool wsrep_prepare_key_for_innodb(const uchar* cache_key, ++ size_t cache_key_len, ++ const uchar* row_id, ++ size_t row_id_len, ++ wsrep_buf_t* key, ++ size_t* key_len) ++{ ++ if (*key_len < 3) return false; ++ ++ *key_len= 0; ++ switch (wsrep_protocol_version) ++ { ++ case 0: ++ { ++ key[0].ptr = cache_key; ++ key[0].len = cache_key_len; ++ ++ *key_len = 1; ++ break; ++ } ++ case 1: ++ case 2: ++ case 3: ++ { ++ key[0].ptr = cache_key; ++ key[0].len = strlen( (char*)cache_key ); ++ ++ key[1].ptr = cache_key + strlen( (char*)cache_key ) + 1; ++ key[1].len = strlen( (char*)(key[1].ptr) ); ++ ++ *key_len = 2; ++ break; ++ } ++ default: ++ return false; ++ } ++ ++ key[*key_len].ptr = row_id; ++ key[*key_len].len = row_id_len; ++ ++(*key_len); ++ ++ return true; ++} ++ ++ ++/* ++ * Construct Query_log_Event from thd query and serialize it ++ * into buffer. ++ * ++ * Return 0 in case of success, 1 in case of error. ++ */ ++int wsrep_to_buf_helper( ++ THD* thd, const char *query, uint query_len, uchar** buf, size_t* buf_len) ++{ ++ IO_CACHE tmp_io_cache; ++ if (open_cached_file(&tmp_io_cache, mysql_tmpdir, TEMP_PREFIX, ++ 65536, MYF(MY_WME))) ++ return 1; ++ int ret(0); ++ ++ if (thd->variables.gtid_next.type == GTID_GROUP) ++ { ++ Gtid_log_event gtid_ev(thd, FALSE, &thd->variables.gtid_next); ++ if (!gtid_ev.is_valid()) ret= 0; ++ if (!ret && gtid_ev.write(&tmp_io_cache)) ret= 1; ++ } ++ ++ /* if there is prepare query, add event for it */ ++ if (!ret && thd->wsrep_TOI_pre_query) ++ { ++ Query_log_event ev(thd, thd->wsrep_TOI_pre_query, ++ thd->wsrep_TOI_pre_query_len, ++ FALSE, FALSE, FALSE, 0); ++ if (ev.write(&tmp_io_cache)) ret= 1; ++ } ++ ++ /* continue to append the actual query */ ++ Query_log_event ev(thd, query, query_len, FALSE, FALSE, FALSE, 0); ++ if (!ret && ev.write(&tmp_io_cache)) ret= 1; ++ if (!ret && wsrep_write_cache_buf(&tmp_io_cache, buf, buf_len)) ret= 1; ++ close_cached_file(&tmp_io_cache); ++ return ret; ++} ++ ++#include "sql_show.h" ++static int ++create_view_query(THD *thd, uchar** buf, size_t* buf_len) ++{ ++ LEX *lex= thd->lex; ++ SELECT_LEX *select_lex= &lex->select_lex; ++ TABLE_LIST *first_table= select_lex->table_list.first; ++ TABLE_LIST *views = first_table; ++ ++ String buff; ++ const LEX_STRING command[3]= ++ {{ C_STRING_WITH_LEN("CREATE ") }, ++ { C_STRING_WITH_LEN("ALTER ") }, ++ { C_STRING_WITH_LEN("CREATE OR REPLACE ") }}; ++ ++ buff.append(command[thd->lex->create_view_mode].str, ++ command[thd->lex->create_view_mode].length); ++ ++ if (!lex->definer) ++ { ++ /* ++ DEFINER-clause is missing; we have to create default definer in ++ persistent arena to be PS/SP friendly. ++ If this is an ALTER VIEW then the current user should be set as ++ the definer. ++ */ ++ ++ if (!(lex->definer= create_default_definer(thd))) ++ { ++ WSREP_WARN("view default definer issue"); ++ } ++ } ++ ++ views->algorithm = lex->create_view_algorithm; ++ views->definer.user = lex->definer->user; ++ views->definer.host = lex->definer->host; ++ views->view_suid = lex->create_view_suid; ++ views->with_check = lex->create_view_check; ++ ++ view_store_options(thd, views, &buff); ++ buff.append(STRING_WITH_LEN("VIEW ")); ++ /* Test if user supplied a db (ie: we did not use thd->db) */ ++ if (views->db && views->db[0] && ++ (thd->db == NULL || strcmp(views->db, thd->db))) ++ { ++ append_identifier(thd, &buff, views->db, ++ views->db_length); ++ buff.append('.'); ++ } ++ append_identifier(thd, &buff, views->table_name, ++ views->table_name_length); ++ if (lex->view_list.elements) ++ { ++ List_iterator_fast<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, ¬_used); ++ } ++ ++ if (err) ++ { ++ WSREP_ERROR("Failed to flush tables: %d (%s)", err, strerror(err)); ++ } ++ else ++ { ++ WSREP_INFO("Tables flushed."); ++ const char base_name[]= "tables_flushed"; ++ ssize_t const full_len= strlen(mysql_real_data_home) + strlen(base_name)+2; ++ char *real_name = (char*) malloc(full_len); ++ sprintf(real_name, "%s/%s", mysql_real_data_home, base_name); ++ char *tmp_name = (char*) malloc(full_len + 4); ++ sprintf(tmp_name, "%s.tmp", real_name); ++ ++ FILE* file= fopen(tmp_name, "w+"); ++ if (0 == file) ++ { ++ err= errno; ++ WSREP_ERROR("Failed to open '%s': %d (%s)", tmp_name, err,strerror(err)); ++ } ++ else ++ { ++ fprintf(file, "%s:%lld\n", ++ wsrep_cluster_state_uuid, (long long)wsrep_locked_seqno); ++ fsync(fileno(file)); ++ fclose(file); ++ if (rename(tmp_name, real_name) == -1) ++ { ++ err= errno; ++ WSREP_ERROR("Failed to rename '%s' to '%s': %d (%s)", ++ tmp_name, real_name, err,strerror(err)); ++ } ++ } ++ free(real_name); ++ free(tmp_name); ++ } ++ ++ return err; ++} ++ ++static void sst_disallow_writes (THD* thd, bool yes) ++{ ++ char query_str[64] = { 0, }; ++ ssize_t const query_max = sizeof(query_str) - 1; ++ snprintf (query_str, query_max, "SET GLOBAL innodb_disallow_writes=%d", ++ yes ? 1 : 0); ++ ++ if (run_sql_command(thd, query_str)) ++ { ++ WSREP_ERROR("Failed to disallow InnoDB writes"); ++ } ++} ++ ++static void* sst_donor_thread (void* a) ++{ ++ sst_thread_arg* arg= (sst_thread_arg*)a; ++ ++ WSREP_INFO("Running: '%s'", arg->cmd); ++ ++ int err= 1; ++ bool locked= false; ++ ++ const char* out= NULL; ++ const size_t out_len= 128; ++ char out_buf[out_len]; ++ ++ wsrep_uuid_t ret_uuid= WSREP_UUID_UNDEFINED; ++ wsrep_seqno_t ret_seqno= WSREP_SEQNO_UNDEFINED; // seqno of complete SST ++ ++ wsp::thd thd(FALSE); // we turn off wsrep_on for this THD so that it can ++ // operate with wsrep_ready == OFF ++ wsp::process proc(arg->cmd, "r"); ++ ++ err= proc.error(); ++ ++/* Inform server about SST script startup and release TO isolation */ ++ mysql_mutex_lock (&arg->lock); ++ arg->err = -err; ++ mysql_cond_signal (&arg->cond); ++ mysql_mutex_unlock (&arg->lock); //! @note arg is unusable after that. ++ ++ if (proc.pipe() && !err) ++ { ++wait_signal: ++ out= my_fgets (out_buf, out_len, proc.pipe()); ++ ++ if (out) ++ { ++ const char magic_flush[]= "flush tables"; ++ const char magic_cont[]= "continue"; ++ const char magic_done[]= "done"; ++ ++ if (!strcasecmp (out, magic_flush)) ++ { ++ err= sst_flush_tables (thd.ptr); ++ if (!err) ++ { ++ sst_disallow_writes (thd.ptr, true); ++ locked= true; ++ goto wait_signal; ++ } ++ } ++ else if (!strcasecmp (out, magic_cont)) ++ { ++ if (locked) ++ { ++ sst_disallow_writes (thd.ptr, false); ++ thd.ptr->global_read_lock.unlock_global_read_lock (thd.ptr); ++ locked= false; ++ } ++ err= 0; ++ goto wait_signal; ++ } ++ else if (!strncasecmp (out, magic_done, strlen(magic_done))) ++ { ++ err= sst_scan_uuid_seqno (out + strlen(magic_done) + 1, ++ &ret_uuid, &ret_seqno); ++ } ++ else ++ { ++ WSREP_WARN("Received unknown signal: '%s'", out); ++ } ++ } ++ else ++ { ++ WSREP_ERROR("Failed to read from: %s", proc.cmd()); ++ proc.wait(); ++ } ++ if (!err && proc.error()) err= proc.error(); ++ } ++ else ++ { ++ WSREP_ERROR("Failed to execute: %s : %d (%s)", ++ proc.cmd(), err, strerror(err)); ++ } ++ ++ if (locked) // don't forget to unlock server before return ++ { ++ sst_disallow_writes (thd.ptr, false); ++ thd.ptr->global_read_lock.unlock_global_read_lock (thd.ptr); ++ } ++ ++ // signal to donor that SST is over ++ struct wsrep_gtid const state_id = { ++ ret_uuid, err ? WSREP_SEQNO_UNDEFINED : ret_seqno ++ }; ++ wsrep->sst_sent (wsrep, &state_id, -err); ++ proc.wait(); ++ ++ return NULL; ++} ++ ++ ++ ++static int sst_donate_other (const char* method, ++ const char* addr, ++ const char* uuid, ++ wsrep_seqno_t seqno, ++ bool bypass) ++{ ++ ssize_t cmd_len = 4096; ++ char cmd_str[4096]; ++ const char* binlog_opt= ""; ++ char* binlog_opt_val= NULL; ++ ++ int ret; ++ if ((ret= generate_binlog_opt_val(&binlog_opt_val))) ++ { ++ WSREP_ERROR("sst_donate_other(): generate_binlog_opt_val() failed: %d",ret); ++ return ret; ++ } ++ if (strlen(binlog_opt_val)) binlog_opt= WSREP_SST_OPT_BINLOG; ++ ++ ret= snprintf (cmd_str, cmd_len, ++ "wsrep_sst_%s " ++ WSREP_SST_OPT_ROLE" 'donor' " ++ WSREP_SST_OPT_ADDR" '%s' " ++ WSREP_SST_OPT_AUTH" '%s' " ++ WSREP_SST_OPT_SOCKET" '%s' " ++ WSREP_SST_OPT_DATA" '%s' " ++ WSREP_SST_OPT_CONF" '%s' " ++ WSREP_SST_OPT_CONF_SUFFIX" '%s' " ++ " %s '%s' " ++ WSREP_SST_OPT_GTID" '%s:%lld'" ++ "%s", ++ method, addr, sst_auth_real, mysqld_unix_port, ++ mysql_real_data_home, wsrep_defaults_file, wsrep_defaults_group_suffix, ++ binlog_opt, binlog_opt_val, ++ uuid, (long long) seqno, ++ bypass ? " "WSREP_SST_OPT_BYPASS : ""); ++ my_free(binlog_opt_val); ++ ++ if (ret < 0 || ret >= cmd_len) ++ { ++ WSREP_ERROR("sst_donate_other(): snprintf() failed: %d", ret); ++ return (ret < 0 ? ret : -EMSGSIZE); ++ } ++ ++ if (!bypass && wsrep_sst_donor_rejects_queries) sst_reject_queries(FALSE); ++ ++ pthread_t tmp; ++ sst_thread_arg arg(cmd_str); ++ mysql_mutex_lock (&arg.lock); ++ ret = pthread_create (&tmp, NULL, sst_donor_thread, &arg); ++ if (ret) ++ { ++ WSREP_ERROR("sst_donate_other(): pthread_create() failed: %d (%s)", ++ ret, strerror(ret)); ++ return ret; ++ } ++ mysql_cond_wait (&arg.cond, &arg.lock); ++ ++ WSREP_INFO("sst_donor_thread signaled with %d", arg.err); ++ return arg.err; ++} ++ ++wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx, ++ const void* msg, size_t msg_len, ++ const wsrep_gtid_t* current_gtid, ++ const char* state, size_t state_len, ++ bool bypass) ++{ ++ /* This will be reset when sync callback is called. ++ * Should we set wsrep_ready to FALSE here too? */ ++// wsrep_notify_status(WSREP_MEMBER_DONOR); ++ local_status.set(WSREP_MEMBER_DONOR); ++ ++ const char* method = (char*)msg; ++ size_t method_len = strlen (method); ++ const char* data = method + method_len + 1; ++ ++ char uuid_str[37]; ++ wsrep_uuid_print (¤t_gtid->uuid, uuid_str, sizeof(uuid_str)); ++ ++ int ret; ++ if (!strcmp (WSREP_SST_MYSQLDUMP, method)) ++ { ++ ret = sst_donate_mysqldump(data, ¤t_gtid->uuid, uuid_str, ++ current_gtid->seqno, bypass); ++ } ++ else ++ { ++ ret = sst_donate_other(method, data, uuid_str, current_gtid->seqno,bypass); ++ } ++ ++ return (ret > 0 ? WSREP_CB_SUCCESS : WSREP_CB_FAILURE); ++} ++ ++void wsrep_SE_init_grab() ++{ ++ if (mysql_mutex_lock (&LOCK_wsrep_sst_init)) abort(); ++} ++ ++void wsrep_SE_init_wait() ++{ ++ while (SE_initialized == false) ++ { ++ mysql_cond_wait (&COND_wsrep_sst_init, &LOCK_wsrep_sst_init); ++ } ++ mysql_mutex_unlock (&LOCK_wsrep_sst_init); ++} ++ ++void wsrep_SE_init_done() ++{ ++ mysql_cond_signal (&COND_wsrep_sst_init); ++ mysql_mutex_unlock (&LOCK_wsrep_sst_init); ++} ++ ++void wsrep_SE_initialized() ++{ ++ SE_initialized = true; ++} +diff --git a/sql/wsrep_sst.h b/sql/wsrep_sst.h +new file mode 100644 +index 0000000..b7f0e26 +--- /dev/null ++++ b/sql/wsrep_sst.h +@@ -0,0 +1,40 @@ ++/* Copyright (C) 2013 Codership Oy <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, >id->uuid)) > 0 && ++ offset < str_len && str[offset] == ':') { ++ ++offset; ++ if (offset < str_len) ++ { ++ errno = 0; ++ gtid->seqno = strtoll(str + offset, &endptr, 0); ++ ++ if (errno == 0) { ++ offset = endptr - str; ++ return offset; ++ } ++ } ++ } ++ *gtid = WSREP_GTID_UNDEFINED; ++ return -EINVAL; ++} ++ ++/*! ++ * Write GTID to string ++ * @return length of GTID stirng representation of -EMSGSIZE if string is too ++ * short ++ */ ++int ++wsrep_gtid_print(const wsrep_gtid_t* gtid, char* str, size_t str_len) ++{ ++ unsigned int offset, ret; ++ if ((offset = wsrep_uuid_print(>id->uuid, str, str_len)) > 0) ++ { ++ ret = snprintf(str + offset, str_len - offset, ++ ":%" PRId64, gtid->seqno); ++ if (ret <= str_len - offset) { ++ return (offset + ret); ++ } ++ ++ } ++ ++ return -EMSGSIZE; ++} +diff --git a/wsrep/wsrep_loader.c b/wsrep/wsrep_loader.c +new file mode 100644 +index 0000000..c330c77 +--- /dev/null ++++ b/wsrep/wsrep_loader.c +@@ -0,0 +1,203 @@ ++/* Copyright (C) 2009-2011 Codership Oy <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; ++ } ++} diff --git a/debian/patches/series b/debian/patches/series index c6ee1f47..eae7eb5e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,6 +5,5 @@ disable_tests.patch fix_standalone_tests.patch kfreebsd_tests.patch spelling.patch -CVE-2014-0001.patch -mysql-5.6.16_wsrep_25.5.patch +mysql-5.6.23_wsrep_25.10.patch wsrep_sst_mysqldump.patch diff --git a/debian/patches/wsrep_sst_mysqldump.patch b/debian/patches/wsrep_sst_mysqldump.patch index 63bcd512..6b970767 100644 --- a/debian/patches/wsrep_sst_mysqldump.patch +++ b/debian/patches/wsrep_sst_mysqldump.patch @@ -1,20 +1,31 @@ ---- old/scripts/wsrep_sst_mysqldump.sh 2014-07-31 16:52:30.553138975 +0000 -+++ new/scripts/wsrep_sst_mysqldump.sh 2014-07-31 16:55:55.539138944 +0000 -@@ -67,7 +67,7 @@ if test -n "$WSREP_SST_OPT_PSWD"; then A +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="nice -n 15 ionice -c2 -n7 mysqldump $AUTH -S$WSREP_SST_OPT_SOCKET \ +-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" -@@ -92,7 +92,7 @@ DROP PREPARE stmt;" + --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 $AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\ -+MYSQL="nice -n 15 ionice -c2 -n7 mysql $AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\ +-MYSQL="$MYSQL_CLIENT $AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\ ++MYSQL="$MYSQL_APPS_PREFIX $MYSQL_CLIENT $AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\ "--disable-reconnect --connect_timeout=10" # need to disable logging when loading the dump diff --git a/mysql-wsrep-5.6/.gitignore b/mysql-wsrep-5.6/.gitignore new file mode 100644 index 00000000..8bbfde40 --- /dev/null +++ b/mysql-wsrep-5.6/.gitignore @@ -0,0 +1,3139 @@ +*-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/CMakeLists.txt b/mysql-wsrep-5.6/CMakeLists.txt index 5941954e..5be5e924 100644 --- a/mysql-wsrep-5.6/CMakeLists.txt +++ b/mysql-wsrep-5.6/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,8 +19,27 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6) CMAKE_POLICY(VERSION 2.8) 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") + CMAKE_POLICY(SET CMP0022 OLD) +ENDIF() + +# We use the LOCATION target property (CMP0026) +# and get_target_property() for non-existent targets (CMP0045) +# and INSTALL_NAME_DIR (CMP0042) +IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR + CMAKE_VERSION VERSION_GREATER "3.0.0") + CMAKE_POLICY(SET CMP0026 OLD) + CMAKE_POLICY(SET CMP0045 OLD) + CMAKE_POLICY(SET CMP0042 OLD) +ENDIF() + MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") +# Will set GIT_EXECUTABLE and GIT_FOUND +FIND_PACKAGE(Git) + SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # First, decide about build type (debug or release) @@ -60,15 +79,8 @@ SET(BUILDTYPE_DOCSTRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel") -# Possibly temporary fix: Clang on 32 bit causes non-debug server to crash -IF(CMAKE_OSX_ARCHITECTURES MATCHES "i386") - SET(CMAKE_CXX_COMPILER g++) -ENDIF() - IF(WITH_DEBUG) SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING ${BUILDTYPE_DOCSTRING} FORCE) - SET(MYSQL_MAINTAINER_MODE ON CACHE BOOL - "MySQL maintainer-specific development environment") IF(UNIX AND NOT APPLE) # Compiling with PIC speeds up embedded build, on PIC sensitive systems # Predefine it to ON, in case user chooses to build embedded. @@ -98,6 +110,15 @@ ELSE() ENDIF() PROJECT(${MYSQL_PROJECT_NAME}) +# Maintainer mode is default on only for Linux debug builds using GCC/G++ +IF(CMAKE_BUILD_TYPE MATCHES "Debug" OR WITH_DEBUG) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND + CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX) + SET(MYSQL_MAINTAINER_MODE ON CACHE BOOL + "MySQL maintainer-specific development environment") + ENDIF() +ENDIF() + OPTION(WITH_DEFAULT_COMPILER_OPTIONS "Use flags from cmake/build_configurations/compiler_options.cmake" ON) @@ -154,31 +175,6 @@ IF(WITH_DEFAULT_FEATURE_SET) INCLUDE(${CMAKE_SOURCE_DIR}/cmake/build_configurations/feature_set.cmake) ENDIF() -# -# Control aspects of the development environment which are -# specific to MySQL maintainers and developers. -# -INCLUDE(maintainer) - -OPTION(MYSQL_MAINTAINER_MODE - "MySQL maintainer-specific development environment" OFF) - -# Whether the maintainer mode compiler options should be enabled. -IF(MYSQL_MAINTAINER_MODE) - IF(CMAKE_C_COMPILER_ID MATCHES "GNU") - SET_MYSQL_MAINTAINER_GNU_C_OPTIONS() - ENDIF() - IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS() - ENDIF() - IF(CMAKE_C_COMPILER_ID MATCHES "Intel") - SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS() - ENDIF() - IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS() - ENDIF() -ENDIF() - # Add macros INCLUDE(character_sets) INCLUDE(cpu_info) @@ -207,7 +203,9 @@ OPTION(WITHOUT_SERVER OFF) IF(UNIX) OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF) ENDIF() -OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) +IF(NOT WITHOUT_SERVER) + OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) +ENDIF() MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED) @@ -385,14 +383,15 @@ IF(SYSCONFDIR) SET(DEFAULT_SYSCONFDIR "${SYSCONFDIR}") ENDIF() -OPTION(TMPDIR -"PATH to MySQL TMP dir. If unspecified, defaults to P_tmpdir in <stdio.h>" OFF) -IF(TMPDIR) +SET(TMPDIR "P_tmpdir" + CACHE PATH + "PATH to MySQL TMP dir. Defaults to the P_tmpdir macro in <stdio.h>") +IF(TMPDIR STREQUAL "P_tmpdir") + # Do not quote it, to refer to the P_tmpdir macro. + SET(DEFAULT_TMPDIR "P_tmpdir") +ELSE() # Quote it, to make it a const char string. SET(DEFAULT_TMPDIR "\"${TMPDIR}\"") -ELSE() - # Do not quote it, to refer to the P_tmpdir macro in <stdio.h>. - SET(DEFAULT_TMPDIR "P_tmpdir") ENDIF() # Run platform tests @@ -419,30 +418,22 @@ MYSQL_CHECK_LIBEVENT() # Why doesn't these flags affect the entire build? # Because things may already have been included with ADD_SUBDIRECTORY # -IF(MYSQL_MAINTAINER_MODE) - # Set compiler flags required under maintainer mode. - MESSAGE(STATUS "C warning options: ${MY_MAINTAINER_C_WARNINGS}") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_MAINTAINER_C_WARNINGS}") - MESSAGE(STATUS "C++ warning options: ${MY_MAINTAINER_CXX_WARNINGS}") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_MAINTAINER_CXX_WARNINGS}") -ENDIF() - -IF(CMAKE_COMPILER_IS_GNUCXX) - STRING(REGEX MATCH "-Werror" - BUILD_WITH_WERROR ${CMAKE_CXX_FLAGS}) - IF(BUILD_WITH_WERROR) - SET("COMPILE_FLAG_WERROR" 1) - ENDIF() -ENDIF() +OPTION(MYSQL_MAINTAINER_MODE + "MySQL maintainer-specific development environment" OFF) + +INCLUDE(maintainer) IF(WITH_UNIT_TESTS) ENABLE_TESTING() ENDIF() IF(NOT WITHOUT_SERVER) -SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "") - # Add storage engines and plugins. - CONFIGURE_PLUGINS() + SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "") + # Add storage engines and plugins. + CONFIGURE_PLUGINS() +ELSE() + # We may still want Cluster client libraries, use -DWITH_NDBCLUSTER=1 + ADD_SUBDIRECTORY(storage/ndb) ENDIF() ADD_SUBDIRECTORY(include) @@ -463,36 +454,47 @@ IF(WITH_UNIT_TESTS) IF(WIN32) ADD_DEFINITIONS( /D _VARIADIC_MAX=10 ) ENDIF() + # libc++ doesn't have tuple in tr1 + IF(HAVE_LLVM_LIBCPP) + ADD_DEFINITIONS(-DGTEST_USE_OWN_TR1_TUPLE=1) + ENDIF() ADD_SUBDIRECTORY(unittest/gunit) ENDIF() ADD_SUBDIRECTORY(extra) +ADD_SUBDIRECTORY(client) +ADD_SUBDIRECTORY(sql/share) +ADD_SUBDIRECTORY(libservices) + +IF(UNIX) + ADD_SUBDIRECTORY(man) +ENDIF() + IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(tests) - ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(sql) - ADD_SUBDIRECTORY(sql/share) - ADD_SUBDIRECTORY(libservices) OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF) IF(WITH_EMBEDDED_SERVER) ADD_SUBDIRECTORY(libmysqld) ADD_SUBDIRECTORY(libmysqld/examples) ENDIF(WITH_EMBEDDED_SERVER) +ENDIF() + +# scripts/mysql_config depends on client and server targets loaded above. +# It is referenced by some of the directories below, so we insert it here. +ADD_SUBDIRECTORY(scripts) +IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(mysql-test) ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) ADD_SUBDIRECTORY(support-files) - ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(sql-bench) - IF(UNIX) - ADD_SUBDIRECTORY(man) - ENDIF() IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt) ADD_SUBDIRECTORY(internal) ENDIF() - ADD_SUBDIRECTORY(packaging/rpm-uln) ADD_SUBDIRECTORY(packaging/rpm-oel) ADD_SUBDIRECTORY(packaging/rpm-fedora) + ADD_SUBDIRECTORY(packaging/rpm-sles) ENDIF() INCLUDE(cmake/abi_check.cmake) @@ -505,13 +507,14 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in ${CMAKE_BINARY_DIR}/sql/sql_builtin.cc) CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY) + ${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in + ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY) # Handle the "INFO_*" files. INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake) # Source: This can be done during the cmake phase, all information is # available, but should be repeated on each "make" just in case someone -# does "cmake ; make ; bzr pull ; make". +# does "cmake ; make ; git pull ; make". CREATE_INFO_SRC(${CMAKE_BINARY_DIR}/Docs) ADD_CUSTOM_TARGET(INFO_SRC ALL COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/info_src.cmake @@ -569,3 +572,37 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") ENDIF() INCLUDE(CPack) + +# C compiler flags consist of: +# CPPFLAGS Taken from environment, see above. +# ADD_DEFINITIONS In each individual CMakeLists.txt +# CMAKE_C_FLAGS From command line. +# We extend these in maintainer.cmake +# ENV{CFLAGS} From environment, but environment is ignored if +# CMAKE_C_FLAGS is also given on command line +# CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} +# We extend these in compiler_options.cmake +# +# Note that CMakeCache.txt contains cmake builtins for these variables, +# *not* the values that will actually be used: + +IF(CMAKE_GENERATOR MATCHES "Makefiles") + MESSAGE(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +ENDIF() +GET_PROPERTY(cwd_definitions DIRECTORY PROPERTY COMPILE_DEFINITIONS) +MESSAGE(STATUS "COMPILE_DEFINITIONS: ${cwd_definitions}") +MESSAGE(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") +MESSAGE(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") +IF(CMAKE_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Makefiles") + STRING(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKEBT) + MESSAGE(STATUS "CMAKE_C_FLAGS_${CMAKEBT}: ${CMAKE_C_FLAGS_${CMAKEBT}}") + MESSAGE(STATUS "CMAKE_CXX_FLAGS_${CMAKEBT}: ${CMAKE_CXX_FLAGS_${CMAKEBT}}") +ENDIF() +IF(NOT CMAKE_GENERATOR MATCHES "Makefiles") + MESSAGE(STATUS "CMAKE_C_FLAGS_DEBUG: ${CMAKE_C_FLAGS_DEBUG}") + MESSAGE(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}") + MESSAGE(STATUS + "CMAKE_C_FLAGS_RELWITHDEBINFO: ${CMAKE_C_FLAGS_RELWITHDEBINFO}") + MESSAGE(STATUS + "CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") +ENDIF() diff --git a/mysql-wsrep-5.6/Docs/ChangeLog b/mysql-wsrep-5.6/Docs/ChangeLog index d4f05948..9988db36 100644 --- a/mysql-wsrep-5.6/Docs/ChangeLog +++ b/mysql-wsrep-5.6/Docs/ChangeLog @@ -1,1373 +1 @@ ------------------------------------------------------------- -revno: 5732 -committer: Anirudh Mangipudi <anirudh.mangipudi@oracle.com> -branch nick: mysql-5.6.16-release -timestamp: Thu 2014-01-09 20:13:58 +0530 -message: - Bug#18047812: RESULT FILE MISMATCH DUE TO COPYRIGHT YEAR IN OUTPUT - Problem: - Copyright mismatch is causing test failure. - - Solution: - Replacing the present year (2014) as the copyright year. ------------------------------------------------------------- -revno: 5731 -committer: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> -branch nick: mysql-5.6.16-release -timestamp: Thu 2014-01-09 13:40:11 +0100 -message: - Updated release version ------------------------------------------------------------- -revno: 5730 -committer: Tor Didriksen <tor.didriksen@oracle.com> -branch nick: 5.6.16-release -timestamp: Wed 2014-01-08 14:55:14 +0100 -message: - Bug#18046811 COMPILATION ERRORS WHILE BUILDING MYSQL-5.6.16 ON SOLARIS 10 - - Include my_config.h before any system headers, to avoid - Warning (Anachronism): Attempt to redefine _FILE_OFFSET_BITS without using #undef. - - Include <stdio.h> before <vector> to avoid - "/usr/include/floatingpoint.h", line 164: Error: FILE is not defined." - "/usr/include/stdio.h", line 82: Error: Multiple declaration for std::FILE." - (this must be a bug in the solaris header files) ------------------------------------------------------------- -revno: 5729 -committer: Murthy Narkedimilli <murthy.narkedimilli@oracle.com> -branch nick: mysql-5.6.16-release -timestamp: Wed 2014-01-08 11:16:17 +0100 -message: - Correcting the version, and updating the current copyright year which reflects in the MySQL welcome message. ------------------------------------------------------------- -revno: 5728 -committer: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> -branch nick: mysql-5.6.16-release -timestamp: Tue 2014-01-07 19:09:54 +0100 -message: - Fix for fedora and rpm uln package build ------------------------------------------------------------- -revno: 5727 [merge] -committer: Vishal Chaudhary <vishal.chaudhary@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2014-01-06 12:04:40 +0100 -message: - Empty version change upmerge - ------------------------------------------------------------ - revno: 2875.437.321 - author: laasya.moduludu@oracle.com - committer: Laasya Moduludu <laasya.moduludu@oracle.com> - branch nick: mysql-5.5 - timestamp: Mon 2014-01-06 11:43:05 +0100 - message: - Raise version number after cloning 5.5.36 ------------------------------------------------------------- -revno: 5726 -author: vishal.chaudhary@oracle.com -committer: Vishal Chaudhary <vishal.chaudhary@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2014-01-06 11:43:05 +0100 -message: - Raise version number after cloning 5.6.16 ------------------------------------------------------------- -revno: 5725 -tags: clone-5.6.16-build -committer: Jimmy Yang <jimmy.yang@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2014-01-06 16:24:28 +0800 -message: - Fix #Bug 17800829 - MEMCACHED.MEMC247_CACHE_POLICY CRASHES IN PB2 WITH - ASSERTION `IT->SLABS_CLSID - - rb://3890 approved by Sunny Bains ------------------------------------------------------------- -revno: 5724 [merge] -committer: Murthy Narkedimilli <murthy.narkedimilli@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2014-01-06 11:33:08 +0530 -message: - Update/added copyright headers - ------------------------------------------------------------ - revno: 2875.437.320 - tags: clone-5.5.36-build - committer: Murthy Narkedimilli <murthy.narkedimilli@oracle.com> - branch nick: mysql-5.5 - timestamp: Mon 2014-01-06 10:52:35 +0530 - message: - Updated/added copyright headers ------------------------------------------------------------- -revno: 5723 -committer: Murthy Narkedimilli <murthy.narkedimilli@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2014-01-06 10:53:19 +0530 -message: - Updated/added copyright headers ------------------------------------------------------------- -revno: 5722 -committer: Venkata Sidagam <venkata.sidagam@oracle.com> -branch nick: 5.6 -timestamp: Fri 2014-01-03 15:38:15 +0530 -message: - Bug #17209750 OLD FILES NOT BEING REMOVED FROM - PERFORMANCE_SCHEMA.FILE_INSTANCES - - The test case is having issues(basically some timining issues). - Need to refactor the test case. Hence removed for time being. ------------------------------------------------------------- -revno: 5721 -committer: Sujatha Sivakumar <sujatha.sivakumar@oracle.com> -branch nick: Bug17842137_mysql-5.6 -timestamp: Thu 2014-01-02 11:01:12 +0530 -message: - Bug#17842137:ASSERT IN ROW BASED REPLICATION WHEN - TRANSACTION CACHE SIZE IS EXACTLY 32768 - - Problem: - ======== - When the binlog's IO_CACHE grows up to exact 32768 bytes it - causes binlog events to get corrupt, if this transaction - precedes with a transaction whose IO_CACHE size is >32768. - - Analysis: - ======== - On the master during the execution of a transaction all the - events that are related to that transaction will be written - to the IO_CACHE. The size of the IO_CACHE is 32768. - - The transaction whose events can fit within the IO_CACHE - are never flushed to disk. During flush operation they do - nothing but simply set the cache->read_end and end_of_file - to current size. At the time of writing to the binlog the - cache is read back and if CRC is enabled checksum is - calculated if not then the content is written to binlog file. - - If the transaction size exceeds 32768 then it will be - written to a temporary file and the cache is reinited so - that remaining events can be written to cache. During - writing to binary log file this temp file is read back. - - In the bug scenario the transaction size grows exactly to - 32768, and during flush operation it expects current size of - cache to be < 32768. Which is incorrect ideally it should - have been <= 32768. As the size is still equal to IO_CACHE - size. - - Because of the incorrect check cache is marked for flush but - the writing function "my_b_write" doesn't flush the buffer - to disk as it expects cache size to be > 32768 and the cache - is reinited without writing to temp file. When the cache is - read back it finds the buffer to be empty and tries to fill - it from temp file which wrong. Hence the buffer is filled - with some other transaction related data causing corruption. - - - Fix: - === - During flush the check for size has been changed from "<" to - "<=". ------------------------------------------------------------- -revno: 5720 -committer: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-31 12:29:00 +0900 -message: - Follow up for Bug#16249481 fix. - If flush_rbt is active (in recovery phase), buf_page_t::space and buf_page_t::offset cannot be invalidated until the bpage is removed from flush_list. - - * revno: 5677 - * committer: Sunny Bains <Sunny.Bains@Oracle.Com> - * branch nick: 5.6 - * timestamp: Tue 2013-12-10 14:30:34 +0530 - * message: - * Bug#16249481 - INNODB DOES NOT SCALE WELL ON 12 CORE SYSTEM FOR SPECIFIC ALL IN MEMORY SELECT - * - * Add a new build option: INNODB_PAGE_ATOMIC_REF_COUNT, default is ON. - * - * If this option is enabled then use atomic reference counting to track - * block use. If it is off then use the old way. - * * Approved by Yasufumi Kinoshita rb#3958. ------------------------------------------------------------- -revno: 5719 -committer: Ashish Agarwal<ashish.y.agarwal@oracle.com> -branch nick: bug_17065383 -timestamp: Mon 2013-12-30 13:40:45 +0530 -message: - Bug#17065383: PASSWORD VALIDATE PLUGIN STORES HASH OF - LOWERCASE PASSWORD BY MISTAKE - - PROBLEM: Dictionary check was done on the original - password string (converting it to lowercase), - which leads to storing a wrong password hash - for the user. - - SOLUTION: A copy of the string is created and all the - string comparisons is done on it. ------------------------------------------------------------- -revno: 5718 [merge] -committer: Arun Kuruvila <arun.kuruvila@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2013-12-30 12:00:48 +0530 -message: - Merging from mysql-5.5 to mysql-trunk. - ------------------------------------------------------------ - revno: 2875.437.319 - committer: Arun Kuruvila <arun.kuruvila@oracle.com> - branch nick: mysql-5.5 - timestamp: Mon 2013-12-30 11:39:55 +0530 - message: - Bug #16324629 : SERVER CRASHES ON UPDATE/JOIN FEDERATED + - LOCAL TABLE WHEN ONLY 1 LOCAL ROW - - Description: When updating a federated table with UPDATE... - JOIN, the server consistently crashes with Signal 11 when - only 1 row exists in the local table involved in the join - and that 1 row can be joined with a row in the federated - table. - - Analysis: Interaction between the federated engine and the - optimizer results in the crash. In our scenario, ie, local - table having only one row, the program is following a - different path because the table is treated as a constant - table by the join optimizer. So in this scenario - "index_read()" is happening in the prepare phase, - since optimizer plan is different for constant table joins. - In this case, "index_read_idx_map()" (inside handler.cc) is - calling "index_read()" and inside "index_read()", matching - rows are fetched and "stored_result" gets populated by - calling "store_result()". And just after "index_read()", - "index_end()" function is called. And in the "index_end()", - its freeing the "stored_result" by calling "free_result()". - So when it reaches the execution phase, in "position()" - function, we are getting assertion at - "DBUG_ASSERT(stored_result);". In all other scenarios (ie, - table with more than 1 row), optimizer plan is different - and "index_read()" is happening in the execution phase. - - Fix: So my fix is to have a separate ha_federated member - function for "index_read_idx_map()" which will handle - federated engine separately. So that position() will be - called before index_end() call in constant table scenario. ------------------------------------------------------------- -revno: 5717 [merge] -committer: Aditya A <aditya.a@oracle.com> -branch nick: mysql-5.6 -timestamp: Sun 2013-12-29 17:10:21 +0530 -message: - Bug#12762390 SHOW INNODB STATUS REPORTS NON-FK - ERRORS IN THE FK SECTION - - [Merge from 5.5] - ------------------------------------------------------------ - revno: 2875.437.318 - committer: Aditya A <aditya.a@oracle.com> - branch nick: mysql-5.5 - timestamp: Sun 2013-12-29 16:55:24 +0530 - message: - Bug#12762390 SHOW INNODB STATUS REPORTS NON-FK - ERRORS IN THE FK SECTION - - ANALYSIS - -------- - - Any error during the renaming of the table was - incorrectly logged in the dict_foreign_err_file - and it showed up in foreign key section when - we give the query "show engine innodb status". - - FIX - --- - Prevent renaming error from being logged in - dict_foreign_err_file section. - - [Aprooved by marko #rb 2501 ] ------------------------------------------------------------- -revno: 5716 -committer: Praveenkumar Hulakund <praveenkumar.hulakund@oracle.com> -branch nick: mysql_5_6 -timestamp: Sat 2013-12-28 22:08:40 +0530 -message: - Bug#17862905: MYSQLDUMP CREATES USELESS METADATA LOCKS - - Problem Description: - -------------------- - While taking the backup using tool "mysqldump" with option - "--single-transaction", MDL lock is acquired on each table dumped. - But these locks are not released until the backup operation is - completed. Any concurrent DDL operation on those tables will be - blocked until backup operation is completed. Moreover such blocked - DDL operations will also block other concurrent DML operations - (Since DDL has priority over DML) creating pile-up. - - Note that officially mysqldump --single-transaction is documented as - not working/not supported in presence of concurrent DDL statements. - But it might work for some people in some scenarios and before 5.5, - due to absence of MDL, combination of "mysqldump --single-transaction" - and concurrent DDL didn't create pile-up of DML statements. - - Analysis: - -------------------- - "mysqldump" start transaction with consistent snapshot and sets - isolation level to "repeatable read" when it is used with option - "--single-transaction". Data of all the tables is dumped using - SELECT statement as part of this transaction. MDL lock SR is - taken on all these tables and held till the transaction is - committed or rolled back. Any other incompatible MDL lock request - on these tables will wait until timeout or "mysqldump" operation - is completed. - - As result concurrent DDL operations on the tables which were dumped - will be blocked till the end of dump or timeout. - - Note that once table is dumped it won't be used again by "mysqldump". - This fact and the fact that "mysqldump --single-transactions" produces - backup with validity point at the start of transaction (and also - retrieves binlog position for backup at the start of transaction) means - that "mysqldump --single-transaction" can release MDL on tables which - it has already dumped without introducing more problems with - consistency. - - Fix: - -------------------- - To make "mysqldump --single-transaction" to release locks once - dumping of the table is done, modified mysqldump client code - to dump table data after setting a savepoint. Once dumping of - table data is over, added code to rollback to the savepoint set. - Rolling back to savepoint will release MDL lock acquired for the - table. - - But as of now, on rollback to savepoint, MDL locks are - not released if binlog is on. This logic is added to avoid - dropping of tables before rollback to savepoint event is - written to binlog. But when binlog handlerton can clear cache - and can safely rollback to savepoint without writing an event for - rollback to savepoint then also we are not releasing the MDL - locks. - - This is fixed by introducing a new handlerton function call - savepoint_rollback_can_release_mdl. We call this function to - check with each storage engine participating in transaction - whether it is safe to release MDL after rollback to savepoint. - Metadata locks are released only if all the storage engines - agreed that it is a safe thing to do. - - 1) For InnoDB storage engine this handlerton function can allow - release of MDL locks if transaction has not acquired any InnoDB - locks. - - 2) For Binlog this handlerton function can allow release of MDL - locks if rollback to savepoint will completely remove any - traces of transaction from cache. - - 3) Absence of this method for any storage engine means it is not - safe to release MDL locks. - - Note that this patch doesn't make "mysqldump --single-transaction" - safe in general case in presence of concurrent DDL. Nor makes it - officially supported in this case. It just allows to avoid problem - with unnecessary concurrent DDL blocking and associated DML query - pile-up in some specific cases when it might work. ------------------------------------------------------------- -revno: 5715 -committer: Venkata Sidagam <venkata.sidagam@oracle.com> -branch nick: 5.6 -timestamp: Fri 2013-12-27 14:11:20 +0530 -message: - Bug #17209750 OLD FILES NOT BEING REMOVED FROM - PERFORMANCE_SCHEMA.FILE_INSTANCES - - Description: "When a file is deleted from the disk, it is - also removed from the file_instances table." This is not - true on either 5.5.23 or 5.6.11. When there are three - relay log files on disk, but the file_instances table - lists more number of relay logs. Even this case is - happening for master bin and slave bin logs. - - Analysis: When we are deleting the - slave-relay-bin/master-bin/slave-bin log files we were - using the my_delete() function which is not P_S - instrumented function. Hence, the files are not removed - from the file_instances table. - - Fix: As part of the fix we replaced my_delete() - function with P_S instrumented mysql_file_delete() function. ------------------------------------------------------------- -revno: 5714 -committer: Shaohua Wang <shaohua.wang@oracle.com> -branch nick: mysql-5.6-bugfix1 -timestamp: Thu 2013-12-26 17:47:04 +0800 -message: - BUG#17978763 - SEGV IN FTSPARSE() BOOLEAN MODE QUERY AGAINST '\"\"@117' - - We check whether node is null in fts_ast_term_set_distance, and do nothing - if the node is null. - - rb://4230 approved by Jimmy.Yang ------------------------------------------------------------- -revno: 5713 [merge] -committer: Satya Bodapati <satya.bodapati@oracle.com> -branch nick: mysql-5.6 -timestamp: Thu 2013-12-26 14:39:11 +0530 -message: - Merge testcase for BUG#16752251 from mysql-5.5 to mysql-5.6 - ------------------------------------------------------------ - revno: 2875.437.317 - committer: Satya Bodapati <satya.bodapati@oracle.com> - branch nick: mysql-5.5 - timestamp: Thu 2013-12-26 14:33:52 +0530 - message: - BUG#16752251 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE OPERATION IF - IT IS DONE IN-PLACE - - Add testcase as innodb-change-buffer-recovery.test ------------------------------------------------------------- -revno: 5712 -committer: Annamalai Gurusami <annamalai.gurusami@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-24 10:59:45 +0530 -message: - Fixing a pb2 issue. This test case times out under valgrind. - Not running it under valgrind until further notice. ------------------------------------------------------------- -revno: 5711 -committer: Annamalai Gurusami <annamalai.gurusami@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2013-12-23 12:11:26 +0530 -message: - Bug #17991524 THE DEBUG SYNC POINT IB_CORRUPT_PAGE0 IS NOT WORKING AS EXPECTED - - Problem: - - The debug point ib_corrupt_page0 is not working reliably. This is because of - the background i/o threads. If the page 0 of a tablespace is flushed by a user - session (the SET command for variable innodb_buf_flush_list_now), then the - debug point ib_corrupt_page0 will be enabled and will work as expected. But if - the page 0 of the tablespace is flushed by a background i/o thread, then - ib_corrupt_page0 will not work as expected. - - Solution: - - Removing the ib_corrupt_page0 debug point and re-writing the test case using - some other means. - - rb#4216 approved by Jimmy. ------------------------------------------------------------- -revno: 5710 -committer: Aditya A <aditya.a@oracle.com> -branch nick: mysql-5.6 -timestamp: Sun 2013-12-22 22:07:51 +0530 -message: - Bug#17287443 ERROR(1030): GOT ERROR -1 FROM STORAGE ENGINE - - Post push test failure fix in test script. ------------------------------------------------------------- -revno: 5709 -committer: Annamalai Gurusami <annamalai.gurusami@oracle.com> -branch nick: mysql-5.6 -timestamp: Fri 2013-12-20 19:14:13 +0530 -message: - Fixing a pb2 issue. The combination gcov + embedded + crash test does not work. ------------------------------------------------------------- -revno: 5708 -committer: Neeraj Bisht <neeraj.x.bisht@oracle.com> -branch nick: 5.6 -timestamp: Fri 2013-12-20 15:15:00 +0530 -message: - Bug#16539903 - SERVER CRASHES IN IN HA_MYISAM::FT_INIT_EXT WITH - A FROM SUBQUERY - - Problem:- - Full-text search combined with derived tables causes a segment fault. - - Analysis:- - In query like - EXPLAIN SELECT MATCH(ft) AGAINST( "test" IN BOOLEAN MODE) FROM - ( SELECT ft FROM t1 ) AS t; - - We are creating a temporary table for the subquery result table. - But after wl-5274(where we are postponed materialization), we will create - tmp table, but skip instantiation of temporary table. - - When we have full-text function in our main select query, we are - going to call Item_func_match::init_search() for all the full-text item. - There we are going to take care about - condition like - --> match ... against (null) - and we are going to call handler::ft_init_ext(), which is used to - Initialize full-text index scan(which need table to be initialized). - but as we havnt initialized the table. This cause a segmentation fault. - - Solution:- - When we have derived tables, instead of intializing full-text function at - optimization, we will initiate it at the time of execution . ------------------------------------------------------------- -revno: 5707 -committer: Annamalai Gurusami <annamalai.gurusami@oracle.com> -branch nick: mysql-5.6 -timestamp: Fri 2013-12-20 12:05:46 +0530 -message: - BUG 17335427 - INNODB CAN NOT USE THE DOUBLEWRITE BUFFER PROPERLY - - Problem: - - Fixing a memory issue in my original fix. This was identified from PB2 - failures. If the page is uncompressed, then its size must be equal to - UNIV_PAGE_SIZE. The buf_page_is_corrupted() assumes the size of the - uncompressed pages as equal to UNIV_PAGE_SIZE. - - Solution: - - Call buf_page_is_corrupted() for uncompressed pages only if page size is - equal to UNIV_PAGE_SIZE. - - approved by Yasufumi over IM. ------------------------------------------------------------- -revno: 5706 -committer: Aditya A <aditya.a@oracle.com> -branch nick: mysql-5.6 -timestamp: Fri 2013-12-20 11:22:30 +0530 -message: - Bug#17287443 ERROR(1030): GOT ERROR -1 FROM STORAGE ENGINE - - PROBLEM - ------- - When we try to do DML operations in innodb - force recovery mode.we get a cryptic error - message. - ERROR(1030): GOT ERROR -1 FROM STORAGE ENGINE - - FIX - --- - Introduced a new error ER_INNODB_FORCE_RECOVERY - which will print proper error message. - - [Approved by Kevin and Krunal #rb4095 and rb#4137] ------------------------------------------------------------- -revno: 5705 [merge] -committer: Venkata Sidagam <venkata.sidagam@oracle.com> -branch nick: 5.6 -timestamp: Thu 2013-12-19 16:29:20 +0530 -message: - Bug #17780290 PUBLISH THE GIS TEST FOR BUG#16451878 - - Merging from 5.5 to 5.6 - ------------------------------------------------------------ - revno: 2875.437.316 - committer: Venkata Sidagam <venkata.sidagam@oracle.com> - branch nick: 5.5 - timestamp: Thu 2013-12-19 16:08:38 +0530 - message: - Bug #17780290 PUBLISH THE GIS TEST FOR BUG#16451878 - - Adding the test cases for the BUG#16451878. ------------------------------------------------------------- -revno: 5704 -committer: Aditya A <aditya.a@oracle.com> -branch nick: mysql-5.6 -timestamp: Thu 2013-12-19 16:06:45 +0530 -message: - Bug#17448389 SYS_DATAFILES TABLE IS NOT UPDATED AFTER - RECOVERY FOR TABLES WITH .ISL PATH - - PROBLEM - ------- - - If user changes updates the path of .ibd files in - *.isl files and does a crash recovery then tables - are loaded from the updated path,but SYS_DATAFILES - are not updated. Now if the user stops and restarts - the server in normal mode ,it will detect that the - there are two different copies of data directory - (one in isl file and one in SYS_DATAFILES table) - and both are valid ( we have not deleted the ibd - file from the original path) and refuse to load the - table and ask user to resolve the conflict. - - FIX - --- - Update the SYS_DATFILES to reflect the updated path - after crash recovery. - - [Aprroved by Kevin rb#4177] ------------------------------------------------------------- -revno: 5703 -committer: Annamalai Gurusami <annamalai.gurusami@oracle.com> -branch nick: mysql-5.6 -timestamp: Thu 2013-12-19 13:20:50 +0530 -message: - Bug #17335427 INNODB CAN NOT USE THE DOUBLEWRITE BUFFER PROPERLY - - Problem: - - If the first page (page 0) of the single table tablespace is corrupted in the - data file then our recovery doesn't progress even if there is a clean copy of - the same available in the double write buffer. - - Analysis: - - During recovery, our first step is to process the double write buffer. We look - at the pages in the double write buffer and determine its (space_id, page_no) - details. Each of the page in the double write buffer corresponds to a page in - the .ibd data file. Using the space_id information we need to map the page in - the double write buffer to the corresponding ibd file. This is done by reading - the space_id information from the first page of the single table tablespace. - If the first page of the single table tablespace is corrupted, then we are - unable to determine the data file to which a particular page in the double - write buffer belongs to. So we need to explore and see if we can determine the - space_id in other means. - - Solution: - - Assume a particular page size. Read N number of pages from the ibd file. - Ignore the corrupted pages and determine the (space_id, page_size and zip_size) - information. Repeat this for all supported page sizes. Using this approach - determine the correct (space_id, page_size and zip_size) of the ibd file. - - rb#4025 approved by Yasufumi. ------------------------------------------------------------- -revno: 5702 -committer: Thirunarayanan B<thirunarayanan.balathandayuth@oracle.com> -branch nick: r-5.6 -timestamp: Thu 2013-12-19 11:44:13 +0530 -message: - Bug #16868967 MYSQL USES SIGNIFICANTLY MORE MEMORY - FOR ALTER TABLE THAN EXPECTED - - Problem: - During online alter table, an online log buffer would be created for - index that is being rebuilt or created. This online log contains two - buffers - head and tail. Alter table takes lot of memory than - expected even there is no concurrent write for index. But Both head - and tail buffer will be useful when there is a concurrent - write on the index. If there are many partitions involved, it is - unlikely that all the partitions would be modified concurrently. - - Solution: - Allocate the tail buffer only when first DML statement happens on the - index. Allocate the head buffer only in apply phase and freed at the - end of the apply phase. - - Approved by Marko rb#3850 ------------------------------------------------------------- -revno: 5701 -committer: horst.hunger@oracle.com -branch nick: mysql-5.6 -timestamp: Wed 2013-12-18 15:39:57 +0100 -message: - Request by development to run memcached in 5.6 ------------------------------------------------------------- -revno: 5700 [merge] -committer: Bjorn Munch <bjorn.munch@oracle.com> -branch nick: main-56 -timestamp: Wed 2013-12-18 14:03:30 +0100 -message: - Followup fix for Bug 17827378 MTR DOES NOT REPORT IF A TEST - FAILS TO DROP CREATED EVENTS: - - - Check for triggers should exclude mtr's own - - Move the code to before checksum table as it might affects result - of some autdit_log tests - - Remove duplicated show status like 'slave_open_temp_tables'; - ------------------------------------------------------------ - revno: 2875.437.315 - committer: Bjorn Munch <bjorn.munch@oracle.com> - branch nick: main-55 - timestamp: Wed 2013-12-18 14:01:15 +0100 - message: - Followup fix for Bug 17827378 MTR DOES NOT REPORT IF A TEST - FAILS TO DROP CREATED EVENTS: - - - Check for triggers should exclude mtr's own - - Move the code to before checksum table as it might affect result - of some autdit_log tests (does in 5.6) - - Replace SHOW STATUS LIKE 'slave_open_temp_tables' to be like in 5.6 ------------------------------------------------------------- -revno: 5699 [merge] -committer: Tor Didriksen <tor.didriksen@oracle.com> -branch nick: 5.6-merge -timestamp: Wed 2013-12-18 11:17:16 +0100 -message: - merge 5.5 => 5.6 - ------------------------------------------------------------ - revno: 2875.437.314 - committer: Tor Didriksen <tor.didriksen@oracle.com> - branch nick: 5.5 - timestamp: Wed 2013-12-18 11:08:21 +0100 - message: - MTR's internal check of the test case 'main.events_trans' failed. - fix: DROP EVENT e1; - ------------------------------------------------------------ - revno: 2875.437.313 - committer: Tor Didriksen <tor.didriksen@oracle.com> - branch nick: 5.5 - timestamp: Wed 2013-12-18 11:05:18 +0100 - message: - Bug#16316074 RFE: MAKE TMPDIR A BUILD-TIME CONFIGURABLE OPTION - Bug#68338 RFE: make tmpdir a build-time configurable option - - Background: Some distributions use tmpfs for mounting /tmp by - default, which has some advantages, but brings also new - issues. Fedora started using tmpfs on /tmp in version 18 for - example. If not configured otherwise in my.cnf, MySQL uses - system's constant P_tmpdir expanded to /tmp on Linux. This can - introduce some problems with limited space in /tmp and also some - data loss in case of replication slave [1]. - - In case distributions would like to use /var/tmp, which should be - better for MySQL purposes, then we have to patch the source or - change tmpdir option in my.cnf, which is however not updated in - case it has already existed. - - Thus, it would be useful to be able to specify default tmpdir - path using a configure option, while using P_tmpdir in case it is - not defined explicitly. - - Based on a contribution from Honza Horak ------------------------------------------------------------- -revno: 5698 [merge] -committer: Venkatesh Duggirala<venkatesh.duggirala@oracle.com> -branch nick: mysql-5.6 -timestamp: Wed 2013-12-18 13:55:27 +0530 -message: - Bug17632978 SLAVE CRASHES IF ROW EVENT IS CORRUPTED - (MYSQLBINLOG -V CRASHES WITH THAT BINLOG) - - Merging fix from mysql-5.5 - Post-Push: Fix Werror-build problem - ------------------------------------------------------------ - revno: 2875.437.312 - committer: Venkatesh Duggirala<venkatesh.duggirala@oracle.com> - branch nick: mysql-5.5 - timestamp: Wed 2013-12-18 13:52:49 +0530 - message: - Bug17632978 SLAVE CRASHES IF ROW EVENT IS CORRUPTED - (MYSQLBINLOG -V CRASHES WITH THAT BINLOG) - - Post Push: Fixing Werror compiler issue ------------------------------------------------------------- -revno: 5697 [merge] -committer: Venkatesh Duggirala<venkatesh.duggirala@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-17 22:26:45 +0530 -message: - Bug17632978 SLAVE CRASHES IF ROW EVENT IS CORRUPTED - (MYSQLBINLOG -V CRASHES WITH THAT BINLOG) - - Merging fix from mysql-5.5 - ------------------------------------------------------------ - revno: 2875.437.311 - committer: Venkatesh Duggirala<venkatesh.duggirala@oracle.com> - branch nick: mysql-5.5 - timestamp: Tue 2013-12-17 22:11:22 +0530 - message: - Bug#17632978 SLAVE CRASHES IF ROW EVENT IS CORRUPTED - (MYSQLBINLOG -V CRASHES WITH THAT BINLOG) - - Problem: If slave receives a corrupted row event, - slave server is crashing. - - Analysis: When slave is unpacking the row event, it is - not validating the data before applying the event. If the - data is corrupted for eg: the length of a field is wrong, - it could end up reading wrong data leading to a crash. - A similar problem happens when mysqlbinlog tool is used - against a corrupted binlog using '-v' option. Due to -v - option, the tool tries to print the values of all the - fields. Corrupted field length could lead to a crash. - - Fix: Before unpacking the field, a verification - will be made on the length. If it falls into the event - range, only then it will be unpacked. Otherwise, - "ER_SLAVE_CORRUPT_EVENT" error will be thrown. - Incase mysqlbinlog -v case, the field value will not be - printed and the processing of the file will be stopped. ------------------------------------------------------------- -revno: 5696 -committer: Venkatesh Duggirala<venkatesh.duggirala@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-17 17:13:02 +0530 -message: - BUG#17544169 MYSQLBINLOG -V DOES NOT PROPERLY DECODE - DECIMAL VALUES IN AN RBR LOG - - Analysis: If verbose (-v) option is used in - mysqlbinlog tool it decodes a RBR event into - the query (the same query which was used at - source to generate) and displays immediately - after displaying the row event in the output. - The algorithm used to display the decimal was - wrongly written which were causing problems - similar to the ones mentioned below. - Eg: -0.938582 is decoded as: -938582000.000000000 - 4294967296.001 as: 000000004.294967296.001000000.000000000 - - Fix: 'decimal2string' is an existing function - which converts a decimal value into a string - format. Hence the algorithm used was replaced with - this existing 'decimal2string' function to - avoid problems mentioned above. - After this fix, decimal will be printed exactly - the same way how they get printed in 'select' command - output. - Eg: -0.938582 for decimal(10,10) will be displayed as - -0.938582000. 4294967296.001 for decimal(20,10) will - be displayed as 4294967296.0010000000 ------------------------------------------------------------- -revno: 5695 -committer: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-17 20:30:16 +0900 -message: - Follow up for Bug#16249481 fix. - backport from mysql-trunk - - revno: 7152 - committer: Vasil Dimov <vasil.dimov@oracle.com> - branch nick: mysql-trunk - timestamp: Tue 2013-12-17 11:29:47 +0200 - message: - Followup to sunny.bains@oracle.com-20131210092144-0xfzdmj5vgqlqpq2 - - Fix a compilation failure on Win32: - - buf0buf.ic(1016): error C2664: '_InterlockedExchangeAdd' : cannot - convert parameter 1 from 'ib_uint32_t *' to 'volatile long *' - Types pointed to are unrelated; conversion requires reinterpret_cast, - C-style cast or function-style cast ------------------------------------------------------------- -revno: 5694 -committer: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-17 20:03:26 +0900 -message: - Follow up for Bug#16249481 fix. - Atomic operation macro for Soralis and Windows added by Bug#16249481 fix were wrong. - Aligned same for mysql-trunk. - - * revno: 5677 - * committer: Sunny Bains <Sunny.Bains@Oracle.Com> - * branch nick: 5.6 - * timestamp: Tue 2013-12-10 14:30:34 +0530 - * message: - * Bug#16249481 - INNODB DOES NOT SCALE WELL ON 12 CORE SYSTEM FOR SPECIFIC ALL IN MEMORY SELECT - * - * Add a new build option: INNODB_PAGE_ATOMIC_REF_COUNT, default is ON. - * - * If this option is enabled then use atomic reference counting to track - * block use. If it is off then use the old way. - * - * Approved by Yasufumi Kinoshita rb#3958. ------------------------------------------------------------- -revno: 5693 -committer: Jorgen Loland <jorgen.loland@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-17 10:45:12 +0100 -message: - BUG#17889511 - - fix test errors ------------------------------------------------------------- -revno: 5692 -committer: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2013-12-16 21:03:59 +0900 -message: - The fix for Bug#16249481 was not enabled for builds. - - "#cmakedefine INNODB_PAGE_ATOMIC_REF_COUNT" is added to config.h.cmake - - Patch made by Sunny Bains (by mail) - Approved by Yasufumi Kinoshita - - * revno: 5677 - * committer: Sunny Bains <Sunny.Bains@Oracle.Com> - * branch nick: 5.6 - * timestamp: Tue 2013-12-10 14:30:34 +0530 - * message: - * Bug#16249481 - INNODB DOES NOT SCALE WELL ON 12 CORE SYSTEM FOR SPECIFIC ALL IN MEMORY SELECT - * - * Add a new build option: INNODB_PAGE_ATOMIC_REF_COUNT, default is ON. - * - * If this option is enabled then use atomic reference counting to track - * block use. If it is off then use the old way. - * - * Approved by Yasufumi Kinoshita rb#3958. ------------------------------------------------------------- -revno: 5691 -committer: Jorgen Loland <jorgen.loland@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2013-12-16 08:40:11 +0100 -message: - Bug#17889511: FORCE INDEX UNABLE TO FORCE AN ORDER BY WITH JOIN - - "FORCE INDEX [FOR ORDER BY] (indexName)" did not work for joins - because test_if_skip_sort_order() contains a heuristic that - table scan + join cache tends to be cheaper than an index scan. - - While the heuristic may be correct, it should not override the - users explicit request to use the index. - - This patch also changes the warning created for EXPLAIN. Instead - of printing only "IGNORE/USE/FORCE INDEX" it now also prints - "FOR [GROUP BY|ORDER BY|JOIN]" if this was specified in the - query. ------------------------------------------------------------- -revno: 5690 -committer: Thirunarayanan B<thirunarayanan.balathandayuth@oracle.com> -branch nick: r-5.6 -timestamp: Mon 2013-12-16 12:29:20 +0530 -message: - Bug #16924719 SMALL PERFORMANCE IMPACT WITH HEAP BLOCK - DEBUGGING INFO IN RELEASE BUILDS - Problem: - Memory block debugging details (file_name, lineno) is present on - release builds.It impacts by a tiny amount on every heap creation. - - Solution: - Removed the file_name, line no parameters from mem_heap_create_func() - and mem_alloc_func() in release builds. - - [Approved by Marko #rb 4022] ------------------------------------------------------------- -revno: 5689 [merge] -committer: Kent Boortz <kent.boortz@oracle.com> -branch nick: mysql-5.6 -timestamp: Sat 2013-12-14 13:11:48 +0100 -message: - Merge mysql-5.5 --> mysql-5.6 - ------------------------------------------------------------ - revno: 2875.437.310 - committer: Kent Boortz <kent.boortz@oracle.com> - branch nick: mysql-5.5 - timestamp: Sat 2013-12-14 13:05:36 +0100 - message: - Bug#29716 : Bug#11746921 : MYSQL_INSTALL_DB REFERS TO THE (OBSOLETE) MYSQLBUG SCRIPT DURING INSTALLATION - Bug#68742 : Bug#16530527 : OBSOLETE BUGREPORT ADDRESSES ------------------------------------------------------------- -revno: 5688 -committer: Shaohua Wang <shaohua.wang@oracle.com> -branch nick: mysql-5.6-bugfix1 -timestamp: Fri 2013-12-13 17:56:54 +0800 -message: - Bug#17033591 5.6.12 REMOVED UNIV_SYNC_DEBUG FROM UNIV_DEBUG - - Enable UNIV_SYNC_DEBUG and fix fts test failures. - - rb://4139 approved by Marko and Jimmy. ------------------------------------------------------------- -revno: 5687 [merge] -committer: Marc Alff <marc.alff@oracle.com> -branch nick: mysql-5.6-push -timestamp: Fri 2013-12-13 10:42:34 +0100 -message: - Merge mysql-5.5 --> mysql-5.6 - ------------------------------------------------------------ - revno: 2875.437.309 [merge] - committer: Marc Alff <marc.alff@oracle.com> - branch nick: mysql-5.5-push - timestamp: Fri 2013-12-13 10:26:05 +0100 - message: - Push to mysql-5.5 - ------------------------------------------------------------ - revno: 2875.465.1 - committer: Marc Alff <marc.alff@oracle.com> - branch nick: mysql-5.5-bug17928281 - timestamp: Wed 2013-12-11 11:15:23 +0100 - message: - Bug#17928281 'CHECK_PERFORMANCE_SCHEMA()' LEAVES 'CURRENT_THD' REFERRING - DESTRUCTED THD OBJ - - Prior to fix, function check_performance_schema() could leave - behind stale pointers in thread local storage, for the following keys: - - THR_THD (used by _current_thd) - - THR_MALLOC (used for memory allocation) - This is an unsafe practice, which can potentially cause crashes, - and that can cause other bugs when code is modified during maintenance. - - With this fix, thread local storage keys used temporarily within - function check_performance_schema() are cleaned up after use. ------------------------------------------------------------- -revno: 5686 -committer: mithun <mithun.c.y@oracle.com> -branch nick: mysql-5.6 -timestamp: Fri 2013-12-13 11:09:40 +0530 -message: - Bug #17513341 : >=4G JOIN_BUFFER_SIZE CRASH WHEN - JOINING TABLES, VIEWS - ISSUE : 1. Offset address from a join buffer of size - >=4gb can be >4 bytes long. But we - have only considered offsets upto 4bytes long. - This will lead to invalid buffer read and - memory corruption henceforth. - 2. If we fail to allocate join buffer then - we are not freeing the JOIN_CACHE_X instance. - Now next join buffer will wrongly take this - unfreed JOIN_CACHE_X instance as its previous - cache. Hence in incremental join buffer - implementation there will be a chance for - unallocated memory access. - Solution : 1. Now for join buffer >=4gb we have made offest - address size = 8 bytes. - 2. If we fail to allocate the join buffer we free - the JOIN_CACHE_X instance also. ------------------------------------------------------------- -revno: 5685 -committer: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com> -branch nick: mysql-5.6 -timestamp: Fri 2013-12-13 13:23:34 +0900 -message: - Fix the possibile rare race condition at Bug#16249481 fix. - - Approved by Sunny Bains (IM) - - * revno: 5677 - * committer: Sunny Bains <Sunny.Bains@Oracle.Com> - * branch nick: 5.6 - * timestamp: Tue 2013-12-10 14:30:34 +0530 - * message: - * Bug#16249481 - INNODB DOES NOT SCALE WELL ON 12 CORE SYSTEM FOR SPECIFIC ALL IN MEMORY SELECT - * - * Add a new build option: INNODB_PAGE_ATOMIC_REF_COUNT, default is ON. - * - * If this option is enabled then use atomic reference counting to track - * block use. If it is off then use the old way. - * - * Approved by Yasufumi Kinoshita rb#3958. ------------------------------------------------------------- -revno: 5684 -committer: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com> -branch nick: mysql-5.6 -timestamp: Fri 2013-12-13 12:52:47 +0900 -message: - The adjustment about UNIV_SUNC_DEBUG is needed for Bug#16249481 fix - - Approved by Sunny Bains (IM) - - * revno: 5677 - * committer: Sunny Bains <Sunny.Bains@Oracle.Com> - * branch nick: 5.6 - * timestamp: Tue 2013-12-10 14:30:34 +0530 - * message: - * Bug#16249481 - INNODB DOES NOT SCALE WELL ON 12 CORE SYSTEM FOR SPECIFIC ALL IN MEMORY SELECT - * - * Add a new build option: INNODB_PAGE_ATOMIC_REF_COUNT, default is ON. - * - * If this option is enabled then use atomic reference counting to track - * block use. If it is off then use the old way. - * - * Approved by Yasufumi Kinoshita rb#3958. ------------------------------------------------------------- -revno: 5683 [merge] -committer: sayantan dutta <sayantan.dutta@oracle.com> -branch nick: mysql-5.6 -timestamp: Thu 2013-12-12 12:23:02 +0530 -message: - Bug 17827378 5.5=>5.6 - ------------------------------------------------------------ - revno: 2875.437.308 - committer: sayantan dutta <sayantan.dutta@oracle.com> - branch nick: mysql-5.5 - timestamp: Thu 2013-12-12 12:20:57 +0530 - message: - Bug #17827378 - MTR DOES NOT REPORT IF A TEST FAILS TO DROP CREATED EVENTS ------------------------------------------------------------- -revno: 5682 -committer: Vasil Dimov <vasil.dimov@oracle.com> -branch nick: mysql-5.6 -timestamp: Wed 2013-12-11 16:13:33 +0200 -message: - Backport from mysql-trunk to mysql-5.6: - - ** revision-id: vasil.dimov@oracle.com-20131203163459-tlkyqdq93jysk9z0 - ** committer: Vasil Dimov <vasil.dimov@oracle.com> - ** branch nick: mysql-trunk - ** timestamp: Tue 2013-12-03 18:34:59 +0200 - ** message: - ** Fix Bug#70768 Persistent optimizer statistics often causes LOCK_open stalls - ** - ** Protect each table's dict_table_t::stat* members with a latch dedicated - ** for this table instead of using a global pool of 64 shared latches. - ** With 6 tables, the chances of at least two ending up with the same latch - ** is 23.9%. With a lots of tables, there are tons of collisions. - ** - ** Reviewed by: Kevin (rb:3805) ------------------------------------------------------------- -revno: 5681 -committer: Roy Lyseng <roy.lyseng@oracle.com> -branch nick: mysql-5.6 -timestamp: Wed 2013-12-11 09:59:30 +0100 -message: - Bug#17600176: This query returns a row in 5.5 but not 5.6 or current 5.7 - - The problem query contains an IN subquery that is transformed to - a semi-join. The subquery contains an outer join operation. - When run standalone, the outer join in the subquery is preserved as an - outer join and returns one row. However, when the full query is run, - the outer join is converted into an inner join, and the subquery no - longer returns any row. This causes the outer query to return no rows. - - The problem is with the IF clause in the WHERE clause of the subquery, - When transforming into semi-join, we rely on Item::fix_after_pullout() - to adjust used_tables and not_null_tables information within the - condition objects, in order to determine e.g. the outer join to inner - join transform. However, there is no specific implementation of - ::fix_after_pullout() for the IF clause, so it returns generic - information generated by Item_func::fix_after_pullout(). The fix is to - add this function. - - By analysis, this appears to be a problem for BETWEEN predicates and - IN predicates too. A specific implementation of :;fix_after_pullout() - is added for both classes. - - In addition, it was detected that not_null_tables information was not - updated correctly for class Item_row. However, I was not able to think - out any failing test for this problem, so no test case was added. ------------------------------------------------------------- -revno: 5680 -committer: Thirunarayanan B<thirunarayanan.balathandayuth@oracle.com> -branch nick: mysql-5.6 -timestamp: Wed 2013-12-11 14:06:16 +0530 -message: - Bug #17848838 BACKPORT 16511145 TO 5.6 - Backporting the fix of Bug #16511145 - from trunk to mysql-5.6 - - [Approved by Kevin rb# 3983] ------------------------------------------------------------- -revno: 5679 -committer: Anil Toshniwal <anil.toshniwal@oracle.com> -branch nick: mysql-5.6 -timestamp: Wed 2013-12-11 13:35:55 +0530 -message: - Bug#16936961 INCORRECT TRANSACTION ACTIVE TIME FOR RECOVING TRANSACTION - AFTER CRASH - Problem: The start_time member of trx_t structure is uninitialized in - trx_create(), that is, at the time of transaction object creation. - The start_time was initialized only at the start of transaction. - So after crash, start_time was taking the garbage value and while - rollback is running in background for uncommited trx. - - Fixed: Initialized the start_time member in trx_resurrect_*(), when trx - is in either ACTIVE or PREPARED STATE. - - Approved by Jimmy (rb#4046). ------------------------------------------------------------- -revno: 5678 -committer: Anil Toshniwal <anil.toshniwal@oracle.com> -branch nick: mysql-5.6 -timestamp: Wed 2013-12-11 12:30:53 +0530 -message: - Bug#17810862 INNOCHECKSUM.EXE CANNOT HANDLE >=4G FILES - (AND PRINTS WRONG ERROR MESSAGE) - Problem: - 1) mysql-5.6 innochecksum tool don't support file larger than 2GB. - 2) Wasn't used the Windows specific API, _stat64() to get file size, so - was printing wrong error message. - Solution: - 1) Fixed innochecksum to provide utility to support large file also. - 2) Use Windows Specific API, _stat64() to get file size. - - Approved by Kevin (rb#4012). ------------------------------------------------------------- -revno: 5677 -committer: Sunny Bains <Sunny.Bains@Oracle.Com> -branch nick: 5.6 -timestamp: Tue 2013-12-10 14:30:34 +0530 -message: - Bug#16249481 - INNODB DOES NOT SCALE WELL ON 12 CORE SYSTEM FOR SPECIFIC ALL IN MEMORY SELECT - - Add a new build option: INNODB_PAGE_ATOMIC_REF_COUNT, default is ON. - - If this option is enabled then use atomic reference counting to track - block use. If it is off then use the old way. - - Approved by Yasufumi Kinoshita rb#3958. ------------------------------------------------------------- -revno: 5676 -committer: Roy Lyseng <roy.lyseng@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-10 09:24:24 +0100 -message: - Bug#71010: Bug#17876794: sql/sql_resolver.cc refers to partition engine fields - - An #ifdef was missed in this file. ------------------------------------------------------------- -revno: 5675 -committer: Tor Didriksen <tor.didriksen@oracle.com> -branch nick: 5.6-merge -timestamp: Mon 2013-12-09 09:27:28 +0100 -message: - Bug#17400967 MYSQL_CONFIG FAILS TO FILTER OUT SOME WARNING FLAG - - For clang and gcc we set some warning flags when compiling the server. - Remove them when generating the script mysqld_config. ------------------------------------------------------------- -revno: 5674 -committer: Thirunarayanan B<thirunarayanan.balathandayuth@oracle.com> -branch nick: r-5.6 -timestamp: Mon 2013-12-09 11:56:43 +0530 -message: - Bug #16924719 SMALL PERFORMANCE IMPACT WITH HEAP BLOCK - DEBUGGING INFO IN RELEASE BUILDS - Fixed build problem in debug mode. ------------------------------------------------------------- -revno: 5673 -committer: Pavan Naik<pavan.naik@oracle.com> -branch nick: mysql-5.6 -timestamp: Mon 2013-12-09 11:45:35 +0530 -message: - BUG#16321920 : CREATE A SEPARATE INNODB_ZIP TEST SUITE - - innodb.innodb-wl5980-alter.test and innodb.innodb-wl6445-1.test were affecting innodb_zip.innodb-restart.test - - Added "rmdir" statement in the end of both the tests to remove the directory "$MYSQL_TMP_DIR/alt_dir". ------------------------------------------------------------- -revno: 5672 -committer: Thirunarayanan B<thirunarayanan.balathandayuth@oracle.com> -branch nick: r-5.6 -timestamp: Mon 2013-12-09 10:32:10 +0530 -message: - Bug #16924719 SMALL PERFORMANCE IMPACT WITH HEAP BLOCK - DEBUGGING INFO IN RELEASE BUILDS - Problem: - Memory block debugging details (file_name, lineno) is present on - release builds.It impacts by a tiny amount on every heap creation. - - Solution: - Removed file_no, lineno of block details in release builds. - - [Approved by Marko #rb 4022] ------------------------------------------------------------- -revno: 5671 -committer: Vasil Dimov <vasil.dimov@oracle.com> -branch nick: mysql-5.6 -timestamp: Fri 2013-12-06 13:49:49 +0200 -message: - Backport from mysql-trunk to mysql-5.6: - - ** revision-id: vasil.dimov@oracle.com-20131203155950-qm0okr731tms81sy - ** committer: Vasil Dimov <vasil.dimov@oracle.com> - ** branch nick: mysql-trunk - ** timestamp: Tue 2013-12-03 17:59:50 +0200 - ** message: - ** Fix Bug#17193801 DICT_TABLE_SCHEMA_CHECK CALLS DTYPE_SQL_NAME - ** NEEDLESSLY - WASTING A LOT OF CPU - ** - ** Avoid the calls to dtype_sql_name() if the results are not going to - ** be used (they are used only in an event of an error). - ** - ** Reviewed by: Kevin (rb:3625) ------------------------------------------------------------- -revno: 5670 [merge] -committer: Guilhem Bichot <guilhem.bichot@oracle.com> -branch nick: 5.6 -timestamp: Wed 2013-12-04 18:08:05 +0100 -message: - Merge of local 5.6 with latest changes of local 5.5 - ------------------------------------------------------------ - revno: 2875.437.307 - committer: Guilhem Bichot <guilhem.bichot@oracle.com> - branch nick: 5.5 - timestamp: Wed 2013-12-04 12:32:42 +0100 - message: - Bug#16539979 - BASIC SELECT COUNT(DISTINCT ID) IS BROKEN - Bug#17867117 - ERROR RESULT WHEN "COUNT + DISTINCT + CASE WHEN" NEED MERGE_WALK - - Problem: - COUNT DISTINCT gives incorrect result when it uses a Unique - Tree and its last inserted record has null value. - - Here is how COUNT DISTINCT is processed, given that this query is not - using loose index scan. - - When a row is produced as a result of joining tables (there is only - one table here), we store the SELECTed value in a Unique tree. This - allows elimination of any duplicates, and thus implements DISTINCT. - - When we have processed all rows like this, we walk the Unique tree, - counting its elements, in Aggregator_distinct::endup() (tree->walk()); - for each element we call Item_sum_count::add(). Such function wants to - ignore any NULL value, for that it checks item_sum -> args[0] -> - null_value. It is a mistake: when walking the Unique tree, the value - to be aggregated is not item_sum ->args[0] but rather table -> - field[0]. - - Solution: - instead of item_sum -> args[0] -> null_value, use arg_is_null(), which - knows where to look (like in fix for bug 57932). - - As a consequence of this solution, we have to make arg_is_null() a - little more general: - 1) Because it was so far only used for AVG() (which always has a - single argument), this function was looking at a single argument; now - that it has to work with COUNT(DISTINCT expression1,expression2), it - must look at all arguments. - 2) Because we start using arg_is_null () for COUNT(DISTINCT), i.e. in - Item_sum_count::add (), it implies that we are also using it for - COUNT(no DISTINCT) (same add ()). For COUNT(no DISTINCT), the - nullness to check is that of item_sum -> args[0]. But the null_value - of such item is reliable only if val_*() has been called on it. So far - arg_is_null() was always used after a call to arg_val*(), so could - rely on null_value; but for COUNT, there is no call to arg_val*(), so - arg_is_null() has to call is_null() instead. - - Testcase for 16539979 by Neeraj. Testcase for 17867117 contributed by - Xiaobin Lin from Taobao. ------------------------------------------------------------- -revno: 5669 -committer: Krunal Bauskar krunal.bauskar@oracle.com -branch nick: mysql-5.6 -timestamp: Wed 2013-12-04 15:58:27 +0530 -message: - - bug#70867: WRONG OS ERROR NUMBER REPORTED IN ERROR LOG DURING FAILURE AT - STARTUP - - InnoDB has handler to handle some of the common known errors. - One of such error is ACCESS VIOLATION error which is detected and - proper notifying error message is printed but it left unmapped to internal - InnoDB error code that causes caller function to think that error is - is not from know list and caller try to invoke default error handle - leading to error-code and message mis-match. - - Fixed by ensuring that known ACCESS VIOLATION error is mapped to proper - InnoDB error code. - - Approved by: Kevin (rb#3986) - (BPS approval by Sveta) ------------------------------------------------------------- -revno: 5668 [merge] -committer: Hery Ramilison <hery.ramilison@oracle.com> -branch nick: mysql-5.6 -timestamp: Wed 2013-12-04 04:12:50 +0100 -message: - Upmerge of the mysql-5.1.73 build - ------------------------------------------------------------ - revno: 2875.437.306 [merge] - committer: Hery Ramilison <hery.ramilison@oracle.com> - branch nick: mysql-5.5 - timestamp: Wed 2013-12-04 04:04:44 +0100 - message: - Upmerge of the mysql-5.1.73 build - ------------------------------------------------------------ - revno: 2661.885.1 - author: - committer: Hery Ramilison <hery.ramilison@oracle.com> - branch nick: mysql-5.1 - timestamp: Tue 2013-12-03 20:47:36 +0100 - message: - Merge from mysql-5.1.73-release ------------------------------------------------------------- -revno: 5667 [merge] -author: vishal.chaudhary@oracle.com -committer: Vishal Chaudhary <vishal.chaudhary@oracle.com> -branch nick: mysql-5.6 -timestamp: Tue 2013-12-03 10:53:16 +0100 -message: - Merge from mysql-5.6.15-release - ------------------------------------------------------------ - revno: 5583.2.2 - tags: mysql-5.6.15 - committer: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - branch nick: mysql-5.6.15-release - timestamp: Sun 2013-11-17 18:51:36 +0100 - message: - Merged Bug #17675622 cset 5632 from mysql-5.6 +This is a first release, this file is supposed to be empty diff --git a/mysql-wsrep-5.6/Docs/INFO_SRC b/mysql-wsrep-5.6/Docs/INFO_SRC index 422ae193..fbc1a6c3 100644 --- a/mysql-wsrep-5.6/Docs/INFO_SRC +++ b/mysql-wsrep-5.6/Docs/INFO_SRC @@ -1,7 +1,7 @@ -revision-id: anirudh.mangipudi@oracle.com-20140109144358-97kc3jwcfpa3a43n -date: 2014-01-09 20:13:58 +0530 -build-date: 2014-01-09 15:46:48 +0100 -revno: 5732 -branch-nick: mysql-5.6.16-release +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.16 +MySQL source 5.6.23 diff --git a/mysql-wsrep-5.6/Docs/INSTALL-BINARY b/mysql-wsrep-5.6/Docs/INSTALL-BINARY index 234c255d..864415f7 100644 --- a/mysql-wsrep-5.6/Docs/INSTALL-BINARY +++ b/mysql-wsrep-5.6/Docs/INSTALL-BINARY @@ -1,60 +1,76 @@ - -2.2. Installing MySQL on Unix/Linux Using Generic Binaries +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 + 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.17), and OS indicates the type of operating system - for which the distribution is intended (for example, pc-linux-i686 - or winx64). + 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. + 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/. + 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 - 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. - - 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 + 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 @@ -67,14 +83,15 @@ 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." + 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: + 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 @@ -90,53 +107,54 @@ 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." + 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. + 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." + 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. + 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). + 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. + 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 @@ -144,614 +162,1020 @@ shell> cd /usr/local 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: + 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. + 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: + 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." + 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." + 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 - Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights - reserved. Legal Notices + 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: -2.3. Installing MySQL on Microsoft Windows + * 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. + 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. + 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 E.10.6, "Windows Platform Limitations." + 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 Section 22.1, - "MySQL Connector/ODBC." But note that 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 Section 22.2, - "MySQL Connector/Net." But note that MySQL Installer will - install and configure Connector/NET for you. + 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 following. Generally speaking, you should use MySQL - Installer. It 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." + 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." + 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." + 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." + 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." + 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. + 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 + 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 + %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 + 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." + 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 +2.3.2 Choosing An Installation Package - For MySQL 5.6, there are installation package formats to choose - from when installing MySQL on Windows: + 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.17.0.msi or - mysql-installer-commercial-5.6.17.0.msi, and utilizes MSI's 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 for - Microsoft Windows, 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) - . + 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.17-win32.zip or mysql-5.6.17-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. - - 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 is an application that simplifies the installation - and updating process for a wide range of MySQL products, including - MySQL Notifier for Microsoft Windows, MySQL Workbench, and MySQL - for Excel. From this central application, you can see which MySQL - products are already installed, configure them, and update or - remove them if necessary. The installer can also install plugins, - documentation, tutorials, and example databases. The MySQL - Installer is only available for Microsoft Windows, and includes - both a GUI and command-line interface. + 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 MySQL - Server). The file is over 160MB, and have names of 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. + * 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 file is about 2MB, and have names of 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. + * 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. + 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 + * 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. It also - integrates with your MOS account, so enter in your MOS - credentials to automatically receive updates for your - commercial MySQL products. + 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 release notes detailing the changes in each release of MySQL + 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. And while the 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 versions 5.1, 5.5, and 5.6. It can also - manage either commercial or community editions of the MySQL - Server. + 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 commercial or community edition. + 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 setup of the - applications. For example: + MySQL Installer handles the initial configuration and set up + of the applications. For example: - 1. It will create MySQL Server connections in MySQL Workbench. + 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. + 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 imports example databases. + 3. It can optionally import example databases. - 4. It creates 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. - This feature is only available during the initial installation - of the MySQL Server, and not during future updates. User - accounts may also be added with MySQL Workbench. + 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. + 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 automatically. + MySQL Installer can optionally check for updated components + and download them for you. -2.3.3.1. MySQL Installer GUI +2.3.3.1 MySQL Installer GUI - After installation of the GUI version, the installer will have add - its own Start Menu item under MySQL. + 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. + 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. - After the installer itself has been installed and started, the - following screen is displayed: + The initial execution of MySQL Installer requires you to + accept the license agreement before installing MySQL + products. - Figure 2.7. MySQL Installer - Welcome Screen - MySQL Installer - Welcome Screen + Figure 2.7 MySQL Installer - License Agreement + MySQL Installer - License Agreement - There are three main options: +Installing New Packages - 1. Install MySQL Products - The Installation Wizard. + 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. - 2. About MySQL - Learn about MySQL products and features. + * Developer: Install all products needed to develop + applications with MySQL. This is the default option. - 3. Resources - Information to help install and configure MySQL. + * Server only: Only install the MySQL server. - To Install MySQL Products after executing MySQL Installer for the - first time, you must accept the license agreement before - proceeding with the installation process. + * Client only: Only install the MySQL client products, + which does not include the MySQL server. - Figure 2.8. MySQL Installer - License Agreement - MySQL Installer - License Agreement + * Full: Install all MySQL products. - If you are connected to the Internet, then the Installer will - search for the latest MySQL components and add them to the - installation bundle. Click Connect to the Internet to complete - this step, or otherwise check the Skip checkbox and then Continue. + * 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.9. MySQL Installer - Find latest products - MySQL Installer - Find latest products + Figure 2.8 MySQL Installer - Choosing a Setup Type + MySQL Installer - Choosing a Setup Type - If you chose "Connect to the Internet," the next page will show - the progress of MySQL Installer's search for available updates. - When the search is complete (or if you opted to skip the search), - you will be taken to the Choose Setup Type page: + 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". - Figure 2.10. MySQL Installer - Choosing a Setup Type - MySQL Installer - Choosing a Setup Type + The next window lists the MySQL products that are scheduled + to be installed: - Determine the option most compatible with your preferences by - reading the Setup Type Description descriptions. + Figure 2.9 MySQL Installer - Installation Progress + MySQL Installer - Installation Progress - The Installation and Data paths are also defined here, and a - caution flag will notify you if the data path you define already - exists. + As components are installed, their Status changes from a + progress percentage to "Complete". - After you select a setup type, the MySQL Installer will check your - system for the necessary external requirements and download then - install missing components onto your system. + 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. - Figure 2.11. MySQL Installer - Check Requirements - MySQL Installer - Check Requirements +Configuring MySQL Server - The next window lists the MySQL products that are scheduled to be - installed: + Configuring the MySQL server begins with defining several + Type and Networking options. - Figure 2.12. MySQL Installer - Installation Progress - MySQL Installer - Installation Progress + Figure 2.10 MySQL Installer - Configuration Overview + MySQL Installer - Configuration Overview - As components are installed, you'll see their status change from - "to be installed" to "install success." + Server Configuration Type - Figure 2.13. MySQL Installer - Installation Progress status - MySQL Installer - Installation Progress status + 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. - After all components are installed, the next step involves - configuring the products. The Configuration Overview window - displays the progress and then loads a configuration window if it - is required. + * 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. - Figure 2.14. MySQL Installer - Configuration Overview - MySQL Installer - Configuration Overview + * 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 - The ideal MySQL Server configuration depends on your intended use, - as explained in the next window. Choose the description that most - closely applies to your machine. - - You may enable TCP/IP Networking here as otherwise only localhost - connections are allowed. - - 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.15. MySQL Installer - MySQL Server Configuration: Define - platform, networking, and logging options - MySQL Installer- MySQL Server Configuration: Define platform, - networking, and logging options - - Next, choose your account information. Defining a root password is - required, whereas it's optional to create additional users. There - are several different predefined user roles that each have - different permission levels. For example, a "DB Admin" will have - more privileges than a "DB Designer.". - - Figure 2.16. MySQL Installer - MySQL Server Configuration: User - accounts - MySQL Installer - MySQL Server Configuration: User accounts +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 the Current Root - Password will also be needed. + 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, how the MySQL Server should be loaded at startup, - and how the Windows Service for MySQL Server will be run. + 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.17. MySQL Installer - MySQL Server Configuration: Windows - service details - MySQL Installer - MySQL Server Configuration: Windows service - details + 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 Windows as a - service. And the Next button will be disabled until this user is - given these user rights. + 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 - 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. + 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. - The final configuration step is available if the Advanced - Configuration option was checked, and it includes configuration - options related to log file names: + Figure 2.16 MySQL Installer - MySQL Server Configuration: + Apply Server Configuration + MySQL Installer - MySQL Server Configuration: Apply Server + Configuration - Figure 2.18. MySQL Installer - MySQL Server Configuration: Logging - options - MySQL Installer - MySQL Server Configuration: Logging options + 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 completed, you - may save the installation log, and then load MySQL Workbench if - the Start MySQL Workbench after Setup option is checked: + After the MySQL Installer configuration process is finished, + MySQL Installer reloads the opening page where you can + execute other installation and configuration related actions. - Figure 2.19. MySQL Installer - Installation Complete - MySQL Installer - Installation Complete + 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: - You can now open MySQL Installer from the Microsoft Windows Start - menu under the MySQL group, which will load the MySQL Installer - Maintenance Screen. This is used to add, update, and remove - features. + Figure 2.17 MySQL Installer - Main Dashboard + MySQL Installer - Main Dashboard - Figure 2.20. MySQL Installer - Maintenance Screen - MySQL Installer - Maintenance Screen +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 - An Update Screen screen is shown if MySQL Installer is used on a - machine with older products installed, as opposed to the - Maintenance Screen shown above. However, the functionality remains - the same. + 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. - Add/Modify Products and Features will list all installed and - available MySQL products. +2.3.3.1.1 MySQL Product Catalog - Figure 2.21. MySQL Installer - Add/Modify Products and Features - MySQL Installer - Add/Modify Products and Features + 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 installation is now complete. MySQL Server should be running, - and most MySQL products installed and available for use. + The MySQL product catalog was added in MySQL Installer 1.4.0. - See also the MySQL Workbench documentation - (http://dev.mysql.com/doc/workbench/en/). + Manual updates -2.3.3.2. MySQL Installer Console + You can update the MySQL product catalog at any time by + clicking Catalog on the Installer dashboard. - 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. + Figure 2.20 MySQL Installer - Open the MySQL Product Catalog + MySQL Installer - Open the MySQL Product Catalog - 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" + From there, click Execute to update the product catalog. - MySQLInstallerConsole supports the following options, which are - specified on the command line: + Automatic updates - * --help, -h, or -? - Displays a help message with usage examples, and then exits. -C:\> MySQLInstallerConsole --help + 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. - * --updates (or -u) - Checks for new products before any further action is taken. - Disabled by default. + The next window configures the Automatic Catalog Update. + Enable or disable this feature, and also set the hour. - * --nowait - Skips the final pause when the program finishes. Otherwise, a - "Press Enter to continue." dialogue is generated. It is used - in conjunction with other options. + Figure 2.21 MySQL Installer - Configure the Catalog Scheduler + MySQL Installer - Configure the Catalog Scheduler - * --catalog=catalog_name (or -c) - Sets the default catalog. Use --list to view a list of - available catalogs. + This option uses the Windows Task Scheduler to schedule a + task named "ManifestUpdate". - * --type=installation_type (or -t) - Sets the installation type. - The possible values for installation_type are: developer, - server, client, full, and custom. + Change History - * --action=action_name - The action being performed. - The possible values are: install, remove, upgrade, list, and - status. + 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. - + install: Installs a product or products, as defined by - --products + Figure 2.22 MySQL Installer - Catalog Change History + MySQL Installer - Catalog Change History - + upgrade: Upgrades a product or products, as defined by - --products. +2.3.3.1.2 Remove MySQL Products - + remove: Removes a product or products, as defined by - --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 - + list: Lists the product manifest, both installed and - available products. + To select all MySQL products, click the [ ] checkbox to the + left of the Product label. - + status: Shows the status after another action is - performed. + Figure 2.23 MySQL Installer - Removing Products: Select + MySQL Installer - Removing Products: Select - * --product=product_name[:feature1],[feature2], [...] (or -p) - Set the feature list of a product. Use --list to view - available products, or pass in --product=* (an asterisk) to - install all available products. + Figure 2.24 MySQL Installer - Removing Products: Executed + MySQL Installer - Removing Products: Executed - * --config=product_name:passwd=root_password[;parameter1=value], - [;parameter2=value], ... - The configuration parameters for the most recently listed - products. +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. - * --user=product_name:name=username,host:hostname,role=rolename, - password=password or - --user=product_name:name=username,host:hostname,role=rolename, - tokens=tokens - Creates a new user. - Requires: name, host, role, and the password or tokens. Tokens - are separated by pipe ("|") characters. - -2.3.4. MySQL Notifier for Microsoft Windows - - The MySQL Notifier for Microsoft Windows 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 for Microsoft Windows also gives - quick access to several MySQL GUI tools (such as MySQL Workbench) - through its context menu. - - The MySQL Notifier for Microsoft Windows is installed by MySQL - Installer, and (by default) will start-up when Microsoft Windows - is started. + 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 for Microsoft Windows product is selected, then proceed - with the installation. See the MySQL Installer manual for - additional details. + (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 release notes detailing the changes in each release of MySQL - Notifier for Microsoft Windows, see the MySQL Notifier Release - Notes (http://dev.mysql.com/doc/relnotes/mysql-notifier/en/). + 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 for Microsoft Windows help and support. + 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. + * 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. + * 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 @@ -759,403 +1183,418 @@ C:\> MySQLInstallerConsole --help 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. + 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 for Microsoft - Windows 1.1.0. + Remote monitoring is available since MySQL Notifier 1.1.0. - The MySQL Notifier for Microsoft Windows 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 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 for Microsoft Windows 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. + 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 for Microsoft Windows. + 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. + 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: + Clicking the system tray icon will reveal several options, as + seen in the screenshots below: - The Service Instance menu is the main MySQL Notifier for Microsoft - Windows window, and enables you to Stop, Start, and Restart the - MySQL Server. + The Service Instance menu is the main MySQL Notifier window, + and enables you to Stop, Start, and Restart the MySQL Server. - Figure 2.22. MySQL Notifier for Microsoft Windows Service Instance - menu - MySQL Notifier for Microsoft Windows Service Instance menu + 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 a Refresh Status option to manually - refresh the status of all monitored services (in both local and - remote computers) and MySQL instances. + 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 for Microsoft Windows. + 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 for - Microsoft Windows 1.1.0. + The Refresh Status feature is available since MySQL Notifier + 1.1.0. - Figure 2.23. MySQL Notifier for Microsoft Windows Actions menu - MySQL Notifier for Microsoft Windows Actions menu + Figure 2.33 MySQL Notifier Actions menu + MySQL Notifier Actions menu - The Actions, Options menu configures MySQL Notifier for Microsoft - Windows and includes options to: + 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 for Microsoft Windows. + * 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. + * 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 for Microsoft Windows, and runs - this check every # weeks. + * 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." + * 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 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. + balloon notification from the taskbar when a monitored + service changes its status. - Figure 2.24. MySQL Notifier for Microsoft Windows Options menu - MySQL Notifier for Microsoft Windows Options menu + 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: + The Actions, Manage Monitored Items menu enables you to + configure the monitored services and MySQL instances. First, + with the Services tab open: - Figure 2.25. MySQL Notifier for Microsoft Windows Manage Services - menu - MySQL Notifier for Microsoft Windows Manage Services menu + Figure 2.35 MySQL Notifier Manage Services menu + MySQL Notifier Manage Services menu The Instances tab is similar: - Figure 2.26. MySQL Notifier for Microsoft Windows Manage Instances - menu - MySQL Notifier for Microsoft Windows Manage Instances menu + 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 for Microsoft Windows to monitor it. Add a new service or + 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.27. MySQL Notifier for Microsoft Windows Adding new - services - MySQL Notifier for Microsoft Windows Adding new services + Figure 2.37 MySQL Notifier Adding new services + MySQL Notifier Adding new services And instances: - Figure 2.28. MySQL Notifier for Microsoft Windows Adding new - instances - MySQL Notifier for Microsoft Windows Adding new instances + Figure 2.38 MySQL Notifier Adding new instances + MySQL Notifier Adding new instances Note - The Instances tab available since MySQL Notifier for Microsoft - Windows 1.1.0. + The Instances tab available since MySQL Notifier 1.1.0. -2.3.4.1. Remote monitoring set up and installation instructions +2.3.4.1 Remote monitoring set up and installation instructions - The MySQL Notifier for Microsoft Windows uses Windows Management - Instrumentation (WMI) to manage and monitor services in remote - computers running Windows XP or later. This guide explains how it + 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 for Microsoft - Windows 1.1.0. + 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 for Microsoft - Windows is using asynchronous notification queries on remote + 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 - for Microsoft Windows so it knows when a service status has - changed on the remote computer. Asynchronous notifications offer - the best performance compared to semi-synchronous notifications or + 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.29. MySQL Notifier for Microsoft Windows Distributed - Component Object Model (DCOM) - MySQL Notifier for Microsoft Windows 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 for Microsoft Windows (Computer A), and multiple + 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 for Microsoft Windows (Computer A) +Computer running MySQL Notifier (Computer A) - 1. Allow for remote administration by either editing the Group - Policy Editor, or using NETSH: + 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. + 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. + 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. + 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). + 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) . + 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): + + 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. + 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). + 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). + 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). + 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]\My -SqlNotifier.exe name=MySqlNotifier +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. + 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. + 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 for Microsoft Windows (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. + 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: + 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. + 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. + 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. + 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. + 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. + 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: + 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. + 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. + 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. + 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). + 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. + + 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. + 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. + 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). + + 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). + + 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). + + 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). + + 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. + (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. + + 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 +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: + 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 @@ -1169,197 +1608,208 @@ Archive This process is described in the sections that follow. -2.3.5.1. Extracting the Install Archive +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. + 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. + 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 Installer 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." + 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.3.3, "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: + 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. + 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. + 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. + 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." + 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: + 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 - Note that Windows path names are specified in option files using - (forward) slashes rather than backslashes. If you do use - backslashes, double them: + 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.3.3, "Using Option Files." + 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. + 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: + 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. + 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 +2.3.5.3 Selecting a MySQL Server Type - The following table shows the available servers for Windows in - MySQL 5.6. + 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 + 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. + 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. + 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. + 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 +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. + 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. + 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 for Microsoft Windows GUI can be - used to start/stop/restart at any time. + 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. + 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. + 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. + 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. + 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): + 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 creat -ed +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 creat -ed +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 creat -ed +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 @@ -1368,159 +1818,170 @@ 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: + something like this, which indicates that the server is ready + to service client connections: mysqld: ready for connections -Version: '5.6.17' socket: '' port: 3306 +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. + 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." + 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 +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. + The MySQL server can be started manually from the command + line. This can be done on any version of Windows. Note - The MySQL Notifier for Microsoft Windows GUI can also be used to - start/stop/restart the MySQL server. + 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: + 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. + 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 +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 - 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 that users - in the MySQL grant system are wholly independent from any login - users under 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 as mysqld - --console; in this case, you may get some useful information on - the screen that may help solve the problem. + 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 23.4.3, "The DBUG Package." + 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. + Use mysqld --verbose --help to display all the options that + mysqld supports. -2.3.5.6. Customizing the PATH for MySQL Tools +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: + 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. + * 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. + * 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. + * 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) + 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. + 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. + 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 for Microsoft Windows GUI can also be used to - monitor the status of the MySQL service. + 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. + 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: + 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. + 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 - 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 that users - in the MySQL grant system are wholly independent from any login - users under Windows. + 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 @@ -1528,187 +1989,196 @@ 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: + 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. + * 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. + * 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. + * 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 that 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. + 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. + 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: + 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. + * 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. + 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 + * 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. + 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 the named file and - ignores the standard option files. + 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. + --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. + 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. + 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. + 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. + 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-m -anual +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 + 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 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." + 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 +2.3.5.8 Testing The MySQL Installation - You can test whether the MySQL server is working by executing any - of the following commands: + 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 -mysql +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 +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. + 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. + 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. - Note that 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." + 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." + "mysqlshow --- Display Database, Table, and Column + Information." -2.3.6. Troubleshooting a Microsoft Windows MySQL Server Installation +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 @@ -1717,99 +2187,114 @@ C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql" test 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." + 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." + 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: + 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: + * 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. + 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:\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: + + 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 - Note that Windows path names are specified in option files - using (forward) slashes rather than backslashes. If you do use - backslashes, double them: + + 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.3.3, "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. + + 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: + * 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. + + 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: + 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/tools/exi - sting/delsrv-o.asp and use the delsrv mysql syntax. + 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 +2.3.7 Upgrading MySQL on Windows - This section lists some of the steps to take when 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 @@ -1823,93 +2308,124 @@ C:\> sc delete mysql 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: + 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: + 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 +shutdown + Note If the MySQL root user account has a password, invoke - mysqladmin with the -p option and supply the password when + 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). + 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 installing 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. - - 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. + 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." + 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 +2.3.8 Windows Postinstallation Procedures - GUI tools exist that perform most of the tasks described below, - including: + GUI tools exist that perform most of the tasks described + below, including: - * MySQL Installer: Used to install and upgrade MySQL products. + * 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: 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 - used the 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. + * 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 @@ -1921,20 +2437,22 @@ C:\> C:\mysql\bin\mysqlshow | 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 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: + 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) +--------------------+ @@ -1945,8 +2463,8 @@ Enter password: (enter root password here) | test | +--------------------+ - If you specify a database name, mysqlshow displays a list of the - tables within the database: + If you specify a database name, mysqlshow displays a list of + the tables within the database: C:\> C:\mysql\bin\mysqlshow mysql Database: mysql +---------------------------+ @@ -1974,8 +2492,8 @@ Database: mysql | user | +---------------------------+ - Use the mysql program to select information from a table in the - mysql database: + 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 | @@ -1984,14 +2502,12 @@ C:\> C:\mysql\bin\mysql -e "SELECT Host,Db,User FROM mysql.db" | % | 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." + 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." - Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights - reserved. Legal Notices + 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/README-wsrep b/mysql-wsrep-5.6/Docs/README-wsrep new file mode 100644 index 00000000..7b1435f4 --- /dev/null +++ b/mysql-wsrep-5.6/Docs/README-wsrep @@ -0,0 +1,487 @@ +Codership Oy +http://www.codership.com +<info@codership.com> + +DISCLAIMER + +THIS SOFTWARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +IN NO EVENT SHALL CODERSHIP OY BE HELD LIABLE TO ANY PARTY FOR ANY DAMAGES +RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE. + +Trademark Information. + +MySQL is a trademark or registered trademark of Oracle and/or its affiliates. +Other trademarks are the property of their respective owners. + +Licensing Information. + +Please see file COPYING that came with this distribution + +Source code can be found at +wsrep API: https://launchpad.net/wsrep +MySQL patch: https://launchpad.net/codership-mysql + + +ABOUT THIS DOCUMENT + +This document covers installation and configuration issues specific to this +wsrep-patched MySQL distribution by Codership. It does not cover the use or +administration of MySQL server per se. The reader is assumed to know how to +install, configure, administer and use standard MySQL server version 5.1.xx. + + + MYSQL-5.5.x/wsrep-23.x + +CONTENTS: +========= +1. WHAT IS WSREP PATCH FOR MYSQL +2. INSTALLATION +3. FIRST TIME SETUP + 3.1 CONFIGURATION FILES + 3.2 DATABASE PRIVILEGES + 3.3 CHECK AND CORRECT FIREWALL SETTINGS + 3.4 SELINUX + 3.5 APPARMOR + 3.6 CONNECT TO CLUSTER +4. UPGRADING FROM MySQL 5.1.x +5. CONFIGURATION OPTIONS + 5.1 MANDATORY MYSQL OPTIONS + 5.2 WSREP OPTIONS +6. ONLINE SCHEMA UPGRADE + 6.1 TOTAL ORDER ISOLATION (TOI) + 6.2 ROLLING SCHEMA UPGRADE (RSU) +7. LIMITATIONS + + +1. WHAT IS WSREP PATCH FOR MYSQL/INNODB + +Wsrep API developed by Codership Oy is a modern generic (database-agnostic) +replication API for transactional databases with a goal to make database +replication/logging subsystem completely modular and pluggable. It is developed +with flexibility and completeness in mind to satisfy broad range of modern +replication scenarios. It is equally suitable for synchronous and asynchronous, +master-slave and multi-master replication. + +wsrep stands for Write Set REPlication. + +Wsrep patch for MySQL/InnoDB allows MySQL server to load and use various wsrep +API implementations ("wsrep providers") with different qualities of service. +Without wsrep provider MySQL-wsrep server will function like a regular +standalone server. + + +2. INSTALLATION + +In the examples below mysql authentication options are omitted for brevity. + +2.1 Download and install mysql-wsrep package. + +Download binary package for your Linux distribution from +https://launchpad.net/codership-mysql/ + +2.1.1 On Debian and Debian-derived distributions. + +Upgrade from mysql-server-5.0 to mysql-wsrep is not supported yet, please +upgrade to mysql-server-5.1 first. + +If you're installing over an existing mysql installation, mysql-server-wsrep +will conflict with mysql-server-5.1 package, so remove it first: + +$ sudo apt-get remove mysql-server-5.1 mysql-server-core-5.1 + +mysql-server-wsrep requires psmisc and mysql-client-5.1.47 (or later). +MySQL 5.1 packages can be found from backports repositories. +For further information about configuring and using Debian or Ubuntu +backports, see: + +* http://backports.debian.org + +* https://help.ubuntu.com/community/UbuntuBackports + +For example, installation of required packages on Debian Lenny: + +$ sudo apt-get install psmisc +$ sudo apt-get -t lenny-backports install mysql-client-5.1 + +Now you should be able to install mysql-wsrep package: + +$ sudo dpkg -i <mysql-server-wsrep DEB> + +2.1.2 On CentOS and similar RPM-based distributions. + +If you're migrating from existing MySQL installation, there are two variants: + + a) If you're already using official MySQL-server-community 5.1.x RPM from + Oracle: + + # rpm -e mysql-server + + b) If you're upgrading from the stock mysql-5.0.77 on CentOS: + + 1) Make sure that the following packages are not installed: + # rpm --nodeps --allmatches -e mysql-server mysql-test mysql-bench + + 2) Install *official* MySQL-shared-compat-5.1.x from + http://dev.mysql.com/downloads/mysql/5.1.html + +Actual installation: + + # rpm -Uvh <MySQL-server-wsrep RPM> + + If this fails due to unsatisfied dependencies, install missing packages + (e.g. yum install perl-DBI) and retry. + +Additional packages to consider (if not yet installed): + * galera (multi-master replication provider, https://launchpad.net/galera) + * MySQL-client-community (for connecting to server and mysqldump-based SST) + * rsync (for rsync-based SST) + * xtrabackup and nc (for xtrabackup-based SST) + +2.2 Upgrade system tables. + +If you're upgrading a previous MySQL installation, it might be advisable to +upgrade system tables. To do that start mysqld and run mysql_upgrade command. +Consult MySQL documentation in case of errors. Normally they are not critical +and can be ignored unless specific functionality is needed. + + +3. FIRST TIME SETUP + +Unless you're upgrading an already installed mysql-wsrep package, you will need +to set up a few things to prepare server for operation. + +3.1 CONFIGURATION FILES + +* Make sure system-wide my.cnf does not bind mysqld to 127.0.0.1. That is, if + you have the following line in [mysqld] section, comment it out: + + #bind-address = 127.0.0.1 + +* Make sure system-wide my.cnf contains "!includedir /etc/mysql/conf.d/" line. + +* Edit /etc/mysql/conf.d/wsrep.cnf and set wsrep_provider option by specifying + a path to provider library. If you don't have a provider, leave it as it is. + +* When a new node joins the cluster it'll have to receive a state snapshot from + one of the peers. This requires a privileged MySQL account with access from + the rest of the cluster. Edit /etc/mysql/conf.d/wsrep.cnf and set mysql + login/password pair for SST, for example: + + wsrep_sst_auth=wsrep_sst:wspass + +* See CONFIGURATION section below about other configuration parameters that you + might want to change at this point. + +3.2 DATABASE PRIVILEGES + +Restart MySQL server and connect to it as root to grant privileges to SST +account (empty users confuse MySQL authentication matching rules, we need to +delete them too): + +$ mysql -e "SET wsrep_on=OFF; DELETE FROM mysql.user WHERE user='';" +$ mysql -e "SET wsrep_on=OFF; GRANT ALL ON *.* TO wsrep_sst@'%' IDENTIFIED BY 'wspass'"; + +3.3 CHECK AND CORRECT FIREWALL SETTINGS. + +MySQL-wsrep server needs to be accessible from other cluster members through +its client listening socket and through wsrep provider socket. See your +distribution and wsrep provider documentation for details. For example on +CentOS you might need to do something along these lines: + +# iptables --insert RH-Firewall-1-INPUT 1 --proto tcp --source <my IP>/24 --destination <my IP>/32 --dport 3306 -j ACCEPT +# iptables --insert RH-Firewall-1-INPUT 1 --proto tcp --source <my IP>/24 --destination <my IP>/32 --dport 4567 -j ACCEPT + +If there is a NAT firewall between the nodes, it must be configured to allow +direct connections between the nodes (e.g. via port forwarding). + +3.4 SELINUX + +If you have SELinux enabled, it may block mysqld from doing required operations. +You'll need to either disable it or configure to allow mysqld to run external +programs and open listen sockets at unprivileged ports (i.e. things that +an unprivileged user can do). See SELinux documentation about it. + +To quickly disable SELinux: +1) run 'setenforce 0' as root. +2) set 'SELINUX=permissive' in /etc/selinux/config + +3.5 APPARMOR + +AppArmor automatically comes with Ubuntu and may also prevent mysqld to from +opening additional ports or run scripts. See AppArmor documentation about its +configuration. To disable AppArmor for mysqld: + +$ cd /etc/apparmor.d/disable/ +$ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld +$ sudo service apparmor restart + + +3.6 CONNECT TO CLUSTER + +Now you're ready to connect to cluster by setting wsrep_cluster_address variable +and monitor status of wsrep provider: + +mysql> SET GLOBAL wsrep_cluster_address='<cluster address string>'; +mysql> SHOW STATUS LIKE 'wsrep%'; + + +4 UPGRADING FROM MySQL 5.1.x + +!!! THESE INSTRUCTIONS ARE PRELIMINARY AND INCOMPLETE !!! + +1) BEFORE UPGRADE (while running 5.1.x): + - comment out 'wsrep_provider' setting from configuration files + (my.cnf and/or wsrep.cnf) + - If performing a rolling upgrade on a running cluster, set + wsrep_sst_method=mysqldump. + You might also need to configure wsrep_sst_receive_address and + wsrep_sst_auth appropriately. mysqldump is the only way to transfer data + from 5.1.x to 5.5.x reliably. + - remove innodb_plugin settings from configuration files. + +2) Perform upgrade as usual: + http://dev.mysql.com/doc/refman/5.5/en/upgrading-from-previous-series.html + Don't forget to run 'mysql_upgrade' command. + +3) AFTER UPGRADING individual node: + - uncomment 'wsrep_provider' line in configuration file. + - restart the server and join the cluster. + +4) AFTER UPGRADING the whole cluster: + - revert to usual wsrep SST settings if not 'mysqldump'. + + +5. CONFIGURATION OPTIONS + +5.1 MANDATORY MYSQL OPTIONS + +binlog_format=ROW + This option is required to use row-level replication as opposed to + statement-level. For performance and consistency considerations don't change + that. As a side effect, binlog, if turned on, can be ROW only. In future this + option won't have special meaning. + +innodb_autoinc_lock_mode=2 + This is a required parameter. Without it INSERTs into tables with + AUTO_INCREMENT column may fail. + autoinc lock modes 0 and 1 can cause unresolved deadlock, and make + system unresponsive. + +innodb_locks_unsafe_for_binlog=1 + This option is required for parallel applying. + +5.2 WSREP OPTIONS + +All options are optional except for wsrep_provider, wsrep_cluster_address, and +wsrep_sst_auth. + +wsrep_provider=none + A full path to the library that implements WSREP interface. If none is + specified, the server behaves like a regular mysqld. + +wsrep_provider_options= + Provider-specific option string. Check wsrep provider documentation or + http://www.codership.com/wiki + +wsrep_cluster_address= + Provider-specific cluster address string. This is used to connect a node to + the desired cluster. This option can be given either on mysqld startup or set + during runtime. See wsrep provider documentation for possible values. + +wsrep_cluster_name="my_wsrep_cluster" + Logical cluster name, must be the same for all nodes of the cluster. + +wsrep_node_address= + An option to explicitly specify the network address of the node in the form + <address>[:port] if autoguessing for some reason does not produce desirable + results (multiple network interfaces, NAT, etc.) + If not explicitly overridden by wsrep_sst_receive_address, the <address> part + will be used to listen for SST (see below). And the whole <address>[:port] + will be passed to wsrep provider to be used as a base address in its + communications. + +wsrep_node_name= + Human readable node name (for easier log reading only). Defaults to hostname. + +wsrep_slave_threads=1 + Number of threads dedicated to processing of writesets from other nodes. + For best performance should be few per CPU core. + +wsrep_dbug_option + Options for the built-in DBUG library (independent from what MySQL uses). + Empty by default. Not currently in use. + +wsrep_debug=0 + Enable debug-level logging. + +wsrep_convert_LOCK_to_trx=0 + Implicitly convert locking sessions into transactions inside mysqld. By + itself it does not mean support for locking sessions, but it prevents the + database from going into logically inconsistent state. Note however, that + loading large database dump with LOCK statements might result in abnormally + large transactions and cause an out-of-memory condition + +wsrep_retry_autocommit=1 + Retry autocommit queries and single statement transactions should they fail + certification test. This is analogous to rescheduling an autocommit query + should it go into deadlock with other transactions in the database lock + manager. + +wsrep_auto_increment_control=1 + Automatically adjust auto_increment_increment and auto_increment_offset + variables based on the number of nodes in the cluster. Significantly reduces + certification conflict rate for INSERTS. + +wsrep_drupal_282555_workaround=1 + MySQL seems to have an obscure bug when INSERT into table with + AUTO_INCREMENT column with NULL value for that column can fail with a + duplicate key error. When this option is on, it retries such INSERTs. + Required for stable Drupal operation. Documented at: + http://bugs.mysql.com/bug.php?id=41984 + http://drupal.org/node/282555 + +wsrep_causal_reads=0 + Enforce strict READ COMMITTED semantics on reads and transactions. May + result in additional latencies. It is a session variable. + +wsrep_OSU_method=TOI + Online Schema Upgrade (OSU) can be performed with two alternative methods: + Total Order Isolation (TOI) runs DDL statement in all cluster nodes in + same total order sequence locking the affected table for the duration of the + operation. This may result in the whole cluster being blocked for the + duration of the operation. + Rolling Schema Upgrade (RSU) executes the DDL statement only locally, thus + blocking only one cluster node. During the DDL processing, the node + is not replicating and may be unable to process replication events (due to + table lock). Once DDL operation is complete, the node will catch up and sync + with the cluster to become fully operational again. The DDL statement or + its effects are not replicated, so it is user's responsibility to manually + perform this operation on each of the nodes. + +wsrep_forced_binlog_format=none + Force every transaction to use given binlog format. When this variable is + set to something else than NONE, all transactions will use the given forced + format, regardless of what the client session has specified in binlog_format. + Valid choices for wsrep_forced_binlog_format are: ROW, STATEMENT, MIXED and + special value NONE, meaning that there is no forced binlog format in effect. + This variable was intruduced to support STATEMENT format replication during + rolling schema upgrade processing. However, in most cases ROW replication + is valid for asymmetrict schema replication. + +State snapshot transfer options. + +When a new node joins the cluster it has to synchronize its initial state with +the other cluster members by transferring state snapshot from one of them. +The options below govern how this happens and should be set up before attempting +to join or start a cluster. + +wsrep_sst_method=rsync + What method to use to copy database state to a newly joined node. Supported + methods: + - mysqldump: slow (except for small datasets) but most tested. + - rsync: much faster on large datasets. + - rsync_wan: same as rsync but with deltaxfer to minimize network traffic. + - xtrabackup: very fast and practically non-blocking SST method based on + Percona's xtrabackup tool. + + (for xtrabackup to work the following settings must be present in my.cnf + on all nodes: + [mysqld] + wsrep_sst_auth=root:<root password> + datadir=<path to data dir> + [client] + socket=<path to socket> + ) + +wsrep_sst_receive_address= + Address (hostname:port) at which this node wants to receive state snapshot. + Defaults to mysqld bind address, and if that is not specified (0.0.0.0) - + to the first IP of eth0 + mysqld bind port. + NOTE: check that your firewall allows connections to this address from other + cluster nodes. + +wsrep_sst_auth= + Authentication information needed for state transfer. Depends on the state + transfer method. For mysqldump-based SST it is + <mysql_root_user>:<mysql_root_password> + and should be the same on all nodes - it is used to authenticate with both + state snapshot receiver and state snapshot donor. + +wsrep_sst_donor= + A name of the node which should serve as state snapshot donor. This allows + to control which node will serve state snapshot request. By default the + most suitable node is chosen by wsrep provider. This is the same as given in + wsrep_node_name. + + +6. ONLINE SCHEMA UPGRADE + + Schema upgrades mean any data definition statements (DDL statemnents) run + for the database. They change the database structure and are non- + transactional. + + Release 22.3 brings a new method for performing schema upgrades. User can + now choose whether to use the traditional total order isolation or new + rolling schema upgrade method. The OSU method choice is done by global + parameter: 'wsrep_OSU_method'. + +6.1 Total Order Isolation (TOI) + + With earlier releases, DDL processing happened always by Total Order + Isolation (TOI) method. With TOI, the DDL was scheduled to be processed in + same transaction seqeuncing 'slot' in each cluster node. + The processing is secured by locking the affected table from any other use. + With TOI method, the whole cluster has part of the database locked for the + duration of the DDL processing. + +6.2 Rolling Schema Upgrade (RSU) + + Rolling schema upgrade is new DDL processing method, where DDL will be + processed locally for the node. The node is disconnected of the replication + for the duration of the DDL processing, so that there is only DDL statement + processing in the node and it does not block the rest of the cluster. When + the DDL processing is complete, the node applies delayed replication events + and synchronizes back with the cluster. + The DDL can then be executed cluster-wide by running the same DDL statement + for each node in turn. When this rolling schema upgrade proceeds, part of + the cluster will have old schema structure and part of the cluster will have + new schema structure. + + +7. LIMITATIONS + +1) Currently replication works only with InnoDB storage engine. Any writes to + tables of other types, including system (mysql.*) tables are not replicated. + However, DDL statements are replicated in statement level, and changes + to mysql.* tables will get replicated that way. + So, you can safely issue: CREATE USER..., + but issuing: INSERT INTO mysql.user..., will not be replicated. + +2) DELETE operation is unsupported on tables without primary key. Also rows in + tables without primary key may appear in different order on different nodes. + As a result SELECT...LIMIT... may return slightly different sets. + +3) Unsupported queries: + * LOCK/UNLOCK TABLES cannot be supported in multi-master setups. + * lock functions (GET_LOCK(), RELEASE_LOCK()... ) + +4) Query log cannot be directed to table. If you enable query logging, + you must forward the log to a file: + log_output = FILE + Use general_log and general_log_file to choose query logging and the + log file name + +5) Maximum allowed transaction size is defined by wsrep_max_ws_rows and + wsrep_max_ws_size. Anything bigger (e.g. huge LOAD DATA) will be rejected. + +6) Due to cluster level optimistic concurrency control, transaction issuing + COMMIT may still be aborted at that stage. There can be two transactions. + writing to same rows and committing in separate cluster nodes, and only one + of the them can successfully commit. The failing one will be aborted. + For cluster level aborts, MySQL/galera cluster gives back deadlock error. + code (Error: 1213 SQLSTATE: 40001 (ER_LOCK_DEADLOCK)). + +7) XA transactions can not be supported due to possible rollback on commit. + diff --git a/mysql-wsrep-5.6/INSTALL-SOURCE b/mysql-wsrep-5.6/INSTALL-SOURCE index f21ca02f..ac578609 100644 --- a/mysql-wsrep-5.6/INSTALL-SOURCE +++ b/mysql-wsrep-5.6/INSTALL-SOURCE @@ -1,377 +1,217 @@ +Chapter 2 Installing and Upgrading MySQL -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. - 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. - If you are interested in migrating to MySQL from another database - system, you may wish to read Section B.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: + 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: + 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, "Choosing Which MySQL Distribution to Install." + 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." + 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." + 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." + 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." + 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: - + Solaris and OpenSolaris, including PKG and IPS formats, - see Section 2.6, "Installing MySQL on Solaris and - OpenSolaris." + + Linux, including notes on distribution specific + methods, see Section 2.5, "Installing MySQL on + Linux." - + IBM AIX, see Section 2.6, "Installing MySQL on Solaris - and OpenSolaris." + + Solaris and OpenSolaris, including PKG and IPS + formats, see Section 2.7, "Installing MySQL on + Solaris and OpenSolaris." - + Hewlett-Packard HP-UX, including the DEPOT package - format, see Section 2.7, "Installing MySQL on HP-UX." + + IBM AIX, see Section 2.7, "Installing MySQL on + Solaris and OpenSolaris." - + FreeBSD, see Section 2.8, "Installing MySQL on FreeBSD." + + 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." - - * Mac OS X - For installation on Mac OS X, including using both the binary - package and native PKG formats, see Section 2.4, "Installing - MySQL on Mac OS X." - For information on making use of the MySQL Startup Item to - automatically start and stop MySQL, see Section 2.4.3, + 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.4, "Installing and Using the MySQL Preference Pane." + 2.4.5, "Installing and Using the MySQL Preference Pane." -2.1. General Installation Guidance +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 - - This section lists the operating systems on which MySQL Community - Server is known to run. - Important - - Oracle Corporation does not necessarily provide official support - for all the platforms listed in this section. For information - about those platforms that are officially supported, see - http://www.mysql.com/support/supportedplatforms/database.html on - the MySQL Web site. - - We use CMake, so it is possible to port MySQL to all modern - systems that have a C++ compiler and a working implementation of - POSIX threads. (Thread support is needed for the server. To - compile only the client code, the only requirement is a C++ - compiler.) - - MySQL has been reported to compile successfully on the following - systems: - - * FreeBSD 5.x and up. See Section 2.8, "Installing MySQL on - FreeBSD." - - * HP-UX 11.x. See Section 2.7, "Installing MySQL on HP-UX." - - * Linux. Builds on all recent Linux distributions based on the - 2.6 kernel. See Section 2.5, "Installing MySQL on Linux." - - * Mac OS X. See Section 2.4, "Installing MySQL on Mac OS X." - - * Solaris 2.8 on SPARC and x86. See Section 2.6, "Installing - MySQL on Solaris and OpenSolaris." - - * Microsoft Windows. See Section 2.3, "Installing MySQL on - Microsoft Windows." - - MySQL has also been known to run on other systems in the past. See - Section 2.1, "General Installation Guidance." Some porting effort - might be required for current versions of MySQL on these systems. - - Not all platforms are equally well-suited for running MySQL. How - well a certain platform is suited for a high-load mission-critical - MySQL server is determined by the following factors: - - * General stability of the thread library. A platform may have - an excellent reputation otherwise, but MySQL is only as stable - as the thread library it calls, even if everything else is - perfect. - - * The capability of the kernel and the thread library to take - advantage of symmetric multi-processor (SMP) systems. In other - words, when a process creates a thread, it should be possible - for that thread to run on a CPU different from the original - process. - - * The capability of the kernel and the thread library to run - many threads that acquire and release a mutex over a short - critical region frequently without excessive context switches. - If the implementation of pthread_mutex_lock() is too anxious - to yield CPU time, this hurts MySQL tremendously. If this - issue is not taken care of, adding extra CPUs actually makes - MySQL slower. + 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: - * General file system stability and performance. - - * Table size. If your tables are large, performance is affected - by the ability of the file system to deal with large files and - dealing with them efficiently. - - * Our level of expertise here at Oracle Corporation with the - platform. If we know a platform well, we enable - platform-specific optimizations and fixes at compile time. We - can also provide advice on configuring your system optimally - for MySQL. - - * The amount of testing we have done internally for similar - configurations. - - * The number of users that have run MySQL successfully on the - platform in similar configurations. If this number is high, - the likelihood of encountering platform-specific surprises is - much smaller. - -2.1.2. Choosing Which MySQL Distribution to Install - - When preparing to install MySQL, you should decide which version - to use. MySQL development occurs in several release series, and - you can pick the one that best fits your needs. After deciding - which version to install, you can choose a distribution format. - Releases are available in binary or source format. - -2.1.2.1. Choosing Which Version of MySQL to Install - - The first decision to make is whether you want to use a production - (stable) release or a development release. In the MySQL - development process, multiple release series co-exist, each at a - different stage of maturity. - -Production Releases - - - * MySQL 5.6: Latest General Availability (Production) release - - * MySQL 5.5: Previous General Availability (Production) release - - * MySQL 5.1: Older General Availability (Production) release - - * MySQL 5.0: Older Production release nearing the end of the - product lifecycle - - MySQL 4.1, 4.0, and 3.23 are old releases that are no longer - supported. - - See http://www.mysql.com/about/legal/lifecycle/ for information - about support policies and schedules. - - Normally, if you are beginning to use MySQL for the first time or - trying to port it to some system for which there is no binary - distribution, use the most recent General Availability series - listed in the preceding descriptions. All MySQL releases, even - those from development series, are checked with the MySQL - benchmarks and an extensive test suite before being issued. - - If you are running an older system and want to upgrade, but do not - want to take the chance of having a nonseamless upgrade, you - should upgrade to the latest version in the same release series - you are using (where only the last part of the version number is - newer than yours). We have tried to fix only fatal bugs and make - only small, relatively "safe" changes to that version. - - If you want to use new features not present in the production - release series, you can use a version from a development series. - Be aware that development releases are not as stable as production - releases. - - We do not use a complete code freeze because this prevents us from - making bugfixes and other fixes that must be done. We may add - small things that should not affect anything that currently works - in a production release. Naturally, relevant bugfixes from an - earlier series propagate to later series. - - If you want to use the very latest sources containing all current - patches and bugfixes, you can use one of our source code - repositories (see Section 2.9.3, "Installing MySQL Using a - Development Source Tree"). These are not "releases" as such, but - are available as previews of the code on which future releases are - to be based. - - 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 also include a suffix to 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: - - * 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. + * 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. - - * 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. - - All releases of MySQL are run through our standard tests and - benchmarks to ensure that they are relatively safe to use. Because - the standard tests are extended over time to check for all - previously found bugs, the test suite keeps getting better. - - All releases have been tested at least with these tools: - - * An internal test suite. The mysql-test directory contains an - extensive set of test cases. We run these tests for every - server binary. See Section 23.1.2, "The MySQL Test Suite," for - more information about this test suite. - - * The MySQL benchmark suite. This suite runs a range of common - queries. It is also a test to determine whether the latest - batch of optimizations actually made the code faster. See - Section 8.12.2, "The MySQL Benchmark Suite." - - We also perform additional integration and nonfunctional testing - of the latest MySQL version in our internal production - environment. Integration testing is done with different - connectors, storage engines, replication modes, backup, - partitioning, stored programs, and so forth in various - combinations. Additional nonfunctional testing is done in areas of - performance, concurrency, stress, high volume, upgrade and - downgrade. - -2.1.2.2. Choosing a Distribution Format - - After choosing which version of MySQL to install, you should - decide whether to use a binary distribution or a source - distribution. In most cases, you should probably use a binary - distribution, if one exists for your platform. Binary - distributions are available in native format for many platforms, - such as RPM packages for Linux, DMG packages for Mac OS X, and PKG - packages for Solaris. Distributions are also available in more - generic formats such as Zip archives or compressed tar files. - - Reasons to choose a binary distribution include the following: - - * Binary distributions generally are easier to install than - source distributions. - - * To satisfy different user requirements, we provide several - servers in binary distributions. mysqld is an optimized server - that is a smaller, faster binary. mysqld-debug is compiled - with debugging support. - Each of these servers is compiled from the same source - distribution, though with different configuration options. All - native MySQL clients can connect to servers from either MySQL - version. - - Under some circumstances, you may be better off installing MySQL - from a source distribution: + 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 @@ -379,109 +219,84 @@ Production Releases 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: + 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_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 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 Bazaar + * 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, - because the source code is always the ultimate manual. + 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.2.3. How and When Updates Are Released - - MySQL is evolving quite rapidly and we want to share new - developments with other MySQL users. We try to produce a new - release whenever we have new and useful features that others also - seem to have a need for. - - We also try to help users who request features that are easy to - implement. We take note of what our licensed users want, and we - especially take note of what our support customers want and try to - help them in this regard. - - No one is required to download a new release. The Release Notes - (http://dev.mysql.com/doc/relnotes/mysql/5.6/en/) help you - determine whether the new release has something you really want. - - We use the following policy when updating MySQL: - - * Enterprise Server releases are meant to appear every 18 - months, supplemented by quarterly service packs and monthly - rapid updates. Community Server releases are meant to appear 2 - to 3 times per year. - - * Releases are issued within each series. For each release, the - last number in the version is one more than the previous - release within the same series. - - * Binary distributions for some platforms are made by us for - major releases. Other people may make binary distributions for - other systems, but probably less frequently. - - * We make fixes available as soon as we have identified and - corrected small or noncritical but annoying bugs. The fixes - are available in source form immediately from our public - Bazaar repositories, and are included in the next release. - - * If by any chance a security vulnerability or critical bug is - found in a release, our policy is to fix it in a new release - as soon as possible. (We would like other companies to do - this, too!) - -2.1.3. How to Get MySQL +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. + 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/). See Section - 2.5.1, "Installing MySQL on Linux Using the MySQL Yum Repository" - for details. + 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 +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: + 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 + * Cryptographic signatures using GnuPG, the GNU Privacy + Guard * For RPM packages, the built-in RPM integrity verification mechanism @@ -489,72 +304,74 @@ Production Releases 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. + 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.17-linux-i686.tar.gz -aaab65abbec64d5e907dcd41b8699945 mysql-standard-5.6.17-linux-i686.ta -r.gz -shell> md5.exe mysql-installer-community-5.6.17.msi -aaab65abbec64d5e907dcd41b8699945 mysql-installer-community-5.6.17.ms -i +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. + 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. + 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 +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. + 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: + 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: PGP Universal 2.9.1 (Build 347) +Version: GnuPG v1.4.9 (SunOS) mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3 RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ @@ -565,34 +382,95 @@ K2HtkrPbP72vwsEKMYhhr0eKCbtLGfls9krjJ6sBgACyP/Vb7hiPwxh6rDZ7ITnE kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q2TXlTUUwgUmVs -ZWFzZSBFbmdpbmVlcmluZyA8bXlzcWwtYnVpbGRAb3NzLm9yYWNsZS5jb20+iGYE -ExECACYCGyMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAUCTnc+KgUJE/sCFQAKCRCM -cY07UHLh9SbMAJ4l1+qBz2BZNSGCZwwA6YbhGPC7FwCgp8z5TzIw4YQuL5NGJ/sy -0oSazqmJASIEEAECAAwFAk53QS4FAwASdQAACgkQlxC4m8pXrXwJ8Qf/be/UO9mq -foc2sMyhwMpN4/fdBWwfLkA12FXQDOQMvwH9HsmEjnfUgYKXschZRi+DuHXe1P7l -8G2aQLubhBsQf9ejKvRFTzuWMQkdIq+6Koulxv6ofkCcv3d1xtO2W7nb5yxcpVBP -rRfGFGebJvZa58DymCNgyGtAU6AOz4veavNmI2+GIDQsY66+tYDvZ+CxwzdYu+HD -V9HmrJfc6deM0mnBn7SRjqzxJPgoTQhihTav6q/R5/2p5NvQ/H84OgS6GjosfGc2 -duUDzCP/kheMRKfzuyKCOHQPtJuIj8++gfpHtEU7IDUX1So3c9n0PdpeBvclsDbp -RnCNxQWU4mBot7kCDQQ+PqMdEAgA7+GJfxbMdY4wslPnjH9rF4N2qfWsEN/lxaZo -JYc3a6M02WCnHl6ahT2/tBK2w1QI4YFteR47gCvtgb6O1JHffOo2HfLmRDRiRjd1 -DTCHqeyX7CHhcghj/dNRlW2Z0l5QFEcmV9U0Vhp3aFfWC4Ujfs3LU+hkAWzE7zaD -5cH9J7yv/6xuZVw411x0h4UqsTcWMu0iM1BzELqX1DY7LwoPEb/O9Rkbf4fmLe11 -EzIaCa4PqARXQZc4dhSinMt6K3X4BrRsKTfozBu74F47D8Ilbf5vSYHbuE5p/1oI -Dznkg/p8kW+3FxuWrycciqFTcNz215yyX39LXFnlLzKUb/F5GwADBQf+Lwqqa8CG -rRfsOAJxim63CHfty5mUc5rUSnTslGYEIOCR1BeQauyPZbPDsDD9MZ1ZaSafanFv -wFG6Llx9xkU7tzq+vKLoWkm4u5xf3vn55VjnSd1aQ9eQnUcXiL4cnBGoTbOWI39E -cyzgslzBdC++MPjcQTcA7p6JUVsP6oAB3FQWg54tuUo0Ec8bsM8b3Ev42LmuQT5N -dKHGwHsXTPtl0klk4bQk4OajHsiy1BMahpT27jWjJlMiJc+IWJ0mghkKHt926s/y -mfdf5HkdQ1cyvsz5tryVI3Fx78XeSYfQvuuwqp2H139pXGEkg0n6KdUOetdZWhe7 -0YGNPw1yjWJT1IhUBBgRAgAMBQJOdz3tBQkT+wG4ABIHZUdQRwABAQkQjHGNO1By -4fUUmwCbBYr2+bBEn/L2BOcnw9Z/QFWuhRMAoKVgCFm5fadQ3Afi+UQlAcOphrnJ -=Eto8 +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: + 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 @@ -600,15 +478,15 @@ 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: + 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>" +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>" +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 @@ -616,214 +494,220 @@ 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: + 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." + 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. + 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 + Table 2.1 MySQL Package and Signature Files for Source files File Type File Name - Distribution file mysql-standard-5.6.17-linux-i686.tar.gz - Signature file mysql-standard-5.6.17-linux-i686.tar.gz.asc + 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: + 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.17-linux-i686.tar.gz.asc -gpg: Signature made Tue 01 Feb 2011 02:38:30 AM CST using DSA key ID -5072E1F5 -gpg: Good signature from "MySQL Release Engineering <mysql-build@oss. -oracle.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.17-linux-i686.tar.gz.asc -gpg: Signature made Wed 23 Jan 2013 02:25:45 AM PST using DSA key ID -5072E1F5 +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. -oracle.com>" +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 th -e owner. -Primary key fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 507 -2 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 +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. + 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: + Download and install Gpg4win, and then load Kleopatra. The + dialog should look similar to: - Figure 2.1. Initial screen after loading Kleopatra + 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. + 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 + 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 + 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 + 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.17.msi - Signature file mysql-installer-community-5.6.17.msi.asc + 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. + 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 + 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. + 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 + 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 + 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. + explains why you probably don't see a green Good signature + result. -2.1.4.4. Signature Checking Using RPM +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: + 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.17-0.glibc23.i386.rpm -MySQL-server-5.6.17-0.glibc23.i386.rpm: md5 gpg OK +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: + (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 http://dev.mysql.com/doc/refman/5.6/en/checking-g -pg-signature.html + 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." + If you need to obtain the MySQL public key, see Section + 2.1.4.2, "Signature Checking Using GnuPG." -2.1.5. Installation Layouts +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. + 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.2, "MySQL Installation Layout for Generic + Unix/Linux Binary Package" - * Section 2.5.3, "MySQL Installation Layout for Linux RPM - Packages" + * Section 2.5.5, "MySQL Installation Layout for Linux RPM + Packages from the MySQL Developer Zone" - * Section 2.4.2, "MySQL Installation Layout on Mac OS X" + * Section 2.4.2, "MySQL Installation Layout on OS X" -2.1.6. Compiler-Specific Build Characteristics +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. + 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 @@ -831,62 +715,79 @@ pg-signature.html * SSL support is not included. -2.2. Installing MySQL on Unix/Linux Using Generic Binaries +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 + 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.17), and OS indicates the type of operating system - for which the distribution is intended (for example, pc-linux-i686 - or winx64). + 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. + 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/. + 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. - - 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. + 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 + 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 @@ -899,14 +800,15 @@ pg-signature.html 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." + 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: + 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 @@ -922,53 +824,54 @@ 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." + 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. + 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." + 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. + 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). + 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. + 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 @@ -976,611 +879,1021 @@ shell> cd /usr/local 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: + 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. + 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: + 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." + 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." + 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. -2.3. Installing MySQL on Microsoft Windows + * 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. + 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. + 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 E.10.6, "Windows Platform Limitations." + 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 Section 22.1, - "MySQL Connector/ODBC." But note that 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 Section 22.2, - "MySQL Connector/Net." But note that MySQL Installer will - install and configure Connector/NET for you. + 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 following. Generally speaking, you should use MySQL - Installer. It 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." + 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." + 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." + 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." + 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." + 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. + 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 + 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 + %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 + 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." + 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 +2.3.2 Choosing An Installation Package - For MySQL 5.6, there are installation package formats to choose - from when installing MySQL on Windows: + 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.17.0.msi or - mysql-installer-commercial-5.6.17.0.msi, and utilizes MSI's 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 for - Microsoft Windows, 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) - . + 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.17-win32.zip or mysql-5.6.17-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. - - 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 is an application that simplifies the installation - and updating process for a wide range of MySQL products, including - MySQL Notifier for Microsoft Windows, MySQL Workbench, and MySQL - for Excel. From this central application, you can see which MySQL - products are already installed, configure them, and update or - remove them if necessary. The installer can also install plugins, - documentation, tutorials, and example databases. The MySQL - Installer is only available for Microsoft Windows, and includes - both a GUI and command-line interface. + 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 MySQL - Server). The file is over 160MB, and have names of 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. + * 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 file is about 2MB, and have names of 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. + * 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. + 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 + * 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. It also - integrates with your MOS account, so enter in your MOS - credentials to automatically receive updates for your - commercial MySQL products. + 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 release notes detailing the changes in each release of MySQL + 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. And while the 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 versions 5.1, 5.5, and 5.6. It can also - manage either commercial or community editions of the MySQL - Server. + 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 commercial or community edition. + 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 setup of the - applications. For example: + MySQL Installer handles the initial configuration and set up + of the applications. For example: - 1. It will create MySQL Server connections in MySQL Workbench. + 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. + 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 imports example databases. + 3. It can optionally import example databases. - 4. It creates 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. - This feature is only available during the initial installation - of the MySQL Server, and not during future updates. User - accounts may also be added with MySQL Workbench. + 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. + 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 automatically. + MySQL Installer can optionally check for updated components + and download them for you. -2.3.3.1. MySQL Installer GUI +2.3.3.1 MySQL Installer GUI - After installation of the GUI version, the installer will have add - its own Start Menu item under MySQL. + 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. + 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. - After the installer itself has been installed and started, the - following screen is displayed: + The initial execution of MySQL Installer requires you to + accept the license agreement before installing MySQL + products. - Figure 2.7. MySQL Installer - Welcome Screen - MySQL Installer - Welcome Screen + Figure 2.7 MySQL Installer - License Agreement + MySQL Installer - License Agreement - There are three main options: +Installing New Packages - 1. Install MySQL Products - The Installation Wizard. + 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. - 2. About MySQL - Learn about MySQL products and features. + * Developer: Install all products needed to develop + applications with MySQL. This is the default option. - 3. Resources - Information to help install and configure MySQL. + * Server only: Only install the MySQL server. - To Install MySQL Products after executing MySQL Installer for the - first time, you must accept the license agreement before - proceeding with the installation process. + * Client only: Only install the MySQL client products, + which does not include the MySQL server. - Figure 2.8. MySQL Installer - License Agreement - MySQL Installer - License Agreement + * 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. - If you are connected to the Internet, then the Installer will - search for the latest MySQL components and add them to the - installation bundle. Click Connect to the Internet to complete - this step, or otherwise check the Skip checkbox and then Continue. + Figure 2.8 MySQL Installer - Choosing a Setup Type + MySQL Installer - Choosing a Setup Type - Figure 2.9. MySQL Installer - Find latest products - MySQL Installer - Find latest products + 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". - If you chose "Connect to the Internet," the next page will show - the progress of MySQL Installer's search for available updates. - When the search is complete (or if you opted to skip the search), - you will be taken to the Choose Setup Type page: + The next window lists the MySQL products that are scheduled + to be installed: - Figure 2.10. MySQL Installer - Choosing a Setup Type - MySQL Installer - Choosing a Setup Type + Figure 2.9 MySQL Installer - Installation Progress + MySQL Installer - Installation Progress - Determine the option most compatible with your preferences by - reading the Setup Type Description descriptions. + As components are installed, their Status changes from a + progress percentage to "Complete". - The Installation and Data paths are also defined here, and a - caution flag will notify you if the data path you define already - exists. + 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. - After you select a setup type, the MySQL Installer will check your - system for the necessary external requirements and download then - install missing components onto your system. +Configuring MySQL Server - Figure 2.11. MySQL Installer - Check Requirements - MySQL Installer - Check Requirements + Configuring the MySQL server begins with defining several + Type and Networking options. - The next window lists the MySQL products that are scheduled to be - installed: + Figure 2.10 MySQL Installer - Configuration Overview + MySQL Installer - Configuration Overview - Figure 2.12. MySQL Installer - Installation Progress - MySQL Installer - Installation Progress + Server Configuration Type - As components are installed, you'll see their status change from - "to be installed" to "install success." + 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. - Figure 2.13. MySQL Installer - Installation Progress status - MySQL Installer - Installation Progress status + * 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. - After all components are installed, the next step involves - configuring the products. The Configuration Overview window - displays the progress and then loads a configuration window if it - is required. + * 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. - Figure 2.14. MySQL Installer - Configuration Overview - MySQL Installer - Configuration Overview + * 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. - The ideal MySQL Server configuration depends on your intended use, - as explained in the next window. Choose the description that most - closely applies to your machine. - - You may enable TCP/IP Networking here as otherwise only localhost - connections are allowed. - - 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.15. MySQL Installer - MySQL Server Configuration: Define - platform, networking, and logging options - MySQL Installer- MySQL Server Configuration: Define platform, - networking, and logging options - - Next, choose your account information. Defining a root password is - required, whereas it's optional to create additional users. There - are several different predefined user roles that each have - different permission levels. For example, a "DB Admin" will have - more privileges than a "DB Designer.". - - Figure 2.16. MySQL Installer - MySQL Server Configuration: User - accounts - MySQL Installer - MySQL Server Configuration: User accounts + 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 the Current Root - Password will also be needed. + 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 - Next, configure the Windows Service Details. This includes the - service name, how the MySQL Server should be loaded at startup, - and how the Windows Service for MySQL Server will be run. + 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 - Figure 2.17. MySQL Installer - MySQL Server Configuration: Windows - service details - MySQL Installer - MySQL Server Configuration: Windows service - details +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 Windows as a - service. And the Next button will be disabled until this user is - given these user rights. + 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 - 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. + 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. - The final configuration step is available if the Advanced - Configuration option was checked, and it includes configuration - options related to log file names: + Figure 2.16 MySQL Installer - MySQL Server Configuration: + Apply Server Configuration + MySQL Installer - MySQL Server Configuration: Apply Server + Configuration - Figure 2.18. MySQL Installer - MySQL Server Configuration: Logging - options - MySQL Installer - MySQL Server Configuration: Logging options + 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 completed, you - may save the installation log, and then load MySQL Workbench if - the Start MySQL Workbench after Setup option is checked: + After the MySQL Installer configuration process is finished, + MySQL Installer reloads the opening page where you can + execute other installation and configuration related actions. - Figure 2.19. MySQL Installer - Installation Complete - MySQL Installer - Installation Complete + 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: - You can now open MySQL Installer from the Microsoft Windows Start - menu under the MySQL group, which will load the MySQL Installer - Maintenance Screen. This is used to add, update, and remove - features. + Figure 2.17 MySQL Installer - Main Dashboard + MySQL Installer - Main Dashboard - Figure 2.20. MySQL Installer - Maintenance Screen - MySQL Installer - Maintenance Screen +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 - An Update Screen screen is shown if MySQL Installer is used on a - machine with older products installed, as opposed to the - Maintenance Screen shown above. However, the functionality remains - the same. + The ability to install Pre-Release versions of MySQL products + was added in MySQL Installer 1.4.0. - Add/Modify Products and Features will list all installed and - available MySQL products. + 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. - Figure 2.21. MySQL Installer - Add/Modify Products and Features - MySQL Installer - Add/Modify Products and Features +2.3.3.1.1 MySQL Product Catalog - The installation is now complete. MySQL Server should be running, - and most MySQL products installed and available for use. + 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 - See also the MySQL Workbench documentation - (http://dev.mysql.com/doc/workbench/en/). + The MySQL product catalog was added in MySQL Installer 1.4.0. -2.3.3.2. MySQL Installer Console + Manual updates - 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. + You can update the MySQL product catalog at any time by + clicking Catalog on the Installer dashboard. - 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" + 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. - MySQLInstallerConsole supports the following options, which are - specified on the command line: + Automatic updates - * --help, -h, or -? - Displays a help message with usage examples, and then exits. -C:\> MySQLInstallerConsole --help + 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. - * --updates (or -u) - Checks for new products before any further action is taken. - Disabled by default. + The next window configures the Automatic Catalog Update. + Enable or disable this feature, and also set the hour. - * --nowait - Skips the final pause when the program finishes. Otherwise, a - "Press Enter to continue." dialogue is generated. It is used - in conjunction with other options. + Figure 2.21 MySQL Installer - Configure the Catalog Scheduler + MySQL Installer - Configure the Catalog Scheduler - * --catalog=catalog_name (or -c) - Sets the default catalog. Use --list to view a list of - available catalogs. + This option uses the Windows Task Scheduler to schedule a + task named "ManifestUpdate". - * --type=installation_type (or -t) - Sets the installation type. - The possible values for installation_type are: developer, - server, client, full, and custom. + Change History - * --action=action_name - The action being performed. - The possible values are: install, remove, upgrade, list, and - status. + 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. - + install: Installs a product or products, as defined by - --products + Figure 2.22 MySQL Installer - Catalog Change History + MySQL Installer - Catalog Change History - + upgrade: Upgrades a product or products, as defined by - --products. +2.3.3.1.2 Remove MySQL Products - + remove: Removes a product or products, as defined by - --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 - + list: Lists the product manifest, both installed and - available products. + To select all MySQL products, click the [ ] checkbox to the + left of the Product label. - + status: Shows the status after another action is - performed. + Figure 2.23 MySQL Installer - Removing Products: Select + MySQL Installer - Removing Products: Select - * --product=product_name[:feature1],[feature2], [...] (or -p) - Set the feature list of a product. Use --list to view - available products, or pass in --product=* (an asterisk) to - install all available products. + Figure 2.24 MySQL Installer - Removing Products: Executed + MySQL Installer - Removing Products: Executed - * --config=product_name:passwd=root_password[;parameter1=value], - [;parameter2=value], ... - The configuration parameters for the most recently listed - products. +2.3.3.1.3 Alter MySQL Products + + MySQL Installer offers several options to alter your MySQL + product installations. - * --user=product_name:name=username,host:hostname,role=rolename, - password=password or - --user=product_name:name=username,host:hostname,role=rolename, - tokens=tokens - Creates a new user. - Requires: name, host, role, and the password or tokens. Tokens - are separated by pipe ("|") characters. - -2.3.4. MySQL Notifier for Microsoft Windows - - The MySQL Notifier for Microsoft Windows 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 for Microsoft Windows also gives - quick access to several MySQL GUI tools (such as MySQL Workbench) - through its context menu. - - The MySQL Notifier for Microsoft Windows is installed by MySQL - Installer, and (by default) will start-up when Microsoft Windows - is started. +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 for Microsoft Windows product is selected, then proceed - with the installation. See the MySQL Installer manual for - additional details. + (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 release notes detailing the changes in each release of MySQL - Notifier for Microsoft Windows, see the MySQL Notifier Release - Notes (http://dev.mysql.com/doc/relnotes/mysql-notifier/en/). + 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 for Microsoft Windows help and support. + 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. + * 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. + * 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 @@ -1588,403 +1901,418 @@ C:\> MySQLInstallerConsole --help 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. + 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 for Microsoft - Windows 1.1.0. + Remote monitoring is available since MySQL Notifier 1.1.0. - The MySQL Notifier for Microsoft Windows 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 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 for Microsoft Windows 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. + 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 for Microsoft Windows. + 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. + 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: + Clicking the system tray icon will reveal several options, as + seen in the screenshots below: - The Service Instance menu is the main MySQL Notifier for Microsoft - Windows window, and enables you to Stop, Start, and Restart the - MySQL Server. + The Service Instance menu is the main MySQL Notifier window, + and enables you to Stop, Start, and Restart the MySQL Server. - Figure 2.22. MySQL Notifier for Microsoft Windows Service Instance - menu - MySQL Notifier for Microsoft Windows Service Instance menu + 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 a Refresh Status option to manually - refresh the status of all monitored services (in both local and - remote computers) and MySQL instances. + 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 for Microsoft Windows. + 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 for - Microsoft Windows 1.1.0. + The Refresh Status feature is available since MySQL Notifier + 1.1.0. - Figure 2.23. MySQL Notifier for Microsoft Windows Actions menu - MySQL Notifier for Microsoft Windows Actions menu + Figure 2.33 MySQL Notifier Actions menu + MySQL Notifier Actions menu - The Actions, Options menu configures MySQL Notifier for Microsoft - Windows and includes options to: + 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 for Microsoft Windows. + * 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. + * 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 for Microsoft Windows, and runs - this check every # weeks. + * 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." + * 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 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. + balloon notification from the taskbar when a monitored + service changes its status. - Figure 2.24. MySQL Notifier for Microsoft Windows Options menu - MySQL Notifier for Microsoft Windows Options menu + 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: + The Actions, Manage Monitored Items menu enables you to + configure the monitored services and MySQL instances. First, + with the Services tab open: - Figure 2.25. MySQL Notifier for Microsoft Windows Manage Services - menu - MySQL Notifier for Microsoft Windows Manage Services menu + Figure 2.35 MySQL Notifier Manage Services menu + MySQL Notifier Manage Services menu The Instances tab is similar: - Figure 2.26. MySQL Notifier for Microsoft Windows Manage Instances - menu - MySQL Notifier for Microsoft Windows Manage Instances menu + 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 for Microsoft Windows to monitor it. Add a new service or + 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.27. MySQL Notifier for Microsoft Windows Adding new - services - MySQL Notifier for Microsoft Windows Adding new services + Figure 2.37 MySQL Notifier Adding new services + MySQL Notifier Adding new services And instances: - Figure 2.28. MySQL Notifier for Microsoft Windows Adding new - instances - MySQL Notifier for Microsoft Windows Adding new instances + Figure 2.38 MySQL Notifier Adding new instances + MySQL Notifier Adding new instances Note - The Instances tab available since MySQL Notifier for Microsoft - Windows 1.1.0. + The Instances tab available since MySQL Notifier 1.1.0. -2.3.4.1. Remote monitoring set up and installation instructions +2.3.4.1 Remote monitoring set up and installation instructions - The MySQL Notifier for Microsoft Windows uses Windows Management - Instrumentation (WMI) to manage and monitor services in remote - computers running Windows XP or later. This guide explains how it + 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 for Microsoft - Windows 1.1.0. + 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 for Microsoft - Windows is using asynchronous notification queries on remote + 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 - for Microsoft Windows so it knows when a service status has - changed on the remote computer. Asynchronous notifications offer - the best performance compared to semi-synchronous notifications or + 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.29. MySQL Notifier for Microsoft Windows Distributed - Component Object Model (DCOM) - MySQL Notifier for Microsoft Windows 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 for Microsoft Windows (Computer A), and multiple + 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 for Microsoft Windows (Computer A) +Computer running MySQL Notifier (Computer A) - 1. Allow for remote administration by either editing the Group - Policy Editor, or using NETSH: + 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. + 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. + 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. + 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). + 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) . + 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): + + 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. + 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). + 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). + 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). + 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]\My -SqlNotifier.exe name=MySqlNotifier +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. + 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. + 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 for Microsoft Windows (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. + 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: + 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. + 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. + 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. + 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. + 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. + 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: + 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. + 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. + 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. + 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). + 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. + + 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. + 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. + 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). + + 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). + + 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). + + 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). + + 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. + (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. + + 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 +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: + 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 @@ -1998,197 +2326,208 @@ Archive This process is described in the sections that follow. -2.3.5.1. Extracting the Install Archive +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. + 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. + 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 Installer 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." + 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.3.3, "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: + 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. + 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. + 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. + 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." + 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: + 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 - Note that Windows path names are specified in option files using - (forward) slashes rather than backslashes. If you do use - backslashes, double them: + 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.3.3, "Using Option Files." + 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. + 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: + 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. + 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 +2.3.5.3 Selecting a MySQL Server Type - The following table shows the available servers for Windows in - MySQL 5.6. + 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 + 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. + 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. + 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. + 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 +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. + 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. + 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 for Microsoft Windows GUI can be - used to start/stop/restart at any time. + 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. + 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. + 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. + 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. + 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): + 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 creat -ed +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 creat -ed +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 creat -ed +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 @@ -2197,159 +2536,170 @@ 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: + something like this, which indicates that the server is ready + to service client connections: mysqld: ready for connections -Version: '5.6.17' socket: '' port: 3306 +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. + 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." + 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 +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. + The MySQL server can be started manually from the command + line. This can be done on any version of Windows. Note - The MySQL Notifier for Microsoft Windows GUI can also be used to - start/stop/restart the MySQL server. + 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: + 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. + 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 +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 - 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 that users - in the MySQL grant system are wholly independent from any login - users under 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 as mysqld - --console; in this case, you may get some useful information on - the screen that may help solve the problem. + 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 23.4.3, "The DBUG Package." + 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. + Use mysqld --verbose --help to display all the options that + mysqld supports. -2.3.5.6. Customizing the PATH for MySQL Tools +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: + 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. + * 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. + * 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. + * 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) + 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. + 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. + 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 for Microsoft Windows GUI can also be used to - monitor the status of the MySQL service. + 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. + 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: + 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. + 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 - 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 that users - in the MySQL grant system are wholly independent from any login - users under Windows. + 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 @@ -2357,187 +2707,196 @@ 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: + 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. + * 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. + * 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. + * 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 that 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. + 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. + 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: + 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. + * 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. + 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 + * 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. + 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 the named file and - ignores the standard option files. + 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. + --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. + 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. + 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. + 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. + 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-m -anual +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 + 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 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." + 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 +2.3.5.8 Testing The MySQL Installation - You can test whether the MySQL server is working by executing any - of the following commands: + 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 -mysql +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 +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. + 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. + 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. - Note that 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." + 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." + "mysqlshow --- Display Database, Table, and Column + Information." -2.3.6. Troubleshooting a Microsoft Windows MySQL Server Installation +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 @@ -2546,99 +2905,114 @@ C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql" test 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." + 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." + 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: + 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: + * 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. + 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:\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: + + 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 - Note that Windows path names are specified in option files - using (forward) slashes rather than backslashes. If you do use - backslashes, double them: + + 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.3.3, "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. + + 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: + * 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. + + 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: + 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/tools/exi - sting/delsrv-o.asp and use the delsrv mysql syntax. + 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 +2.3.7 Upgrading MySQL on Windows - This section lists some of the steps to take when 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 @@ -2652,93 +3026,124 @@ C:\> sc delete mysql 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: + 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: + 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 +shutdown + Note If the MySQL root user account has a password, invoke - mysqladmin with the -p option and supply the password when + 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). + 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 installing 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. - - 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. + 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." + 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 +2.3.8 Windows Postinstallation Procedures - GUI tools exist that perform most of the tasks described below, - including: + GUI tools exist that perform most of the tasks described + below, including: - * MySQL Installer: Used to install and upgrade MySQL products. + * 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 Notifier: Starts, stops, or restarts the MySQL + server, and monitors its status. - * MySQL for Excel: Edits MySQL data with Microsoft Excel. + * 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." + 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 - used the 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. + 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 @@ -2750,20 +3155,22 @@ C:\> C:\mysql\bin\mysqlshow | 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 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: + 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) +--------------------+ @@ -2774,8 +3181,8 @@ Enter password: (enter root password here) | test | +--------------------+ - If you specify a database name, mysqlshow displays a list of the - tables within the database: + If you specify a database name, mysqlshow displays a list of + the tables within the database: C:\> C:\mysql\bin\mysqlshow mysql Database: mysql +---------------------------+ @@ -2803,8 +3210,8 @@ Database: mysql | user | +---------------------------+ - Use the mysql program to select information from a table in the - mysql database: + 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 | @@ -2813,180 +3220,160 @@ C:\> C:\mysql\bin\mysql -e "SELECT Host,Db,User FROM mysql.db" | % | 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." + 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." + 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 Mac OS X - - MySQL for Mac OS X is available in a number of different forms: - - * Native Package Installer format, which uses the native Mac OS - X installer to walk you through the installation of MySQL. For - more information, see Section 2.4.2, "Installing MySQL on Mac - OS X Using Native Packages." You can use the package installer - with Mac OS X 10.3 and later, and the package is available for - both PowerPC and Intel architectures, and 32-bit and 64-bit - architectures. There is no Universal Binary available using - the package installation method. 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."You can use the package installer with - Mac OS X 10.3 and later, and available for both PowerPC and - Intel architectures, and both 32-bit and 64-bit architectures. - A Universal Binary, incorporating both Power PC and Intel - architectures and 32-bit and 64-bit binaries is available. - In addition to the core installation, the Package Installer - also includes Section 2.4.3, "Installing the MySQL Startup - Item" and Section 2.4.4, "Installing and Using the MySQL - Preference Pane," both of which simplify the management of - your installation. - - * Mac OS X server includes a version of MySQL as standard. If - you want to use a more recent version than that supplied with - the Mac OS X server release, you can make use of the package - or tar formats. For more information on using the MySQL - bundled with Mac OS X, see Section 2.4.5, "Using the Bundled - MySQL on Mac OS X Server." - - For additional information on using MySQL on Mac OS X, see Section - 2.4.1, "General Notes on Installing MySQL on Mac OS X." - -2.4.1. General Notes on Installing MySQL on Mac OS X +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: - * The default location for the MySQL Unix socket is different on - Mac OS X and Mac OS X Server depending on the installation - type you chose. The following table shows the default - locations by installation type. - Table 2.5. MySQL Unix Socket Locations on Mac OS X by - Installation Type - - Installation Type Socket Location - Package Installer from MySQL /tmp/mysql.sock - Tarball from MySQL /tmp/mysql.sock - MySQL Bundled with Mac OS X Server /var/mysql/mysql.sock - To prevent issues, you should either change the configuration - of the socket used within your application (for example, - changing php.ini), or you should configure the socket location - using a MySQL configuration file and the socket option. For - more information, see Section 5.1.3, "Server Command Options." - - * You may need (or want) to create a specific mysql user to own - the MySQL directory and data. On Mac OS X 10.4 and lower you - can do this by using the Netinfo Manager application, located - within the Utilities folder within the Applications folder. On - Mac OS X 10.5 and later you can do this through the Directory - Utility. From Mac OS X 10.5 and later (including Mac OS X - Server 10.5) the mysql 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. - - * Due to a bug in the Mac OS X package installer, you may see - this error message in the destination disk selection dialog: -You cannot install this software on this disk. (null) - If this error occurs, click the Go Back button once to return - to the previous screen. Then click Continue to advance to the - destination disk selection again, and you should be able to - choose the destination disk correctly. We have reported this - bug to Apple and it is investigating this problem. + * 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): + 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: + + 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: + + 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. + 3. Start the server from System Preferences or + Terminal.app. - * 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: + * 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 + + 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. -2.4.2. Installing MySQL on Mac OS X Using Native Packages + * Prior to OS X 10.7, MySQL server was bundled with OS X + Server. - You can install MySQL on Mac OS X 10.3.x ("Panther") or newer - using a Mac OS X binary package in DMG format instead of the - binary tarball distribution. Please note that older versions of - Mac OS X (for example, 10.1.x or 10.2.x) are not supported by this - package. +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. + 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 Mac OS X Server) or mysqladmin shutdown on the - command line. + 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 should 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.4, "Installing - and Using the MySQL Preference Pane." + 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.1.39-osx10.5-x86_64.pkg installs MySQL into - /usr/local/mysql-5.1.39-osx10.5-x86_64 . The following table shows - the layout of the installation directory. + 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.6. MySQL Installation Layout on Mac OS X + 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 Manual in Info format + docs Helper documents, like the Release Notes and build + information include Include (header) files lib Libraries man Unix manual pages @@ -3003,384 +3390,492 @@ alias mysqladmin /usr/local/mysql/bin/mysqladmin 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, the MySQLStartupItem.pkg installation - package, and the MySQL.prefPane. Double-click the disk image - to open it. - - 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 5.1.39, double-click - mysql-5.1.39-osx10.5-x86.pkg. - - 3. You will be presented with the opening installer dialog. Click - Continue to begin installation. - MySQL Package Installer: Step 1 - - 4. A copy of the installation instructions and other important - information relevant to this installation are displayed. Click - Continue . - - 5. If you have downloaded the community version of MySQL, you - will be shown a copy of the relevant GNU General Public - License. Click Continue . - - 6. Select the drive you want to use to install the MySQL Startup - Item. The drive must have a valid, bootable, Mac OS X - operating system installed. Click Continue. - MySQL Package Installer: Step 4 - - 7. You will be asked to confirm the details of the installation, - including the space required for the installation. To change - the drive on which the startup item is installed, click either - Go Back or Change Install Location.... To install the startup - item, click Install. - - 8. Once the installation has been completed successfully, you - will be shown an Install Succeeded message. - - For convenience, you may also want to install the startup item and - preference pane. See Section 2.4.3, "Installing the MySQL Startup - Item," and Section 2.4.4, "Installing and Using the MySQL - Preference Pane." + 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 -2.4.3. Installing the MySQL Startup Item + 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 - The MySQL Installation Package includes a startup item that can be - used to automatically start and stop MySQL. + 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, the MySQLStartupItem.pkg installation - package, and the MySQL.prefPane. Double-click the disk image - to open it. - - 2. Double-click the MySQLStartItem.pkg file to start the - installation process. - - 3. You will be presented with the Install MySQL Startup Item - dialog. - MySQL Startup Item Installer: Step 1 - Click Continue to continue the installation process. + 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. A copy of the installation instructions and other important - information relevant to this installation are displayed. Click - Continue . + 4. Complete the MySQL server installation process. - 5. Select the drive you want to use to install the MySQL Startup - Item. The drive must have a valid, bootable, Mac OS X - operating system installed. Click Continue. - MySQL Startup Item Installer: Step 3 + 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 - 6. You will be asked to confirm the details of the installation. - To change the drive on which the startup item is installed, - click either Go Back or Change Install Location.... To install - the startup item, click Install. + Deselecting Automatically Start MySQL Server on Startup from + the MySQL Preference Pane sets the MYSQLCOM variable to -NO-. - 7. Once the installation has been completed successfully, you - will be shown an Install Succeeded message. - MySQL Startup Item Installer: Step 5 + 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. - 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-. - - After the installation, you can start and stop MySQL 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: + 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: + If you have installed the Startup Item, use this command to + stop the server: shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop -2.4.4. Installing and Using the MySQL Preference Pane +2.4.5 Installing and Using the MySQL Preference Pane - The MySQL Package installer disk image also includes a custom - MySQL Preference Pane that enables you to start, stop, and control - automated startup during boot of your MySQL installation. + 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 package, which - is provided on a disk image (.dmg) that includes the main - MySQL installation package, the MySQLStartupItem.pkg - installation package, and the MySQL.prefPane. Double-click the - disk image to open it. - - 2. Double-click the MySQL.prefPane. The MySQL System Preferences - will open. - - 3. If this is the first time you have installed the preference - pane, you will be asked to confirm installation and whether - you want to install the preference pane for all users, or only - the current user. To install the preference pane for all users - you will need administrator privileges. If necessary, you will - be prompted for the username and password for a user with - administrator privileges. + 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. If you already have the MySQL Preference Pane installed, you - will be asked to confirm whether you want to overwrite the - existing MySQL Preference Pane. + 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 Other section of the preference panes list. - MySQL Preference Pane - - 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 MySQL 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 MySQL 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. + 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. + 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.4.5. Using the Bundled MySQL on Mac OS X Server - - If you are running Mac OS X Server, a version of MySQL should - already be installed. The following table shows the versions of - MySQL that ship with Mac OS X Server versions. +2.5 Installing MySQL on Linux - Table 2.7. MySQL Versions Preinstalled with Mac OS X Server - Mac OS X Server Version MySQL Version - 10.2-10.2.2 3.23.51 - 10.2.3-10.2.6 3.23.53 - 10.3 4.0.14 - 10.3.2 4.0.16 - 10.4.0 4.1.10a - 10.5.0 5.0.45 - 10.6.0 5.0.82 - - The following table shows the installation layout of MySQL on Mac - OS X Server. - - Table 2.8. MySQL Directory Layout for Preinstalled MySQL - Installations on Mac OS X Server - Directory Contents of Directory - /usr/bin Client programs - /var/mysql Log files, databases - /usr/libexec The mysqld server - /usr/share/man Unix manual pages - /usr/share/mysql/mysql-test MySQL test suite - /usr/share/mysql Miscellaneous support files, including error - messages, character set files, sample configuration files, SQL for - database installation - /var/mysql/mysql.sock Location of the MySQL Unix socket - -Additional Resources - - - * For more information on managing the bundled MySQL instance in - Mac OS X Server 10.5, see Mac OS X Server: Web Technologies - Administration For Version 10.5 Leopard - (http://images.apple.com/server/macosx/docs/Web_Technologies_A - dmin_v10.5.pdf). + 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: - * For more information on managing the bundled MySQL instance in - Mac OS X Server 10.6, see Mac OS X Server: Web Technologies - Administration Version 10.6 Snow Leopard - (http://manuals.info.apple.com/en_US/WebTech_v10.6.pdf). + * 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." - * The MySQL server bundled with Mac OS X Server does not include - the MySQL client libraries and header files required to access - and use MySQL from a third-party driver, such as Perl DBI or - PHP. For more information on obtaining and installing MySQL - libraries, see Mac OS X Server version 10.5: MySQL libraries - available for download (http://support.apple.com/kb/TA25017). - Alternatively, you can ignore the bundled MySQL server and - install MySQL from the package or tarball installation. + * 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." -2.5. Installing MySQL on Linux + * 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." - 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 using a precompiled RPM package. For more + information, see Section 2.5.5, "Installing MySQL on + Linux Using RPM Packages." - * 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 a precompiled Debian package. For more + information, see Section 2.5.6, "Installing MySQL on + Linux Using Debian Packages from Oracle." - * Extracting and compiling MySQL from a source distribution. For - detailed instructions, see Section 2.9, "Installing MySQL from - Source." + * 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 with Yum using the MySQL Yum repository - (http://dev.mysql.com/downloads/repo/). For detailed - instructions, see Section 2.5.1, "Installing MySQL on Linux - Using the MySQL Yum Repository." + * Installing using Oracle's Unbreakable Linux Network + (ULN). For more information, see Section 2.6, "Installing + MySQL Using Unbreakable Linux Network (ULN)." - * Installing using a precompiled RPM package. For more - information, see Section 2.5.3, "Installing MySQL on Linux - Using RPM Packages." + * Extracting and compiling MySQL from a source + distribution. For detailed instructions, see Section 2.9, + "Installing MySQL from Source." - * Installing using a precompiled Debian package. For more - information, see Section 2.5.4, "Installing MySQL on Linux - Using Debian Packages." - - 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 package 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.5, - "Installing MySQL on Linux Using Native Package Managers." + 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." + 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 +2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository - MySQL provides a Yum-style software repository for the following - Linux platforms: + MySQL provides a Yum-style software repository for the + following Linux platforms: - * EL6-based platforms (for example, Red Hat Enterprise Linux 6, - Oracle Linux 6, and CentOS 6) + * EL5, EL6, and EL7-based platforms (for example, the + corresponding versions of Red Hat Enterprise Linux, + Oracle Linux, and CentOS) - * EL5-based platforms (for example, Red Hat Enterprise Linux 5, - Oracle Linux 5, and CentOS 5) - - * Fedora 18, 19, and 20 + * Fedora 20 and 21 Currently, the MySQL Yum repository - (http://dev.mysql.com/downloads/repo/) for the above-mentioned - platforms provides RPM packages for installing the MySQL server, - client, MySQL Workbench, Connector/ODBC, and Connector/Python - (currently not available for EL5-based platforms). - - MySQL does not currently provide software repositories for other - Linux platforms. Refer to Section 2.5, "Installing MySQL on Linux" - for instructions on how to install MySQL on those platforms. - Note - - The MySQL Yum repository service 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). + (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." + 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 the latest GA Version of MySQL +Steps for a Fresh Installation of MySQL - Follow the steps below to install the latest GA version of MySQL - with the MySQL Yum repository: + 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: + 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 - (http://dev.mysql.com/downloads/repo) in the MySQL - Developer Zone. + (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 with the name of the - downloaded RPM file: -shell> sudo yum localinstall platform-and-version-specific.rpm - For an EL6-based system, the command is in the form of: -shell> sudo yum localinstall mysql-community-release-el6-{version-num -ber}.noarch.rpm - For Fedora 18: -shell> sudo yum localinstall mysql-community-release-fc18-{version-nu -mber}.noarch.rpm - For Fedora 19: -shell> sudo yum localinstall mysql-community-release-fc19-{version-nu -mber}.noarch.rpm + 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-nu -mber}.noarch.rpm +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}.noa -rch.rpm - The installation command adds the MySQL Yum repository to - your system's repository list as well as downloading the - GnuPG keys to check the integrity of the software - packages. See Section 2.1.4.2, "Signature Checking Using - GnuPG" for details on GnuPG key checking. +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> sudo yum repolist enabled | grep "mysql*-community*" +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 - 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 from - within 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. Installing MySQL with Yum + 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-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). +shell> sudo yum install mysql-community-server - 3. Starting and Stopping the MySQL 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: @@ -3393,35 +3888,46 @@ mysqld (pid 3066) is running. Stop the MySQL server with the following command: shell> sudo service mysqld stop - 4. Securing the MySQL Installation - Always run the program mysql_secure_installation to secure - your MySQL installation: + 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 - mysql_secure_installation allows you to perform important - operations like setting root password, removing anonymous - users, and so on. The program is safe and easy to use. It is - important to remember the root password you set though. See - Section 4.4.5, "mysql_secure_installation --- Improve MySQL - Installation Security" for details. + 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*' lis -t available - - Install any packages of your choice with the following command, - replacing package-name with name of the package: + 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: @@ -3430,214 +3936,248 @@ shell> sudo yum install mysql-workbench-community To install the shared client libraries: shell> sudo yum install mysql-community-libs -Steps for a Fresh Installation of a Developer Milestone Release (DMR) -of MySQL - - Follow the steps below to install a developer milestone release - (DMR) of MySQL with the MySQL Yum repository: - Warning - - Developer milestone releases (DMRs) are for use at your own risk. - Significant development changes take place in milestone releases - and you may encounter compatibility issues, such as data format - changes that require attention in addition to the usual procedure - of running mysql_upgrade. For example, you may find it necessary - to dump your data with mysqldump before the upgrade and reload it - afterward. - - - 1. Add the MySQL Yum repository by following the instructions - given in Section 2.5.1, "." - - 2. Enable and disable the appropriate sub-repositories. Inside - the MySQL Yum repositories, different release series of the - MySQL Community Server are hosted in different - sub-repositories. Sub-repository for the latest GA series - (currently 5.6) is enabled by default, and sub-repositories - 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 - sub-repositories in the MySQL Yum repository: -shell> sudo yum repolist all | grep "mysql*-community*" - To install the latest release from a specific series other - than GA series, simply disable the sub-repository for the - latest GA series and enable the sub-repository for the - specific series before running the yum install command. This - is how it can be done, if, for example, you want to install - the 5.7 DMR series: -shell> sudo yum-config-manager --disable mysql56-community -shell> sudo yum-config-manager --enable mysql57-community-dmr - You can also enable and disable sub-repositories by editing - manually the /etc/yum.repos.d/mysql-community.repo file. This - is a typical entry for a sub-repository 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 sub-repository you want to configure, - and edit the enabled= line. Make enabled=0 to disable a - sub-repository, or enabled=1 to enable a sub-repository. - You can verify that the enabling and disabling of - sub-repositories have been done correctly by run the following - command and check its output: -shell> sudo yum repolist enabled | grep "mysql*-community*" - Note - You can only enable sub-repository for one release series at a - time. When sub-repositories for more than one release series - are enabled, the latest series will be used by Yum. - Then, install the MySQL server from the chosen series by the - command: -shell> sudo yum install mysql-server - - 3. Follow the instructions given in Section 2.5.1, "" and Section - 2.5.1, "." - 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. + 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 +2.5.2 Replacing a Third-Party Distribution of MySQL Using the MySQL Yum Repository - Different distributions of MySQL are distributed by different - parties through their own software repositories or download sites. - You can replace a third-party distribution of MySQL using the - MySQL Yum repository in a few steps. + 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. Stopping Yum from Receiving MySQL Packages from Third-Party, - Non-Native Repositories - Before you can use the MySQL Yum repository for installing (or - updating) MySQL, you must stop your system from receiving - MySQL packages from any third-party, non-native Yum - repositories. - One way to check whether Yum is now receiving third-party - MySQL distributions from other repositories is to use the - following command: -shell> yum list installed mysql\* - This is a sample output for the command: -mysql.i686 5.1.69-1.el6_4 @updates -mysql-libs.i686 5.1.69-1.el6_4 @updates -mysql-server.i686 5.1.69-1.el6_4 @updates - The output shows the names of the packages of the third-party - MySQL distribution that are installed and, on the right-hand - side, the repository (which is named updates, a native - repository for the Linux distribution) from which they were - installed. - However, sometimes the names of the packages of the - third-party distribution might not contain the string "mysql" - in it. It might be useful to search also with this command: -shell> yum --disablerepo=\* provides mysql\* - The following is a sample output of the command: -MariaDB-compat-10.0.4-1.i686 ... -... -Repo : installed -Matched from: -Other : mysql-libs + 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. -MariaDB-server-10.0.4-1.i686 ... -... -Repo : installed -Matched from: -Other : mysql-server - From the result we can see the names of some of the packages - for the installed third-party distribution of MySQL - (MariaDB-server and MariaDB-compat). To try to get an - exhaustive list of packages installed for this third-party - distribution of MySQL, it might be helpful to search for - installed packages of similar names with, for example, the - following command: +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 MariaDB-compat.i686 10.0.4-1 - @mariadb + @mariadb MariaDB-server.i686 10.0.4-1 - @mariadb - From the command output, we can identify all the installed - packages (MariaDB-common, MariaDB-compat, and MariaDB-server) - and the third-party Yum repository from which they were - installed (named mariadb). - The next step is to stop Yum from receiving packages from the - third-party Yum repository: + @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 - For platforms like Fedora 18, 19, and 20 that install MySQL - from the native repositories, this step is usually not - required, unless you have explicitly added a third-party Yum - repository for MySQL packages. - - 3. Adding the MySQL Yum Repository - Once the third-party Yum repository has been disabled, add the - MySQL Yum repository to your system's repository list by - following the instructions given in Section 2.5.1, "." - - 4. Uninstalling the Third-Party MySQL Distribution and Installing - MySQL with the MySQL Yum Repository - The installed third-party MySQL distribution must first be - uninstalled before you can use the MySQL Yum repository to - install MySQL, or the installation process will give an error. - Assuming that, as in the example above, the third-part MySQL - packages you have found are named MariaDB-common, - MariaDB-compat, and MariaDB-server, uninstall them with the - following command: + 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 - Note - If your third-party MySQL distribution was not installed by - Yum or by an RPM installer, you will not be able to detect and - then uninstall it by Yum. If you are not sure what to do in - that case, consult a system administrator or the original - third-party distributor. - Then, install MySQL from the MySQL Yum repository with the - following command: -shell> sudo yum install mysql-server - The MySQL server and other components required to run the - server, including the client, the shared client libraries, and - the common error messages and character sets for client and - server, are now installed from the MySQL Yum repository. To - install more components for MySQL, see Section 2.5.1, "." - Follow the postinstallation procedures exdocbuild-run-cmd - push-docs-to-web-staging.sh downloadsplained in Section 2.10, - "Postinstallation Setup and Testing." - -2.5.3. Installing MySQL on Linux Using RPM Packages + 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 - To install or upgrade to MySQL 5.6.11, be sure to read the special - instructions at the end of this section. + 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 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 methods for doing so: for EL5 or EL6-based - platforms and Fedora 18, 19, or 20, this can be done using the - MySQL Yum repository (see Section 2.5.1, "Installing MySQL on - Linux Using the MySQL Yum Repository" for details); for other - platforms, we provide various RPM packages that work for different - platforms, and this section explains how these packages work. - - For non-RPM Linux distributions, you can install MySQL using a - .tar.gz package. See Section 2.2, "Installing MySQL on Unix/Linux - Using Generic Binaries." + The MySQL SLES repository provides RPM packages for + installing and managing the MySQL server, client, and other + components on SUSE Enterprise Linux Server. - Installations created from our Linux RPM distributions result in - files under the system directories shown in the following table. + 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 - Table 2.9. MySQL Installation Layout for Linux RPM Packages + 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 @@ -3647,354 +4187,485 @@ shell> sudo yum install mysql-server /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 + 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. + 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. + 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. + 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 remove the 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.) - - RPMs for MySQL Cluster. Standard MySQL server RPMs built by MySQL - do not provide support for the NDBCLUSTER storage engine. + 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 - When upgrading a MySQL Cluster RPM installation, you must upgrade - all installed RPMs, including the Server and Client RPMs. + 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." - For more information about installing MySQL Cluster from RPMs, see - Section 17.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 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. + 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. - The RPM packages shown in the following list are available. The - names shown here use a suffix of .glibc23.i386.rpm, but particular - packages can have different suffixes, described later. + 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. - * MySQL-server-VERSION.glibc23.i386.rpm + 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.glibc23.i386.rpm - The standard MySQL client programs. You probably always want - to install this package. + * MySQL-client-VERSION.linux_glibc2.5.i386.rpm + The standard MySQL client programs. You probably always + want to install this package. - * MySQL-devel-VERSION.glibc23.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-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.glibc23.i386.rpm + * 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.glibc23.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.glibc23.i386.rpm + (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.glibc23.i386.rpm + * 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). + 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: + 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. + 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.3. The + 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. + independent or intended for a specific platform, as shown in + the following table. - Table 2.10. MySQL Linux Installation Packages + Table 2.7 MySQL Linux Installation Packages PLATFORM Value Intended Use - glibc23 Platform independent, should run on any Linux distribution - that supports glibc 2.3 - rhel4, rhel5 Red Hat Enterprise Linux 4 or 5 - el6 Enterprise Linux 6 - sles10, sles11 SuSE Linux Enterprise Server 10 or 11 + 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 glibc23 packages are available currently. + 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. + The CPU value indicates the processor type or family for + which the package is built. - Table 2.11. MySQL Installation Packages for Linux CPU Identifiers + 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.glibc23.i386.rpm - - To perform a standard minimal installation, install the server and - client RPMs: -shell> rpm -i MySQL-server-VERSION.glibc23.i386.rpm -shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm - - To install only the client programs, install just the client RPM: -shell> rpm -i MySQL-client-VERSION.glibc23.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. + 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. + 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." + 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." + 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. + 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: + 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. + * 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, it is possible to - install using yum: -shell> yum install MySQL-server-NEWVERSION.glibc23.i386.rpm + 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, the upgrade is performed by removing - the old installation and installing the new one. To do this, use - the following procedure: + 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.glibc23.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.glibc23.i386.rpm - - Alternatively, the removal and installation can be done using yum: -shell> yum remove MySQL-server-OLDVERSION.glibc23.i386.rpm -shell> yum install MySQL-server-NEWVERSION.glibc23.i386.rpm - -2.5.4. Installing MySQL on Linux Using Debian Packages +shell> rpm -e MySQL-server-OLDVERSION.linux_glibc2.5.i386.rpm - Oracle provides Debian packages for installation on Debian or - Debian-like Linux systems. To obtain a package, see Section 2.1.3, - "How to Get MySQL." - Note + Repeat this step for all installed MySQL RPMs. - Debian 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. - - Debian package files have names in 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.12. MySQL Installation Packages for Linux CPU Identifiers - CPU Value Intended Processor Type or Family - i686 Pentium processor or better, 32 bit - x86_64 64-bit x86 processor - - After downloading a Debian package, use the following command to - install it; + 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 in the /opt/mysql/server-5.6 - directory. - - You may also need to install the libaio library if it is not - already present on your system: -shell> apt-get install libaio1 + The Debian package installs files under the + /opt/mysql/server-5.6 directory. -2.5.5. Installing MySQL on Linux Using Native Package Managers + Note - Many Linux distributions include a version of the MySQL server, - client tools, and development components in their standard package - management system. This section provides basic instructions for - installing MySQL using those package management systems. + 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 package 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." + 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 and EL6-based Linux platforms and Fedora 18, 19, and - 20, you can install MySQL using the MySQL Yum 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: + 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 @@ -4003,34 +4674,34 @@ Resolving Dependencies ---> 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 +--> 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 -===================================================================== -=========== + Size +====================================================================== +========== Installing: mysql x86_64 5.1.48-2.fc13 updates - 889 k + 889 k mysql-libs x86_64 5.1.48-2.fc13 updates - 1.2 M + 1.2 M mysql-server x86_64 5.1.48-2.fc13 updates - 8.1 M + 8.1 M Installing for dependencies: perl-DBD-MySQL x86_64 4.017-1.fc13 updates - 136 k + 136 k Transaction Summary -===================================================================== -=========== +====================================================================== +========== Install 4 Package(s) Upgrade 0 Package(s) @@ -4042,33 +4713,33 @@ 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 +00:04 (2/4): mysql-libs-5.1.48-2.fc13.x86_64.rpm | 1.2 MB - 00:06 +00:06 (3/4): mysql-server-5.1.48-2.fc13.x86_64.rpm | 8.1 MB - 00:40 +00:40 (4/4): perl-DBD-MySQL-4.017-1.fc13.x86_64.rpm | 136 kB - 00:00 ---------------------------------------------------------------------- ------------ +00:00 +---------------------------------------------------------------------- +---------- Total 201 kB/s | 10 MB - 00:52 +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 + 1/4 Installing : mysql-5.1.48-2.fc13.x86_64 - 2/4 + 2/4 Installing : perl-DBD-MySQL-4.017-1.fc13.x86_64 - 3/4 + 3/4 Installing : mysql-server-5.1.48-2.fc13.x86_64 - 4/4 + 4/4 Installed: - mysql.x86_64 0:5.1.48-2.fc13 mysql-libs.x86_64 0:5.1.48- -2.fc13 + 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: @@ -4076,73 +4747,84 @@ Dependency Installed: 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: + + 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: + + 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. + + 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 - On Debian and related distributions, there are two packages, + 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. + 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): + 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: +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-pe -rl mailx + libmysqlclient15off libmysqlclient16 libnet-daemon-perl libplrpc-per +l mailx mysql-common postfix Suggested packages: - dbishell libipc-sharedcache-perl tinyca procmail postfix-mysql post -fix-pgsql + 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-pe -rl mailx + 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 libmysqlclien -t15off 5.1.30really5.0.75-0ubuntu10.5 [1843kB] +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 installe -d.) +(Reading database ... 121260 files and directories currently installed +.) ... Processing 1 added doc-base file(s)... Registering documents with scrollkeeper... @@ -4162,48 +4844,50 @@ Setting up mysql-server-5.1 (5.1.31-1ubuntu2) ... ...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 46 -409 +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 table -s. + * 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: + 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. + + 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: + 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 @@ -4213,322 +4897,294 @@ 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: + + 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: + 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: + + 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: + + 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 on Solaris and OpenSolaris +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.6.1, "Installing MySQL on Solaris Using - a Solaris PKG." + * 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.6.2, "Installing - MySQL on OpenSolaris Using IPS." + 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. + 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. + 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: + 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: + * 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: + * 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. + 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.6.1. Installing MySQL on Solaris Using a Solaris PKG +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. + 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.17-solaris10-x86_64.pkg.gz + 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.17-solaris10-x86_64.pkg + 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.17 + (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: + 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 + 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: + 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.17-solaris10-x86_64.pkg +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.6.2. Installing MySQL on OpenSolaris Using IPS +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: + 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. + 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: + 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: + 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 - + 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_64bi -t=1 + 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.7. Installing MySQL on HP-UX - - MySQL for HP-UX is available in a number of different forms: - - * Using a DEPOT distribution provided at - http://dev.mysql.com/downloads/. Please read the general notes - on HP-UX installation before continuing. For more information - on DEPOT installations, see Section 2.7.2, "Installing MySQL - on HP-UX Using DEPOT Packages." - - * Using a binary tarball distribution provided at - http://dev.mysql.com/downloads/. Please read the general notes - on HP-UX installation before continuing. For more information - on binary installations, see Section 2.2, "Installing MySQL on - Unix/Linux Using Generic Binaries." - -2.7.1. General Notes on Installing MySQL on HP-UX - - Some additional notes on installing and using MySQL on HP-UX: - - * If you install MySQL using a binary tarball distribution on - HP-UX, you may run into trouble even before you get the MySQL - distribution unpacked, as the HP-UX 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. - - * Because of some critical bugs in the standard HP-UX libraries, - you should install the following patches before trying to run - MySQL on HP-UX 11.0: -PHKL_22840 Streams cumulative -PHNE_22397 ARPA cumulative - This solves the problem of getting EWOULDBLOCK from recv() and - EBADF from accept() in threaded applications. - -2.7.2. Installing MySQL on HP-UX Using DEPOT Packages - - The HP-UX DEPOT format packages can be installed using the - swinstall command. You should install the ncurses and zlib - libraries before installing the MySQL DEPOT package. You can use - the free software depothelper tool to install these packages and - any dependencies for you automatically. - - To install using the MySQL DEPOT packages, follow this guide: - - 1. Download the MySQL DEPOT package from - http://dev.mysql.com/downloads/. You must uncompress the - package before installation: -root-shell> gunzip mysql-5.1.48-hpux11.31-ia64-64bit.depot.gz - - 2. Install the DEPOT package using swinstall: -root-shell> swinstall -s mysql-5.1.49-hpux11.31-ia64-64bit.depot - MySQL will be installed into a directory matching the depot - package name, within /usr/local. For convenience, you may want - to create a symbolic link to the installed directory, for - example: -root-shell> ln -s mysql-5.1.49-hpux11.31-ia64-64bit mysql - - 3. Your package is now installed. You should complete the - configuration of MySQL by creating a user and group: -root-shell> /usr/sbin/groupadd mysql -root-shell> /usr/sbin/useradd -g mysql -d /var/lib/mysql/ -s /bin/fal -se mysql - - 4. Create the standard database using the new user/group you have - created, and set the permissions: -root-shell> cd /usr/local/ -root-shell> scripts/mysql_install_db --user=mysql -root-shell> chown -R root . -root-shell> chown -R mysql data - - 5. Finally, secure your new installation by setting the root - passwords, and then start your MySQL server using the mysql - user: -root-shell> mysql_secure_installation -root-shell> mysqld_safe --user=mysql & - -2.8. Installing MySQL on FreeBSD +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." + 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: + 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. + * A working MySQL with all optimizations enabled that are + known to work on your version of FreeBSD. * Automatic configuration and build. @@ -4537,12 +5193,12 @@ root-shell> mysqld_safe --user=mysql & * 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 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. + 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 @@ -4553,12 +5209,13 @@ root-shell> mysqld_safe --user=mysql & ... 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. + /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: + * To remove MySQL after installation using the ports + system: # cd /usr/ports/databases/mysql51-server # make deinstall ... @@ -4566,192 +5223,216 @@ root-shell> mysqld_safe --user=mysql & # 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 + * 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 Section - 2.1.1, "Operating Systems Supported by MySQL Community Server." + 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." + 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.17. 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. Development trees have not - necessarily received the same level of testing as standard - release distributions, so this installation method is usually - required only if you need the most recent code changes. For - information on building from one of the development trees, see - Section 2.9.3, "Installing MySQL Using a Development Source - Tree." + * 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. + 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: + 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. + * 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 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 10 - or later, Visual Studio 2008 or later, and many current - vendor-supplied compilers are known to work. + * 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: - - * To obtain the source tree, you must have Bazaar installed. The - Bazaar VCS Web site (http://bazaar-vcs.org) has 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 Mac - OS X host. - - * bison is needed to generate sql_yacc.cc from sql_yacc.yy You - should use the latest version of bison where possible. - Versions 1.75 and 2.1 are known to work. There have been - reported problems with bison 1.875. If you experience - problems, upgrade to a later, rather than earlier, version. - 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 + 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.4, "Setting Environment Variables." + 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 + 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." - 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.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 +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." + 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." + 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." + 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). + 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. + 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.3, "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: + 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 @@ -4773,51 +5454,55 @@ 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." + 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. + 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. + 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. + 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. + 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: + * 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. + + * 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. @@ -4828,36 +5513,40 @@ Configure the Distribution distribution: shell> cd mysql-VERSION - Configure the source directory. The minimum configuration command - includes no options to override configuration defaults: + 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 9 2008" -shell> cmake . -G "Visual Studio 9 2008 Win64" + 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 Mac OS X, to use the Xcode IDE: + 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: + 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 + * -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. + * -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. + * -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. + * -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." + 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: @@ -4866,24 +5555,26 @@ 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 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. + * 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. + * 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: + being used, run these commands on Unix before re-running + CMake: shell> make clean shell> rm CMakeCache.txt @@ -4893,14 +5584,14 @@ 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. + 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." + 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 @@ -4911,31 +5602,49 @@ 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. + 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 - build at the same level like this: -shell> mkdir build -shell> cd build + 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 - 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. + 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 @@ -4943,191 +5652,332 @@ Install the Distribution 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. + 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: + 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: + 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. + 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_databa -se +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." + 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." + 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." + 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. -2.9.3. Installing MySQL Using a Development Source Tree - - This section discusses how to install MySQL from the latest - development source code. Development trees have not necessarily - received the same level of testing as standard release - distributions, so this installation method is usually required - only if you need the most recent code changes. Do not use a - development tree for production systems. If your goal is simply to - get MySQL up and running on your system, you should use a standard - release distribution (either a binary or source distribution). See - Section 2.1.3, "How to Get MySQL." - - MySQL development projects are hosted on Launchpad - (http://launchpad.net/). MySQL projects, including MySQL Server, - MySQL Workbench, and others are available from 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. - - To install MySQL from a development source tree, your system must - satisfy the tool requirements listed at Section 2.9, "Installing - MySQL from Source," including the requirements for Bazaar and - bison. - - To create a local branch of the MySQL development tree on your - machine, use this procedure: - - 1. To obtain a copy of the MySQL source code, you must create a - new Bazaar branch. If you do not already have a Bazaar +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: + 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. - - 3. The initial download will take some time to complete, - depending on the speed of your connection. Please be patient. - Once you have downloaded the first tree, additional trees - should take significantly less time to download. - - 4. 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: + + 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 - 5. 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: + + 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: + + 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." If you - think you have a better idea on how to do something, send an - email message to the list with a patch. - - After you have the local branch, you can build MySQL server from - the source code. For information, see 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 23.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: + 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." + 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. + 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.13. MySQL Source-Configuration Option Reference (CMake) + 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_INSTALL_PREFIX Installation base directory /usr/local/mysql - + 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 + 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 - + 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 + 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 + + 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_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 @@ -5138,16 +5988,19 @@ shell> ccmake . 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/Mac OS X project name 3306 5.6.5 + 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 - WITH_ASAN Enable address sanitizer OFF 5.6.15 + 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 @@ -5157,107 +6010,117 @@ shell> ccmake . 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_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_xxx_STORAGE_ENGINE Compile storage engine xxx statically into - server + 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_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_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_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_ZLIB Type of zlib support system - WITHOUT_xxx_STORAGE_ENGINE Exclude storage engine xxx from build + 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. - * General Options + * Section 2.9.4, "" - * Installation Layout Options + * Section 2.9.4, "" - * Feature Options + * Section 2.9.4, "" - * Options for Compiling MySQL Cluster + * Section 2.9.4, "" - * Compiler Flags + * 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. + 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. + 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. + 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. + 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. + 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. + 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. + This value can be set at server startup with the + --basedir option. * -DINSTALL_BINDIR=dir_name Where to install user programs. @@ -5286,10 +6149,11 @@ Installation Layout Options + DEB: DEB package layout (experimental). You can select a predefined layout but modify individual - component installation locations by specifying other options. - For example: + 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. @@ -5300,14 +6164,15 @@ shell> cmake . -DINSTALL_LAYOUT=SVR4 -DMYSQL_DATADIR=/var/mysql/data 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=). + 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. + This value can be set at server startup with the + --plugin_dir option. * -DINSTALL_SBINDIR=dir_name Where to install the mysqld server. @@ -5320,49 +6185,55 @@ shell> cmake . -DINSTALL_LAYOUT=SVR4 -DMYSQL_DATADIR=/var/mysql/data * -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=). + 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. + 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. + 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. + 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. + 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. + 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. + 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_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 @@ -5370,14 +6241,14 @@ Storage Engine Options 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 NDB 7.3 source distributions, it - is enabled by default. See Section 17.2.2.3, "Building MySQL - Cluster from Source on Linux," and Section 17.2.3.2, "Compiling - and Installing MySQL Cluster from Source on Windows," for more - information. + 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: @@ -5386,9 +6257,9 @@ Storage Engine Options -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. + -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 @@ -5397,141 +6268,168 @@ Feature Options 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. + 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. + 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. + 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. + 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 + 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 + 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-synchronization.ht - ml). + (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. + 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" + 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. + 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." + 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). + 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. + 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. + environment. If enabled, this option causes compiler + warnings to become errors. * -DMYSQL_PROJECT_NAME=name - For Windows or Mac OS X, the project name to incorporate into - the project file name. This option was added in MySQL 5.6.5. + 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 on which the server listens for TCP/IP + 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. + 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. + 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 address sanitization, for compilers that - support it. The default is off. This option was added in MySQL - 5.6.15. + 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_COMPILER_OPTIONS=bool - Whether to use the flags from - cmake/build_configurations/compiler_options.cmake. This option - was added in MySQL 5.6.6. + 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. + 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. + 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: @@ -5546,516 +6444,610 @@ Feature Options (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. + 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. + 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. + 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. + * 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 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. + 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.9, - "Using SSL for Secure Connections." + + 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: + 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. + + 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. + Whether to build without the MySQL server. The default is + OFF, which does build the server. Compiler Flags - To specify compiler flags, set the CFLAGS and CXXFLAGS environment - variables before running CMake. Example: -shell> CFLAGS=-DHAVE_EMBEDDED_PRIVILEGE_CONTROL -shell> CXXFLAGS=-DHAVE_EMBEDDED_PRIVILEGE_CONTROL -shell> export CFLAGS CXXFLAGS -shell> cmake [options] - The following flags control configuration features: + * -DCMAKE_C_FLAGS="flags" + Flags for the C Compiler. - * HAVE_EMBEDDED_PRIVILEGE_CONTROL - By default, authentication for connections to the embedded - server is disabled. To enable connection authentication, - define this flag. + * -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. + 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). + 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. + 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. + 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. + 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. Default is empty. In MySQL Cluster NDB 7.2.9 and later, - this option is ignored if -DWITH_NDB_JAVA=OFF is used. + 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. Default - is 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. Default is ON. + 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. Default - is ON. + 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. + 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. + 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. + 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 +2.9.5 Dealing with Problems Compiling MySQL - The solution to many problems involves reconfiguring. If you do - reconfigure, take note of the following: + 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. + * 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. + * 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: + being used, run the following commands before re-running + CMake: + + On Unix: shell> make clean shell> rm CMakeCache.txt - Or, on Windows: + On Windows: shell> devenv MySQL.sln /clean shell> del CMakeCache.txt - If you build out 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). + 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: + 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 flags to be used by your C or C++ compilers, specify - them using the CFLAGS and CXXFLAGS environment variables. You - can also specify the compiler names this way using CC and CXX. - For example: + * To define which C and C++ compilers to use, you can + define the CC and CXX environment variables. For example: shell> CC=gcc -shell> CFLAGS=-O3 shell> CXX=g++ -shell> CXXFLAGS=-O3 -shell> export CC CFLAGS CXX CXXFLAGS +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. - * 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. + * 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: + 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: + * 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 bison (the GNU version of yacc) and - use that instead. + + 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." + 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 +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 5.5.8, the file looks like this: + 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=5 -MYSQL_VERSION_PATCH=8 -MYSQL_VERSION_EXTRA= +MYSQL_VERSION_MINOR=7 +MYSQL_VERSION_PATCH=4 +MYSQL_VERSION_EXTRA=-m14 - If the source is not for a General Availability (GA) release, the - MYSQL_VERSION_EXTRA value will be nonempty. For example, the value - for a Release Candidate release would look like this: -MYSQL_VERSION_EXTRA=rc + 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_P -ATCH + 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 +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." + 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." + * 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." + * 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." + 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." + * 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." + * 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 +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. + 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. + * 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. + * 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 Mac OS X using a DMG distribution, the - installer runs mysql_install_db. + * 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. + 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." + 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." + 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: + 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: + + 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." + 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 - script used to initialize the mysql database containing - the grant tables that store the server access - permissions. + 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. + 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. + + 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. + + 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: + --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 script 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 + + 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: + 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." + + 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). + 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: + 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." + + 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: + 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: + + 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.17, for pc-linux-gnu on i686 +mysqladmin Ver 14.12 Distrib 5.6.23, for pc-linux-gnu on i686 ... -Server version 5.6.17 +Server version 5.6.23 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/lib/mysql/mysql.sock @@ -6064,19 +7056,23 @@ 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. + + 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: + + 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: + information from the server. The output should be similar + to what is shown here: shell> bin/mysqlshow +--------------------+ | Databases | @@ -6120,287 +7116,295 @@ shell> bin/mysql -e "SELECT Host,Db,User FROM db" mysql | % | 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: + + 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: + (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: + 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.4, "Setting Environment Variables." - - You can set up new accounts using the bin/mysql_setpermission - script if you install the DBI and DBD::mysql Perl modules. See - Section 4.6.14, "mysql_setpermission --- Interactively Set - Permissions in Grant Tables." For Perl module installation - instructions, see Section 2.13, "Perl Installation Notes." - - If you would like to use mysqlaccess and have the MySQL - distribution in some nonstandard location, you must change the - location where mysqlaccess expects to find the mysql client. Edit - the bin/mysqlaccess script at approximately line 18. Search for a - line that looks like this: -$MYSQL = '/usr/local/bin/mysql'; # path to mysql executable - - Change the path to reflect the location where mysql actually is - stored on your system. If you do not do this, a Broken pipe error - will occur when you run mysqlaccess. - -2.10.1.1. Problems Running mysql_install_db - - The purpose of the mysql_install_db script 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. + 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: + 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: + 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." + 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). + 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: + 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." + + 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. + 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: + 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: + + 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 C.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 script - 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: + 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 script again. - - * You can start mysqld manually using the --skip-grant-tables - option and add the privilege information yourself using mysql: + + 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 + 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 Mac 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.3, "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.4, "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.6.2, "Installing MySQL on + 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 Mac 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. + 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 + 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. + 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.3, + /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. + 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 + 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. + 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: + 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: + 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: + 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 @@ -6408,25 +7412,26 @@ shell> chkconfig --add mysql 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: + /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. + 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: + 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 @@ -6436,15 +7441,16 @@ 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 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. + The following table shows which option groups the server and + each startup script read from option files. - Table 2.14. MySQL Startup scripts and supported server option + Table 2.12 MySQL Startup scripts and supported server option groups Script Option Groups mysqld [mysqld], [server], [mysqld-major_version] @@ -6452,208 +7458,230 @@ basedir=/usr/local/mysql 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. + [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. + [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.3.3, "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: + 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.2.3, "InnoDB Configuration" for - guidelines and Section 14.2.13, "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. + + * 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. + 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: + 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. + + 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: + 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. + * 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: + 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: + + 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: + + 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.") + + 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: + 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 - 23.4.3, "The DBUG Package." -2.10.2. Securing the Initial MySQL Accounts + * 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. + * 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." + 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: + 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. + * 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: + 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 | @@ -6667,56 +7695,57 @@ mysql> SELECT User, Host, Password FROM mysql.user; +------+--------------------+----------+ 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: + 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. + * 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. + 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 C.5.4.1, "How to Reset the - Root Password." + 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. + 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." + 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: + The root account passwords can be set several ways. The + following discussion demonstrates three methods: * Use the SET PASSWORD statement @@ -6724,10 +7753,10 @@ Assigning root Account Passwords * 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. + 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 @@ -6736,8 +7765,8 @@ 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 %. + 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 @@ -6746,49 +7775,50 @@ 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: + 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. + 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: + 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. + 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. + 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: + 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. + 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. + 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 @@ -6801,17 +7831,17 @@ 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): + 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. + 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 @@ -6829,378 +7859,407 @@ 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: + 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. + 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: + 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 25, "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: + 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." + mysql database that contains the grant tables. See + Section 7.2, "Database Backup Methods." - * Read all the notes in Section 2.11.1.2, "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 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.) + (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 16.1.3.4, "GTID mode and - mysql_upgrade." + 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 16.4.3, "Upgrading a + * 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 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 and EL6-based Linux platforms (for example, Red Hat - Enterprise Linux, Oracle Linux, and CentOS), you can perform an - in-place upgrade of MySQL and its components to the latest GA - releases with the MySQL Yum repository. See Section 2.11.1.1, - "Upgrading MySQL with the MySQL Yum 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. + 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 + 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 + 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 EL5 or EL6-based Linux platforms and Fedora 18, 19, or 20 you - can upgrade MySQL and its components to the latest GA releases - with the MySQL Yum repository. - Note - - Before you perform any upgrade actions, please pay attention to - the following: - - * If your version of MySQL is more than one series older than - the latest GA series (for example, assuming the current GA - release series is 5.6 and you have 5.1.x installed right now), - do NOT use the following instructions to update MySQL, and do - NOT enable the MySQL Yum repository on your system until you - have upgraded MySQL by other means (see Section 2.11.1, - "Upgrading MySQL") to at least the last GA series before the - latest one. - - * 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. - - * If your MySQL installation is a third-party distribution, - follow the instructions in Section 2.5.2, "Replacing a - Third-Party Distribution of MySQL Using the MySQL Yum - Repository" for upgrading the installation. - - The Yum update performs an in-place update for MySQL (that is, - replaces the old version of the software and then runs the new - version off the old version's data files). It updates MySQL to the - latest release in the same release series. Assuming that you - already have the MySQL Yum repository on your system's repository - list (see Section 2.5.1, "" for details), make sure your Yum - repository setup is up-to-date by running: -shell> sudo yum update mysql-community-release - - You can then update MySQL and its components by the following - command: + 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 the MySQL Yum repository setup and - MySQL at the same time by telling Yum to update everything on your - system (this might take considerably more time): + Alternatively, you can update MySQL by telling Yum to + update everything on your system (this might take + considerably more time): shell> sudo yum update - Note that by default, the yum update command will only update - MySQL to the latest version in the same release series, which - means, for example, a 5.6.x installation will NOT be updated to a - 5.7.x release automatically. To update to the next release series, - after updating the MySQL Yum repository setup as described above, - you need to first disable the sub-repository for your original - version and enable the sub-repository for your target version - before you run the yum update command for MySQL. See the - instructions for doing that in Section 2.5.1, "." - 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-previous-se - ries.html). - - The MySQL server always restarts after an update by Yum. Once the - server restarts, you should 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. - - Although we recommend that you update all the MySQL components at - the same time, you can also update only a specific component. You - can use the following command to list all the installed packages - for the MySQL components, which can all be updated with the MySQL - Yum repository: + 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: + choice, update the package with the following command, + replacing package-name with the name of the package: shell> sudo yum update package-name -Upgrading to the Shared Client Libraries +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. + 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 + 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 + 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, - "." + shared libraries using the instructions given in Section + 2.5.1, "." + +2.11.1.2 Upgrading MySQL with the MySQL APT Repository -2.11.1.2. Upgrading from MySQL 5.5 to 5.6 + 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. + 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. + 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. + 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: + 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: + * 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. + + 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. + 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. + 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.) + "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." @@ -7208,47 +8267,49 @@ Upgrading to the Shared Client Libraries * If you run MySQL Server on Windows, see Section 2.3.7, "Upgrading MySQL on Windows." - * If you use replication, see Section 16.4.3, "Upgrading a + * 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 + 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: + 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. + * 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. + 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 @@ -7270,190 +8331,296 @@ Configuration Changes 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: + With regard to compatibility with previous releases, the + most important changes are: - + innodb_file_per_table is enabled (previously disabled). + + innodb_file_per_table is enabled (previously + disabled). - + innodb_checksum_algorithm is CRC32 (previously INNODB). + + 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: + 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. + Those settings preserve compatibility as follows: - + 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. + + 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: + * 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. + + 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: + 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 - ... */. + + 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.6, "." - - * 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 + 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: + 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 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. + 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. + 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. + 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. + 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: + * 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 @@ -7461,401 +8628,439 @@ SQL Changes 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. + 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. + 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: + 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: + 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. + + 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 + + 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: + * 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. + 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. + 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: + 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. + * 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. + * 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. + * 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 +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 features found in MySQL 5.6, but not - in 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. + 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 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. + 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 16.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 + * 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." + 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. + 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. + 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.2.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. + 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. + 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: + 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 + * 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 + * 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." + 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. + 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: + 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." + 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. + 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). + 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. + 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 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. + 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: + 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 @@ -7864,85 +9069,94 @@ shell> mysql db_name < dump.sql shell> mysqldump db_name > dump.sql shell> mysql db_name < dump.sql - To rebuild all tables in all databases, use the --all-databases - option: + 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 a MyISAM - table, use this statement: -mysql> ALTER TABLE t1 ENGINE = MyISAM; - - If you are not sure which storage engine to specify in the ALTER - TABLE statement, use SHOW CREATE TABLE to display the table - definition. + 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." - If you must rebuild a table because a table checking operation - indicates that the table is corrupt or needs an upgrade, you can - use REPAIR TABLE if that statement supports the table's storage - engine. For example, to repair a MyISAM table, use this statement: + 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; - For storage engines such as InnoDB that REPAIR TABLE does not - support, use mysqldump to create a dump file and mysql to reload - the file, as described earlier. - - For specifics about which storage engines REPAIR TABLE supports, - see Section 13.7.2.5, "REPAIR TABLE Syntax." - - 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: + 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. + 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: + 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): + 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 -; +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. + * 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. + After making the appropriate changes, CHECK TABLE should + report no error. -2.11.5. Copying MySQL Databases to Another Machine +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 14.3, "The MyISAM Storage Engine." - - 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. + issues.) See Section 15.2, "The MyISAM Storage Engine." Use mysqldump --help to see what options are available. @@ -7952,28 +9166,28 @@ MODIFY c1 CHAR(N) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci 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: + 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_na -me +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: + 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: + 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. + 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: @@ -7981,50 +9195,49 @@ 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: + 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 databas -e +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. + 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. + 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 +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. + 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. + 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.3.3, "Using Option Files." + 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). - CFLAGS Flags for your C compiler (for running CMake). - CXXFLAGS Flags for 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. + 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.7.7, "The Cleartext + 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_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 @@ -8034,219 +9247,228 @@ shell> mysqlimport db_name DUMPDIR/*.txt # load data into tables $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_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_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_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 - C.5.4.6, "Time Zone Problems." - UMASK The user-file creation mode when creating files. See note - following table. + 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. + 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." + 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." + 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: + 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 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. + * 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. + MySQL assumes that the value for UMASK or UMASK_DIR is in + octal if it starts with a zero. -2.13. Perl Installation Notes +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." + 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. + 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. + 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 +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. + 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 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: + 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. + 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. + 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: + 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: + 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. + 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. + 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://servers.digitaldaze.com/extensions/perl/modules.html#module - s + 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- - Look under the heading "Installing New Modules that Require - Locally Installed Modules." +2.13.2 Installing ActiveState Perl on Windows -2.13.2. Installing ActiveState Perl on Windows - - On Windows, you should do the following to install the MySQL DBD - module with ActiveState Perl: + 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. + 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: + 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. + 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: + 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 +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: + 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. + * 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. + * 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. + * 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. + 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): + 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. + 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. - Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights - reserved. Legal Notices + 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/README b/mysql-wsrep-5.6/README index 0e5a814e..d7ae7e1c 100644 --- a/mysql-wsrep-5.6/README +++ b/mysql-wsrep-5.6/README @@ -5,7 +5,7 @@ For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License. MySQL is brought to you by Oracle. -Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. License information can be found in the COPYING file. diff --git a/mysql-wsrep-5.6/VERSION b/mysql-wsrep-5.6/VERSION index 3d1e30fb..f84d42f3 100644 --- a/mysql-wsrep-5.6/VERSION +++ b/mysql-wsrep-5.6/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=6 -MYSQL_VERSION_PATCH=16 +MYSQL_VERSION_PATCH=23 MYSQL_VERSION_EXTRA= diff --git a/mysql-wsrep-5.6/client/client_priv.h b/mysql-wsrep-5.6/client/client_priv.h index 24678211..bd7f0111 100644 --- a/mysql-wsrep-5.6/client/client_priv.h +++ b/mysql-wsrep-5.6/client/client_priv.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -99,6 +99,7 @@ enum options_client OPT_CONFIG_ALL, OPT_SERVER_PUBLIC_KEY, OPT_ENABLE_CLEARTEXT_PLUGIN, + OPT_CONNECTION_SERVER_ID, OPT_MAX_CLIENT_OPTION }; diff --git a/mysql-wsrep-5.6/client/mysql.cc b/mysql-wsrep-5.6/client/mysql.cc index 7e3456f3..450bda04 100644 --- a/mysql-wsrep-5.6/client/mysql.cc +++ b/mysql-wsrep-5.6/client/mysql.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1315,9 +1315,9 @@ int main(int argc,char *argv[]) put_info("Welcome to the MySQL monitor. Commands end with ; or \\g.", INFO_INFO); - sprintf((char*) glob_buffer.ptr(), - "Your MySQL connection id is %lu\nServer version: %s\n", - mysql_thread_id(&mysql), server_version_string(&mysql)); + snprintf((char*) glob_buffer.ptr(), glob_buffer.alloced_length(), + "Your MySQL connection id is %lu\nServer version: %s\n", + mysql_thread_id(&mysql), server_version_string(&mysql)); put_info((char*) glob_buffer.ptr(),INFO_INFO); put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"), INFO_INFO); @@ -1404,6 +1404,17 @@ int main(int argc,char *argv[]) sig_handler mysql_end(int sig) { +#ifndef _WIN32 + /* + Ingnoring SIGQUIT, SIGINT and SIGHUP signals when cleanup process starts. + This will help in resolving the double free issues, which occures in case + the signal handler function is started in between the clean up function. + */ + signal(SIGQUIT, SIG_IGN); + signal(SIGINT, SIG_IGN); + signal(SIGHUP, SIG_IGN); +#endif + mysql_close(&mysql); #ifdef HAVE_READLINE if (!status.batch && !quick && !opt_html && !opt_xml && diff --git a/mysql-wsrep-5.6/client/mysql_config_editor.cc b/mysql-wsrep-5.6/client/mysql_config_editor.cc index e1b46315..5997e63a 100644 --- a/mysql-wsrep-5.6/client/mysql_config_editor.cc +++ b/mysql-wsrep-5.6/client/mysql_config_editor.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. This 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,8 +49,8 @@ static int g_fd; excluding the header part. */ static size_t file_size; -static char *opt_user= NULL, *opt_password= NULL, *opt_host=NULL, - *opt_login_path= NULL, *opt_socket= NULL, *opt_port= NULL; +static const char *opt_user= NULL, *opt_password= NULL, *opt_host=NULL, + *opt_login_path= "client", *opt_socket= NULL, *opt_port= NULL; static char my_login_file[FN_REFLEN]; static char my_key[LOGIN_KEY_LEN]; @@ -140,11 +140,11 @@ static struct my_option my_set_command_options[]= {"password", 'p', "Prompt for password to be entered into the login file.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"user", 'u', "User name to be entered into the login file.", &opt_user, - &opt_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "Socket path to be entered into login file.", &opt_socket, - &opt_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &opt_socket, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to be entered into login file.", &opt_port, - &opt_port, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &opt_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"warn", 'w', "Warn and ask for confirmation if set command attempts to " "overwrite an existing login path (enabled by default).", &opt_warn, &opt_warn, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, @@ -454,10 +454,6 @@ static int do_handle_options(int argc, char *argv[]) if ( argc_cmd > 1) goto error; - /* If NULL, set it to 'client' (default) */ - if (!opt_login_path) - opt_login_path= my_strdup("client", MYF(MY_WME)); - done: my_free(ptr); DBUG_RETURN(command); @@ -776,7 +772,7 @@ static my_bool check_and_create_login_file(void) { verbose_msg("File exists.\n"); - file_size= stat_info.st_size; + file_size= (size_t) stat_info.st_size; #ifdef _WIN32 if (1) @@ -943,7 +939,7 @@ static void mask_password_and_print(char *buf) static void remove_options(DYNAMIC_STRING *file_buf, const char *path_name) { /* If nope of the options are specified remove the entire path. */ - if (!opt_remove_host && !opt_remove_pass && !opt_remove_user + if (!opt_remove_host && !opt_remove_pass && !opt_remove_user && !opt_remove_socket && !opt_remove_port) { remove_login_path(file_buf, path_name); @@ -1046,7 +1042,7 @@ static void remove_login_path(DYNAMIC_STRING *file_buf, const char *path_name) DBUG_ENTER("remove_login_path"); char *start=NULL, *end= NULL; - int tot_len, len, diff; + int to_move, len, diff; if((start= locate_login_path(file_buf, path_name)) == NULL) /* login path was not found, skip.. */ @@ -1058,7 +1054,7 @@ static void remove_login_path(DYNAMIC_STRING *file_buf, const char *path_name) { end ++; /* Move past '\n' */ len= ((diff= (start - end)) > 0) ? diff : - diff; - tot_len= file_buf->length - len ; + to_move= file_buf->length - (end - file_buf->str); } else { @@ -1067,7 +1063,7 @@ static void remove_login_path(DYNAMIC_STRING *file_buf, const char *path_name) goto done; } - while(tot_len --) + while(to_move --) *(start ++)= *(end ++); *start= '\0'; @@ -1295,7 +1291,7 @@ error: @param plain [in] Plain text to be encrypted. @param plain_len [in] Length of the plain text. - @param cipher [in] Encrypted cipher text. + @param cipher [out] Encrypted cipher text. @return -1 if error encountered, length encrypted, otherwise. @@ -1306,9 +1302,12 @@ static int encrypt_buffer(const char *plain, int plain_len, char cipher[]) DBUG_ENTER("encrypt_buffer"); int aes_len; - aes_len= my_aes_get_size(plain_len); + aes_len= my_aes_get_size(plain_len, my_aes_128_ecb); - if (my_aes_encrypt(plain, plain_len, cipher, my_key, LOGIN_KEY_LEN) == aes_len) + if (my_aes_encrypt((const unsigned char *) plain, plain_len, + (unsigned char *) cipher, + (const unsigned char *) my_key, LOGIN_KEY_LEN, + my_aes_128_ecb, NULL) == aes_len) DBUG_RETURN(aes_len); verbose_msg("Error! Couldn't encrypt the buffer.\n"); @@ -1321,7 +1320,7 @@ static int encrypt_buffer(const char *plain, int plain_len, char cipher[]) @param cipher [in] Cipher text to be decrypted. @param cipher_len [in] Length of the cipher text. - @param plain [in] Decrypted plain text. + @param plain [out] Decrypted plain text. @return -1 if error encountered, length decrypted, otherwise. @@ -1332,8 +1331,11 @@ static int decrypt_buffer(const char *cipher, int cipher_len, char plain[]) DBUG_ENTER("decrypt_buffer"); int aes_length; - if ((aes_length= my_aes_decrypt(cipher, cipher_len, (char *) plain, - my_key, LOGIN_KEY_LEN)) > 0) + if ((aes_length= my_aes_decrypt((const unsigned char *) cipher, cipher_len, + (unsigned char *) plain, + (const unsigned char *) my_key, + LOGIN_KEY_LEN, + my_aes_128_ecb, NULL)) > 0) DBUG_RETURN(aes_length); verbose_msg("Error! Couldn't decrypt the buffer.\n"); diff --git a/mysql-wsrep-5.6/client/mysql_upgrade.c b/mysql-wsrep-5.6/client/mysql_upgrade.c index c72a1303..929d8be6 100644 --- a/mysql-wsrep-5.6/client/mysql_upgrade.c +++ b/mysql-wsrep-5.6/client/mysql_upgrade.c @@ -476,6 +476,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name, */ if (run_tool(tool_executable_name, &ds_tmp, /* Get output from command, discard*/ + "--no-defaults", "--help", "2>&1", IF_WIN("> NUL", "> /dev/null"), diff --git a/mysql-wsrep-5.6/client/mysqladmin.cc b/mysql-wsrep-5.6/client/mysqladmin.cc index b87a884b..4d3f6749 100644 --- a/mysql-wsrep-5.6/client/mysqladmin.cc +++ b/mysql-wsrep-5.6/client/mysqladmin.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ ulonglong last_values[MAX_MYSQL_VAR]; static int interval=0; static my_bool option_force=0,interrupted=0,new_line=0, opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0, - tty_password= 0, opt_nobeep; + tty_password= 0, opt_nobeep, opt_secure_auth= TRUE; static my_bool debug_info_flag= 0, debug_check_flag= 0; static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations; static uint opt_count_iterations= 0, my_end_arg; @@ -75,6 +75,7 @@ extern "C" my_bool get_one_option(int optid, const struct my_option *opt, char *argument); static my_bool sql_connect(MYSQL *mysql, uint wait); static int execute_commands(MYSQL *mysql,int argc, char **argv); +static char **mask_password(int argc, char ***argv); static int drop_db(MYSQL *mysql,const char *db); extern "C" sig_handler endprog(int signal_number); static void nice_time(ulong sec,char *buff); @@ -181,6 +182,9 @@ static struct my_option my_long_options[] = "Currently only works with extended-status.", &opt_relative, &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" + " uses old (pre-4.1.1) protocol.", &opt_secure_auth, + &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name, @@ -311,11 +315,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc,char *argv[]) { - int error= 0, ho_error; + int error= 0, ho_error, temp_argc; int first_command; my_bool can_handle_passwords; MYSQL mysql; - char **commands, **save_argv; + char **commands, **save_argv, **temp_argv; MY_INIT(argv[0]); mysql_init(&mysql); @@ -330,6 +334,9 @@ 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; if (debug_check_flag) @@ -340,7 +347,7 @@ int main(int argc,char *argv[]) usage(); exit(1); } - commands = argv; + commands = temp_argv; if (tty_password) opt_password = get_tty_password(NullS); @@ -349,6 +356,8 @@ int main(int argc,char *argv[]) if (opt_bind_addr) mysql_options(&mysql,MYSQL_OPT_BIND,opt_bind_addr); + if (!opt_secure_auth) + mysql_options(&mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth); if (opt_compress) mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS); if (opt_connect_timeout) @@ -504,6 +513,13 @@ int main(int argc,char *argv[]) my_free(shared_memory_base_name); #endif free_defaults(save_argv); + temp_argc--; + while(temp_argc >= 0) + { + my_free(temp_argv[temp_argc]); + temp_argc--; + } + my_free(temp_argv); my_end(my_end_arg); exit(error ? 1 : 0); return 0; @@ -977,7 +993,10 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } } else + { + print_cmdline_password_warning(); typed_password= argv[1]; + } if (typed_password[0]) { @@ -1161,6 +1180,47 @@ error: return 0; } +/** + @brief Masking the password if it is passed as command line argument. + + @details It works in Linux and changes cmdline in ps and /proc/pid/cmdline, + but it won't work for history file of shell. + The command line arguments are copied to another array and the + password in the argv is masked. This function is called just after + "handle_options" because in "handle_options", the agrv pointers + are altered which makes freeing of dynamically allocated memory + difficult. The password masking is done before all other operations + in order to minimise the time frame of password visibility via cmdline. + + @param argc command line options (count) + @param argv command line options (values) + + @return temp_argv copy of argv +*/ + +static char **mask_password(int argc, char ***argv) +{ + char **temp_argv; + temp_argv= (char **)(my_malloc(sizeof(char *) * argc, MYF(MY_WME))); + argc--; + while (argc > 0) + { + temp_argv[argc]= my_strdup((*argv)[argc], MYF(MY_FAE)); + if (find_type((*argv)[argc - 1],&command_typelib, FIND_TYPE_BASIC) == ADMIN_PASSWORD || + find_type((*argv)[argc - 1],&command_typelib, FIND_TYPE_BASIC) == ADMIN_OLD_PASSWORD) + { + char *start= (*argv)[argc]; + while (*start) + *start++= 'x'; + start= (*argv)[argc]; + if (*start) + start[1]= 0; /* Cut length of argument */ + } + argc--; + } + temp_argv[argc]= my_strdup((*argv)[argc], MYF(MY_FAE)); + return(temp_argv); +} static void print_version(void) { diff --git a/mysql-wsrep-5.6/client/mysqlbinlog.cc b/mysql-wsrep-5.6/client/mysqlbinlog.cc index 3b031ae0..711f9b3e 100644 --- a/mysql-wsrep-5.6/client/mysqlbinlog.cc +++ b/mysql-wsrep-5.6/client/mysqlbinlog.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +69,7 @@ using std::max; #define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES) char server_version[SERVER_VERSION_LENGTH]; -ulong server_id = 0; +ulong filter_server_id = 0; /* One statement can result in a sequence of several events: Intvar_log_events, User_var_log_events, and Rand_log_events, followed by one @@ -125,12 +125,16 @@ static my_bool force_if_open_opt= 1, raw_mode= 0; static my_bool to_last_remote_log= 0, stop_never= 0; static my_bool opt_verify_binlog_checksum= 1; static ulonglong offset = 0; -static uint stop_never_server_id= 1; +static int64 stop_never_slave_server_id= -1; +#ifndef DBUG_OFF +static int64 connection_server_id= -1; +#endif //DBUG_OFF static char* host = 0; static int port= 0; static uint my_end_arg; static const char* sock= 0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; +static my_bool opt_secure_auth= TRUE; #ifdef HAVE_SMEM static char *shared_memory_base_name= 0; @@ -149,7 +153,6 @@ static ulonglong start_position, stop_position; static char *start_datetime_str, *stop_datetime_str; static my_time_t start_datetime= 0, stop_datetime= MY_TIME_T_MAX; static ulonglong rec_count= 0; -static ushort binlog_flags = 0; static MYSQL* mysql = NULL; static char* dirname_for_local_load= 0; static uint opt_server_id_bits = 0; @@ -195,7 +198,9 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info, const char* logname); static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, const char* logname); -static Exit_status dump_log_entries(const char* logname); +static Exit_status dump_single_log(PRINT_EVENT_INFO *print_event_info, + const char* logname); +static Exit_status dump_multiple_logs(int argc, char **argv); static Exit_status safe_connect(); /* @@ -868,7 +873,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, events. */ if (ev_type != ROTATE_EVENT && - server_id && (server_id != ev->server_id)) + filter_server_id && (filter_server_id != ev->server_id)) goto end; } if (((my_time_t) (ev->when.tv_sec) >= stop_datetime) @@ -944,9 +949,20 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, { in_transaction= false; print_event_info->skipped_event_in_transaction= false; + if (print_event_info->is_gtid_next_set) + print_event_info->is_gtid_next_valid= false; } else if (starts_group) in_transaction= true; + else + { + /* + We are not in a transaction and are not seeing a BEGIN or + COMMIT. So this is an implicitly committing DDL. + */ + if (print_event_info->is_gtid_next_set && !in_transaction) + print_event_info->is_gtid_next_valid= false; + } ev->print(result_file, print_event_info); if (head->error == -1) @@ -1283,6 +1299,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, case GTID_LOG_EVENT: { seen_gtids= true; + print_event_info->is_gtid_next_set= true; + print_event_info->is_gtid_next_valid= true; if (print_event_info->skipped_event_in_transaction == true) fprintf(result_file, "COMMIT /* added by mysqlbinlog */%s\n", print_event_info->delimiter); print_event_info->skipped_event_in_transaction= false; @@ -1296,6 +1314,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, { in_transaction= false; print_event_info->skipped_event_in_transaction= false; + if (print_event_info->is_gtid_next_set) + print_event_info->is_gtid_next_valid= false; ev->print(result_file, print_event_info); if (head->error == -1) goto err; @@ -1318,9 +1338,11 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, since there may be no gtids on the next one. */ seen_gtids= false; - fprintf(result_file, "SET @@SESSION.GTID_NEXT= 'AUTOMATIC' " - "/* added by mysqlbinlog */ %s\n", - print_event_info->delimiter); + fprintf(result_file, "%sAUTOMATIC' /* added by mysqlbinlog */ %s\n", + Gtid_log_event::SET_STRING_PREFIX, + print_event_info->delimiter); + print_event_info->is_gtid_next_set= false; + print_event_info->is_gtid_next_valid= true; } } ev->print(result_file, print_event_info); @@ -1472,9 +1494,12 @@ static struct my_option my_long_options[] = "prefix for the file names.", &output_file, &output_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" + " uses old (pre-4.1.1) protocol.", &opt_secure_auth, + &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"server-id", OPT_SERVER_ID, "Extract only binlog entries created by the server having the given id.", - &server_id, &server_id, 0, GET_ULONG, + &filter_server_id, &filter_server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"server-id-bits", 0, "Set number of significant bits in server-id", @@ -1529,9 +1554,15 @@ static struct my_option my_long_options[] = &stop_never, &stop_never, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"stop-never-slave-server-id", OPT_WAIT_SERVER_ID, - "The slave server ID used for stop-never", - &stop_never_server_id, &stop_never_server_id, 0, - GET_UINT, REQUIRED_ARG, 65535, 1, 65535, 0, 0, 0}, + "The slave server_id used for --read-from-remote-server --stop-never.", + &stop_never_slave_server_id, &stop_never_slave_server_id, 0, + GET_LL, REQUIRED_ARG, -1, -1, 0xFFFFFFFFLL, 0, 0, 0}, +#ifndef DBUG_OFF + {"connection-server-id", OPT_CONNECTION_SERVER_ID, + "The slave server_id used for --read-from-remote-server.", + &connection_server_id, &connection_server_id, 0, + GET_LL, REQUIRED_ARG, -1, -1, 0xFFFFFFFFLL, 0, 0, 0}, +#endif {"stop-position", OPT_STOP_POSITION, "Stop reading the binlog at position N. Applies to the last binlog " "passed on the command line.", @@ -1833,6 +1864,8 @@ static Exit_status safe_connect() mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); if (opt_bind_addr) mysql_options(mysql, MYSQL_OPT_BIND, opt_bind_addr); + if (!opt_secure_auth) + mysql_options(mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth); #ifdef HAVE_SMEM if (shared_memory_base_name) mysql_options(mysql, MYSQL_SHARED_MEMORY_BASE_NAME, @@ -1864,11 +1897,35 @@ static Exit_status safe_connect() @retval OK_STOP No error, but the end of the specified range of events to process has been reached and the program should terminate. */ -static Exit_status dump_log_entries(const char* logname) +static Exit_status dump_single_log(PRINT_EVENT_INFO *print_event_info, + const char* logname) { - DBUG_ENTER("dump_log_entries"); + DBUG_ENTER("dump_single_log"); + + Exit_status rc= OK_CONTINUE; + + switch (opt_remote_proto) + { + case BINLOG_LOCAL: + rc= dump_local_log_entries(print_event_info, logname); + break; + case BINLOG_DUMP_NON_GTID: + case BINLOG_DUMP_GTID: + rc= dump_remote_log_entries(print_event_info, logname); + break; + default: + DBUG_ASSERT(0); + break; + } + DBUG_RETURN(rc); +} + +static Exit_status dump_multiple_logs(int argc, char **argv) +{ + DBUG_ENTER("dump_multiple_logs"); Exit_status rc= OK_CONTINUE; + PRINT_EVENT_INFO print_event_info; if (!print_event_info.init_ok()) DBUG_RETURN(ERROR_STOP); @@ -1884,18 +1941,18 @@ static Exit_status dump_log_entries(const char* logname) print_event_info.verbose= short_form ? 0 : verbose; - switch (opt_remote_proto) + // Dump all logs. + my_off_t save_stop_position= stop_position; + stop_position= ~(my_off_t)0; + for (int i= 0; i < argc; i++) { - case BINLOG_LOCAL: - rc= dump_local_log_entries(&print_event_info, logname); - break; - case BINLOG_DUMP_NON_GTID: - case BINLOG_DUMP_GTID: - rc= dump_remote_log_entries(&print_event_info, logname); - break; - default: - DBUG_ASSERT(0); - break; + if (i == argc - 1) // last log, --stop-position applies + stop_position= save_stop_position; + if ((rc= dump_single_log(&print_event_info, argv[i])) != OK_CONTINUE) + break; + + // For next log, --start-position does not apply + start_position= BIN_LOG_HEADER_SIZE; } if (buff_ev.elements > 0) @@ -1922,6 +1979,14 @@ static Exit_status dump_log_entries(const char* logname) if (print_event_info.skipped_event_in_transaction) fprintf(result_file, "COMMIT /* added by mysqlbinlog */%s\n", print_event_info.delimiter); + if (!print_event_info.is_gtid_next_valid) + { + fprintf(result_file, "%sAUTOMATIC' /* added by mysqlbinlog */%s\n", + Gtid_log_event::SET_STRING_PREFIX, + print_event_info.delimiter); + print_event_info.is_gtid_next_set= false; + print_event_info.is_gtid_next_valid= true; + } fprintf(result_file, "DELIMITER ;\n"); strmov(print_event_info.delimiter, ";"); } @@ -2016,6 +2081,12 @@ err: } +static int get_dump_flags() +{ + return stop_never ? 0 : BINLOG_DUMP_NON_BLOCK; +} + + /** Requests binlog dump from a remote server and prints the events it receives. @@ -2064,7 +2135,21 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, Fake a server ID to log continously. This will show as a slave on the mysql server. */ - server_id= ((to_last_remote_log && stop_never) ? stop_never_server_id : 0); + if (to_last_remote_log && stop_never) + { + if (stop_never_slave_server_id == -1) + server_id= 1; + else + server_id= stop_never_slave_server_id; + } + else + server_id= 0; +#ifndef DBUG_OFF + if (connection_server_id != -1) + server_id= connection_server_id; + +#endif + size_t tlen = strlen(logname); if (tlen > UINT_MAX) { @@ -2092,7 +2177,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, */ int4store(ptr_buffer, (uint32) start_position); ptr_buffer+= ::BINLOG_POS_OLD_INFO_SIZE; - int2store(ptr_buffer, binlog_flags); + int2store(ptr_buffer, get_dump_flags()); ptr_buffer+= ::BINLOG_FLAGS_INFO_SIZE; int4store(ptr_buffer, server_id); ptr_buffer+= ::BINLOG_SERVER_ID_INFO_SIZE; @@ -2123,7 +2208,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, } uchar* ptr_buffer= command_buffer; - int2store(ptr_buffer, binlog_flags); + int2store(ptr_buffer, get_dump_flags()); ptr_buffer+= ::BINLOG_FLAGS_INFO_SIZE; int4store(ptr_buffer, server_id); ptr_buffer+= ::BINLOG_SERVER_ID_INFO_SIZE; @@ -2286,8 +2371,14 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, error("Could not create log file '%s'", log_file_name); DBUG_RETURN(ERROR_STOP); } - my_fwrite(result_file, (const uchar*) BINLOG_MAGIC, - BIN_LOG_HEADER_SIZE, MYF(0)); + DBUG_EXECUTE_IF("simulate_result_file_write_error_for_FD_event", + DBUG_SET("+d,simulate_fwrite_error");); + if (my_fwrite(result_file, (const uchar*) BINLOG_MAGIC, + BIN_LOG_HEADER_SIZE, MYF(MY_NABP))) + { + error("Could not write into log file '%s'", log_file_name); + DBUG_RETURN(ERROR_STOP); + } /* Need to handle these events correctly in raw mode too or this could get messy @@ -2310,7 +2401,13 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, if (raw_mode) { - my_fwrite(result_file, net->read_pos + 1 , len - 1, MYF(0)); + DBUG_EXECUTE_IF("simulate_result_file_write_error", + DBUG_SET("+d,simulate_fwrite_error");); + if (my_fwrite(result_file, net->read_pos + 1 , len - 1, MYF(MY_NABP))) + { + error("Could not write into log file '%s'", log_file_name); + retval= ERROR_STOP; + } if (ev) { ev->temp_buf=0; @@ -2763,6 +2860,15 @@ static int args_post_process(void) global_sid_lock->unlock(); +#ifndef DBUG_OFF + if (connection_server_id == 0 && stop_never) + error("Cannot set --server-id=0 when --stop-never is specified."); + if (connection_server_id != -1 && stop_never_slave_server_id != -1) + error("Cannot set --connection-server-id= %lld and " + "--stop-never-slave-server-id= %lld. ", connection_server_id, + stop_never_slave_server_id); +#endif + DBUG_RETURN(OK_CONTINUE); } @@ -2806,22 +2912,22 @@ int main(int argc, char** argv) { char **defaults_argv; Exit_status retval= OK_CONTINUE; - ulonglong save_stop_position; MY_INIT(argv[0]); DBUG_ENTER("main"); DBUG_PROCESS(argv[0]); my_init_time(); // for time functions - /* + tzset(); // set tzname + /* A pointer of type Log_event can point to INTVAR USER_VAR RANDOM - events, when we allocate a element of sizeof(Log_event*) + events, when we allocate a element of sizeof(Log_event*) for the DYNAMIC_ARRAY. */ - if((my_init_dynamic_array(&buff_ev, sizeof(buff_event_info), + if((my_init_dynamic_array(&buff_ev, sizeof(buff_event_info), INTVAR_DYNAMIC_INIT, INTVAR_DYNAMIC_INCR))) exit(1); @@ -2847,6 +2953,7 @@ int main(int argc, char** argv) exit(1); } + umask(((~my_umask) & 0666)); /* Check for argument conflicts and do any post-processing */ if (args_post_process() == ERROR_STOP) exit(1); @@ -2902,17 +3009,7 @@ int main(int argc, char** argv) "\n/*!40101 SET NAMES %s */;\n", charset); } - for (save_stop_position= stop_position, stop_position= ~(my_off_t)0 ; - (--argc >= 0) ; ) - { - if (argc == 0) // last log, --stop-position applies - stop_position= save_stop_position; - if ((retval= dump_log_entries(*argv++)) != OK_CONTINUE) - break; - - // For next log, --start-position does not apply - start_position= BIN_LOG_HEADER_SIZE; - } + retval= dump_multiple_logs(argc, argv); if (!raw_mode) { diff --git a/mysql-wsrep-5.6/client/mysqlcheck.c b/mysql-wsrep-5.6/client/mysqlcheck.c index 51d4c16d..e40fb75a 100644 --- a/mysql-wsrep-5.6/client/mysqlcheck.c +++ b/mysql-wsrep-5.6/client/mysqlcheck.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0, opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, - opt_write_binlog= 1; + opt_write_binlog= 1, opt_secure_auth=TRUE; static uint verbose = 0, opt_mysql_port=0; static int my_end_arg; static char * opt_mysql_unix_port = 0; @@ -144,6 +144,9 @@ static struct my_option my_long_options[] = "when commands should not be sent to replication slaves.", &opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" + " uses old (pre-4.1.1) protocol.", &opt_secure_auth, + &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', @@ -891,6 +894,8 @@ static int dbConnect(char *host, char *user, char *passwd) mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); if (opt_bind_addr) mysql_options(&mysql_connection, MYSQL_OPT_BIND, opt_bind_addr); + if (!opt_secure_auth) + mysql_options(&mysql_connection, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth); #ifdef HAVE_SMEM if (shared_memory_base_name) mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); diff --git a/mysql-wsrep-5.6/client/mysqldump.c b/mysql-wsrep-5.6/client/mysqldump.c index 307e7fc0..b440ccfe 100644 --- a/mysql-wsrep-5.6/client/mysqldump.c +++ b/mysql-wsrep-5.6/client/mysqldump.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -109,7 +109,8 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_slave_apply= 0, opt_include_master_host_port= 0, opt_events= 0, opt_comments_used= 0, - opt_alltspcs=0, opt_notspcs= 0, opt_drop_trigger= 0; + opt_alltspcs=0, opt_notspcs= 0, opt_drop_trigger= 0, + opt_secure_auth= 1; static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*mysql=0; @@ -508,6 +509,9 @@ static struct my_option my_long_options[] = {"socket", 'S', "The socket file to use for connection.", &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" + " uses old (pre-4.1.1) protocol.", &opt_secure_auth, + &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #include <sslopt-longopts.h> {"tab",'T', "Create tab-separated textfile for each table to given path. (Create .sql " @@ -610,7 +614,7 @@ static void verbose_msg(const char *fmt, ...) void check_io(FILE *file) { - if (ferror(file)) + if (ferror(file) || errno == 5) die(EX_EOF, "Got errno %d on write", errno); } @@ -1519,6 +1523,8 @@ static int connect_to_db(char *host, char *user,char *passwd) mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); if (opt_bind_addr) mysql_options(&mysql_connection,MYSQL_OPT_BIND,opt_bind_addr); + if (!opt_secure_auth) + mysql_options(&mysql_connection,MYSQL_SECURE_AUTH,(char*)&opt_secure_auth); #ifdef HAVE_SMEM if (shared_memory_base_name) mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); @@ -2568,7 +2574,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, if (strcmp (table_type, "VIEW") == 0) /* view */ print_comment(sql_file, 0, - "\n--\n-- Temporary table structure for view %s\n--\n\n", + "\n--\n-- Temporary view structure for view %s\n--\n\n", result_table); else print_comment(sql_file, 0, @@ -2595,7 +2601,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, char *scv_buff= NULL; my_ulonglong n_cols; - verbose_msg("-- It's a view, create dummy table for view\n"); + verbose_msg("-- It's a view, create dummy view\n"); /* save "show create" statement for later */ if ((row= mysql_fetch_row(result)) && (scv_buff=row[1])) @@ -2668,7 +2674,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, fprintf(sql_file, "SET @saved_cs_client = @@character_set_client;\n" "SET character_set_client = utf8;\n" - "/*!50001 CREATE TABLE %s (\n", + "/*!50001 CREATE VIEW %s AS SELECT \n", result_table); /* @@ -2677,31 +2683,24 @@ static uint get_table_structure(char *table, char *db, char *table_type, there should be a _trailing_ comma. */ + row= mysql_fetch_row(result); /* - The actual column type doesn't matter anyway, since the table will - be dropped at run time. - We do tinyint to avoid hitting the row size limit. + A temporary view is created to resolve the view interdependencies. + This temporary view is dropped when the actual view is created. */ - fprintf(sql_file, " %s tinyint NOT NULL", + + fprintf(sql_file, " 1 AS %s", quote_name(row[0], name_buff, 0)); while((row= mysql_fetch_row(result))) { - /* col name, col type */ - fprintf(sql_file, ",\n %s tinyint NOT NULL", + fprintf(sql_file, ",\n 1 AS %s", quote_name(row[0], name_buff, 0)); } - /* - Stand-in tables are always MyISAM tables as the default - engine might have a column-limit that's lower than the - number of columns in the view, and MyISAM support is - guaranteed to be in the server anyway. - */ - fprintf(sql_file, - "\n) ENGINE=MyISAM */;\n" + fprintf(sql_file,"*/;\n" "SET character_set_client = @saved_cs_client;\n"); check_io(sql_file); @@ -3629,7 +3628,8 @@ static void dump_table(char *table, char *db) field->type == MYSQL_TYPE_BLOB || field->type == MYSQL_TYPE_LONG_BLOB || field->type == MYSQL_TYPE_MEDIUM_BLOB || - field->type == MYSQL_TYPE_TINY_BLOB)) ? 1 : 0; + field->type == MYSQL_TYPE_TINY_BLOB || + field->type == MYSQL_TYPE_GEOMETRY)) ? 1 : 0; if (extended_insert && !opt_xml) { if (i == 0) @@ -5580,15 +5580,8 @@ static my_bool get_view_structure(char *table, char* db) "\n--\n-- Final view structure for view %s\n--\n\n", result_table); - /* Table might not exist if this view was dumped with --tab. */ - fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", opt_quoted_table); - if (opt_drop) - { - fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", - opt_quoted_table); - check_io(sql_file); - } - + verbose_msg("-- Dropping the temporary view structure created\n"); + fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", opt_quoted_table); my_snprintf(query, sizeof(query), "SELECT CHECK_OPTION, DEFINER, SECURITY_TYPE, " @@ -5762,7 +5755,7 @@ static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size) int main(int argc, char **argv) { char bin_log_name[FN_REFLEN]; - int exit_code; + int exit_code, md_result_fd; MY_INIT("mysqldump"); compatible_mode_normal_str[0]= 0; @@ -5861,19 +5854,36 @@ int main(int argc, char **argv) dump_all_tablespaces(); dump_all_databases(); } - else if (argc > 1 && !opt_databases) - { - /* Only one database and selected table(s) */ - if (!opt_alltspcs && !opt_notspcs) - dump_tablespaces_for_tables(*argv, (argv + 1), (argc -1)); - dump_selected_tables(*argv, (argv + 1), (argc - 1)); - } else { - /* One or more databases, all tables */ - if (!opt_alltspcs && !opt_notspcs) - dump_tablespaces_for_databases(argv); - dump_databases(argv); + // Check all arguments meet length condition. Currently database and table + // names are limited to NAME_LEN bytes and stack-based buffers assumes + // that escaped name will be not longer than NAME_LEN*2 + 2 bytes long. + int argument; + for (argument= 0; argument < argc; argument++) + { + size_t argument_length= strlen(argv[argument]); + if (argument_length > NAME_LEN) + { + die(EX_CONSCHECK, "[ERROR] Argument '%s' is too long, it cannot be " + "name for any table or database.\n", argv[argument]); + } + } + + if (argc > 1 && !opt_databases) + { + /* Only one database and selected table(s) */ + if (!opt_alltspcs && !opt_notspcs) + dump_tablespaces_for_tables(*argv, (argv + 1), (argc - 1)); + dump_selected_tables(*argv, (argv + 1), (argc - 1)); + } + else + { + /* One or more databases, all tables */ + if (!opt_alltspcs && !opt_notspcs) + dump_tablespaces_for_databases(argv); + dump_databases(argv); + } } /* if --dump-slave , start the slave sql thread */ @@ -5890,8 +5900,19 @@ int main(int argc, char **argv) if (opt_slave_apply && add_slave_statements()) goto err; - /* ensure dumped data flushed */ - if (md_result_file && fflush(md_result_file)) + if (md_result_file) + md_result_fd= my_fileno(md_result_file); + + /* + Ensure dumped data flushed. + First we will flush the file stream data to kernel buffers with fflush(). + Second we will flush the kernel buffers data to physical disk file with + my_sync(), this will make sure the data succeessfully dumped to disk file. + fsync() fails with EINVAL if stdout is not redirected to any file, hence + MY_IGNORE_BADFD is passed to ingnore that error. + */ + if (md_result_file && + (fflush(md_result_file) || my_sync(md_result_fd, MYF(MY_IGNORE_BADFD)))) { if (!first_error) first_error= EX_MYSQLERR; diff --git a/mysql-wsrep-5.6/client/mysqlimport.c b/mysql-wsrep-5.6/client/mysqlimport.c index 17637493..94a1d711 100644 --- a/mysql-wsrep-5.6/client/mysqlimport.c +++ b/mysql-wsrep-5.6/client/mysqlimport.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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 @@ static char *add_load_option(char *ptr,const char *object, static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0, replace=0,silent=0,ignore=0,opt_compress=0, - opt_low_priority= 0, tty_password= 0; + opt_low_priority= 0, tty_password= 0, opt_secure_auth= 1; static my_bool debug_info_flag= 0, debug_check_flag= 0; static uint opt_use_threads=0, opt_local_file=0, my_end_arg= 0; static char *opt_password=0, *current_user=0, @@ -161,6 +161,9 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"replace", 'r', "If duplicate unique key was found, replace old row.", &replace, &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" + " uses old (pre-4.1.1) protocol.", + &opt_secure_auth, &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name, @@ -440,6 +443,8 @@ static MYSQL *db_connect(char *host, char *database, mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); if (opt_bind_addr) mysql_options(mysql,MYSQL_OPT_BIND,opt_bind_addr); + if (!opt_secure_auth) + mysql_options(mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth); #ifdef HAVE_SMEM if (shared_memory_base_name) mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); diff --git a/mysql-wsrep-5.6/client/mysqlshow.c b/mysql-wsrep-5.6/client/mysqlshow.c index 13dc20e0..755ef31d 100644 --- a/mysql-wsrep-5.6/client/mysqlshow.c +++ b/mysql-wsrep-5.6/client/mysqlshow.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 @@ 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 my_bool opt_secure_auth= TRUE; #ifdef HAVE_SMEM static char *shared_memory_base_name=0; @@ -132,6 +133,8 @@ int main(int argc, char **argv) mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); if (opt_bind_addr) mysql_options(&mysql,MYSQL_OPT_BIND,opt_bind_addr); + if (!opt_secure_auth) + mysql_options(&mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth); #ifdef HAVE_SMEM if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); @@ -244,6 +247,9 @@ static struct my_option my_long_options[] = {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" + " uses old (pre-4.1.1) protocol.", &opt_secure_auth, + &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, "Base name of shared memory.", &shared_memory_base_name, diff --git a/mysql-wsrep-5.6/client/mysqlslap.c b/mysql-wsrep-5.6/client/mysqlslap.c index d75195fd..54585034 100644 --- a/mysql-wsrep-5.6/client/mysqlslap.c +++ b/mysql-wsrep-5.6/client/mysqlslap.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -126,6 +126,7 @@ static char *host= NULL, *opt_password= NULL, *user= NULL, *post_system= NULL, *opt_mysql_unix_port= NULL; static char *opt_plugin_dir= 0, *opt_default_auth= 0; +static my_bool opt_secure_auth= TRUE; static uint opt_enable_cleartext_plugin= 0; static my_bool using_opt_enable_cleartext_plugin= 0; @@ -346,6 +347,8 @@ int main(int argc, char **argv) #endif if (opt_protocol) mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); + if (!opt_secure_auth && slap_connect(&mysql)) + mysql_options(&mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth); #ifdef HAVE_SMEM if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); @@ -684,6 +687,9 @@ static struct my_option my_long_options[] = {"query", 'q', "Query to run or file containing query to run.", &user_supplied_query, &user_supplied_query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" + " uses old (pre-4.1.1) protocol.", &opt_secure_auth, + &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifdef HAVE_SMEM {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, "Base name of shared memory.", &shared_memory_base_name, diff --git a/mysql-wsrep-5.6/cmake/build_configurations/compiler_options.cmake b/mysql-wsrep-5.6/cmake/build_configurations/compiler_options.cmake index da1cce0e..a27ff7ac 100644 --- a/mysql-wsrep-5.6/cmake/build_configurations/compiler_options.cmake +++ b/mysql-wsrep-5.6/cmake/build_configurations/compiler_options.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,47 +43,16 @@ IF(UNIX) SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") ENDIF() - # HPUX flags - IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX") - IF(CMAKE_C_COMPILER_ID MATCHES "HP") - IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64") - SET(COMMON_C_FLAGS "+DSitanium2 -mt -AC99") - SET(COMMON_CXX_FLAGS "+DSitanium2 -mt -Aa") - SET(CMAKE_C_FLAGS_DEBUG "+O0 -g ${COMMON_C_FLAGS}") - SET(CMAKE_CXX_FLAGS_DEBUG "+O0 -g ${COMMON_CXX_FLAGS}") - # We have seen compiler bugs with optimisation and -g, so disabled for now - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_C_FLAGS}") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_CXX_FLAGS}") - ENDIF() - ENDIF() - SET(WITH_SSL no) - ENDIF() - - # Linux flags - IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - IF(CMAKE_C_COMPILER_ID MATCHES "Intel") - SET(COMMON_C_FLAGS "-static-intel -static-libgcc -g -mp -restrict") - SET(COMMON_CXX_FLAGS "-static-intel -static-libgcc -g -mp -restrict") - IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64") - SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -no-ftz -no-prefetch") - SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -no-ftz -no-prefetch") - ENDIF() - SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}") - SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}") - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_C_FLAGS}") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_CXX_FLAGS}") - SET(WITH_SSL no) - ENDIF() + # Default Clang flags + IF(CMAKE_C_COMPILER_ID MATCHES "Clang") + SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}") ENDIF() - - # OSX flags - IF(APPLE) - SET(COMMON_C_FLAGS "-g -fno-strict-aliasing") - SET(COMMON_CXX_FLAGS "-g -fno-strict-aliasing") - SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}") + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}") - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os ${COMMON_C_FLAGS}") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os ${COMMON_CXX_FLAGS}") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") ENDIF() # Solaris flags @@ -93,9 +62,15 @@ IF(UNIX) SET(WITH_MYSQLD_LDFLAGS "-lmtmalloc" CACHE STRING "") ENDIF() IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") + + SET(SUNPRO_CXX_LIBRARY "stlport4" CACHE STRING + "What C++ library to use. The server needs stlport4. It is possible to build the client libraries with -DWITHOUT_SERVER=1 -DSUNPRO_CXX_LIBRARY=Cstd") + + MESSAGE(STATUS "SUNPRO_CXX_LIBRARY ${SUNPRO_CXX_LIBRARY}") + IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386") SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic") - SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic -library=stlport4") + SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic -library=${SUNPRO_CXX_LIBRARY}") # We have to specify "-xO1" for DEBUG flags here, # see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6879978 SET(CMAKE_C_FLAGS_DEBUG "-xO1 ${COMMON_C_FLAGS}") @@ -110,7 +85,7 @@ IF(UNIX) ELSE() # Assume !x86 is SPARC SET(COMMON_C_FLAGS "-g -Xa -xstrconst -mt") - SET(COMMON_CXX_FLAGS "-g0 -mt -library=stlport4") + SET(COMMON_CXX_FLAGS "-g0 -mt -library=${SUNPRO_CXX_LIBRARY}") IF(32BIT) SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -xarch=sparc") SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -xarch=sparc") diff --git a/mysql-wsrep-5.6/cmake/build_configurations/feature_set.cmake b/mysql-wsrep-5.6/cmake/build_configurations/feature_set.cmake index 656a360f..29ad01a3 100644 --- a/mysql-wsrep-5.6/cmake/build_configurations/feature_set.cmake +++ b/mysql-wsrep-5.6/cmake/build_configurations/feature_set.cmake @@ -77,6 +77,5 @@ IF(FEATURE_SET) ENDFOREACH() ENDIF() -OPTION(ENABLED_LOCAL_INFILE "" ON) SET(WITH_SSL bundled CACHE STRING "") SET(WITH_ZLIB bundled CACHE STRING "") diff --git a/mysql-wsrep-5.6/cmake/build_configurations/mysql_release.cmake b/mysql-wsrep-5.6/cmake/build_configurations/mysql_release.cmake index 3cbb1b56..87dd43a5 100644 --- a/mysql-wsrep-5.6/cmake/build_configurations/mysql_release.cmake +++ b/mysql-wsrep-5.6/cmake/build_configurations/mysql_release.cmake @@ -19,6 +19,7 @@ INCLUDE(CheckIncludeFiles) INCLUDE(CheckLibraryExists) OPTION(DEBUG_EXTNAME "" ON) +OPTION(ENABLED_LOCAL_INFILE "" ON) IF(NOT COMPILATION_COMMENT) SET(COMPILATION_COMMENT "MySQL Community Server (GPL)") diff --git a/mysql-wsrep-5.6/cmake/compile_flags.cmake b/mysql-wsrep-5.6/cmake/compile_flags.cmake new file mode 100644 index 00000000..5e872f98 --- /dev/null +++ b/mysql-wsrep-5.6/cmake/compile_flags.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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_COMPILE_FLAGS(<source files> COMPILE_FLAGS <flags>) +MACRO(ADD_COMPILE_FLAGS) + SET(FILES "") + SET(FLAGS "") + SET(COMPILE_FLAGS) + FOREACH(ARG ${ARGV}) + IF(ARG STREQUAL "COMPILE_FLAGS") + SET(COMPILE_FLAGS "COMPILE_FLAGS") + ELSEIF(COMPILE_FLAGS) + LIST(APPEND FLAGS ${ARG}) + ELSE() + LIST(APPEND FILES ${ARG}) + ENDIF() + ENDFOREACH() + FOREACH(FILE ${FILES}) + FOREACH(FLAG ${FLAGS}) + GET_SOURCE_FILE_PROPERTY(PROP ${FILE} COMPILE_FLAGS) + IF(NOT PROP) + SET(PROP ${FLAG}) + ELSE() + SET(PROP "${PROP} ${FLAG}") + ENDIF() + SET_SOURCE_FILES_PROPERTIES( + ${FILE} PROPERTIES COMPILE_FLAGS "${PROP}" + ) + ENDFOREACH() + ENDFOREACH() +ENDMACRO() diff --git a/mysql-wsrep-5.6/cmake/cpack_source_ignore_files.cmake b/mysql-wsrep-5.6/cmake/cpack_source_ignore_files.cmake index fdceba1d..078df6c6 100644 --- a/mysql-wsrep-5.6/cmake/cpack_source_ignore_files.cmake +++ b/mysql-wsrep-5.6/cmake/cpack_source_ignore_files.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,9 +14,6 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA SET(CPACK_SOURCE_IGNORE_FILES -\\\\.bzr/ -\\\\.bzr-mysql -\\\\.bzrignore CMakeCache\\\\.txt cmake_dist\\\\.cmake CPackSourceConfig\\\\.cmake diff --git a/mysql-wsrep-5.6/cmake/dtrace.cmake b/mysql-wsrep-5.6/cmake/dtrace.cmake index 771a28bc..400b8126 100644 --- a/mysql-wsrep-5.6/cmake/dtrace.cmake +++ b/mysql-wsrep-5.6/cmake/dtrace.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,7 +40,16 @@ MACRO(CHECK_DTRACE) SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace") ENDIF() SET(HAVE_DTRACE ${ENABLE_DTRACE}) - IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") + EXECUTE_PROCESS( + COMMAND ${DTRACE} -V + OUTPUT_VARIABLE out) + IF(out MATCHES "Sun D" OR out MATCHES "Oracle D") + IF(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND + NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") + SET(HAVE_REAL_DTRACE_INSTRUMENTING ON CACHE BOOL "Real DTrace detected") + ENDIF() + ENDIF() + IF(HAVE_REAL_DTRACE_INSTRUMENTING) IF(CMAKE_SIZEOF_VOID_P EQUAL 4) SET(DTRACE_FLAGS -32 CACHE INTERNAL "DTrace architecture flags") ELSE() @@ -93,7 +102,7 @@ FUNCTION(DTRACE_INSTRUMENT target) ADD_DEPENDENCIES(${target} gen_dtrace_header) # Invoke dtrace to generate object file and link it together with target. - IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") + IF(HAVE_REAL_DTRACE_INSTRUMENTING) SET(objdir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir) SET(outfile ${objdir}/${target}_dtrace.o) GET_TARGET_PROPERTY(target_type ${target} TYPE) @@ -110,12 +119,22 @@ FUNCTION(DTRACE_INSTRUMENT target) WORKING_DIRECTORY ${objdir} ) ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux") + # dtrace on Linux runs gcc and uses flags from environment + SET(CFLAGS_SAVED $ENV{CFLAGS}) + # We want to strip off all warning flags, including -Werror=xxx-xx, + # but keep flags like + # -Wp,-D_FORTIFY_SOURCE=2 + STRING(REGEX REPLACE "-W[A-Za-z0-9][-A-Za-z0-9=]+" "" + C_FLAGS "${CMAKE_C_FLAGS}") + + SET(ENV{CFLAGS} ${C_FLAGS}) SET(outfile "${CMAKE_BINARY_DIR}/probes_mysql.o") # Systemtap object EXECUTE_PROCESS( COMMAND ${DTRACE} -G -s ${CMAKE_SOURCE_DIR}/include/probes_mysql.d.base -o ${outfile} ) + SET(ENV{CFLAGS} ${CFLAGS_SAVED}) ENDIF() # Do not try to extend the library if we have not built the .o file @@ -151,7 +170,7 @@ ENDFUNCTION() # run them again through dtrace -G to generate an ELF file that links # to mysqld. MACRO (DTRACE_INSTRUMENT_STATIC_LIBS target libs) -IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND ENABLE_DTRACE) +IF(HAVE_REAL_DTRACE_INSTRUMENTING AND ENABLE_DTRACE) # Filter out non-static libraries in the list, if any SET(static_libs) FOREACH(lib ${libs}) diff --git a/mysql-wsrep-5.6/cmake/info_macros.cmake.in b/mysql-wsrep-5.6/cmake/info_macros.cmake.in index 1b19134d..fc2f8849 100644 --- a/mysql-wsrep-5.6/cmake/info_macros.cmake.in +++ b/mysql-wsrep-5.6/cmake/info_macros.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,11 +23,14 @@ # If further variables are used in this file, add them to this list. SET(VERSION "@VERSION@") +SET(MAJOR_VERSION "@MAJOR_VERSION@") +SET(MINOR_VERSION "@MINOR_VERSION@") +SET(PATCH_VERSION "@PATCH_VERSION@") SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@") SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@") SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@") -SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@") +SET(GIT_EXECUTABLE "@GIT_EXECUTABLE@") SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@") SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@") SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@") @@ -36,34 +39,51 @@ SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@") # Create an "INFO_SRC" file with information about the source (only). -# We use "bzr version-info", if possible, and the "VERSION" contents. +# We use "git log", if possible, and the "VERSION" contents. # -# Outside development (BZR tree), the "INFO_SRC" file will not be modified +# Outside development (git tree), the "INFO_SRC" file will not be modified # provided it exists (from "make dist" or a source tarball creation). MACRO(CREATE_INFO_SRC target_dir) SET(INFO_SRC "${target_dir}/INFO_SRC") - IF(BZR_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/.bzr) - # Sources are in a BZR repository: Always update. - # Add a timeout in case BZR hangs forever ... + SET(PERLSCRIPT + "use warnings; use POSIX qw(strftime); " + "print strftime \"%F %T %z\", localtime;") + EXECUTE_PROCESS( + COMMAND perl -e "${PERLSCRIPT}" + RESULT_VARIABLE result + OUTPUT_VARIABLE bdate + ERROR_VARIABLE error + ) + IF(error) + MESSAGE(STATUS "Could not determine build-date: <${error}>") + ENDIF() + + IF(GIT_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/.git) + # Sources are in a GIT repository: Always update. EXECUTE_PROCESS( - COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR} + COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE bname + ) + + EXECUTE_PROCESS( + COMMAND ${GIT_EXECUTABLE} log -1 + --pretty="commit: %H%ndate: %ci%nbuild-date: ${bdate} %nshort: %h%nbranch: ${bname}" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE VERSION_INFO - RESULT_VARIABLE RESULT - ERROR_VARIABLE ERROR - TIMEOUT 10 ) - IF(NOT RESULT EQUAL 0) - MESSAGE(STATUS "Error from ${BZR_EXECUTABLE}: ${ERROR}") - SET(BZR_EXECUTABLE) - ENDIF() + + ## Output from git is quoted with "", remove them. + STRING(REPLACE "\"" "" VERSION_INFO "${VERSION_INFO}") FILE(WRITE ${INFO_SRC} "${VERSION_INFO}\n") # to debug, add: FILE(APPEND ${INFO_SRC} "\nResult ${RESULT}\n") # For better readability ... - FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n") + FILE(APPEND ${INFO_SRC} + "MySQL source ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}\n") ELSEIF(EXISTS ${INFO_SRC}) - # Outside a BZR tree, there is no need to change an existing "INFO_SRC", + # Outside a git tree, there is no need to change an existing "INFO_SRC", # it cannot be improved. ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC) # If we are building from a source distribution, it also contains "INFO_SRC". diff --git a/mysql-wsrep-5.6/cmake/info_src.cmake b/mysql-wsrep-5.6/cmake/info_src.cmake index 97776b70..ce9873cc 100644 --- a/mysql-wsrep-5.6/cmake/info_src.cmake +++ b/mysql-wsrep-5.6/cmake/info_src.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,11 +16,11 @@ # The sole purpose of this cmake control file is to create the "INFO_SRC" file. -# As long as and "bzr pull" (or "bzr commit") is followed by a "cmake", +# As long as and "git pull" (or "git commit") is followed by a "cmake", # the call in top level "CMakeLists.txt" is sufficient. # This file is to provide a separate target for the "make" phase, -# to ensure the BZR revision-id is correct even after a sequence -# cmake ; make ; bzr pull ; make +# to ensure the git commit hash is correct even after a sequence +# cmake ; make ; git pull ; make # Get the macros which handle the "INFO_*" files. diff --git a/mysql-wsrep-5.6/cmake/install_macros.cmake b/mysql-wsrep-5.6/cmake/install_macros.cmake index 792d6fb6..83bd6bd0 100644 --- a/mysql-wsrep-5.6/cmake/install_macros.cmake +++ b/mysql-wsrep-5.6/cmake/install_macros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,26 +21,35 @@ MACRO (INSTALL_DEBUG_SYMBOLS targets) GET_TARGET_PROPERTY(location ${target} LOCATION) GET_TARGET_PROPERTY(type ${target} TYPE) IF(NOT INSTALL_LOCATION) - IF(type MATCHES "STATIC_LIBRARY" OR type MATCHES "MODULE_LIBRARY" OR type MATCHES "SHARED_LIBRARY") + IF(type MATCHES "STATIC_LIBRARY" + OR type MATCHES "MODULE_LIBRARY" + OR type MATCHES "SHARED_LIBRARY") SET(INSTALL_LOCATION "lib") ELSEIF(type MATCHES "EXECUTABLE") SET(INSTALL_LOCATION "bin") ELSE() - MESSAGE(FATAL_ERROR "cannot determine type of ${target}. Don't now where to install") + MESSAGE(FATAL_ERROR + "cannot determine type of ${target}. Don't now where to install") ENDIF() ENDIF() STRING(REPLACE ".exe" ".pdb" pdb_location ${location}) STRING(REPLACE ".dll" ".pdb" pdb_location ${pdb_location}) STRING(REPLACE ".lib" ".pdb" pdb_location ${pdb_location}) IF(CMAKE_GENERATOR MATCHES "Visual Studio") - STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location}) + STRING(REPLACE + "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" + pdb_location ${pdb_location}) ENDIF() IF(target STREQUAL "mysqld") SET(comp Server) ELSE() SET(comp Debuginfo) ENDIF() - INSTALL(FILES ${pdb_location} DESTINATION ${INSTALL_LOCATION} COMPONENT ${comp}) + # No .pdb file for static libraries. + IF(NOT type MATCHES "STATIC_LIBRARY") + INSTALL(FILES ${pdb_location} + DESTINATION ${INSTALL_LOCATION} COMPONENT ${comp}) + ENDIF() ENDFOREACH() ENDIF() ENDMACRO() diff --git a/mysql-wsrep-5.6/cmake/libutils.cmake b/mysql-wsrep-5.6/cmake/libutils.cmake index 3967dbe9..3d210322 100644 --- a/mysql-wsrep-5.6/cmake/libutils.cmake +++ b/mysql-wsrep-5.6/cmake/libutils.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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/mysql-wsrep-5.6/cmake/maintainer.cmake b/mysql-wsrep-5.6/cmake/maintainer.cmake index 5360e8a9..c537d002 100644 --- a/mysql-wsrep-5.6/cmake/maintainer.cmake +++ b/mysql-wsrep-5.6/cmake/maintainer.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,44 +13,39 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE(CheckCCompilerFlag) - -# Setup GCC (GNU C compiler) warning options. -MACRO(SET_MYSQL_MAINTAINER_GNU_C_OPTIONS) - SET(MY_MAINTAINER_WARNINGS - "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror") - - CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement" - HAVE_DECLARATION_AFTER_STATEMENT) - IF(HAVE_DECLARATION_AFTER_STATEMENT) - SET(MY_MAINTAINER_DECLARATION_AFTER_STATEMENT - "-Wdeclaration-after-statement") - ENDIF() - SET(MY_MAINTAINER_C_WARNINGS - "${MY_MAINTAINER_WARNINGS} ${MY_MAINTAINER_DECLARATION_AFTER_STATEMENT}" - CACHE STRING "C warning options used in maintainer builds.") - # Do not make warnings in checks into errors. - SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error") -ENDMACRO() - - -# Setup G++ (GNU C++ compiler) warning options. -MACRO(SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS) - SET(MY_MAINTAINER_CXX_WARNINGS - "${MY_MAINTAINER_WARNINGS} -Wno-unused-parameter -Woverloaded-virtual" - CACHE STRING "C++ warning options used in maintainer builds.") -ENDMACRO() - -# Setup ICC (Intel C Compiler) warning options. -MACRO(SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS) - SET(MY_MAINTAINER_WARNINGS "-Wcheck") - SET(MY_MAINTAINER_C_WARNINGS "${MY_MAINTAINER_WARNINGS}" - CACHE STRING "C warning options used in maintainer builds.") -ENDMACRO() - -# Setup ICPC (Intel C++ Compiler) warning options. -MACRO(SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS) - SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_WARNINGS}" - CACHE STRING "C++ warning options used in maintainer builds.") -ENDMACRO() - +# Common warning flags for GCC, G++, Clang and Clang++ +SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security") +MY_CHECK_C_COMPILER_FLAG("-Wvla" HAVE_WVLA) # Requires GCC 4.3+ or Clang +IF(HAVE_WVLA) + SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla") +ENDIF() + +# Common warning flags for GCC and Clang +SET(MY_C_WARNING_FLAGS + "${MY_WARNING_FLAGS} -Wwrite-strings -Wdeclaration-after-statement") + +# Common warning flags for G++ and Clang++ +SET(MY_CXX_WARNING_FLAGS + "${MY_WARNING_FLAGS} -Woverloaded-virtual -Wno-unused-parameter") + +# Extra warning flags for Clang++ +IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(MY_CXX_WARNING_FLAGS + "${MY_CXX_WARNING_FLAGS} -Wno-null-conversion -Wno-unused-private-field") +ENDIF() + +# Turn on Werror (warning => error) when using maintainer mode. +IF(MYSQL_MAINTAINER_MODE) + SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -Werror") + SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -Werror") + SET(COMPILE_FLAG_WERROR 1) +ENDIF() + +# Set warning flags for GCC/Clang +IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_WARNING_FLAGS}") +ENDIF() +# Set warning flags for G++/Clang++ +IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS}") +ENDIF() diff --git a/mysql-wsrep-5.6/cmake/make_dist.cmake.in b/mysql-wsrep-5.6/cmake/make_dist.cmake.in index ada27c36..8b845b92 100644 --- a/mysql-wsrep-5.6/cmake/make_dist.cmake.in +++ b/mysql-wsrep-5.6/cmake/make_dist.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,7 +14,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Make source distribution -# If bzr is present, run bzr export. +# If git is present, run git archive. # Otherwise, just run cpack with source configuration. SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@") @@ -22,13 +22,12 @@ SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@") SET(CMAKE_CPACK_COMMAND "@CMAKE_CPACK_COMMAND@") SET(CMAKE_COMMAND "@CMAKE_COMMAND@") -SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@") +SET(GIT_EXECUTABLE "@GIT_EXECUTABLE@") SET(GTAR_EXECUTABLE "@GTAR_EXECUTABLE@") SET(TAR_EXECUTABLE "@TAR_EXECUTABLE@") SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@") SET(CMAKE_MAKE_PROGRAM "@CMAKE_MAKE_PROGRAM@") SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@") -SET(PLUGIN_REPOS "@PLUGIN_REPOS@") SET(VERSION "@VERSION@") @@ -40,38 +39,54 @@ SET(PACKAGE_DIR ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}) FILE(REMOVE_RECURSE ${PACKAGE_DIR}) FILE(REMOVE ${PACKAGE_DIR}.tar.gz ) -IF(BZR_EXECUTABLE) - MESSAGE(STATUS "Running bzr export") +# Only allow git if source dir itself is a git repository +IF(GIT_EXECUTABLE) EXECUTE_PROCESS( - COMMAND "${BZR_EXECUTABLE}" export - ${PACKAGE_DIR} + COMMAND "${GIT_EXECUTABLE}" rev-parse --show-toplevel + OUTPUT_VARIABLE GIT_ROOT + ERROR_VARIABLE GIT_ROOT_ERROR + OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE RESULT ) - IF(NOT RESULT EQUAL 0) - SET(BZR_EXECUTABLE) + IF(NOT RESULT EQUAL 0 OR NOT GIT_ROOT STREQUAL ${CMAKE_SOURCE_DIR}) + MESSAGE(STATUS "This is not a git repository") + SET(GIT_EXECUTABLE) ENDIF() ENDIF() -IF(BZR_EXECUTABLE) - FOREACH(REPO ${PLUGIN_REPOS}) - GET_FILENAME_COMPONENT(PLUGIN_NAME ${REPO} NAME) - SET(DEST ${PACKAGE_DIR}/plugin/${PLUGIN_NAME}) - MESSAGE(STATUS "Running bzr export for plugin/${PLUGIN_NAME}") +IF(GIT_EXECUTABLE) + MESSAGE(STATUS "Running git archive -o ${PACKAGE_DIR}.tar") + EXECUTE_PROCESS( + COMMAND "${GIT_EXECUTABLE}" archive --format=tar + --prefix=${CPACK_SOURCE_PACKAGE_FILE_NAME}/ -o ${PACKAGE_DIR}.tar HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + RESULT_VARIABLE RESULT + ) + IF(NOT RESULT EQUAL 0) + SET(GIT_EXECUTABLE) + ELSE() + # Unpack tarball EXECUTE_PROCESS( - COMMAND "${BZR_EXECUTABLE}" export ${DEST} - WORKING_DIRECTORY ${REPO} - RESULT_VARIABLE RESULT + COMMAND ${CMAKE_COMMAND} -E tar xf ${PACKAGE_DIR}.tar + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE TAR_RESULT ) - IF(NOT RESULT EQUAL 0) - MESSAGE(STATUS "bzr export failed") + IF(NOT TAR_RESULT EQUAL 0) + SET(GIT_EXECUTABLE) + ELSE() + # Remove tarball after unpacking + EXECUTE_PROCESS( + COMMAND ${CMAKE_COMMAND} -E remove ${PACKAGE_DIR}.tar + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) ENDIF() - ENDFOREACH() + ENDIF() ENDIF() -IF(NOT BZR_EXECUTABLE) - MESSAGE(STATUS "bzr not found or source dir is not a repo, use CPack") +IF(NOT GIT_EXECUTABLE) + MESSAGE(STATUS "git not found or source dir is not a repo, use CPack") IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) # In-source build is the worst option, we have to cleanup source tree. diff --git a/mysql-wsrep-5.6/cmake/os/Darwin.cmake b/mysql-wsrep-5.6/cmake/os/Darwin.cmake index 53b9ad1e..4bb0a85d 100644 --- a/mysql-wsrep-5.6/cmake/os/Darwin.cmake +++ b/mysql-wsrep-5.6/cmake/os/Darwin.cmake @@ -15,24 +15,6 @@ # This file includes OSX specific options and quirks, related to system checks -# Workaround for CMake bug#9051 -# (CMake does not pass CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET when -# running TRY_COMPILE) - -IF(CMAKE_OSX_SYSROOT) - SET(ENV{CMAKE_OSX_SYSROOT} ${CMAKE_OSX_SYSROOT}) -ENDIF() -IF(CMAKE_OSX_SYSROOT) - SET(ENV{MACOSX_DEPLOYMENT_TARGET} ${OSX_DEPLOYMENT_TARGET}) -ENDIF() - -IF(CMAKE_OSX_DEPLOYMENT_TARGET) - # Workaround linker problems on OSX 10.4 - IF(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.5") - ADD_DEFINITIONS(-fno-common) - ENDIF() -ENDIF() - # This is used for the version_compile_machine variable. IF(CMAKE_SIZEOF_VOID_P MATCHES 8) SET(MYSQL_MACHINE_TYPE "x86_64") diff --git a/mysql-wsrep-5.6/cmake/os/Linux.cmake b/mysql-wsrep-5.6/cmake/os/Linux.cmake index 5a1bd2f2..350e1503 100644 --- a/mysql-wsrep-5.6/cmake/os/Linux.cmake +++ b/mysql-wsrep-5.6/cmake/os/Linux.cmake @@ -20,7 +20,6 @@ INCLUDE(CheckSymbolExists) # Something that needs to be set on legacy reasons SET(TARGET_OS_LINUX 1) -SET(HAVE_NPTL 1) SET(_GNU_SOURCE 1) # Fix CMake (< 2.8) flags. -rdynamic exports too many symbols. diff --git a/mysql-wsrep-5.6/cmake/os/Windows.cmake b/mysql-wsrep-5.6/cmake/os/Windows.cmake index 06108445..d320bf3b 100644 --- a/mysql-wsrep-5.6/cmake/os/Windows.cmake +++ b/mysql-wsrep-5.6/cmake/os/Windows.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,28 +63,37 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4) ENDIF() IF(MSVC) - # Enable debug info also in Release build, and create PDB to be able to analyze - # crashes - FOREACH(lang C CXX) - SET(CMAKE_${lang}_FLAGS_RELEASE "${CMAKE_${lang}_FLAGS_RELEASE} /Zi") - ENDFOREACH() + # Enable debug info also in Release build, + # and create PDB to be able to analyze crashes. FOREACH(type EXE SHARED MODULE) - SET(CMAKE_{type}_LINKER_FLAGS_RELEASE "${CMAKE_${type}_LINKER_FLAGS_RELEASE} /debug") + SET(CMAKE_{type}_LINKER_FLAGS_RELEASE + "${CMAKE_${type}_LINKER_FLAGS_RELEASE} /debug") ENDFOREACH() - # Force static runtime libraries - # Choose C++ exception handling: - # If /EH is not specified, the compiler will catch structured and - # C++ exceptions, but will not destroy C++ objects that will go out of - # scope as a result of the exception. - # /EHsc catches C++ exceptions only and tells the compiler to assume that - # extern C functions never throw a C++ exception. + # For release types Debug Release RelWithDebInfo (but not MinSizeRel): + # - Force static runtime libraries + # - Choose C++ exception handling: + # If /EH is not specified, the compiler will catch structured and + # C++ exceptions, but will not destroy C++ objects that will go out of + # scope as a result of the exception. + # /EHsc catches C++ exceptions only and tells the compiler to assume that + # extern C functions never throw a C++ exception. + # - Choose debugging information: + # /Z7 + # Produces an .obj file containing full symbolic debugging + # information for use with the debugger. The symbolic debugging + # information includes the names and types of variables, as well as + # functions and line numbers. No .pdb file is produced by the compiler. + FOREACH(lang C CXX) + SET(CMAKE_${lang}_FLAGS_RELEASE "${CMAKE_${lang}_FLAGS_RELEASE} /Z7") + ENDFOREACH() FOREACH(flag - CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT + CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT) + CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT) STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}") SET("${flag}" "${${flag}} /EHsc") ENDFOREACH() diff --git a/mysql-wsrep-5.6/cmake/os/WindowsCache.cmake b/mysql-wsrep-5.6/cmake/os/WindowsCache.cmake index ec40e9e7..a1764ad7 100644 --- a/mysql-wsrep-5.6/cmake/os/WindowsCache.cmake +++ b/mysql-wsrep-5.6/cmake/os/WindowsCache.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,6 +20,7 @@ # different results. IF(MSVC) +SET(HAVE_LLVM_LIBCPP CACHE INTERNAL "") SET(HAVE_ACCESS 1 CACHE INTERNAL "") SET(HAVE_AIO_H CACHE INTERNAL "") SET(HAVE_AIO_READ CACHE INTERNAL "") @@ -87,7 +88,7 @@ SET(HAVE_GETRLIMIT CACHE INTERNAL "") SET(HAVE_GETRUSAGE CACHE INTERNAL "") SET(HAVE_GETTIMEOFDAY CACHE INTERNAL "") SET(HAVE_GETWD CACHE INTERNAL "") -SET(HAVE_GMTIME_R CACHE INTERNAL "") +SET(HAVE_GMTIME_R 1 CACHE INTERNAL "") SET(HAVE_GRP_H CACHE INTERNAL "") SET(HAVE_IA64INTRIN_H CACHE INTERNAL "") SET(HAVE_IEEEFP_H CACHE INTERNAL "") @@ -110,7 +111,7 @@ SET(HAVE_LANGINFO_H CACHE INTERNAL "") SET(HAVE_LDIV 1 CACHE INTERNAL "") SET(HAVE_LIMITS_H 1 CACHE INTERNAL "") SET(HAVE_LOCALE_H 1 CACHE INTERNAL "") -SET(HAVE_LOCALTIME_R CACHE INTERNAL "") +SET(HAVE_LOCALTIME_R 1 CACHE INTERNAL "") SET(HAVE_LOG2 CACHE INTERNAL "") SET(HAVE_LONGJMP 1 CACHE INTERNAL "") SET(HAVE_LRAND48 CACHE INTERNAL "") diff --git a/mysql-wsrep-5.6/cmake/plugin.cmake b/mysql-wsrep-5.6/cmake/plugin.cmake index 2d70245d..e946f0ff 100644 --- a/mysql-wsrep-5.6/cmake/plugin.cmake +++ b/mysql-wsrep-5.6/cmake/plugin.cmake @@ -232,11 +232,4 @@ MACRO(CONFIGURE_PLUGINS) ADD_SUBDIRECTORY(${dir}) ENDIF() ENDFOREACH() - FOREACH(dir ${dirs_plugin}) - IF (EXISTS ${dir}/.bzr) - MESSAGE(STATUS "Found repo ${dir}/.bzr") - LIST(APPEND PLUGIN_BZR_REPOS "${dir}") - ENDIF() - ENDFOREACH() - SET(PLUGIN_REPOS "${PLUGIN_BZR_REPOS}" CACHE INTERNAL "") ENDMACRO() diff --git a/mysql-wsrep-5.6/cmake/ssl.cmake b/mysql-wsrep-5.6/cmake/ssl.cmake index 206d6f14..81719d2e 100644 --- a/mysql-wsrep-5.6/cmake/ssl.cmake +++ b/mysql-wsrep-5.6/cmake/ssl.cmake @@ -52,6 +52,9 @@ MACRO (MYSQL_USE_BUNDLED_SSL) ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include ) SET(SSL_LIBRARIES yassl taocrypt) + IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") + SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBSOCKET}) + ENDIF() SET(SSL_INCLUDE_DIRS ${INC_DIRS}) SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL) SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED") @@ -234,7 +237,7 @@ MACRO (MYSQL_CHECK_SSL) ENDIF() ELSE() MESSAGE(SEND_ERROR - "Wrong option for WITH_SSL. Valid values are : "${WITH_SSL_DOC}) + "Wrong option for WITH_SSL. Valid values are : ${WITH_SSL_DOC}") ENDIF() ENDMACRO() diff --git a/mysql-wsrep-5.6/config.h.cmake b/mysql-wsrep-5.6/config.h.cmake index 665ac6f2..987be271 100644 --- a/mysql-wsrep-5.6/config.h.cmake +++ b/mysql-wsrep-5.6/config.h.cmake @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 @@ /* Headers we may want to use. */ #cmakedefine STDC_HEADERS 1 #cmakedefine _GNU_SOURCE 1 +#cmakedefine HAVE_LLVM_LIBCPP 1 #cmakedefine HAVE_ALLOCA_H 1 #cmakedefine HAVE_AIO_H 1 #cmakedefine HAVE_ARPA_INET_H 1 @@ -187,7 +188,6 @@ #cmakedefine HAVE_LSTAT 1 #cmakedefine HAVE_MEMALIGN 1 /* #cmakedefine HAVE_MLOCK 1 see Bug#54662 */ -#cmakedefine HAVE_NPTL 1 #cmakedefine HAVE_NL_LANGINFO 1 #cmakedefine HAVE_MADVISE 1 #cmakedefine HAVE_DECL_MADVISE 1 diff --git a/mysql-wsrep-5.6/configure.cmake b/mysql-wsrep-5.6/configure.cmake index 843bdf44..e1c17936 100644 --- a/mysql-wsrep-5.6/configure.cmake +++ b/mysql-wsrep-5.6/configure.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,6 +21,7 @@ INCLUDE (CheckLibraryExists) INCLUDE (CheckFunctionExists) INCLUDE (CheckCCompilerFlag) INCLUDE (CheckCSourceRuns) +INCLUDE (CheckCXXSourceRuns) INCLUDE (CheckSymbolExists) @@ -57,40 +58,39 @@ ENDIF() # other threads. SET(SIGNAL_WITH_VIO_SHUTDOWN 1) -# Always enable -Wall for gnu C/C++ -# Remember to strip off these in scripts/CMakeLists.txt -IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter") -ENDIF() -IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -ENDIF() - -# Remember to strip off these in scripts/CMakeLists.txt -IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - SET(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Wall -Wno-null-conversion -Wno-unused-private-field") -ENDIF() -IF(CMAKE_C_COMPILER_ID MATCHES "Clang") - SET(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} -Wall -Wno-null-conversion -Wno-unused-private-field") -ENDIF() - # The default C++ library for SunPro is really old, and not standards compliant. -# http://developers.sun.com/solaris/articles/cmp_stlport_libCstd.html +# http://www.oracle.com/technetwork/server-storage/solaris10/cmp-stlport-libcstd-142559.html # Use stlport rather than Rogue Wave. IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") - SET(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -library=stlport4") + IF(SUNPRO_CXX_LIBRARY) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=${SUNPRO_CXX_LIBRARY}") + ELSE() + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4") + ENDIF() ENDIF() ENDIF() +# Check to see if we are using LLVM's libc++ rather than e.g. libstd++ +# Can then check HAVE_LLBM_LIBCPP later without including e.g. ciso646. +CHECK_CXX_SOURCE_RUNS(" +#include <ciso646> +int main() +{ +#ifdef _LIBCPP_VERSION + return 0; +#else + return 1; +#endif +}" HAVE_LLVM_LIBCPP) + MACRO(DIRNAME IN OUT) GET_FILENAME_COMPONENT(${OUT} ${IN} PATH) ENDMACRO() -IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_C_COMPILER_ID MATCHES "SunPro") +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") diff --git a/mysql-wsrep-5.6/extra/mysql_waitpid.c b/mysql-wsrep-5.6/extra/mysql_waitpid.c index 23177eb5..9e0c76e0 100644 --- a/mysql-wsrep-5.6/extra/mysql_waitpid.c +++ b/mysql-wsrep-5.6/extra/mysql_waitpid.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. This 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,10 @@ int main(int argc, char *argv[]) progname= argv[0]; + fprintf(stderr, + "Warning: %s is deprecated and will be removed in a future version.\n", + progname); + if (handle_options(&argc, &argv, my_long_options, get_one_option)) exit(-1); if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 || diff --git a/mysql-wsrep-5.6/extra/replace.c b/mysql-wsrep-5.6/extra/replace.c index 09bdb60b..591e8d00 100644 --- a/mysql-wsrep-5.6/extra/replace.c +++ b/mysql-wsrep-5.6/extra/replace.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -1020,7 +1020,7 @@ FILE *in,*out; updated=retain=0; reset_buffer(); - while ((error=fill_buffer_retaining(fileno(in),retain)) > 0) + while ((error=fill_buffer_retaining(my_fileno(in),retain)) > 0) { end_of_line=buffer ; buffer[bufbytes]=0; /* Sentinel */ diff --git a/mysql-wsrep-5.6/extra/yassl/CMakeLists.txt b/mysql-wsrep-5.6/extra/yassl/CMakeLists.txt index ca23f333..8115b3da 100644 --- a/mysql-wsrep-5.6/extra/yassl/CMakeLists.txt +++ b/mysql-wsrep-5.6/extra/yassl/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,7 +33,6 @@ SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp sr ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES}) RESTRICT_SYMBOL_EXPORTS(yassl) -INSTALL_DEBUG_SYMBOLS(yassl) IF(MSVC) INSTALL_DEBUG_TARGET(yassl DESTINATION ${INSTALL_LIBDIR}/debug) ENDIF() diff --git a/mysql-wsrep-5.6/extra/yassl/README b/mysql-wsrep-5.6/extra/yassl/README index 24bdf32f..da399c3d 100644 --- a/mysql-wsrep-5.6/extra/yassl/README +++ b/mysql-wsrep-5.6/extra/yassl/README @@ -12,7 +12,71 @@ before calling SSL_new(); *** end Note *** -yaSSL Release notes, version 2.2.2 (7/5/2012) +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. + +yaSSL Release notes, version 2.3.6 (11/25/2014) + + This release of yaSSL fixes some valgrind warnings/errors including + uninitialized reads and off by one index errors induced from fuzzing + the handshake. These were reported by Oracle. + +yaSSL Release notes, version 2.3.5 (9/29/2014) + + This release of yaSSL fixes an RSA Padding check vulnerability reported by + Intel Security Advanced Threat Research team + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0 and note in 1.5.8. + + +yaSSL Release notes, version 2.3.4 (8/15/2014) + + This release of yaSSL adds checking to the input_buffer class itself. + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0 and note in 1.5.8. + + +yaSSL Release notes, version 2.3.2 (7/25/2014) + + This release of yaSSL updates test certs. + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0 and note in 1.5.8. + + +*****************yaSSL Release notes, version 2.3.0 (12/5/2013) + + This release of yaSSL updates asm for newer GCC versions. + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0 and note in 1.5.8. + + +*****************yaSSL Release notes, version 2.2.3 (4/23/2013) + + This release of yaSSL updates the test certificates as they were expired + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0 and note in 1.5.8. + + +*****************yaSSL Release notes, version 2.2.2d (2/5/2013) + + This release of yaSSL contains countermeasuers for the Lucky 13 TLS 1.1 + CBC timing padding attack identified by Nadhem AlFardan and Kenneth Paterson + see: http://www.isg.rhul.ac.uk/tls/ + + It also adds SHA2 certificate verification and better checks for malicious + input. + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0 and note in 1.5.8. + + +*****************yaSSL Release notes, version 2.2.2 (7/5/2012) This release of yaSSL contains bug fixes and more security checks around malicious certificates. diff --git a/mysql-wsrep-5.6/extra/yassl/certs/ca-cert.pem b/mysql-wsrep-5.6/extra/yassl/certs/ca-cert.pem index 6a0cf898..7e64eb47 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/ca-cert.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/ca-cert.pem @@ -1,56 +1,87 @@ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIJAJpBR82hFGKMMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD +VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G +A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3 +dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe +Fw0xNDA3MTEwMzIwMDhaFw0xNzA0MDYwMzIwMDhaMIGUMQswCQYDVQQGEwJVUzEQ +MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3 +dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns +LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL8Myi0Ush6EQlvNOB9K8k11EPG2NZ/fyn0D +mNOs3gNm7irx2LB9bgdUCxCYIU2AyxIg58xP3kV9yXJ3MurKkLtpUhADL6jzlcXx +i2JWG+9nb6QQQZWtCpvjpcCw0nB2UDBbqOgILHztp6J6jTgpHKzH7fJ8lbCVgn1J +XDjNdyXvvYB1U5Q8PcpjW58VtdMdEy8Z0TzbdjrMuH3J5cLX2kBv2CHccxtCLVOc +/hr8fat6Nj+Y3oR8BWfOahQ4h6nxjLVoy2h/cSAr9aBj9VYvoybSt2+xWhfXOJkI +/pNYb/7DE0kIFgunTWcAUjFnI06Y7VFFHbkE2Qvs2CizS73tNnkCAwEAAaOB/DCB ++TAdBgNVHQ4EFgQUJ45nEXTDJh0/7TNjs6TYHTDl6NUwgckGA1UdIwSBwTCBvoAU +J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD +VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290 +aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t +MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYD +VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAeXgMbXmIkfw6FZz5J2IW8CEf ++n0/oqgyHvfyEal0FnRe3BjK8AAq1QMGJjDxR4P9Mm787apPfQxjYDEvfAy/mWaH +7ScIhi3EM+iYIxz+o9uaSU78WkLvccM/rdxKqNKjHQmsMwR7hvNtAFmjyNvRPHP2 +DpDWXkngvzZjCHulsI81O1aMETVJBBzQ57pWxQ0KkY3Wt2IZNBJSTNJtfMU9DxiB +VMv2POWE0tZxFewaNAvwoCF0Q8ijsN/ZZ9rirZNI+KCHvXkU4GIK3/cxLjF70TIq +Cv5dFO/ZZFDkg5G8cA3XiI3ZvIQOxRqzv2QCTlGRpKKFFYOv8FubKElfsrMD2A== +-----END CERTIFICATE----- Certificate: Data: Version: 3 (0x2) Serial Number: - 8a:37:22:65:73:f5:aa:e8 - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=Montana, L=Bozeman, O=sawtooth, OU=consulting, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com + 9a:41:47:cd:a1:14:62:8c + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com Validity - Not Before: Jun 30 18:47:10 2010 GMT - Not After : Mar 26 18:47:10 2013 GMT - Subject: C=US, ST=Montana, L=Bozeman, O=sawtooth, OU=consulting, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com + Not Before: Jul 11 03:20:08 2014 GMT + Not After : Apr 6 03:20:08 2017 GMT + Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public Key: (512 bit) - Modulus (512 bit): - 00:97:30:b9:1a:92:ef:25:4f:ca:4c:11:31:95:1a: - e1:c0:10:19:0a:20:b9:37:80:1a:57:38:02:4e:1b: - c5:0f:28:4f:da:e3:c9:16:aa:50:bd:4a:fb:b7:71: - c7:35:cc:63:81:c1:dd:9d:33:f9:38:16:88:32:a0: - aa:56:23:03:a3 + Public-Key: (2048 bit) + Modulus: + 00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a: + f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac: + de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98: + 21:4d:80:cb:12:20:e7:cc:4f:de:45:7d:c9:72:77: + 32:ea:ca:90:bb:69:52:10:03:2f:a8:f3:95:c5:f1: + 8b:62:56:1b:ef:67:6f:a4:10:41:95:ad:0a:9b:e3: + a5:c0:b0:d2:70:76:50:30:5b:a8:e8:08:2c:7c:ed: + a7:a2:7a:8d:38:29:1c:ac:c7:ed:f2:7c:95:b0:95: + 82:7d:49:5c:38:cd:77:25:ef:bd:80:75:53:94:3c: + 3d:ca:63:5b:9f:15:b5:d3:1d:13:2f:19:d1:3c:db: + 76:3a:cc:b8:7d:c9:e5:c2:d7:da:40:6f:d8:21:dc: + 73:1b:42:2d:53:9c:fe:1a:fc:7d:ab:7a:36:3f:98: + de:84:7c:05:67:ce:6a:14:38:87:a9:f1:8c:b5:68: + cb:68:7f:71:20:2b:f5:a0:63:f5:56:2f:a3:26:d2: + b7:6f:b1:5a:17:d7:38:99:08:fe:93:58:6f:fe:c3: + 13:49:08:16:0b:a7:4d:67:00:52:31:67:23:4e:98: + ed:51:45:1d:b9:04:d9:0b:ec:d8:28:b3:4b:bd:ed: + 36:79 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 3B:66:FD:A0:40:C6:F4:E2:70:CF:21:1A:0C:4F:67:FE:B7:4B:42:09 + 27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5 X509v3 Authority Key Identifier: - keyid:3B:66:FD:A0:40:C6:F4:E2:70:CF:21:1A:0C:4F:67:FE:B7:4B:42:09 - DirName:/C=US/ST=Montana/L=Bozeman/O=sawtooth/OU=consulting/CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com - serial:8A:37:22:65:73:F5:AA:E8 + keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5 + DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com + serial:9A:41:47:CD:A1:14:62:8C X509v3 Basic Constraints: CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 32:65:a2:b1:dc:6d:e0:8d:8b:c8:58:29:8e:b8:18:4b:62:88: - 13:67:f8:6c:75:46:75:8f:8a:19:a6:a3:d5:3c:fc:57:4e:7a: - 68:a9:fc:93:dc:ae:29:7d:bb:4e:ec:ea:55:fa:a4:e3:00:61: - f4:b0:34:6d:d1:d5:a4:64:24:f8 ------BEGIN CERTIFICATE----- -MIIDQDCCAuqgAwIBAgIJAIo3ImVz9aroMA0GCSqGSIb3DQEBBAUAMIGeMQswCQYD -VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G -A1UEChMIc2F3dG9vdGgxEzARBgNVBAsTCmNvbnN1bHRpbmcxJDAiBgNVBAMTG3d3 -dy5zYXd0b290aC1jb25zdWx0aW5nLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5 -YXNzbC5jb20wHhcNMTAwNjMwMTg0NzEwWhcNMTMwMzI2MTg0NzEwWjCBnjELMAkG -A1UEBhMCVVMxEDAOBgNVBAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAP -BgNVBAoTCHNhd3Rvb3RoMRMwEQYDVQQLEwpjb25zdWx0aW5nMSQwIgYDVQQDExt3 -d3cuc2F3dG9vdGgtY29uc3VsdGluZy5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9A -eWFzc2wuY29tMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJcwuRqS7yVPykwRMZUa -4cAQGQoguTeAGlc4Ak4bxQ8oT9rjyRaqUL1K+7dxxzXMY4HB3Z0z+TgWiDKgqlYj -A6MCAwEAAaOCAQcwggEDMB0GA1UdDgQWBBQ7Zv2gQMb04nDPIRoMT2f+t0tCCTCB -0wYDVR0jBIHLMIHIgBQ7Zv2gQMb04nDPIRoMT2f+t0tCCaGBpKSBoTCBnjELMAkG -A1UEBhMCVVMxEDAOBgNVBAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAP -BgNVBAoTCHNhd3Rvb3RoMRMwEQYDVQQLEwpjb25zdWx0aW5nMSQwIgYDVQQDExt3 -d3cuc2F3dG9vdGgtY29uc3VsdGluZy5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9A -eWFzc2wuY29tggkAijciZXP1qugwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQF -AANBADJlorHcbeCNi8hYKY64GEtiiBNn+Gx1RnWPihmmo9U8/FdOemip/JPcril9 -u07s6lX6pOMAYfSwNG3R1aRkJPg= ------END CERTIFICATE----- + Signature Algorithm: sha1WithRSAEncryption + 79:78:0c:6d:79:88:91:fc:3a:15:9c:f9:27:62:16:f0:21:1f: + fa:7d:3f:a2:a8:32:1e:f7:f2:11:a9:74:16:74:5e:dc:18:ca: + f0:00:2a:d5:03:06:26:30:f1:47:83:fd:32:6e:fc:ed:aa:4f: + 7d:0c:63:60:31:2f:7c:0c:bf:99:66:87:ed:27:08:86:2d:c4: + 33:e8:98:23:1c:fe:a3:db:9a:49:4e:fc:5a:42:ef:71:c3:3f: + ad:dc:4a:a8:d2:a3:1d:09:ac:33:04:7b:86:f3:6d:00:59:a3: + c8:db:d1:3c:73:f6:0e:90:d6:5e:49:e0:bf:36:63:08:7b:a5: + b0:8f:35:3b:56:8c:11:35:49:04:1c:d0:e7:ba:56:c5:0d:0a: + 91:8d:d6:b7:62:19:34:12:52:4c:d2:6d:7c:c5:3d:0f:18:81: + 54:cb:f6:3c:e5:84:d2:d6:71:15:ec:1a:34:0b:f0:a0:21:74: + 43:c8:a3:b0:df:d9:67:da:e2:ad:93:48:f8:a0:87:bd:79:14: + e0:62:0a:df:f7:31:2e:31:7b:d1:32:2a:0a:fe:5d:14:ef:d9: + 64:50:e4:83:91:bc:70:0d:d7:88:8d:d9:bc:84:0e:c5:1a:b3: + bf:64:02:4e:51:91:a4:a2:85:15:83:af:f0:5b:9b:28:49:5f: + b2:b3:03:d8 diff --git a/mysql-wsrep-5.6/extra/yassl/certs/ca-key.pem b/mysql-wsrep-5.6/extra/yassl/certs/ca-key.pem index 45d7b149..774feba0 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/ca-key.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/ca-key.pem @@ -1,9 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIBOQIBAAJBAJcwuRqS7yVPykwRMZUa4cAQGQoguTeAGlc4Ak4bxQ8oT9rjyRaq -UL1K+7dxxzXMY4HB3Z0z+TgWiDKgqlYjA6MCAwEAAQJAEQ9TY7c+uuQU/J5YDO4a -mRR37tegbq3Kyxqrz+p8QuhqLDtVh13GaF7rVU70vyNHm+cgihUyzho/PViAkPBo -qQIhAMU8/RDhDLgL5BxID4sxKIVBtg+imFSbyKVyg7oQLUcXAiEAxDu94O45Cf4a -np9R0thumY/QqWpCkycWAB7fFEuaf1UCIEH+bg4/vqm2ENUFp23DPPOZUPlaRe3J -UhFJh5mx3/RxAiBq++8vfHFYg1Lb/BxOCXVy/zdRxf753ytdcXdJx1Y56QIgVgpN -FNfYJofQfWaP96sjlc0usrT28uceHx0QmHqolVc= +MIIEpAIBAAKCAQEAvwzKLRSyHoRCW804H0ryTXUQ8bY1n9/KfQOY06zeA2buKvHY +sH1uB1QLEJghTYDLEiDnzE/eRX3Jcncy6sqQu2lSEAMvqPOVxfGLYlYb72dvpBBB +la0Km+OlwLDScHZQMFuo6AgsfO2nonqNOCkcrMft8nyVsJWCfUlcOM13Je+9gHVT +lDw9ymNbnxW10x0TLxnRPNt2Osy4fcnlwtfaQG/YIdxzG0ItU5z+Gvx9q3o2P5je +hHwFZ85qFDiHqfGMtWjLaH9xICv1oGP1Vi+jJtK3b7FaF9c4mQj+k1hv/sMTSQgW +C6dNZwBSMWcjTpjtUUUduQTZC+zYKLNLve02eQIDAQABAoIBAD1uTmAahH+dhXzh +Swd84NaZKt6d+TY0DncOPgjqT+UGJtT2OPffDQ8cLgai9CponGNy4zXmBJGRtcGx +pFSs18b7QaDWdW+9C06/sVLoX0kmmFZHx97p6jxgAb8o3DG/SV+TSYd6gVuWS03K +XDhPt+Gy08ch2jwShwfkG9xD7OjsVGHn9u2mCy7134J/xh9hGZykgznfIYWJb3ev +hhUyCKJaCyZh+3AMypw4fbwi7uujqBYA+YqAHgCEqEpB+IQDZy8jWy+baybDBzSU +owM7ctWfcuCtzDSrvcfV9SYwhQ8wIzlS/zzLmSFNiKWr7mK5x+C7R4fBac9z8zC+ +zjkEnOUCgYEA4XZFgFm200nfCu8S1g/wt8sqN7+n+LVN9TE1reSjlKHb8ZattQVk +hYP8G1spqr74Jj92fq0c8MvXJrQbBY5Whn4IYiHBhtZHeT63XaTGOtexdCD2UJdB +BFPtPybWb5H6aCbsKtya8efc+3PweUMbIaNZBGNSB8nX5tEbXV6W+lMCgYEA2O1O +ZGFrkQxhAbUPu0RnUx7cB8Qkfp5shCORDOQSBBZNeJjMlj0gTg9Fmrb4s5MNsqIb +KfImecjF0nh+XnPy13Bhu0DOYQX+aR6CKeYUuKHnltAjPwWTAPLhTX7tt5Zs9/Dk +0c8BmE/cdFSqbV5aQTH+/5q2oAXdqRBU+GvQqoMCgYAh0wSKROtQt3xmv4cr5ihO +6oPi6TXh8hFH/6H1/J8t5TqB/AEDb1OtVCe2Uu7lVtETq+GzD3WQCoS0ocCMDNae +RrorPrUx7WO7pNUNj3LN0R4mNeu+G3L9mzm0h7cT9eqDRZOYuo/kSsy0TKh/CLpB +SahJKD1ePcHONwDL+SzdUQKBgQChV58+udavg22DP4/70NyozgMJI7GhG2PKxElW +NSvRLmVglQVVmRE1/dXfRMeliHJfsoJRqHFFkzbPXB9hUQwFgOivxXu6XiLjPHXD +hAVVbdY6LYSJkzPLONqqMQXNzmwt3VXTVwvwpTVqsK4xukOWygDHS+MZEkPTQvpv +6oDA0QKBgQC524kgNCdwYjTqXyViEvOdgb9I7poOwY0Q/2WanS0aipRayMClpYRh +ntQkue+pncl3C8dwZj26yFTf0jPh9X/5J2G+V0Xdt0UXJPUj5DgOkSfu4yDYFMiU +R3dAd0UYng3OeT9XMVYJSWe+lFhP9sSr4onj44rABVUsJMBKlwQnmg== -----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/extra/yassl/certs/client-cert.der b/mysql-wsrep-5.6/extra/yassl/certs/client-cert.der index c2a75119e54275743b5dc77e1812756668f4a72d..293985adb974f6aefe00cbcd63701ea735fbcfa6 100644 GIT binary patch literal 1198 zcmXqLVp(O-#5`#MGZP~d6DPyA<n{frN#P3&c-c6$+C196^D;8BvN9MnPBG**;ACSC zWnmL$3Jo?CFyI4mIC$87^Ycm)^Aceq>^$sF`Bka8iFq&)E*|#s{G7DlU>`#f10j$u zZXWJ{qWtut#N6D>ymUhe12K>&GY@}xdAS})ZE<mqUUGh}p}c`C+!>sVVgi|YY55LF z3Jm1Lc@0er%nc0<&5bQhOrn5Xa|06tGbnekI=hKc2|0inSs9p{82K3tni#p5niv@w z4l`fW{%5(w$kjUdM2ogoP06gitF(gH-LEY(+r)0vcVSm%^|8Y)^R6^{{MF4^)SbS2 zVd)7o9j{B$-@A96=l%Kq&BsQ$>e<Zhv-YQ+sZUkOT=qhwGx~|i_oEv`CVx$@wyLUl z$QTwjahb4F?<E_DIX>?%w%s=ml;&Az{q^HwFViOv&rQ28UANzF`UQa(D>w`q*DG*4 ziySRU-(u91-`jSm!(pab^Da4uA|>(bL8&Um8_vC#JiG3HMNahrA?7Q7MZ5vI){Ctd z&y1UU;wDe)=9^tNL)32P{#vv9zpBrXi<MsrFSj{J2yaN<TI6SNWO_@RZkYac(eL#K z)_wgG{q*<3U6+}d85tNCH~ukb{0U3}%%QS;EMhDo#y4Eku4lAM)P?XCs82kucD*(A zfI;I)ki0TW<3WSQeGOREENq;$q;dKnO$$v(d5#C<6=4=u17=3X|Hughm;-?cgpr|D zV8YSZd#XL3!mD*fWLSR|COd3+eDI*2uvXRfYbp`#ubF@Iu7B|5!ihbBW&-||XZ+J@ z*Uvm%eJ*3lF|$=pc|8@;n_5p@e7M5!V&l!92N%yXaemKLS!>sv_(vq>;@v%b*8{f~ z<~i1N>qN~uUGAOrmF+*%dbwxG{(D?*+K0{Koa6j6RME(-iL-5Gb&1TpD6Rd>l@m{Y z(yTuz+SIu-_-q~fgq5*n4<+MxBX&ey<-M=GIy<>ca^9T#8^S$vF0@TQoMZFrLD(Vb z#|xdLB9dC?mPj^ptdE@VW9HuU%U-YePM%8a;_Y%eGvTG)p^)PGxb?k{j83~MT$A*T ME;l^GuX~^l0F5cF6aWAK literal 699 zcmXqLV%l!d#FV&znTe5!iIKs8myJ`a&7<u*FC!xhD}zCWA-4f18*?ZNn=n&oupvKC z9?0PkX7evfP0!CW6g1!m39t)u1mqW$<Rs>$81fnLfP}b&St}ERgMAFe3`9VDW?|m) z@^Zb(#Ny%{z2y8{Ls<i9xLur#Vtko-Y55LtX#+WNUISADV*_&_HZV4f66ZBBGcYkQ zgmMSaWiiNs#K_9P?9E`{!Q{wrR=&dh$Bt_p`}fu;C$^bsta)d%V%C&rSJhq=25eI6 zmXWhB-E?_#`c$63Wg4kh&j~fnV`EsvdH0-^+FduT1+Ilm%!~|-iyN;RG+r{01qPWc zABz}^$U4=yU%rc@wcGD~)cWdl;QzU;Th<yhE&|Cbvoy{!Xq?`FRn5YhB~=3#NKL?` z1WE?7!Yr%?%#4ixk;4p_u$UbgA|=;J`=!o1^>K&o|Ko9@Z35GK?39dF`;{&)X#VtD ofBio-jhFscPI}hl2i9r*Ul6V8s+V??chZ!nI}(niOMPYr0K!Dd_5c6? diff --git a/mysql-wsrep-5.6/extra/yassl/certs/client-cert.pem b/mysql-wsrep-5.6/extra/yassl/certs/client-cert.pem index 7acc9a85..38330d53 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/client-cert.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/client-cert.pem @@ -2,54 +2,86 @@ Certificate: Data: Version: 3 (0x2) Serial Number: - c5:d7:6c:11:36:f0:35:e1 - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=programming, CN=www.yassl.com/emailAddress=info@yassl.com + b6:63:af:8f:5d:62:57:a0 + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Programming, CN=www.wolfssl.com/emailAddress=info@wolfssl.com Validity - Not Before: Jun 30 18:39:39 2010 GMT - Not After : Mar 26 18:39:40 2013 GMT - Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=programming, CN=www.yassl.com/emailAddress=info@yassl.com + Not Before: Jul 11 17:39:44 2014 GMT + Not After : Apr 6 17:39:44 2017 GMT + Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Programming, CN=www.wolfssl.com/emailAddress=info@wolfssl.com Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public Key: (512 bit) - Modulus (512 bit): - 00:bd:51:4a:14:fd:6a:19:84:0c:33:38:fc:27:32: - 9c:97:0b:fc:a4:18:60:69:4e:d9:d8:78:50:0b:e9: - 20:5d:d6:1d:70:1c:0c:24:9f:23:82:cc:3a:01:d5: - 97:17:b2:73:6c:86:cf:b5:f1:e5:ce:68:0c:d9:a2: - 12:39:7c:f2:53 + Public-Key: (2048 bit) + Modulus: + 00:c3:03:d1:2b:fe:39:a4:32:45:3b:53:c8:84:2b: + 2a:7c:74:9a:bd:aa:2a:52:07:47:d6:a6:36:b2:07: + 32:8e:d0:ba:69:7b:c6:c3:44:9e:d4:81:48:fd:2d: + 68:a2:8b:67:bb:a1:75:c8:36:2c:4a:d2:1b:f7:8b: + ba:cf:0d:f9:ef:ec:f1:81:1e:7b:9b:03:47:9a:bf: + 65:cc:7f:65:24:69:a6:e8:14:89:5b:e4:34:f7:c5: + b0:14:93:f5:67:7b:3a:7a:78:e1:01:56:56:91:a6: + 13:42:8d:d2:3c:40:9c:4c:ef:d1:86:df:37:51:1b: + 0c:a1:3b:f5:f1:a3:4a:35:e4:e1:ce:96:df:1b:7e: + bf:4e:97:d0:10:e8:a8:08:30:81:af:20:0b:43:14: + c5:74:67:b4:32:82:6f:8d:86:c2:88:40:99:36:83: + ba:1e:40:72:22:17:d7:52:65:24:73:b0:ce:ef:19: + cd:ae:ff:78:6c:7b:c0:12:03:d4:4e:72:0d:50:6d: + 3b:a3:3b:a3:99:5e:9d:c8:d9:0c:85:b3:d9:8a:d9: + 54:26:db:6d:fa:ac:bb:ff:25:4c:c4:d1:79:f4:71: + d3:86:40:18:13:b0:63:b5:72:4e:30:c4:97:84:86: + 2d:56:2f:d7:15:f7:7f:c0:ae:f5:fc:5b:e5:fb:a1: + ba:d3 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 5C:F7:29:21:69:7A:09:78:9E:7B:CD:53:42:02:EC:CE:29:0D:11:DF + 33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0 X509v3 Authority Key Identifier: - keyid:5C:F7:29:21:69:7A:09:78:9E:7B:CD:53:42:02:EC:CE:29:0D:11:DF - DirName:/C=US/ST=Oregon/L=Portland/O=yaSSL/OU=programming/CN=www.yassl.com/emailAddress=info@yassl.com - serial:C5:D7:6C:11:36:F0:35:E1 + keyid:33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0 + DirName:/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Programming/CN=www.wolfssl.com/emailAddress=info@wolfssl.com + serial:B6:63:AF:8F:5D:62:57:A0 X509v3 Basic Constraints: CA:TRUE - Signature Algorithm: md5WithRSAEncryption - b4:a5:f1:71:26:4d:b9:ff:54:f3:09:1f:ac:e1:19:59:e5:ec: - 57:e3:f1:0b:b2:8f:f3:29:eb:6b:c6:fa:27:33:3e:91:d0:77: - 43:c9:ce:1e:0f:71:07:a9:f7:26:e0:7e:ff:30:7d:52:0a:e1: - 80:48:46:bb:99:e9:d9:77:ce:75 + Signature Algorithm: sha1WithRSAEncryption + 85:10:90:c5:5d:de:25:8c:f2:57:7b:2d:14:1c:05:f9:71:63: + 40:b0:e3:c1:c1:2e:13:2a:7a:b7:d6:24:58:87:eb:03:fb:0d: + af:e0:f4:d0:c8:bc:51:36:10:4f:79:cc:4f:66:7d:af:99:cb: + 7b:ce:68:94:c6:36:aa:42:6e:8c:78:5b:b2:85:ca:d1:e1:a8: + 31:d1:81:d9:f9:c1:a3:9e:34:43:ef:0a:79:7d:3e:83:61:fc: + 14:5c:d1:dd:bc:0e:d7:51:b7:71:6e:41:7e:8b:2c:5a:9a:cb: + 77:4b:6a:f5:06:ff:02:af:1e:e6:63:4f:bc:44:d9:3f:56:9e: + 09:9c:43:f9:55:21:32:46:82:09:86:a9:7b:74:1c:9e:5a:2a: + bf:03:79:91:cb:f2:29:7f:c9:15:82:89:b9:53:cd:7e:07:90: + a9:5d:76:e1:19:5e:0d:58:b8:59:d5:0d:df:23:ab:6b:63:76: + 19:9e:9c:df:b0:57:49:6c:d0:86:97:c3:6c:3c:fa:e0:56:c2: + 1b:e3:a1:42:1a:58:62:85:9d:74:19:83:08:af:59:90:f8:99: + bd:67:d3:4a:ea:0e:c9:ca:61:8a:0d:8a:42:cc:90:e9:2e:c2: + 54:73:7f:5e:af:8d:e2:32:cb:45:20:d6:19:4d:5b:77:31:cc: + 0f:2d:c0:7e -----BEGIN CERTIFICATE----- -MIIDDjCCArigAwIBAgIJAMXXbBE28DXhMA0GCSqGSIb3DQEBBAUAMIGOMQswCQYD -VQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwG -A1UEChMFeWFTU0wxFDASBgNVBAsTC3Byb2dyYW1taW5nMRYwFAYDVQQDEw13d3cu -eWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMDA2 -MzAxODM5MzlaFw0xMzAzMjYxODM5NDBaMIGOMQswCQYDVQQGEwJVUzEPMA0GA1UE -CBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwGA1UEChMFeWFTU0wxFDAS -BgNVBAsTC3Byb2dyYW1taW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJ -KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgC -QQC9UUoU/WoZhAwzOPwnMpyXC/ykGGBpTtnYeFAL6SBd1h1wHAwknyOCzDoB1ZcX -snNshs+18eXOaAzZohI5fPJTAgMBAAGjgfYwgfMwHQYDVR0OBBYEFFz3KSFpegl4 -nnvNU0IC7M4pDRHfMIHDBgNVHSMEgbswgbiAFFz3KSFpegl4nnvNU0IC7M4pDRHf -oYGUpIGRMIGOMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH -EwhQb3J0bGFuZDEOMAwGA1UEChMFeWFTU0wxFDASBgNVBAsTC3Byb2dyYW1taW5n -MRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlh -c3NsLmNvbYIJAMXXbBE28DXhMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQAD -QQC0pfFxJk25/1TzCR+s4RlZ5exX4/ELso/zKetrxvonMz6R0HdDyc4eD3EHqfcm -4H7/MH1SCuGASEa7menZd851 +MIIEqjCCA5KgAwIBAgIJALZjr49dYlegMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD +VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEQMA4G +A1UECgwHd29sZlNTTDEUMBIGA1UECwwLUHJvZ3JhbW1pbmcxGDAWBgNVBAMMD3d3 +dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe +Fw0xNDA3MTExNzM5NDRaFw0xNzA0MDYxNzM5NDRaMIGUMQswCQYDVQQGEwJVUzEQ +MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEQMA4GA1UECgwHd29s +ZlNTTDEUMBIGA1UECwwLUHJvZ3JhbW1pbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns +LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMMD0Sv+OaQyRTtTyIQrKnx0mr2qKlIHR9am +NrIHMo7Quml7xsNEntSBSP0taKKLZ7uhdcg2LErSG/eLus8N+e/s8YEee5sDR5q/ +Zcx/ZSRppugUiVvkNPfFsBST9Wd7Onp44QFWVpGmE0KN0jxAnEzv0YbfN1EbDKE7 +9fGjSjXk4c6W3xt+v06X0BDoqAgwga8gC0MUxXRntDKCb42GwohAmTaDuh5AciIX +11JlJHOwzu8Zza7/eGx7wBID1E5yDVBtO6M7o5lencjZDIWz2YrZVCbbbfqsu/8l +TMTRefRx04ZAGBOwY7VyTjDEl4SGLVYv1xX3f8Cu9fxb5fuhutMCAwEAAaOB/DCB ++TAdBgNVHQ4EFgQUM9hFZtdohxh+VA1wJ5HHJteFZcAwgckGA1UdIwSBwTCBvoAU +M9hFZtdohxh+VA1wJ5HHJteFZcChgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD +VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMRAwDgYDVQQKDAd3b2xmU1NM +MRQwEgYDVQQLDAtQcm9ncmFtbWluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t +MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAtmOvj11iV6AwDAYD +VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAhRCQxV3eJYzyV3stFBwF+XFj +QLDjwcEuEyp6t9YkWIfrA/sNr+D00Mi8UTYQT3nMT2Z9r5nLe85olMY2qkJujHhb +soXK0eGoMdGB2fnBo540Q+8KeX0+g2H8FFzR3bwO11G3cW5BfossWprLd0tq9Qb/ +Aq8e5mNPvETZP1aeCZxD+VUhMkaCCYape3QcnloqvwN5kcvyKX/JFYKJuVPNfgeQ +qV124RleDVi4WdUN3yOra2N2GZ6c37BXSWzQhpfDbDz64FbCG+OhQhpYYoWddBmD +CK9ZkPiZvWfTSuoOycphig2KQsyQ6S7CVHN/Xq+N4jLLRSDWGU1bdzHMDy3Afg== -----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/extra/yassl/certs/client-key.der b/mysql-wsrep-5.6/extra/yassl/certs/client-key.der index 6e8b432a07c4d197b514a05153da23ffcd388759..94dc253a2bd214f1c2c9a99c5d7c649e5da5ded9 100644 GIT binary patch literal 1192 zcmV;Z1Xueof&`=j0RRGm0RaHR1JNt~Iixa0J5$JnD=K_+n!TzjQU^!YrZ%z%GLF!? zX?w=QM4r@vNc}BnqKjv{p>@bMEK1TF_lvsE4f*fv@qr$Dn*&Fhzh%sSWh7~)=oE=t z<TUriuoRQ^XL~w&c;Nw7R*|L?LXFZqK%7kP(T3kQQ5y`QJN5CSN;Tx+&X(UBe!ota z&=BaT2rz-KAPYkj#dK%1GJ<c7hQf$InKpyE9zb#;7uQl{By+IN?-|Xm|9EVBz!C%0 zPI3)UZ9AhoqnTcv$k_~qv)PK-R3_VP`mDSEB}~N8dGvA9hCmn-uw%7yPB6rmgoZ6v zFV_|Kf55Kw{9EPwp}Nxo0|5X50)hbn0HWsDUl4I*2%au&(QO`u(h9MRN6su!YM>IH zQ{ItG9c}7ad-8Xx*~Zz5tJvWd<YOlPwQLhvxZ|bBau+TPpKs+^KXz|Pu@S;rE*2>b z-nWk2K-Hq|;2xp$zL(pEW0n-nm<eDlFm{|g&E|;iN0NC9S^(l+UlDwL`3Scl28k+N z{Q#>X;qbG(B&l8|4j%w5{vn!ETW!-TtCWIhLpIp<FUBJLwLx7CGhphZeSYXmRgqTH zTvv}Dlov0m-szsG^v{Y+j-cdLbF$A*hQ(<-^CTdPT$T*_YZ5z}XTjgbma?VQk`0>) zLTDrqMbuE_7dc4KHH(yO5#Eo=SptE90O};C`DruhaokdUh#@F1N#4407U|4KdWa2_ zSA<v=I)Si1qR*ym9<T-}0FUQ)cC6dV$Jt(+KPHe;uKYNV02I5l4_K7vFKT`qPeCEn zF<Bo@iW-flS8O8K<@A0srVz_yrBwrmrY8lA!`HSavQ4@$+DDI6(>;rXjg**Jr2>J0 z0M$4f!;i(23`YxZHIl`!jYi0l7?1UU3it1!{(!l)D!R%TuwA7G(36eWoCF-yVveRJ zfdT){iYj9?H9)FufZmBCYFAC3Zmp9}R*(yAopXx}t|vX-PVlP5Y<OpElv12GXKXF+ zyRYA-kUYdk&yALzn5nd%#imf)v+(<L7XpERUV{l@y}Ep&ze05Nd>qng$pj6Bem*@U z62lmK^C|OR4t8u=b>u;WX`M3j%_6I?HM&Z&JmuL~wqj3R-sPSO%2To|_nxzB3R`() z>~4`xk|6f{{1)xgb`0X|f3j&4Yj_S?Mr5>Jw<VxjbvjG$$2>mw{U*2|#F+}3bH2kF z0)c@5x<r!{tTY)rUy)#}_q5i51vXJrJ?LfJuP)qSKFNK!e~0ipn*)L=H_mcS5!JE5 z3<sc@kxGq!?0L`eIkoA9>|*!YeY|8%B0LWA)=~9`*qOi)AYBhB{afO$*&Nv+R&D%* z&|mEk6&x5L=fpir*U+A7mCqu{1ACt1U;+Fu0)c=L&`Zx7XStscbw`F}t}(*KFsxYy zP}vW)a0d7A)5v0csM>D!AwSc9U+RjhKiMi?^HI{mFgN2Zqje1)O(8VZS8!a3zjEwK zZfMob7<4mEj5<Y+=9WO~WBD0|I#Jz;OR)3#pIs=GIKDNj%3SA@Q#7GPT@yKFLPnvV G&Go+_<wA)7 literal 318 zcmV-E0m1$-f&n@L0RRF)0L>qGNBFqb2*162BVmR%D6H;0sG5}K)h6h1P_ibA93DS) zveUC?l??rMC}q{o5`vxv0HO)q&N?RDMk=61aRLJY009C(Uk184Rd0i^Z|i@I0F5P| z_+>Hj#u7hK_5p7td@{iFghCjjIhmezk-#qJ#XQmN!M442X6iCPK*Q2QXb2!d0wDnJ zrUj&?pl(26QkX%QfJyK6z{X=~1daPKOUPe)Ie!@fApqMRVn$`uk+YNWH-En$5%y}m zTabyn=MDKKhQT%=JQ)HYW<@ijP<W=4QuHi^(a!C@x=#vP;x<oVBWQElOMCtS0w8{j zi@}hpHUs+GgKQcbeX31&Q(UCair_sKc|SQ_^l<_q0Na4L$7uOKt6{@NCs;yYpx*SA Qfuz^cL*f4eyB4``3r`M@W&i*H diff --git a/mysql-wsrep-5.6/extra/yassl/certs/client-key.pem b/mysql-wsrep-5.6/extra/yassl/certs/client-key.pem index 92c052fe..c4e7ad22 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/client-key.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/client-key.pem @@ -1,9 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIBPAIBAAJBAL1RShT9ahmEDDM4/CcynJcL/KQYYGlO2dh4UAvpIF3WHXAcDCSf -I4LMOgHVlxeyc2yGz7Xx5c5oDNmiEjl88lMCAwEAAQJAVGHWLlLhpqvXsEEXCvWh -HCYono+K8YVGzhiaPSTU212fCoQryIxsXQKGBjhFdZm96DZWp+Vd/t/u+B4ZeaqY -+QIhAOBEfbFtdZqk5OmbbRsRVPI7+YYmubgY1TVIPqmxHQ4NAiEA2BrTQkjOb3ul -A/SZO04fJUZsm7Ng92FWHDJsRancSd8CIQCmGbQqZBK1TamJZ6dAY+7RViAx/p6Q -vjuzMeXPUrFdRQIhAMkfBhg9bCqjFyt8PBPOm/vz8+ZgZlE0/JAXeV7IPCVfAiEA -gZwCFm1ghGxmaoB424YC4DHeDeN/g9xwJHT7EuM9Mvc= +MIIEpAIBAAKCAQEAwwPRK/45pDJFO1PIhCsqfHSavaoqUgdH1qY2sgcyjtC6aXvG +w0Se1IFI/S1oootnu6F1yDYsStIb94u6zw357+zxgR57mwNHmr9lzH9lJGmm6BSJ +W+Q098WwFJP1Z3s6enjhAVZWkaYTQo3SPECcTO/Rht83URsMoTv18aNKNeThzpbf +G36/TpfQEOioCDCBryALQxTFdGe0MoJvjYbCiECZNoO6HkByIhfXUmUkc7DO7xnN +rv94bHvAEgPUTnINUG07ozujmV6dyNkMhbPZitlUJttt+qy7/yVMxNF59HHThkAY +E7BjtXJOMMSXhIYtVi/XFfd/wK71/Fvl+6G60wIDAQABAoIBAQCi5thfEHFkCJ4u +bdFtHoXSCrGMR84sUWqgEp5T3pFMHW3qWXvyd6rZxtmKq9jhFuRjJv+1bBNZuOOl +yHIXLgyfb+VZP3ZvSbERwlouFikN3reO3EDVou7gHqH0vpfbhmOWFM2YCWAtMHac +PM3miO5HknkLWgDiXl8RfH35CLcgBokqXf0AqyLh8LO8JKleJg4fAC3+IZpTW23T +K6uUgmhDNtj2L8Yi/LVBXQ0zYOqkfX7oS1WRVtNcV48flBcvqt7pnqj0z4pMjqDk +VnOyz0+GxWk88yQgi1yWDPprEjuaZ8HfxpaypdWSDZsJQmgkEEXUUOQXOUjQNYuU +bRHej8pZAoGBAOokp/lpM+lx3FJ9iCEoL0neunIW6cxHeogNlFeEWBY6gbA/os+m +bB6wBikAj+d3dqzbysfZXps/JpBSrvw4kAAUu7QPWJTnL2p+HE9BIdQxWR9OihqN +p1dsItjl9H4yphDLZKVVA4emJwWMw9e2J7JNujDaR49U0z2LhI2UmFilAoGBANU4 +G8OPxZMMRwtvNZLFsI1GyJIYj/WACvfvof6AubUqusoYsF2lB9CTjdicBBzUYo6m +JoEB/86KKmM0NUCqbYDeiSNqV02ebq2TTlaQC22dc4sMric93k7wqsVseGdslFKc +N2dsLe+7r9+mkDzER8+Nlp6YqbSfxaZQ3LPw+3QXAoGAXoMJYr26fKK/QnT1fBzS +ackEDYV+Pj0kEsMYe/Mp818OdmxZdeRBhGmdMvPNIquwNbpKsjzl2Vi2Yk9d3uWe +CspTsiz3nrNrClt5ZexukU6SIPb8/Bbt03YM4ux/smkTa3gOWkZktF63JaBadTpL +78c8Pvf9JrggxJkKmnO+wxkCgYEAukSTFKw0GTtfkWCs97TWgQU2UVM96GXcry7c +YT7Jfbh/h/A7mwOCKTfOck4R1bHBDAegmZFKjX/sec/xObXphexi99p9vGRNIjwO +8tZR9YfYmcARIF0PKf1b4q7ZHNkhVm38hNBf7RAVHBgh58Q9S9fQnmqVzyLJA3ue +42AB/C8CgYAR0EvPG2e5nxB1R4ZlrjHCxjCsWQZQ2Q+1cAb38NPIYnyo2m72IT/T +f1/qiqs/2Spe81HSwjA34y2jdQ0eTSE01VdwXIm/cuxKbmjVzRh0M06MOkWP5pZA +62P5GYY6Ud2JS7Dz+Z9dKJU4vjWrylznk1M0oUVdEzllQkahn831vw== -----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/extra/yassl/certs/client-keyEnc.pem b/mysql-wsrep-5.6/extra/yassl/certs/client-keyEnc.pem index f6b857fc..0097c076 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/client-keyEnc.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/client-keyEnc.pem @@ -1,12 +1,12 @@ -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED -DEK-Info: DES-CBC,B9D8FB94E38635AB +DEK-Info: DES-EDE3-CBC,BDE979D13CCC0ABD -e7bVyzL1RF6p7hl8GDaOrRTcgB4ip+pWWUcnNf6y2tsuAQx/c/Bd5c9ZDc3L5AXC -oOAzWYB+ay1vWkmAQB4ivFS5QzGDf8870d4FbOejwmgPhiHdZNw5xNwscAN6ps0v -dFaUrR9nzWmbycsQCjXZGIZtGFCtXkA8Gdl5OMO4o+rzM0muNPS5fb++x7oNl1YG -gjReu2sQ85dPfMlnoHhr8Pz9LBcxVyOmcqtmT0SOSuPcoj6aDtcZ+EY9MQf6SR9E -ysmrJKMtp+ABgXglAj5hbT0dMpoJ2KpJYk62JAh/A6DDyv5YYUI0W57xY5+QzaV+ -YXnIvqwLjJ3cXEV4YH7ozLHAESgnAAUoQsin42rrRKt7GxjSdBoFhWjH69V2nl65 -LYRNjE1O5BBEX+rz0S+fe2ZZgT17kUr7eLZCq15J+L5xWQ7R4ERc0w== +N7yz2JV13EmQ7MZPL5wamid5+G1V1gp8FKqMemAC5JDxonS/W9oViMLUcxbfPTDx +FznKdYSVTIQ7vv3ofmDG4MEyV/2C568N2kdtAw+jTfrZFN+IU9CI+W+In/nacirF +02sAcvDMofustnooKNOO7/iyb5+3vRvEt5vSSRQn5WuSQ9sUKjuzoLs/lbf7fyAt +4NeqfI3rYBZXxiUOLITOGXzGNRuFoY+o2uDCfelLAJ8uhiVG6ME3LeJEo1dT5lZ8 +CSJOLPasKg0iG4V7olM4j9FvAfZr48RRsSfUen756Jo2HpI4bad8LKhFYIdNs2Au +WwKLmjpo6QB9hBmRshR04rEXPdrgTqLBExCE08PyaGYnWU8ggWritCeBzDQFj/n4 +sI+NO0Mymuvg98e5RpO52lg3Xnqv9RIK3guLFOmI6aEHC0PS4WwOEQ== -----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/extra/yassl/certs/dsa-cert.pem b/mysql-wsrep-5.6/extra/yassl/certs/dsa-cert.pem index ed1138da..10d533ed 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/dsa-cert.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/dsa-cert.pem @@ -1,70 +1,22 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - ce:df:23:31:64:b4:13:da - Signature Algorithm: dsaWithSHA1 - Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=testing, CN=www.yassl.com/emailAddress=info@yassl.com - Validity - Not Before: Jun 30 18:56:38 2010 GMT - Not After : Mar 26 18:56:39 2013 GMT - Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=testing, CN=www.yassl.com/emailAddress=info@yassl.com - Subject Public Key Info: - Public Key Algorithm: dsaEncryption - DSA Public Key: - pub: - 04:84:a0:26:31:72:0c:e8:4f:5d:53:17:62:b1:80: - ca:c0:16:5f:c3:1e:ea:c5:d9:98:38:f9:be:56:53: - 47:68:ce:08:22:57:1c:bb:0d:77:91:cf:5b:36:ed: - f3:24:82:90:8a:cd:90:7c:db:77:f9:17:2d:73:73: - ef:bb:b9:82 - P: - 00:99:29:69:80:c9:3c:98:68:45:a9:82:fe:67:eb: - 95:88:c5:b4:0c:d6:26:45:95:19:2c:a0:20:5b:7e: - df:69:e9:dc:c3:0f:f3:61:0a:25:9b:f2:21:01:6a: - cd:aa:8c:37:e7:ca:66:db:56:f4:0f:7d:7a:d1:18: - b9:42:fd:1b:11 - Q: - 00:ad:25:29:ab:0a:9f:09:1c:c1:ad:03:20:76:7f: - a6:b7:dd:4d:03:09 - G: - 12:88:99:da:e7:d0:0b:93:9b:e6:ee:3c:21:7f:9c: - b3:b4:8d:a5:8c:e2:37:80:3f:17:d1:81:4f:bd:f0: - 71:b6:32:08:54:dd:bf:01:e2:b3:77:06:64:75:8a: - 04:d6:79:39:b1:02:03:03:c6:06:74:e5:90:05:0a: - 10:46:19:31 - X509v3 extensions: - X509v3 Subject Key Identifier: - BE:F9:8C:5D:D6:1C:B4:EE:81:DD:36:56:0A:21:E4:61:44:73:E9:E2 - X509v3 Authority Key Identifier: - keyid:BE:F9:8C:5D:D6:1C:B4:EE:81:DD:36:56:0A:21:E4:61:44:73:E9:E2 - DirName:/C=US/ST=Oregon/L=Portland/O=yaSSL/OU=testing/CN=www.yassl.com/emailAddress=info@yassl.com - serial:CE:DF:23:31:64:B4:13:DA - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: dsaWithSHA1 - 30:2d:02:14:00:a3:21:20:34:6a:2c:f9:fb:76:d7:20:c9:c0: - 35:1b:64:9a:c2:83:02:15:00:a4:59:ac:6d:da:85:48:ff:f5: - 0d:49:72:c8:cd:91:fc:ec:2f:5c:63 -----BEGIN CERTIFICATE----- -MIIDfjCCAz2gAwIBAgIJAM7fIzFktBPaMAkGByqGSM44BAMwgYoxCzAJBgNVBAYT -AlVTMQ8wDQYDVQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMQ4wDAYDVQQK -EwV5YVNTTDEQMA4GA1UECxMHdGVzdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNv -bTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wHhcNMTAwNjMwMTg1NjM4 -WhcNMTMwMzI2MTg1NjM5WjCBijELMAkGA1UEBhMCVVMxDzANBgNVBAgTBk9yZWdv -bjERMA8GA1UEBxMIUG9ydGxhbmQxDjAMBgNVBAoTBXlhU1NMMRAwDgYDVQQLEwd0 -ZXN0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5p -bmZvQHlhc3NsLmNvbTCB8DCBqAYHKoZIzjgEATCBnAJBAJkpaYDJPJhoRamC/mfr -lYjFtAzWJkWVGSygIFt+32np3MMP82EKJZvyIQFqzaqMN+fKZttW9A99etEYuUL9 -GxECFQCtJSmrCp8JHMGtAyB2f6a33U0DCQJAEoiZ2ufQC5Ob5u48IX+cs7SNpYzi -N4A/F9GBT73wcbYyCFTdvwHis3cGZHWKBNZ5ObECAwPGBnTlkAUKEEYZMQNDAAJA -BISgJjFyDOhPXVMXYrGAysAWX8Me6sXZmDj5vlZTR2jOCCJXHLsNd5HPWzbt8ySC -kIrNkHzbd/kXLXNz77u5gqOB8jCB7zAdBgNVHQ4EFgQUvvmMXdYctO6B3TZWCiHk -YURz6eIwgb8GA1UdIwSBtzCBtIAUvvmMXdYctO6B3TZWCiHkYURz6eKhgZCkgY0w -gYoxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRs -YW5kMQ4wDAYDVQQKEwV5YVNTTDEQMA4GA1UECxMHdGVzdGluZzEWMBQGA1UEAxMN -d3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb22CCQDO -3yMxZLQT2jAMBgNVHRMEBTADAQH/MAkGByqGSM44BAMDMAAwLQIUAKMhIDRqLPn7 -dtcgycA1G2SawoMCFQCkWaxt2oVI//UNSXLIzZH87C9cYw== +MIIDqzCCA2ugAwIBAgIJAMGqrgDU6DyhMAkGByqGSM44BAMwgY4xCzAJBgNVBAYT +AlVTMQ8wDQYDVQQIDAZPcmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQK +DAd3b2xmU1NMMRAwDgYDVQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wu +Y29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMB4XDTEzMDQyMjIw +MDk0NFoXDTE2MDExNzIwMDk0NFowgY4xCzAJBgNVBAYTAlVTMQ8wDQYDVQQIDAZP +cmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQKDAd3b2xmU1NMMRAwDgYD +VQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR8wHQYJKoZIhvcN +AQkBFhBpbmZvQHdvbGZzc2wuY29tMIIBuDCCASwGByqGSM44BAEwggEfAoGBAL1R +7koy4IrH6sbh6nDEUUPPKgfhxxLCWCVexF2+qzANEr+hC9M002haJXFOfeS9DyoO +WFbL0qMZOuqv+22CaHnoUWl7q3PjJOAI3JH0P54ZyUPuU1909RzgTdIDp5+ikbr7 +KYjnltL73FQVMbjTZQKthIpPn3MjYcF+4jp2W2zFAhUAkcntYND6MGf+eYzIJDN2 +L7SonHUCgYEAklpxErfqznIZjVvqqHFaq+mgAL5J8QrKVmdhYZh/Y8z4jCjoCA8o +TDoFKxf7s2ZzgaPKvglaEKiYqLqic9qY78DYJswzQMLFvjsF4sFZ+pYCBdWPQI4N +PgxCiznK6Ce+JH9ikSBvMvG+tevjr2UpawDIHX3+AWYaZBZwKADAaboDgYUAAoGB +AJ3LY89yHyvQ/TsQ6zlYbovjbk/ogndsMqPdNUvL4RuPTgJP/caaDDa0XJ7ak6A7 +TJ+QheLNwOXoZPYJC4EGFSDAXpYniGhbWIrVTCGe6lmZDfnx40WXS0kk3m/DHaC0 +3ElLAiybxVGxyqoUfbT3Zv1JwftWMuiqHH5uADhdXuXVo1AwTjAdBgNVHQ4EFgQU +IJjk416o4v8qpH9LBtXlR9v8gccwHwYDVR0jBBgwFoAUIJjk416o4v8qpH9LBtXl +R9v8gccwDAYDVR0TBAUwAwEB/zAJBgcqhkjOOAQDAy8AMCwCFCjGKIdOSV12LcTu +k08owGM6YkO1AhQe+K173VuaO/OsDNsxZlKpyH8+1g== -----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/extra/yassl/certs/dsa1024.der b/mysql-wsrep-5.6/extra/yassl/certs/dsa1024.der new file mode 100644 index 0000000000000000000000000000000000000000..db880d5148033e2e8c8c2368b6d83b2fb44a5289 GIT binary patch literal 448 zcmV;x0YCmQf&sh&0RRGlfdIWx?n*M?ipT24;p%Y2QA5uv2jRyO!dN9<#9h9tFbxvF zp$pSA(`Z^HaZY{Yy$>o5SXRr@qZvBtulsF+XnE*SX?v@4<0Rk++>!J@o*BtQ?o(fM z^&H?$(gUZTqLI4$DTwEm()-+06*0KeWdf~)icg<&BVoaQ;yQL)Y{dc<0FlY<V9@$7 zXa0GN$Rsm%FSMwfbpnBb0Fqj961VEkav6<V>ZoyAtLdNszDe;4%2sD#VVHko%=nBb z=m-xeOgaTC7yGkjbAhAEz6n|osF<j_qI24q@4(n5%rij3#lAZQ;=x(^mI4LUk3fzM zJ`6&OIm+lKz9fHQksxm}@xHa|<F92YYXHa{ef|Mv8e|r5C;-4|x&ncL0G-QY&vG9t z(EU3Q>p56%i{oxj=z@1_GNau!OUvOKk4^$l{l=OMHnd!x+LNF=OrMa2;?2P2=w$W@ z3xNg|Ai!RhCx~cUSc=t5A)e}4nGN~z<3*QCNhIEH!yTZs+(}CUEStqqvC66xeYE#x q{Yk<5Rx;?S9DZ&9I9*=l)dCbW)m7R?zX(0)x8_oyg;J-h`36J1(Aqx$ literal 0 HcmV?d00001 diff --git a/mysql-wsrep-5.6/extra/yassl/certs/dsa1024.pem b/mysql-wsrep-5.6/extra/yassl/certs/dsa1024.pem new file mode 100644 index 00000000..5478ebfc --- /dev/null +++ b/mysql-wsrep-5.6/extra/yassl/certs/dsa1024.pem @@ -0,0 +1,12 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIBvAIBAAKBgQC9Ue5KMuCKx+rG4epwxFFDzyoH4ccSwlglXsRdvqswDRK/oQvT +NNNoWiVxTn3kvQ8qDlhWy9KjGTrqr/ttgmh56FFpe6tz4yTgCNyR9D+eGclD7lNf +dPUc4E3SA6efopG6+ymI55bS+9xUFTG402UCrYSKT59zI2HBfuI6dltsxQIVAJHJ +7WDQ+jBn/nmMyCQzdi+0qJx1AoGBAJJacRK36s5yGY1b6qhxWqvpoAC+SfEKylZn +YWGYf2PM+Iwo6AgPKEw6BSsX+7Nmc4Gjyr4JWhComKi6onPamO/A2CbMM0DCxb47 +BeLBWfqWAgXVj0CODT4MQos5yugnviR/YpEgbzLxvrXr469lKWsAyB19/gFmGmQW +cCgAwGm6AoGBAJ3LY89yHyvQ/TsQ6zlYbovjbk/ogndsMqPdNUvL4RuPTgJP/caa +DDa0XJ7ak6A7TJ+QheLNwOXoZPYJC4EGFSDAXpYniGhbWIrVTCGe6lmZDfnx40WX +S0kk3m/DHaC03ElLAiybxVGxyqoUfbT3Zv1JwftWMuiqHH5uADhdXuXVAhQ01VXa +Rr8IPem35lKghVKnq/kGQw== +-----END DSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/extra/yassl/certs/server-cert.pem b/mysql-wsrep-5.6/extra/yassl/certs/server-cert.pem index 1ec53c02..f56cba9d 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/server-cert.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/server-cert.pem @@ -1,39 +1,173 @@ Certificate: Data: - Version: 1 (0x0) + Version: 3 (0x2) Serial Number: 1 (0x1) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=Montana, L=Bozeman, O=sawtooth, OU=consulting, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com Validity - Not Before: Jun 30 18:52:17 2010 GMT - Not After : Mar 26 18:52:17 2013 GMT - Subject: C=US, ST=Montana, L=Bozeman, O=yaSSL, OU=support, CN=www.yassl.com/emailAddress=info@yassl.com + Not Before: Jul 11 17:20:14 2014 GMT + Not After : Apr 6 17:20:14 2017 GMT + Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Support, CN=www.wolfssl.com/emailAddress=info@wolfssl.com Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public Key: (512 bit) - Modulus (512 bit): - 00:c6:7b:c0:68:81:2f:de:82:3f:f9:ac:c3:86:4a: - 66:b7:ec:d4:f1:f6:64:21:ff:f5:a2:34:42:d0:38: - 9f:c6:dd:3b:6e:26:65:6a:54:96:dd:d2:7b:eb:36: - a2:ae:7e:2a:9e:7e:56:a5:b6:87:9f:15:c7:18:66: - 7e:16:77:e2:a7 + Public-Key: (2048 bit) + Modulus: + 00:c0:95:08:e1:57:41:f2:71:6d:b7:d2:45:41:27: + 01:65:c6:45:ae:f2:bc:24:30:b8:95:ce:2f:4e:d6: + f6:1c:88:bc:7c:9f:fb:a8:67:7f:fe:5c:9c:51:75: + f7:8a:ca:07:e7:35:2f:8f:e1:bd:7b:c0:2f:7c:ab: + 64:a8:17:fc:ca:5d:7b:ba:e0:21:e5:72:2e:6f:2e: + 86:d8:95:73:da:ac:1b:53:b9:5f:3f:d7:19:0d:25: + 4f:e1:63:63:51:8b:0b:64:3f:ad:43:b8:a5:1c:5c: + 34:b3:ae:00:a0:63:c5:f6:7f:0b:59:68:78:73:a6: + 8c:18:a9:02:6d:af:c3:19:01:2e:b8:10:e3:c6:cc: + 40:b4:69:a3:46:33:69:87:6e:c4:bb:17:a6:f3:e8: + dd:ad:73:bc:7b:2f:21:b5:fd:66:51:0c:bd:54:b3: + e1:6d:5f:1c:bc:23:73:d1:09:03:89:14:d2:10:b9: + 64:c3:2a:d0:a1:96:4a:bc:e1:d4:1a:5b:c7:a0:c0: + c1:63:78:0f:44:37:30:32:96:80:32:23:95:a1:77: + ba:13:d2:97:73:e2:5d:25:c9:6a:0d:c3:39:60:a4: + b4:b0:69:42:42:09:e9:d8:08:bc:33:20:b3:58:22: + a7:aa:eb:c4:e1:e6:61:83:c5:d2:96:df:d9:d0:4f: + ad:d7 Exponent: 65537 (0x10001) - Signature Algorithm: md5WithRSAEncryption - 58:a9:98:e7:16:52:4c:40:e7:e1:47:92:19:1b:3a:8f:97:6c: - 7b:b7:b0:cb:20:6d:ad:b5:d3:47:58:d8:e4:f2:3e:32:e9:ef: - 87:77:e5:54:36:f4:8d:50:8d:07:b4:77:45:ea:9d:a4:33:36: - 9b:0b:e0:74:58:11:c5:01:7b:4d + X509v3 extensions: + X509v3 Subject Key Identifier: + B3:11:32:C9:92:98:84:E2:C9:F8:D0:3B:6E:03:42:CA:1F:0E:8E:3C + X509v3 Authority Key Identifier: + keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5 + DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com + serial:9A:41:47:CD:A1:14:62:8C + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 3d:8c:70:05:5b:62:4b:bf:6c:b6:48:61:01:10:1d:5e:05:ba: + 55:94:2c:ae:59:6f:97:80:5d:6c:86:ec:9a:eb:15:45:44:e4: + 56:f8:75:ca:8a:45:32:f4:c7:e1:fa:f2:98:1c:91:d3:3f:e8: + 0e:c9:1b:fa:e1:79:99:67:0e:0d:6b:8a:ec:1a:2c:59:c4:34: + 04:8d:39:77:cd:b5:e9:60:5b:82:bf:34:ce:ed:c6:4f:3f:b4: + 5c:4d:8a:b4:f4:0a:04:12:a0:56:c1:e1:33:37:a1:54:87:48: + e9:81:c2:0f:8f:6f:d3:52:4c:4c:32:4c:6b:9f:3a:04:8f:77: + 5d:ad:dc:3d:2b:f2:c9:df:3c:60:5d:d8:fc:86:72:7c:3d:d0: + 84:4b:8c:df:26:43:fe:c0:cc:5b:e1:36:b3:3d:32:28:a3:ef: + 0c:20:d6:b1:50:39:d6:67:a9:8b:84:bc:92:34:eb:19:23:e8: + 10:8f:ea:bd:18:8c:93:27:3c:74:75:8e:58:04:fa:2a:74:44: + 7d:fc:4d:39:df:54:17:ba:78:e1:5d:6a:70:d3:7c:a2:80:81: + e6:19:51:91:c3:44:51:ec:bb:88:a9:53:e1:d7:a9:8c:28:f4: + 21:1c:42:51:09:b4:12:6d:a0:d6:25:09:85:c6:2a:0c:af:a7: + 58:e6:52:8b -----BEGIN CERTIFICATE----- -MIICFDCCAb4CAQEwDQYJKoZIhvcNAQEEBQAwgZ4xCzAJBgNVBAYTAlVTMRAwDgYD -VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhzYXd0b290 -aDETMBEGA1UECxMKY29uc3VsdGluZzEkMCIGA1UEAxMbd3d3LnNhd3Rvb3RoLWNv -bnN1bHRpbmcuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0x -MDA2MzAxODUyMTdaFw0xMzAzMjYxODUyMTdaMIGKMQswCQYDVQQGEwJVUzEQMA4G -A1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjEOMAwGA1UEChMFeWFTU0wx -EDAOBgNVBAsTB3N1cHBvcnQxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkq -hkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJB -AMZ7wGiBL96CP/msw4ZKZrfs1PH2ZCH/9aI0QtA4n8bdO24mZWpUlt3Se+s2oq5+ -Kp5+VqW2h58VxxhmfhZ34qcCAwEAATANBgkqhkiG9w0BAQQFAANBAFipmOcWUkxA -5+FHkhkbOo+XbHu3sMsgba2100dY2OTyPjLp74d35VQ29I1QjQe0d0XqnaQzNpsL -4HRYEcUBe00= +MIIEnjCCA4agAwIBAgIBATANBgkqhkiG9w0BAQUFADCBlDELMAkGA1UEBhMCVVMx +EDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNh +d3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz +bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTQwNzEx +MTcyMDE0WhcNMTcwNDA2MTcyMDE0WjCBkDELMAkGA1UEBhMCVVMxEDAOBgNVBAgM +B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xEDAOBgNVBAoMB3dvbGZTU0wxEDAO +BgNVBAsMB1N1cHBvcnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG +SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAMCVCOFXQfJxbbfSRUEnAWXGRa7yvCQwuJXOL07W9hyIvHyf+6hn +f/5cnFF194rKB+c1L4/hvXvAL3yrZKgX/Mpde7rgIeVyLm8uhtiVc9qsG1O5Xz/X +GQ0lT+FjY1GLC2Q/rUO4pRxcNLOuAKBjxfZ/C1loeHOmjBipAm2vwxkBLrgQ48bM +QLRpo0YzaYduxLsXpvPo3a1zvHsvIbX9ZlEMvVSz4W1fHLwjc9EJA4kU0hC5ZMMq +0KGWSrzh1Bpbx6DAwWN4D0Q3MDKWgDIjlaF3uhPSl3PiXSXJag3DOWCktLBpQkIJ +6dgIvDMgs1gip6rrxOHmYYPF0pbf2dBPrdcCAwEAAaOB/DCB+TAdBgNVHQ4EFgQU +sxEyyZKYhOLJ+NA7bgNCyh8OjjwwgckGA1UdIwSBwTCBvoAUJ45nEXTDJh0/7TNj +s6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5h +MRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwK +Q29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcN +AQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYDVR0TBAUwAwEB/zAN +BgkqhkiG9w0BAQUFAAOCAQEAPYxwBVtiS79stkhhARAdXgW6VZQsrllvl4BdbIbs +musVRUTkVvh1yopFMvTH4frymByR0z/oDskb+uF5mWcODWuK7BosWcQ0BI05d821 +6WBbgr80zu3GTz+0XE2KtPQKBBKgVsHhMzehVIdI6YHCD49v01JMTDJMa586BI93 +Xa3cPSvyyd88YF3Y/IZyfD3QhEuM3yZD/sDMW+E2sz0yKKPvDCDWsVA51mepi4S8 +kjTrGSPoEI/qvRiMkyc8dHWOWAT6KnREffxNOd9UF7p44V1qcNN8ooCB5hlRkcNE +Uey7iKlT4depjCj0IRxCUQm0Em2g1iUJhcYqDK+nWOZSiw== +-----END CERTIFICATE----- +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 9a:41:47:cd:a1:14:62:8c + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com + Validity + Not Before: Jul 11 03:20:08 2014 GMT + Not After : Apr 6 03:20:08 2017 GMT + Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a: + f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac: + de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98: + 21:4d:80:cb:12:20:e7:cc:4f:de:45:7d:c9:72:77: + 32:ea:ca:90:bb:69:52:10:03:2f:a8:f3:95:c5:f1: + 8b:62:56:1b:ef:67:6f:a4:10:41:95:ad:0a:9b:e3: + a5:c0:b0:d2:70:76:50:30:5b:a8:e8:08:2c:7c:ed: + a7:a2:7a:8d:38:29:1c:ac:c7:ed:f2:7c:95:b0:95: + 82:7d:49:5c:38:cd:77:25:ef:bd:80:75:53:94:3c: + 3d:ca:63:5b:9f:15:b5:d3:1d:13:2f:19:d1:3c:db: + 76:3a:cc:b8:7d:c9:e5:c2:d7:da:40:6f:d8:21:dc: + 73:1b:42:2d:53:9c:fe:1a:fc:7d:ab:7a:36:3f:98: + de:84:7c:05:67:ce:6a:14:38:87:a9:f1:8c:b5:68: + cb:68:7f:71:20:2b:f5:a0:63:f5:56:2f:a3:26:d2: + b7:6f:b1:5a:17:d7:38:99:08:fe:93:58:6f:fe:c3: + 13:49:08:16:0b:a7:4d:67:00:52:31:67:23:4e:98: + ed:51:45:1d:b9:04:d9:0b:ec:d8:28:b3:4b:bd:ed: + 36:79 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5 + X509v3 Authority Key Identifier: + keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5 + DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com + serial:9A:41:47:CD:A1:14:62:8C + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 79:78:0c:6d:79:88:91:fc:3a:15:9c:f9:27:62:16:f0:21:1f: + fa:7d:3f:a2:a8:32:1e:f7:f2:11:a9:74:16:74:5e:dc:18:ca: + f0:00:2a:d5:03:06:26:30:f1:47:83:fd:32:6e:fc:ed:aa:4f: + 7d:0c:63:60:31:2f:7c:0c:bf:99:66:87:ed:27:08:86:2d:c4: + 33:e8:98:23:1c:fe:a3:db:9a:49:4e:fc:5a:42:ef:71:c3:3f: + ad:dc:4a:a8:d2:a3:1d:09:ac:33:04:7b:86:f3:6d:00:59:a3: + c8:db:d1:3c:73:f6:0e:90:d6:5e:49:e0:bf:36:63:08:7b:a5: + b0:8f:35:3b:56:8c:11:35:49:04:1c:d0:e7:ba:56:c5:0d:0a: + 91:8d:d6:b7:62:19:34:12:52:4c:d2:6d:7c:c5:3d:0f:18:81: + 54:cb:f6:3c:e5:84:d2:d6:71:15:ec:1a:34:0b:f0:a0:21:74: + 43:c8:a3:b0:df:d9:67:da:e2:ad:93:48:f8:a0:87:bd:79:14: + e0:62:0a:df:f7:31:2e:31:7b:d1:32:2a:0a:fe:5d:14:ef:d9: + 64:50:e4:83:91:bc:70:0d:d7:88:8d:d9:bc:84:0e:c5:1a:b3: + bf:64:02:4e:51:91:a4:a2:85:15:83:af:f0:5b:9b:28:49:5f: + b2:b3:03:d8 +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIJAJpBR82hFGKMMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD +VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G +A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3 +dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe +Fw0xNDA3MTEwMzIwMDhaFw0xNzA0MDYwMzIwMDhaMIGUMQswCQYDVQQGEwJVUzEQ +MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3 +dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns +LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL8Myi0Ush6EQlvNOB9K8k11EPG2NZ/fyn0D +mNOs3gNm7irx2LB9bgdUCxCYIU2AyxIg58xP3kV9yXJ3MurKkLtpUhADL6jzlcXx +i2JWG+9nb6QQQZWtCpvjpcCw0nB2UDBbqOgILHztp6J6jTgpHKzH7fJ8lbCVgn1J +XDjNdyXvvYB1U5Q8PcpjW58VtdMdEy8Z0TzbdjrMuH3J5cLX2kBv2CHccxtCLVOc +/hr8fat6Nj+Y3oR8BWfOahQ4h6nxjLVoy2h/cSAr9aBj9VYvoybSt2+xWhfXOJkI +/pNYb/7DE0kIFgunTWcAUjFnI06Y7VFFHbkE2Qvs2CizS73tNnkCAwEAAaOB/DCB ++TAdBgNVHQ4EFgQUJ45nEXTDJh0/7TNjs6TYHTDl6NUwgckGA1UdIwSBwTCBvoAU +J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD +VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290 +aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t +MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYD +VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAeXgMbXmIkfw6FZz5J2IW8CEf ++n0/oqgyHvfyEal0FnRe3BjK8AAq1QMGJjDxR4P9Mm787apPfQxjYDEvfAy/mWaH +7ScIhi3EM+iYIxz+o9uaSU78WkLvccM/rdxKqNKjHQmsMwR7hvNtAFmjyNvRPHP2 +DpDWXkngvzZjCHulsI81O1aMETVJBBzQ57pWxQ0KkY3Wt2IZNBJSTNJtfMU9DxiB +VMv2POWE0tZxFewaNAvwoCF0Q8ijsN/ZZ9rirZNI+KCHvXkU4GIK3/cxLjF70TIq +Cv5dFO/ZZFDkg5G8cA3XiI3ZvIQOxRqzv2QCTlGRpKKFFYOv8FubKElfsrMD2A== -----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/extra/yassl/certs/server-key.pem b/mysql-wsrep-5.6/extra/yassl/certs/server-key.pem index 154d661b..d1627f4d 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/server-key.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/server-key.pem @@ -1,9 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAMZ7wGiBL96CP/msw4ZKZrfs1PH2ZCH/9aI0QtA4n8bdO24mZWpU -lt3Se+s2oq5+Kp5+VqW2h58VxxhmfhZ34qcCAwEAAQJBAJSbGxgjgV+rTZL2Ev58 -viN/IoB25cm/Bn4Heu7DNn2A2kpdGX2cCaf7rEQoIKCiHxvopvxOcd/7nLS/gNli -dCECIQD/cX/9fvB1Uajw0fmvwNON9+3P9uJSqpig90zL32pwjQIhAMbqee9TBMN4 -TxXbgWqA92PrCXe8WDZ3PwoJqdR6MRUDAiEAny+TDF1z6hiWiGTCDgXDkKBlwgjf -p5aKgR077XzwLu0CICVpWEGg1ZaF/CnaPP7w/pZ2UDOK4vRrfRnAM4bY7H5NAiBS -1eXJ/MCZ2uPfpl7XK2BU9P69KdKUk5WHxdRchVvcDg== +MIIEpQIBAAKCAQEAwJUI4VdB8nFtt9JFQScBZcZFrvK8JDC4lc4vTtb2HIi8fJ/7 +qGd//lycUXX3isoH5zUvj+G9e8AvfKtkqBf8yl17uuAh5XIuby6G2JVz2qwbU7lf +P9cZDSVP4WNjUYsLZD+tQ7ilHFw0s64AoGPF9n8LWWh4c6aMGKkCba/DGQEuuBDj +xsxAtGmjRjNph27Euxem8+jdrXO8ey8htf1mUQy9VLPhbV8cvCNz0QkDiRTSELlk +wyrQoZZKvOHUGlvHoMDBY3gPRDcwMpaAMiOVoXe6E9KXc+JdJclqDcM5YKS0sGlC +Qgnp2Ai8MyCzWCKnquvE4eZhg8XSlt/Z0E+t1wIDAQABAoIBAQCa0DQPUmIFUAHv +n+1kbsLE2hryhNeSEEiSxOlq64t1bMZ5OPLJckqGZFSVd8vDmp231B2kAMieTuTd +x7pnFsF0vKnWlI8rMBr77d8hBSPZSjm9mGtlmrjcxH3upkMVLj2+HSJgKnMw1T7Y +oqyGQy7E9WReP4l1DxHYUSVOn9iqo85gs+KK2X4b8GTKmlsFC1uqy+XjP24yIgXz +0PrvdFKB4l90073/MYNFdfpjepcu1rYZxpIm5CgGUFAOeC6peA0Ul7QS2DFAq6EB +QcIw+AdfFuRhd9Jg8p+N6PS662PeKpeB70xs5lU0USsoNPRTHMRYCj+7r7X3SoVD +LTzxWFiBAoGBAPIsVHY5I2PJEDK3k62vvhl1loFk5rW4iUJB0W3QHBv4G6xpyzY8 +ZH3c9Bm4w2CxV0hfUk9ZOlV/MsAZQ1A/rs5vF/MOn0DKTq0VO8l56cBZOHNwnAp8 +yTpIMqfYSXUKhcLC/RVz2pkJKmmanwpxv7AEpox6Wm9IWlQ7xrFTF9/nAoGBAMuT +3ncVXbdcXHzYkKmYLdZpDmOzo9ymzItqpKISjI57SCyySzfcBhh96v52odSh6T8N +zRtfr1+elltbD6F8r7ObkNtXczrtsCNErkFPHwdCEyNMy/r0FKTV9542fFufqDzB +hV900jkt/9CE3/uzIHoumxeu5roLrl9TpFLtG8SRAoGBAOyY2rvV/vlSSn0CVUlv +VW5SL4SjK7OGYrNU0mNS2uOIdqDvixWl0xgUcndex6MEH54ZYrUbG57D8rUy+UzB +qusMJn3UX0pRXKRFBnBEp1bA1CIUdp7YY1CJkNPiv4GVkjFBhzkaQwsYpVMfORpf +H0O8h2rfbtMiAP4imHBOGhkpAoGBAIpBVihRnl/Ungs7mKNU8mxW1KrpaTOFJAza +1AwtxL9PAmk4fNTm3Ezt1xYRwz4A58MmwFEC3rt1nG9WnHrzju/PisUr0toGakTJ +c/5umYf4W77xfOZltU9s8MnF/xbKixsX4lg9ojerAby/QM5TjI7t7+5ZneBj5nxe +9Y5L8TvBAoGATUX5QIzFW/QqGoq08hysa+kMVja3TnKW1eWK0uL/8fEYEz2GCbjY +dqfJHHFSlDBD4PF4dP1hG0wJzOZoKnGtHN9DvFbbpaS+NXCkXs9P/ABVmTo9I89n +WvUi+LUp0EQR6zUuRr79jhiyX6i/GTKh9dwD5nyaHwx8qbAOITc78bA= -----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/extra/yassl/certs/server-keyEnc.pem b/mysql-wsrep-5.6/extra/yassl/certs/server-keyEnc.pem index d3500a1b..e5ab57d4 100644 --- a/mysql-wsrep-5.6/extra/yassl/certs/server-keyEnc.pem +++ b/mysql-wsrep-5.6/extra/yassl/certs/server-keyEnc.pem @@ -1,12 +1,30 @@ -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED -DEK-Info: DES-CBC,08132C1FFF5BC8CC +DEK-Info: DES-CBC,136C7D8A69656668 -gsvuAsGmB8AkR23M25w4E6wuywfBey1Jqh3g71gJcnsUYwynex9dvfAU0lTowOXh -sb7ld1KNjEMzrht9AC1IC0iE1rLqvRQZOdJ7h3n7aHZQ4a/HjcwAhqJq0ZW45m6Q -mpoO5fRISjx2VbKFRUz6Xj2x0/do3IjQhpuUDVrTFFe1sEySM6APZ6CVpcnTOyPR -ADyLDKzOi2E+sj1UXs58pct56FaqTIZPUEflICU3k6q9FPU6gsYANRLfzegclkv4 -JAx6mKVSJuYnjCCppx8WBwGJa1J1GcYRJ3qFfdbUzL4bcXTvoFkJEnDkHsXgDUS6 -xmT0XGT3IMaW8cwQ8KD8m5YYI/L26Mas/w3eA2ekyMR8pYICjXp/YZtcKxxkQSVE -Uv/+D+20KbNAHIW5Mrxf61cX/CggGEbVP8ZhDY1flh8= +jvNTyPaztxPIoAzbdmZnD0Zw2+60tMxNc0GMHNmeOyG25aHP/dT+TWiKFpFVkkkY +uoCIhYUyw7gmpw+CnRJwWd+ans4nrvAjwy5oWJvarvsyUpjqvnPoIlAqd+d4TDKN +eESzcI76+gHdisAtCrQD+fGqgTZhli5TgDbnpasL/QnY2qDlutvakkVw7gPXe156 +2Phy8WN+efr65J6wt3K/dj7Datl9u4JeHQK81gYyWBVX+EagEjPGDzkFQCj9Z0q7 +8K3iB5GW1JAqJS0IfZPB40AnSTF/n1TL1SN3qfU3l7hTGNrx9o7580bgDEoAR7pI +F8eZlS15KHtZmh11AnU1KTKZ6kmgnNqeMTGMN6N0ct2wMKW1dV87eTDlF0oiR2ol +XwtFgKmrIjfpmzkdWjbJmWnGMjD56KdiFZga/ZyKMsPrVoYLgfJEpn36iQspfygx +HCGNTf0PjIsjEWU0WyQiF86t+c45W3wNFsv/AxVyfMl+su02yrd6u2ecuQDir3Cs +b2k8IKtQgVe/NIpEWLKuiHG5oedIPPQyDYK5uq+gHxCGeOoKnWlsWFEHZRiza4X5 +tbgTrJB8Sw0ENWrvVGGmQZN4pSImlsMwzQ2qik5CQ00N1b3+56/obn0z75I3bUSb +tC5g8DRjl6oclAenNgh/MYMT287y5W2dD4npxHcekX4O3J2CDXNfg4vV2j5GRxtg +LVJdYE2p7bpYePCDHrYng8b9ubBprx0CrEnkIvvtUjzNPf6VDL0+MBKl+XgR2/nz +iRqTuZnlGGOyM+KYDwXpgwfs/HfvFGksxTAlO/40GkGh+WGPaIoNyCK0SgQKhyb4 +JIkR0vd2/yLg3lWMJrGwh7A0Gm07Z/781oURP3uWd+PaCOgGcd5ipcAjcEyuxNly +AthipWqmQWUcbf6Z2N9j3OA22Hv2Uzk8HSfi9VOZtL9svdEEZ0NnOekJgnc6stQp +bXiknlK/T5WdrWxSyCfgUq68Vf6DFfIRAVuFdJ3WHT2wVXHrDfft6D+Ne/XCxPoE +8zGmkyusaph33UHQ1oNyUbLbwcDCDSmOo8gYoedD3IwxtMA3wJRugomqosItwV8X +vkgmcy8eSE/+gZUxJEN2gnLcfKFhCkC80J6oFhmoDD6vuUnPHcFdKZgVPw2rzPk5 +Vb1kX+gpORplYmKpq1vz/ujscL4T0TmYLz02hkIS4edpW55ncTTv7JWefpRiTB1J +RB3td3me4htqR+YIDWJ+emrOmqsCG2WvpAS+MTw2mj1jYk9LL/ZYobTjSCEWmuwT +yVK6m303irR7HQDauxhslRFgoK21w63viOyj5NKIU1gQtaAANGDxcgORC1XLjjgt +oNutSQA+7P42vfHSHK4cnTBXl6V32H/GyVpdHQOZqSrqIjgLmUZodSmRPROxosZF +a46B1O7m/rJFxkiKW4vod+/WqjoE0Hhfrb8rRrkRjzGeCqqSSnQ3vrunVkvF8hlA +b6FOv4ZBJL4piC1GKH+rscqke9NEiDqXN8C3iYz86jbck/Ha21yUS8T3X7N52sg+ +B3AmOGnLK6BebYeto9vZxQjacChJZSixSxLV+l9/nVQ0+mW42azHdzk0ru59TGAj -----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/extra/yassl/examples/client/client.cpp b/mysql-wsrep-5.6/extra/yassl/examples/client/client.cpp index fc05b66a..102ed617 100644 --- a/mysql-wsrep-5.6/extra/yassl/examples/client/client.cpp +++ b/mysql-wsrep-5.6/extra/yassl/examples/client/client.cpp @@ -18,6 +18,10 @@ /* client.cpp */ +// takes an optional command line argument of cipher list to make scripting +// easier + + #include "../../testsuite/test.hpp" //#define TEST_RESUME @@ -73,11 +77,16 @@ void client_test(void* args) #ifdef NON_BLOCKING tcp_set_nonblocking(sockfd); #endif - SSL_METHOD* method = TLSv1_client_method(); SSL_CTX* ctx = SSL_CTX_new(method); set_certs(ctx); + if (argc >= 2) { + printf("setting cipher list to %s\n", argv[1]); + if (SSL_CTX_set_cipher_list(ctx, argv[1]) != SSL_SUCCESS) { + ClientError(ctx, NULL, sockfd, "set_cipher_list error\n"); + } + } SSL* ssl = SSL_new(ctx); SSL_set_fd(ssl, sockfd); diff --git a/mysql-wsrep-5.6/extra/yassl/examples/server/server.cpp b/mysql-wsrep-5.6/extra/yassl/examples/server/server.cpp index 173ce8fb..1540f6d3 100644 --- a/mysql-wsrep-5.6/extra/yassl/examples/server/server.cpp +++ b/mysql-wsrep-5.6/extra/yassl/examples/server/server.cpp @@ -18,6 +18,9 @@ /* server.cpp */ +// takes 2 optional command line argument to make scripting +// if the first command line argument is 'n' client auth is disabled +// if the second command line argument is 'd' DSA certs are used instead of RSA #include "../../testsuite/test.hpp" @@ -69,6 +72,9 @@ THREAD_RETURN YASSL_API server_test(void* args) char** argv = 0; set_args(argc, argv, *static_cast<func_args*>(args)); +#ifdef SERVER_READY_FILE + set_file_ready("server_ready", *static_cast<func_args*>(args)); +#endif tcp_accept(sockfd, clientfd, *static_cast<func_args*>(args)); tcp_close(sockfd); @@ -77,8 +83,21 @@ THREAD_RETURN YASSL_API server_test(void* args) SSL_CTX* ctx = SSL_CTX_new(method); //SSL_CTX_set_cipher_list(ctx, "RC4-SHA:RC4-MD5"); - SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, 0); - set_serverCerts(ctx); + + // should we disable client auth + if (argc >= 2 && argv[1][0] == 'n') + printf("disabling client auth\n"); + else + SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, 0); + + // are we using DSA certs + if (argc >= 3 && argv[2][0] == 'd') { + printf("using DSA certs\n"); + set_dsaServerCerts(ctx); + } + else { + set_serverCerts(ctx); + } DH* dh = set_tmpDH(ctx); SSL* ssl = SSL_new(ctx); diff --git a/mysql-wsrep-5.6/extra/yassl/include/buffer.hpp b/mysql-wsrep-5.6/extra/yassl/include/buffer.hpp index 27f71199..77d2ed81 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/buffer.hpp +++ b/mysql-wsrep-5.6/extra/yassl/include/buffer.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,7 +48,11 @@ const uint AUTO = 0xFEEDBEEF; struct NoCheck { - void check(uint, uint); + int check(uint, uint); +}; + +struct Check { + int check(uint, uint); }; /* input_buffer operates like a smart c style array with a checking option, @@ -60,11 +64,13 @@ struct NoCheck { * write to the buffer bulk wise and have the correct size */ -class input_buffer : public NoCheck { +class input_buffer : public Check { uint size_; // number of elements in buffer uint current_; // current offset position in buffer byte* buffer_; // storage for buffer byte* end_; // end of storage marker + int error_; // error number + byte zero_; // for returning const reference to zero byte public: input_buffer(); @@ -93,6 +99,10 @@ public: uint get_remaining() const; + int get_error() const; + + void set_error(); + void set_current(uint i); // read only access through [], advance current @@ -103,7 +113,7 @@ public: bool eof(); // peek ahead - byte peek() const; + byte peek(); // write function, should use at/near construction void assign(const byte* t, uint s); diff --git a/mysql-wsrep-5.6/extra/yassl/include/cert_wrapper.hpp b/mysql-wsrep-5.6/extra/yassl/include/cert_wrapper.hpp index da0be6a3..8e3393b4 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/cert_wrapper.hpp +++ b/mysql-wsrep-5.6/extra/yassl/include/cert_wrapper.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -89,6 +89,7 @@ class CertManager { bool verifyNone_; // no error if verify fails bool failNoCert_; bool sendVerify_; + bool sendBlankCert_; VerifyCallback verifyCallback_; // user verify callback public: CertManager(); @@ -116,16 +117,18 @@ public: bool verifyNone() const; bool failNoCert() const; bool sendVerify() const; + bool sendBlankCert() const; void setVerifyPeer(); void setVerifyNone(); void setFailNoCert(); void setSendVerify(); + void setSendBlankCert(); void setPeerX509(X509*); void setVerifyCallback(VerifyCallback); private: CertManager(const CertManager&); // hide copy - CertManager& operator=(const CertManager&); // and assign + CertManager& operator=(const CertManager&); // and assigin }; diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h index 22bbbbf5..103fcbb0 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h @@ -1,5 +1,6 @@ /* Copyright (C) 2005, 2007 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/des.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/des.h index 6e2ebbd8..f7394b65 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/des.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/des.h @@ -1,5 +1,6 @@ /* 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/des_old.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/des_old.h index 1223a380..b6e2e3e9 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/des_old.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/des_old.h @@ -1,5 +1,6 @@ /* Copyright (C) 2007 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/engine.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/engine.h index cadb05a9..15ddcd14 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/engine.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/engine.h @@ -1,5 +1,6 @@ /* Copyright (C) 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/err.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/err.h index 23f2f139..94847429 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/err.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/err.h @@ -1,5 +1,6 @@ /* Copyright (C) 2005, 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/evp.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/evp.h index eccdcdff..6aa7335d 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/evp.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/evp.h @@ -1,5 +1,6 @@ /* Copyright (C) 2007 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/generate_prefix_files.pl b/mysql-wsrep-5.6/extra/yassl/include/openssl/generate_prefix_files.pl index 9f8f2b17..eb3536c4 100755 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/generate_prefix_files.pl +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/generate_prefix_files.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl # Copyright (C) 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/hmac.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/hmac.h index 478d92e0..5da6644e 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/hmac.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/hmac.h @@ -1,5 +1,6 @@ /* Copyright (C) 2007 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/lhash.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/lhash.h index 34bc34c3..6d64df7d 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/lhash.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/lhash.h @@ -1,5 +1,6 @@ /* 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/md4.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/md4.h index 2718d170..8a864993 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/md4.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/md4.h @@ -1,5 +1,6 @@ /* Copyright (C) 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/md5.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/md5.h index 9400649e..b54ebcd9 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/md5.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/md5.h @@ -1,5 +1,6 @@ /* Copyright (C) 2005, 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/objects.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/objects.h index ec00e04e..ed2c0294 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/objects.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/objects.h @@ -1,5 +1,6 @@ /* Copyright (C) 2007 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/opensslv.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/opensslv.h index bafcfaec..88b9ca6d 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/opensslv.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/opensslv.h @@ -1,5 +1,6 @@ /* 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/pem.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/pem.h index 3762b959..c467e461 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/pem.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/pem.h @@ -1,5 +1,6 @@ /* Copyright (C) 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/pkcs12.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/pkcs12.h index 71ba287e..c3f8ee67 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/pkcs12.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/pkcs12.h @@ -1,5 +1,6 @@ /* Copyright (C) 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/prefix_crypto.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/prefix_crypto.h index ff3aea14..895dd51a 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/prefix_crypto.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/prefix_crypto.h @@ -1,5 +1,6 @@ /* Copyright (C) 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/rand.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/rand.h index 136a0145..9e0cedf3 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/rand.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/rand.h @@ -1,5 +1,6 @@ /* 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/rsa.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/rsa.h index b20da32b..95305a84 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/rsa.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/rsa.h @@ -1,5 +1,6 @@ /* Copyright (C) 2005, 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/sha.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/sha.h index 79b46ec8..5b7c6bd2 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/sha.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/sha.h @@ -1,5 +1,6 @@ /* Copyright (C) 2007 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h index 033c72a7..a6ef8232 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This 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 @@ #include "rsa.h" -#define YASSL_VERSION "2.2.2" +#define YASSL_VERSION "2.3.7" #if defined(__cplusplus) diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/x509.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/x509.h index eb60bcbc..74eb83eb 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/x509.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/x509.h @@ -1,5 +1,6 @@ /* Copyright (C) 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/x509v3.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/x509v3.h index 1215826f..b48e9b48 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/x509v3.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/x509v3.h @@ -1,5 +1,6 @@ /* Copyright (C) 2006 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 diff --git a/mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp b/mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp index fabf4559..3735827b 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp +++ b/mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp @@ -107,6 +107,25 @@ enum AcceptState { }; +// track received messages to explicitly disallow duplicate messages +struct RecvdMessages { + uint8 gotClientHello_; + uint8 gotServerHello_; + uint8 gotCert_; + uint8 gotServerKeyExchange_; + uint8 gotCertRequest_; + uint8 gotServerHelloDone_; + uint8 gotCertVerify_; + uint8 gotClientKeyExchange_; + uint8 gotFinished_; + RecvdMessages() : gotClientHello_(0), gotServerHello_(0), gotCert_(0), + gotServerKeyExchange_(0), gotCertRequest_(0), + gotServerHelloDone_(0), gotCertVerify_(0), + gotClientKeyExchange_(0), gotFinished_(0) + {} +}; + + // combines all states class States { RecordLayerState recordLayer_; @@ -115,6 +134,7 @@ class States { ServerState serverState_; ConnectState connectState_; AcceptState acceptState_; + RecvdMessages recvdMessages_; char errorString_[MAX_ERROR_SZ]; YasslError what_; public: @@ -137,6 +157,7 @@ public: AcceptState& UseAccept(); char* useString(); void SetError(YasslError); + int SetMessageRecvd(HandShakeType); private: States(const States&); // hide copy States& operator=(const States&); // and assign diff --git a/mysql-wsrep-5.6/extra/yassl/src/buffer.cpp b/mysql-wsrep-5.6/extra/yassl/src/buffer.cpp index ea09f787..231e0aec 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/buffer.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/buffer.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This 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,8 +34,19 @@ namespace yaSSL { -void NoCheck::check(uint, uint) +/* return 0 on check success, always true for NoCheck policy */ +int NoCheck::check(uint, uint) { + return 0; +} + +/* return 0 on check success */ +int Check::check(uint i, uint max) +{ + if (i < max) + return 0; + + return -1; } @@ -50,18 +61,20 @@ void NoCheck::check(uint, uint) input_buffer::input_buffer() - : size_(0), current_(0), buffer_(0), end_(0) + : size_(0), current_(0), buffer_(0), end_(0), error_(0), zero_(0) {} input_buffer::input_buffer(uint s) - : size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s) + : size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s), + error_(0), zero_(0) {} // with assign input_buffer::input_buffer(uint s, const byte* t, uint len) - : size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s) + : size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s), + error_(0), zero_(0) { assign(t, len); } @@ -76,8 +89,10 @@ input_buffer::~input_buffer() // users can pass defualt zero length buffer and then allocate void input_buffer::allocate(uint s) { - buffer_ = NEW_YS byte[s]; - end_ = buffer_ + s; + if (error_ == 0) { + buffer_ = NEW_YS byte[s]; + end_ = buffer_ + s; + } } @@ -92,40 +107,67 @@ byte* input_buffer::get_buffer() const // if you know the size before the write use assign() void input_buffer::add_size(uint i) { - check(size_ + i-1, get_capacity()); - size_ += i; + if (error_ == 0 && check(size_ + i-1, get_capacity()) == 0) + size_ += i; + else + error_ = -1; } uint input_buffer::get_capacity() const { - return (uint) (end_ - buffer_); + if (error_ == 0) + return end_ - buffer_; + + return 0; } uint input_buffer::get_current() const { - return current_; + if (error_ == 0) + return current_; + + return 0; } uint input_buffer::get_size() const { - return size_; + if (error_ == 0) + return size_; + + return 0; } uint input_buffer::get_remaining() const { - return size_ - current_; + if (error_ == 0) + return size_ - current_; + + return 0; +} + + +int input_buffer::get_error() const +{ + return error_; +} + + +void input_buffer::set_error() +{ + error_ = -1; } void input_buffer::set_current(uint i) { - if (i) - check(i - 1, size_); - current_ = i; + if (error_ == 0 && i && check(i - 1, size_) == 0) + current_ = i; + else + error_ = -1; } @@ -133,40 +175,59 @@ void input_buffer::set_current(uint i) // user passes in AUTO index for ease of use const byte& input_buffer::operator[](uint i) { - check(current_, size_); - return buffer_[current_++]; + if (error_ == 0 && check(current_, size_) == 0) + return buffer_[current_++]; + + error_ = -1; + return zero_; } // end of input test bool input_buffer::eof() { + if (error_ != 0) + return true; + return current_ >= size_; } // peek ahead -byte input_buffer::peek() const +byte input_buffer::peek() { - return buffer_[current_]; + if (error_ == 0 && check(current_, size_) == 0) + return buffer_[current_]; + + error_ = -1; + return 0; } // write function, should use at/near construction void input_buffer::assign(const byte* t, uint s) { - check(current_, get_capacity()); - add_size(s); - memcpy(&buffer_[current_], t, s); + if (t && error_ == 0 && check(current_, get_capacity()) == 0) { + add_size(s); + if (error_ == 0) { + memcpy(&buffer_[current_], t, s); + return; // success + } + } + + error_ = -1; } // use read to query input, adjusts current void input_buffer::read(byte* dst, uint length) { - check(current_ + length - 1, size_); - memcpy(dst, &buffer_[current_], length); - current_ += length; + if (dst && error_ == 0 && check(current_ + length - 1, size_) == 0) { + memcpy(dst, &buffer_[current_], length); + current_ += length; + } else { + error_ = -1; + } } diff --git a/mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp b/mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp index 752e9cf5..af94f5bc 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +91,7 @@ opaque* x509::use_buffer() //CertManager CertManager::CertManager() : peerX509_(0), selfX509_(0), verifyPeer_(false), verifyNone_(false), failNoCert_(false), - sendVerify_(false), verifyCallback_(0) + sendVerify_(false), sendBlankCert_(false), verifyCallback_(0) {} @@ -143,6 +143,11 @@ void CertManager::setVerifyNone() verifyNone_ = true; } +bool CertManager::sendBlankCert() const +{ + return sendBlankCert_; +} + void CertManager::setFailNoCert() { @@ -155,6 +160,11 @@ void CertManager::setSendVerify() sendVerify_ = true; } +void CertManager::setSendBlankCert() +{ + sendBlankCert_ = true; +} + void CertManager::setVerifyCallback(VerifyCallback vc) { diff --git a/mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp b/mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp index cde3baf5..52994364 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp @@ -950,9 +950,9 @@ x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info) info->set = true; } } - // get blank line - if (fgets(line, sizeof(line), file)) begin = ftell(file); + if (fgets(line,sizeof(line), file)) // get blank line + begin = ftell(file); } } diff --git a/mysql-wsrep-5.6/extra/yassl/src/handshake.cpp b/mysql-wsrep-5.6/extra/yassl/src/handshake.cpp index 280974c1..e63d69e9 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/handshake.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/handshake.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -522,7 +522,7 @@ void buildSHA_CertVerify(SSL& ssl, byte* digest) // some clients still send sslv2 client hello void ProcessOldClientHello(input_buffer& input, SSL& ssl) { - if (input.get_remaining() < 2) { + if (input.get_error() || input.get_remaining() < 2) { ssl.SetError(bad_input); return; } @@ -549,20 +549,24 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl) byte len[2]; - input.read(len, sizeof(len)); + len[0] = input[AUTO]; + len[1] = input[AUTO]; ato16(len, ch.suite_len_); - input.read(len, sizeof(len)); + len[0] = input[AUTO]; + len[1] = input[AUTO]; uint16 sessionLen; ato16(len, sessionLen); ch.id_len_ = sessionLen; - input.read(len, sizeof(len)); + len[0] = input[AUTO]; + len[1] = input[AUTO]; uint16 randomLen; ato16(len, randomLen); - if (ch.suite_len_ > MAX_SUITE_SZ || sessionLen > ID_LEN || - randomLen > RAN_LEN) { + if (input.get_error() || ch.suite_len_ > MAX_SUITE_SZ || + ch.suite_len_ > input.get_remaining() || + sessionLen > ID_LEN || randomLen > RAN_LEN) { ssl.SetError(bad_input); return; } @@ -580,13 +584,12 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl) ch.suite_len_ = j; if (ch.id_len_) - input.read(ch.session_id_, ch.id_len_); + input.read(ch.session_id_, ch.id_len_); // id_len_ from sessionLen if (randomLen < RAN_LEN) memset(ch.random_, 0, RAN_LEN - randomLen); input.read(&ch.random_[RAN_LEN - randomLen], randomLen); - ch.Process(input, ssl); } @@ -783,6 +786,9 @@ int DoProcessReply(SSL& ssl) ssl.verifyState(hdr); } + if (ssl.GetError()) + return 0; + // make sure we have enough input in buffer to process this record if (needHdr || hdr.length_ > buffer.get_remaining()) { // put header in front for next time processing @@ -795,6 +801,9 @@ int DoProcessReply(SSL& ssl) while (buffer.get_current() < hdr.length_ + RECORD_HEADER + offset) { // each message in record, can be more than 1 if not encrypted + if (ssl.GetError()) + return 0; + if (ssl.getSecurity().get_parms().pending_ == false) { // cipher on // sanity check for malicious/corrupted/illegal input if (buffer.get_remaining() < hdr.length_) { @@ -1155,6 +1164,8 @@ void sendCertificateVerify(SSL& ssl, BufferOutput buffer) { if (ssl.GetError()) return; + if(ssl.getCrypto().get_certManager().sendBlankCert()) return; + CertificateVerify verify; verify.Build(ssl); RecordLayerHeader rlHeader; diff --git a/mysql-wsrep-5.6/extra/yassl/src/ssl.cpp b/mysql-wsrep-5.6/extra/yassl/src/ssl.cpp index ae4c1eef..028e0fa4 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/ssl.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/ssl.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -790,7 +790,10 @@ int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file, strncpy(name, path, MAX_PATH - 1 - HALF_PATH); strncat(name, "/", 1); strncat(name, entry->d_name, HALF_PATH); - if (stat(name, &buf) < 0) return SSL_BAD_STAT; + if (stat(name, &buf) < 0) { + closedir(dir); + return SSL_BAD_STAT; + } if (S_ISREG(buf.st_mode)) ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA); diff --git a/mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp b/mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp index e7dab13c..69ba469b 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -220,18 +220,29 @@ void DH_Server::build(SSL& ssl) // read PreMaster secret and decrypt, server side void EncryptedPreMasterSecret::read(SSL& ssl, input_buffer& input) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } + const CertManager& cert = ssl.getCrypto().get_certManager(); RSA rsa(cert.get_privateKey(), cert.get_privateKeyLength(), false); uint16 cipherLen = rsa.get_cipherLength(); if (ssl.isTLS()) { byte len[2]; - input.read(len, sizeof(len)); + len[0] = input[AUTO]; + len[1] = input[AUTO]; ato16(len, cipherLen); } alloc(cipherLen); input.read(secret_, length_); + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } opaque preMasterSecret[SECRET_LEN]; + memset(preMasterSecret, 0, sizeof(preMasterSecret)); rsa.decrypt(preMasterSecret, secret_, length_, ssl.getCrypto().get_random()); @@ -277,6 +288,11 @@ void EncryptedPreMasterSecret::alloc(int sz) // read client's public key, server side void ClientDiffieHellmanPublic::read(SSL& ssl, input_buffer& input) { + if (input.get_error() || input.get_remaining() < (uint)LENGTH_SZ) { + ssl.SetError(bad_input); + return; + } + DiffieHellman& dh = ssl.useCrypto().use_dh(); uint16 keyLength; @@ -285,8 +301,17 @@ void ClientDiffieHellmanPublic::read(SSL& ssl, input_buffer& input) tmp[1] = input[AUTO]; ato16(tmp, keyLength); + if (keyLength < dh.get_agreedKeyLength()/2) { + ssl.SetError(bad_input); + return; + } + alloc(keyLength); input.read(Yc_, keyLength); + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } dh.makeAgreement(Yc_, keyLength); // because of encoding, first byte might be 0, don't use for preMaster @@ -331,6 +356,10 @@ void ClientDiffieHellmanPublic::alloc(int sz, bool offset) // read server's p, g, public key and sig, client side void DH_Server::read(SSL& ssl, input_buffer& input) { + if (input.get_error() || input.get_remaining() < (uint)LENGTH_SZ) { + ssl.SetError(bad_input); + return; + } uint16 length, messageTotal = 6; // pSz + gSz + pubSz byte tmp[2]; @@ -341,6 +370,10 @@ void DH_Server::read(SSL& ssl, input_buffer& input) messageTotal += length; input.read(parms_.alloc_p(length), length); + if (input.get_error() || input.get_remaining() < (uint)LENGTH_SZ) { + ssl.SetError(bad_input); + return; + } // g tmp[0] = input[AUTO]; @@ -349,6 +382,10 @@ void DH_Server::read(SSL& ssl, input_buffer& input) messageTotal += length; input.read(parms_.alloc_g(length), length); + if (input.get_error() || input.get_remaining() < (uint)LENGTH_SZ) { + ssl.SetError(bad_input); + return; + } // pub tmp[0] = input[AUTO]; @@ -357,20 +394,36 @@ void DH_Server::read(SSL& ssl, input_buffer& input) messageTotal += length; input.read(parms_.alloc_pub(length), length); + if (input.get_error() || input.get_remaining() < (uint)LENGTH_SZ) { + ssl.SetError(bad_input); + return; + } // save message for hash verify input_buffer message(messageTotal); input.set_current(input.get_current() - messageTotal); input.read(message.get_buffer(), messageTotal); message.add_size(messageTotal); + if (input.get_error() || input.get_remaining() < (uint)LENGTH_SZ) { + ssl.SetError(bad_input); + return; + } // signature tmp[0] = input[AUTO]; tmp[1] = input[AUTO]; ato16(tmp, length); + if (length == 0) { + ssl.SetError(bad_input); + return; + } signature_ = NEW_YS byte[length]; input.read(signature_, length); + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } // verify signature byte hash[FINISHED_SZ]; @@ -645,6 +698,10 @@ void HandShakeHeader::Process(input_buffer& input, SSL& ssl) { ssl.verifyState(*this); if (ssl.GetError()) return; + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } const HandShakeFactory& hsf = ssl.getFactory().getHandShake(); mySTL::auto_ptr<HandShakeBase> hs(hsf.CreateObject(type_)); if (!hs.get()) { @@ -810,8 +867,19 @@ uint16 ChangeCipherSpec::get_length() const // CipherSpec processing handler -void ChangeCipherSpec::Process(input_buffer&, SSL& ssl) +void ChangeCipherSpec::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } + + // detect duplicate change_cipher + if (ssl.getSecurity().get_parms().pending_ == false) { + ssl.order_error(); + return; + } + ssl.useSecurity().use_parms().pending_ = false; if (ssl.getSecurity().get_resuming()) { if (ssl.getSecurity().get_parms().entity_ == client_end) @@ -873,6 +941,11 @@ output_buffer& operator<<(output_buffer& output, const Alert& a) // Alert processing handler void Alert::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } + if (ssl.getSecurity().get_parms().pending_ == false) { // encrypted alert int aSz = get_length(); // alert size already read on input opaque verify[SHA_LEN]; @@ -890,12 +963,19 @@ void Alert::Process(input_buffer& input, SSL& ssl) if (ssl.getSecurity().get_parms().cipher_type_ == block) { int ivExtra = 0; + opaque fill; if (ssl.isTLSv1_1()) ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - aSz - digestSz; - input.set_current(input.get_current() + padSz); + for (int i = 0; i < padSz; i++) + fill = input[AUTO]; + } + + if (input.get_error()) { + ssl.SetError(bad_input); + return; } // verify @@ -1112,6 +1192,11 @@ static int timing_verify(SSL& ssl, const byte* input, int padLen, int t, // Process handler for Data void Data::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } + int msgSz = ssl.getSecurity().get_parms().encrypt_size_; int pad = 0, padSz = 0; int ivExtra = 0; @@ -1154,7 +1239,7 @@ void Data::Process(input_buffer& input, SSL& ssl) int dataSz = msgSz - ivExtra - digestSz - pad - padSz; - if (dataSz < 0) { + if (dataSz < 0 || dataSz > (MAX_RECORD_SIZE + COMPRESS_EXTRA)) { ssl.SetError(bad_input); return; } @@ -1180,6 +1265,10 @@ void Data::Process(input_buffer& input, SSL& ssl) // advance past mac and fill input.set_current(input.get_current() + digestSz + pad + padSz); + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } } @@ -1199,22 +1288,38 @@ output_buffer& operator<<(output_buffer& output, const HandShakeBase& hs) Certificate::Certificate(const x509* cert) : cert_(cert) { - set_length(cert_->get_length() + 2 * CERT_HEADER); // list and cert size + if (cert) + set_length(cert_->get_length() + 2 * CERT_HEADER); // list and cert size + else + set_length(CERT_HEADER); // total blank cert size, just list header } const opaque* Certificate::get_buffer() const { - return cert_->get_buffer(); + if (cert_) + return cert_->get_buffer(); + + return NULL; } // output operator for Certificate output_buffer& operator<<(output_buffer& output, const Certificate& cert) { - uint sz = cert.get_length() - 2 * CERT_HEADER; + uint sz = cert.get_length(); opaque tmp[CERT_HEADER]; + if ((int)sz > CERT_HEADER) + sz -= 2 * CERT_HEADER; // actual cert, not including headers + else { + sz = 0; // blank cert case + c32to24(sz, tmp); + output.write(tmp, CERT_HEADER); + + return output; + } + c32to24(sz + CERT_HEADER, tmp); output.write(tmp, CERT_HEADER); c32to24(sz, tmp); @@ -1228,6 +1333,11 @@ output_buffer& operator<<(output_buffer& output, const Certificate& cert) // certificate processing handler void Certificate::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } + CertManager& cm = ssl.useCrypto().use_certManager(); uint32 list_sz; @@ -1264,9 +1374,11 @@ void Certificate::Process(input_buffer& input, SSL& ssl) ssl.SetError(YasslError(bad_input)); return; } - x509* myCert; - cm.AddPeerCert(myCert = NEW_YS x509(cert_sz)); - input.read(myCert->use_buffer(), myCert->get_length()); + if (cert_sz) { + x509* myCert; + cm.AddPeerCert(myCert = NEW_YS x509(cert_sz)); + input.read(myCert->use_buffer(), myCert->get_length()); + } list_sz -= cert_sz + CERT_HEADER; } @@ -1394,6 +1506,10 @@ input_buffer& operator>>(input_buffer& input, ServerHello& hello) // Session hello.id_len_ = input[AUTO]; + if (hello.id_len_ > ID_LEN) { + input.set_error(); + return input; + } if (hello.id_len_) input.read(hello.session_id_, hello.id_len_); @@ -1434,8 +1550,13 @@ output_buffer& operator<<(output_buffer& output, const ServerHello& hello) // Server Hello processing handler -void ServerHello::Process(input_buffer&, SSL& ssl) +void ServerHello::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } + if (ssl.GetMultiProtocol()) { // SSLv23 support if (ssl.isTLS() && server_version_.minor_ < 1) // downgrade to SSLv3 @@ -1529,8 +1650,12 @@ const opaque* ServerHello::get_random() const // Server Hello Done processing handler -void ServerHelloDone::Process(input_buffer&, SSL& ssl) +void ServerHelloDone::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } ssl.useStates().useClient() = serverHelloDoneComplete; } @@ -1649,8 +1774,13 @@ output_buffer& operator<<(output_buffer& output, const ClientHello& hello) // Client Hello processing handler -void ClientHello::Process(input_buffer&, SSL& ssl) +void ClientHello::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } + // store version for pre master secret ssl.useSecurity().use_connection().chVersion_ = client_version_; @@ -1782,9 +1912,17 @@ output_buffer& operator<<(output_buffer& output, const ServerKeyExchange& sk) // Server Key Exchange processing handler void ServerKeyExchange::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } createKey(ssl); if (ssl.GetError()) return; server_key_->read(ssl, input); + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } ssl.useStates().useClient() = serverKeyExchangeComplete; } @@ -1906,27 +2044,32 @@ input_buffer& operator>>(input_buffer& input, CertificateRequest& request) { // types request.typeTotal_ = input[AUTO]; + if (request.typeTotal_ > CERT_TYPES) { + input.set_error(); + return input; + } for (int i = 0; i < request.typeTotal_; i++) request.certificate_types_[i] = ClientCertificateType(input[AUTO]); - byte tmp[REQUEST_HEADER]; - input.read(tmp, sizeof(tmp)); + byte tmp[2]; + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; uint16 sz; ato16(tmp, sz); // authorities while (sz) { uint16 dnSz; - input.read(tmp, sizeof(tmp)); + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; ato16(tmp, dnSz); - - DistinguishedName dn; - request.certificate_authorities_.push_back(dn = NEW_YS - byte[REQUEST_HEADER + dnSz]); - memcpy(dn, tmp, REQUEST_HEADER); - input.read(&dn[REQUEST_HEADER], dnSz); + + input.set_current(input.get_current() + dnSz); sz -= dnSz + REQUEST_HEADER; + + if (input.get_error()) + break; } return input; @@ -1965,13 +2108,17 @@ output_buffer& operator<<(output_buffer& output, // CertificateRequest processing handler -void CertificateRequest::Process(input_buffer&, SSL& ssl) +void CertificateRequest::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } CertManager& cm = ssl.useCrypto().use_certManager(); - // make sure user provided cert and key before sending and using - if (cm.get_cert() && cm.get_privateKey()) - cm.setSendVerify(); + cm.setSendVerify(); + if (cm.get_cert() == NULL || cm.get_privateKey() == NULL) + cm.setSendBlankCert(); // send blank cert, OpenSSL requires now } @@ -2049,12 +2196,18 @@ output_buffer& CertificateVerify::get(output_buffer& out) const input_buffer& operator>>(input_buffer& input, CertificateVerify& request) { byte tmp[VERIFY_HEADER]; - input.read(tmp, sizeof(tmp)); + tmp[0] = input[AUTO]; + tmp[1] = input[AUTO]; uint16 sz = 0; ato16(tmp, sz); request.set_length(sz); + if (sz == 0) { + input.set_error(); + return input; + } + request.signature_ = NEW_YS byte[sz]; input.read(request.signature_, sz); @@ -2073,8 +2226,13 @@ output_buffer& operator<<(output_buffer& output, // CertificateVerify processing handler -void CertificateVerify::Process(input_buffer&, SSL& ssl) +void CertificateVerify::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } + const Hashes& hashVerify = ssl.getHashes().get_certVerify(); const CertManager& cert = ssl.getCrypto().get_certManager(); @@ -2113,9 +2271,17 @@ output_buffer& operator<<(output_buffer& output, const ClientKeyExchange& ck) // Client Key Exchange processing handler void ClientKeyExchange::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } createKey(ssl); if (ssl.GetError()) return; client_key_->read(ssl, input); + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } if (ssl.getCrypto().get_certManager().verifyPeer()) build_certHashes(ssl, ssl.useHashes().use_certVerify()); @@ -2202,11 +2368,19 @@ output_buffer& operator<<(output_buffer& output, const Finished& fin) // Finished processing handler void Finished::Process(input_buffer& input, SSL& ssl) { + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } // verify hashes const Finished& verify = ssl.getHashes().get_verify(); uint finishedSz = ssl.isTLS() ? TLS_FINISHED_SZ : FINISHED_SZ; input.read(hashes_.md5_, finishedSz); + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } if (memcmp(&hashes_, &verify.hashes_, finishedSz)) { ssl.SetError(verify_error); @@ -2228,19 +2402,23 @@ void Finished::Process(input_buffer& input, SSL& ssl) opaque mac[SHA_LEN]; // max size int digestSz = ssl.getCrypto().get_digest().get_digestSize(); input.read(mac, digestSz); + if (input.get_error()) { + ssl.SetError(bad_input); + return; + } uint ivExtra = 0; if (ssl.getSecurity().get_parms().cipher_type_ == block) if (ssl.isTLSv1_1()) ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); + opaque fill; int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - HANDSHAKE_HEADER - finishedSz - digestSz; - input.set_current(input.get_current() + padSz); - - // verify mac - if (memcmp(mac, verifyMAC, digestSz)) { - ssl.SetError(verify_error); + for (int i = 0; i < padSz; i++) + fill = input[AUTO]; + if (input.get_error()) { + ssl.SetError(bad_input); return; } diff --git a/mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp b/mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp index 8dce8bd1..16858a6e 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -256,6 +256,77 @@ void States::SetError(YasslError ye) } +// mark message recvd, check for duplicates, return 0 on success +int States::SetMessageRecvd(HandShakeType hst) +{ + switch (hst) { + case hello_request: + break; // could send more than one + + case client_hello: + if (recvdMessages_.gotClientHello_) + return -1; + recvdMessages_.gotClientHello_ = 1; + break; + + case server_hello: + if (recvdMessages_.gotServerHello_) + return -1; + recvdMessages_.gotServerHello_ = 1; + break; + + case certificate: + if (recvdMessages_.gotCert_) + return -1; + recvdMessages_.gotCert_ = 1; + break; + + case server_key_exchange: + if (recvdMessages_.gotServerKeyExchange_) + return -1; + recvdMessages_.gotServerKeyExchange_ = 1; + break; + + case certificate_request: + if (recvdMessages_.gotCertRequest_) + return -1; + recvdMessages_.gotCertRequest_ = 1; + break; + + case server_hello_done: + if (recvdMessages_.gotServerHelloDone_) + return -1; + recvdMessages_.gotServerHelloDone_ = 1; + break; + + case certificate_verify: + if (recvdMessages_.gotCertVerify_) + return -1; + recvdMessages_.gotCertVerify_ = 1; + break; + + case client_key_exchange: + if (recvdMessages_.gotClientKeyExchange_) + return -1; + recvdMessages_.gotClientKeyExchange_ = 1; + break; + + case finished: + if (recvdMessages_.gotFinished_) + return -1; + recvdMessages_.gotFinished_ = 1; + break; + + + default: + return -1; + + } + + return 0; +} + + sslFactory::sslFactory() : messageFactory_(InitMessageFactory), handShakeFactory_(InitHandShakeFactory), @@ -1251,6 +1322,11 @@ void SSL::verifyState(const HandShakeHeader& hsHeader) return; } + if (states_.SetMessageRecvd(hsHeader.get_handshakeType()) != 0) { + order_error(); + return; + } + if (secure_.get_parms().entity_ == client_end) verifyClientState(hsHeader.get_handshakeType()); else @@ -2638,8 +2714,9 @@ ASN1_STRING* StringHolder::GetString() int DeCompress(input_buffer& in, int sz, input_buffer& out) { byte tmp[LENGTH_SZ]; - - in.read(tmp, sizeof(tmp)); + + tmp[0] = in[AUTO]; + tmp[1] = in[AUTO]; uint16 len; ato16(tmp, len); diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/CMakeLists.txt b/mysql-wsrep-5.6/extra/yassl/taocrypt/CMakeLists.txt index aa71ce32..267030ea 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/CMakeLists.txt +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -36,7 +36,6 @@ ENDIF() ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES}) RESTRICT_SYMBOL_EXPORTS(taocrypt) -INSTALL_DEBUG_SYMBOLS(taocrypt) IF(MSVC) INSTALL_DEBUG_TARGET(taocrypt DESTINATION ${INSTALL_LIBDIR}/debug) ENDIF() diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp index cfa8cee5..bc3eebe6 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,8 +261,8 @@ enum ContentType { HUH = 651 }; enum SigType { SHAwDSA = 517, MD2wRSA = 646, MD5wRSA = 648, SHAwRSA = 649, SHA256wRSA = 655, SHA384wRSA = 656, SHA512wRSA = 657, SHA256wDSA = 416 }; -enum HashType { MD2h = 646, MD5h = 649, SHAh = 88, SHA256h = 414, - SHA384h = 415, SHA512h = 416 }; +enum HashType { MD2h = 646, MD5h = 649, SHAh = 88, SHA256h = 414, SHA384h = 415, + SHA512h = 416 }; enum KeyType { DSAk = 515, RSAk = 645 }; // sums of algo OID @@ -300,11 +300,11 @@ private: byte* signature_; char issuer_[ASN_NAME_MAX]; // Names char subject_[ASN_NAME_MAX]; // Names - char beforeDate_[MAX_DATE_SZ]; // valid before date - byte beforeDateType_; // beforeDate time type - char afterDate_[MAX_DATE_SZ]; // valid after date - byte afterDateType_; // afterDate time type - bool verify_; // Default to yes, but could be off + char beforeDate_[MAX_DATE_SZ+1]; // valid before date, +null term + byte beforeDateType_; // beforeDate time type + char afterDate_[MAX_DATE_SZ+1]; // valid after date, +null term + byte afterDateType_; // afterDate time type + bool verify_; // Default to yes, but could be off void ReadHeader(); void Decode(SignerList*, CertType); diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/block.hpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/block.hpp index d7a69211..4f58c82f 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/block.hpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/block.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +74,7 @@ typename A::pointer StdReallocate(A& a, T* p, typename A::size_type oldSize, if (preserve) { A b = A(); typename A::pointer newPointer = b.allocate(newSize, 0); - memcpy(newPointer, p, sizeof(T) * min((word32) oldSize, (word32) newSize)); + memcpy(newPointer, p, sizeof(T) * min(oldSize, newSize)); a.deallocate(p, oldSize); STL::swap(a, b); return newPointer; @@ -186,9 +186,9 @@ public: ~Block() { allocator_.deallocate(buffer_, sz_); } private: + A allocator_; word32 sz_; // size in Ts T* buffer_; - A allocator_; }; diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/integer.hpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/integer.hpp index e1a2ed5f..75a3ee3d 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/integer.hpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/integer.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,14 @@ #endif +#ifdef TAOCRYPT_X86ASM_AVAILABLE + #if defined(__GNUC__) && (__GNUC__ >= 4) + // GCC 4 or greater optimizes too much inline on recursive for bigint, + // -O3 just as fast without asm here anyway + #undef TAOCRYPT_X86ASM_AVAILABLE + #endif +#endif + #ifdef TAOCRYPT_X86ASM_AVAILABLE #ifdef _M_IX86 diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/misc.hpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/misc.hpp index 7624ef97..cb4d26e7 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/misc.hpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/misc.hpp @@ -124,15 +124,22 @@ void CleanUp(); // no gas on these systems ?, disable for now -#if defined(__sun__) || defined (__APPLE__) +#if defined(__sun__) + #undef TAOCRYPT_DISABLE_X86ASM #define TAOCRYPT_DISABLE_X86ASM #endif // icc problem with -03 and integer, disable for now #if defined(__INTEL_COMPILER) + #undef TAOCRYPT_DISABLE_X86ASM #define TAOCRYPT_DISABLE_X86ASM #endif +// indpedent of build system, unless ia32 asm is enabled disable it +#if !defined(TAOCRYPT_ENABLE_X86ASM) + #undef TAOCRYPT_DISABLE_X86ASM + #define TAOCRYPT_DISABLE_X86ASM +#endif // Turn on ia32 ASM for Big Integer // CodeWarrior defines _MSC_VER diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/pwdbased.hpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/pwdbased.hpp index 9025cc1a..cf4dff5c 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/pwdbased.hpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/pwdbased.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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 +16,7 @@ MA 02110-1301 USA. */ + /* pwdbased.hpp defines PBKDF2 from PKCS #5 */ @@ -48,10 +49,7 @@ word32 PBKDF2_HMAC<T>::DeriveKey(byte* derived, word32 dLen, const byte* pwd, word32 pLen, const byte* salt, word32 sLen, word32 iterations) const { - if (dLen > MaxDerivedKeyLength()) - return 0; - - if (iterations < 0) + if (dLen > MaxDerivedKeyLength()) return 0; ByteBlock buffer(T::DIGEST_SIZE); diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/runtime.hpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/runtime.hpp index ef7ce092..4c743625 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/runtime.hpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/runtime.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,10 @@ // Handler for pure virtual functions namespace __Crun { - void pure_error(void); + static void pure_error(void) + { + // "Pure virtual method called, Aborted", GCC 4.2 str cmp fix + } } // namespace __Crun #endif // __sun @@ -48,7 +51,15 @@ extern "C" { #if defined(DO_TAOCRYPT_KERNEL_MODE) #include "kernelc.hpp" #endif - int __cxa_pure_virtual () __attribute__ ((weak)); + +/* Disallow inline __cxa_pure_virtual() */ +static int __cxa_pure_virtual() __attribute__((noinline, used)); +static int __cxa_pure_virtual() +{ + // oops, pure virtual called! + return 0; +} + } // extern "C" #endif // __GNUC__ > 2 diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/sha.hpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/sha.hpp index 5ff86dd1..cf6d0d09 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/sha.hpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/sha.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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/mysql-wsrep-5.6/extra/yassl/taocrypt/src/aes.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/aes.cpp index 9b04e7b0..ee4c7a6e 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/aes.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/aes.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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 +52,7 @@ void AES::Process(byte* out, const byte* in, word32 sz) in += BLOCK_SIZE; } else if (mode_ == CBC) { - if (dir_ == ENCRYPTION) + if (dir_ == ENCRYPTION) { while (blocks--) { r_[0] ^= *(word32*)in; r_[1] ^= *(word32*)(in + 4); @@ -65,7 +65,8 @@ void AES::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else + } + else { while (blocks--) { AsmDecrypt(in, out, (void*)Td0); @@ -78,7 +79,8 @@ void AES::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - } + } + } } #endif // DO_AES_ASM @@ -452,27 +454,30 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock, #if defined(DO_AES_ASM) #ifdef __GNUC__ - #define AS1(x) asm(#x); - #define AS2(x, y) asm(#x ", " #y); + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" #define PROLOG() \ - asm(".intel_syntax noprefix"); \ - AS2( movd mm3, edi ) \ - AS2( movd mm4, ebx ) \ - AS2( sub esp, 4 ) \ - AS2( movd mm7, ebp ) \ - AS2( mov [ebp - 4], esi ) \ - AS2( mov ecx, DWORD PTR [ebp + 8] ) \ - AS2( mov esi, DWORD PTR [ebp + 12] ) \ - AS2( mov ebp, DWORD PTR [ebp + 20] ) - + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + "push ebx;" \ + "push ebp;" \ + "movd mm7, ebp;" \ + "movd mm4, eax;" \ + "mov ebp, edx;" \ + "sub esp, 4;" #define EPILOG() \ - AS2( mov esi, [ebp - 4] ) \ - AS2( mov esp, ebp ) \ - AS2( movd ebx, mm4 ) \ - AS2( movd edi, mm3 ) \ - AS1( emms ) \ - asm(".att_syntax"); + "add esp, 4;" \ + "pop ebp;" \ + "pop ebx;" \ + "emms;" \ + ".att_syntax;" \ + : \ + : "c" (this), "S" (inBlock), "d" (boxes), "a" (outBlock) \ + : "%edi", "memory", "cc" \ + ); + #else #define AS1(x) __asm x #define AS2(x, y) __asm x, y @@ -504,6 +509,8 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock, #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void AES::AsmEncrypt(const byte* inBlock, byte* outBlock, void* boxes) const { @@ -537,7 +544,11 @@ void AES::AsmEncrypt(const byte* inBlock, byte* outBlock, void* boxes) const AS2( xor ecx, DWORD PTR [edi + 8] ) // s2 AS2( xor edx, DWORD PTR [edi + 12] ) // s3 - AS1(loop1: ) +#ifdef _MSC_VER + AS1( loop1: ) // loop1 +#else + AS1(1: ) // loop1 +#endif /* Put0 (mm0) = Te0[get0,rs 24] ^ Te1[get1,rs 16] ^ @@ -652,7 +663,11 @@ void AES::AsmEncrypt(const byte* inBlock, byte* outBlock, void* boxes) const AS1( dec edi ) AS2( movd mm5, edi ) - AS1( jnz loop1 ) +#ifdef _MSC_VER + AS1( jnz loop1) // loop1 +#else + AS1( jnz 1b ) // loop1 +#endif // last round /* @@ -799,9 +814,9 @@ void AES::AsmEncrypt(const byte* inBlock, byte* outBlock, void* boxes) const // store #ifdef __GNUC__ - AS2( mov esi, DWORD PTR [ebp + 16] ) // outBlock + AS2( movd esi, mm4 ) // outBlock #else - AS2( mov esi, DWORD PTR [ebp + 12] ) // outBlock + AS2( mov esi, DWORD PTR [ebp + 12] ) // outBlock #endif AS1( bswap ecx ) @@ -819,6 +834,8 @@ void AES::AsmEncrypt(const byte* inBlock, byte* outBlock, void* boxes) const #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void AES::AsmDecrypt(const byte* inBlock, byte* outBlock, void* boxes) const { @@ -853,7 +870,11 @@ void AES::AsmDecrypt(const byte* inBlock, byte* outBlock, void* boxes) const AS2( xor edx, DWORD PTR [edi + 12] ) // s3 - AS1(loop2: ) +#ifdef _MSC_VER + AS1( loop2: ) // loop2 +#else + AS1(2: ) // loop2 +#endif /* Put0 (mm0) = Td0[GETBYTE(get0, rs24)] ^ Td1[GETBYTE(get3, rs16)] ^ @@ -964,7 +985,11 @@ void AES::AsmDecrypt(const byte* inBlock, byte* outBlock, void* boxes) const AS1( dec edi ) AS2( movd mm5, edi ) - AS1( jnz loop2 ) +#ifdef _MSC_VER + AS1( jnz loop2) // loop2 +#else + AS1( jnz 2b ) // loop2 +#endif // last round /* @@ -1114,9 +1139,9 @@ void AES::AsmDecrypt(const byte* inBlock, byte* outBlock, void* boxes) const // store #ifdef __GNUC__ - AS2( mov esi, DWORD PTR [ebp + 16] ) // outBlock + AS2( movd esi, mm4 ) // outBlock #else - AS2( mov esi, DWORD PTR [ebp + 12] ) // outBlock + AS2( mov esi, DWORD PTR [ebp + 12] ) // outBlock #endif AS2( mov DWORD PTR [esi], eax ) AS2( mov DWORD PTR [esi + 4], ebx ) diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/algebra.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/algebra.cpp index c0dbfbe6..ace17047 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/algebra.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/algebra.cpp @@ -1,4 +1,5 @@ -/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +/* + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -183,10 +184,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x, struct WindowSlider { - WindowSlider(const Integer &expIn, bool fastNegateIn, + WindowSlider(const Integer &exp, bool fastNegate, unsigned int windowSizeIn=0) - : exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn), - windowBegin(0), fastNegate(fastNegateIn), firstTime(true), + : exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn), + windowBegin(0), fastNegate(fastNegate), firstTime(true), finished(false) { if (windowSize == 0) diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/arc4.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/arc4.cpp index a76a3790..10a3a7d6 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/arc4.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/arc4.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -111,28 +111,26 @@ void ARC4::Process(byte* out, const byte* in, word32 length) void ARC4::AsmProcess(byte* out, const byte* in, word32 length) { #ifdef __GNUC__ - #define AS1(x) asm(#x); - #define AS2(x, y) asm(#x ", " #y); + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" #define PROLOG() \ - asm(".intel_syntax noprefix"); \ - AS2( movd mm3, edi ) \ - AS2( movd mm4, ebx ) \ - AS2( movd mm5, esi ) \ - AS2( movd mm6, ebp ) \ - AS2( mov ecx, DWORD PTR [ebp + 8] ) \ - AS2( mov edi, DWORD PTR [ebp + 12] ) \ - AS2( mov esi, DWORD PTR [ebp + 16] ) \ - AS2( mov ebp, DWORD PTR [ebp + 20] ) - + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + "push ebx;" \ + "push ebp;" \ + "mov ebp, eax;" #define EPILOG() \ - AS2( movd ebp, mm6 ) \ - AS2( movd esi, mm5 ) \ - AS2( movd ebx, mm4 ) \ - AS2( mov esp, ebp ) \ - AS2( movd edi, mm3 ) \ - AS1( emms ) \ - asm(".att_syntax"); + "pop ebp;" \ + "pop ebx;" \ + "emms;" \ + ".att_syntax;" \ + : \ + : "c" (this), "D" (out), "S" (in), "a" (length) \ + : "%edx", "memory", "cc" \ + ); + #else #define AS1(x) __asm x #define AS2(x, y) __asm x, y @@ -178,7 +176,11 @@ void ARC4::AsmProcess(byte* out, const byte* in, word32 length) AS2( movzx eax, BYTE PTR [ebp + ecx] ) -AS1( begin: ) +#ifdef _MSC_VER + AS1( loopStart: ) // loopStart +#else + AS1( 0: ) // loopStart for some gas (need numeric for jump back +#endif // y = (y+a) & 0xff; AS2( add edx, eax ) @@ -215,7 +217,11 @@ AS1( begin: ) AS1( inc edi ) AS1( dec DWORD PTR [esp] ) - AS1( jnz begin ) +#ifdef _MSC_VER + AS1( jnz loopStart ) // loopStart +#else + AS1( jnz 0b ) // loopStart +#endif // write back to x_ and y_ @@ -225,6 +231,8 @@ AS1( begin: ) AS1( nothing: ) + // inline adjust + AS2( add esp, 4 ) // fix room on stack EPILOG() } diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp index 65ba213a..7c9e91e1 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -685,7 +685,7 @@ word32 CertDecoder::GetSignature() } sigLength_ = GetLength(source_); - if (sigLength_ == 0 || source_.IsLeft(sigLength_) == false) { + if (sigLength_ <= 1 || source_.IsLeft(sigLength_) == false) { source_.SetError(CONTENT_E); return 0; } @@ -773,7 +773,7 @@ void CertDecoder::GetName(NameType nt) while (source_.get_index() < length) { GetSet(); if (source_.GetError().What() == SET_E) { - source_.SetError(NO_ERROR_E); // extensions may only have sequence + source_.SetError(NO_ERROR_E); // extensions may only have sequence source_.prev(); } GetSequence(); @@ -844,10 +844,8 @@ void CertDecoder::GetName(NameType nt) if (source_.IsLeft(length) == false) return; if (email) { - if (!(ptr = AddTag(ptr, buf_end, "/emailAddress=", 14, length))) { - source_.SetError(CONTENT_E); - return; - } + if (!(ptr = AddTag(ptr, buf_end, "/emailAddress=", 14, length))) + return; } source_.advance(length); @@ -1018,11 +1016,17 @@ bool CertDecoder::ConfirmSignature(Source& pub) RSA_PublicKey pubKey(pub); RSAES_Encryptor enc(pubKey); + if (pubKey.FixedCiphertextLength() != sigLength_) { + source_.SetError(SIG_LEN_E); + return false; + } + return enc.SSL_Verify(build.get_buffer(), build.size(), signature_); } else { // DSA // extract r and s from sequence byte seqDecoded[DSA_SIG_SZ]; + memset(seqDecoded, 0, sizeof(seqDecoded)); DecodeDSA_Signature(seqDecoded, signature_, sigLength_); DSA_PublicKey pubKey(pub); @@ -1080,12 +1084,10 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output) 0x02, 0x02, 0x05, 0x00}; static const byte sha256AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00 }; -#ifdef WORD64_AVAILABLE static const byte sha384AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00 }; static const byte sha512AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00 }; -#endif int algoSz = 0; const byte* algoName = 0; @@ -1100,7 +1102,6 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output) algoName = sha256AlgoID; break; -#ifdef WORD64_AVAILABLE case SHA384h: algoSz = sizeof(sha384AlgoID); algoName = sha384AlgoID; @@ -1110,7 +1111,6 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output) algoSz = sizeof(sha512AlgoID); algoName = sha512AlgoID; break; -#endif case MD2h: algoSz = sizeof(md2AlgoID); diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/blowfish.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/blowfish.cpp index cedae6af..9491c930 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/blowfish.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/blowfish.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz) in += BLOCK_SIZE; } else if (mode_ == CBC) { - if (dir_ == ENCRYPTION) + if (dir_ == ENCRYPTION) { while (blocks--) { r_[0] ^= *(word32*)in; r_[1] ^= *(word32*)(in + 4); @@ -66,7 +66,8 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else + } + else { while (blocks--) { AsmProcess(in, out); @@ -78,6 +79,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } + } } } @@ -222,23 +224,26 @@ void Blowfish::ProcessAndXorBlock(const byte* in, const byte* xOr, byte* out) #if defined(DO_BLOWFISH_ASM) #ifdef __GNUC__ - #define AS1(x) asm(#x); - #define AS2(x, y) asm(#x ", " #y); + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" #define PROLOG() \ - asm(".intel_syntax noprefix"); \ - AS2( movd mm3, edi ) \ - AS2( movd mm4, ebx ) \ - AS2( movd mm5, esi ) \ - AS2( mov ecx, DWORD PTR [ebp + 8] ) \ - AS2( mov esi, DWORD PTR [ebp + 12] ) - + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + "push ebx;" \ + "push ebp;" \ + "movd mm3, eax;" #define EPILOG() \ - AS2( movd esi, mm5 ) \ - AS2( movd ebx, mm4 ) \ - AS2( movd edi, mm3 ) \ - AS1( emms ) \ - asm(".att_syntax"); + "pop ebp;" \ + "pop ebx;" \ + "emms;" \ + ".att_syntax;" \ + : \ + : "c" (this), "S" (inBlock), "a" (outBlock) \ + : "%edi", "%edx", "memory", "cc" \ + ); + #else #define AS1(x) __asm x #define AS2(x, y) __asm x, y @@ -287,6 +292,8 @@ void Blowfish::ProcessAndXorBlock(const byte* in, const byte* xOr, byte* out) #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void Blowfish::AsmProcess(const byte* inBlock, byte* outBlock) const { @@ -335,7 +342,7 @@ void Blowfish::AsmProcess(const byte* inBlock, byte* outBlock) const #endif #ifdef __GNUC__ - AS2( mov edi, [ebp + 16] ) // outBlock + AS2( movd edi, mm3 ) // outBlock #else AS2( mov edi, [ebp + 12] ) // outBlock #endif diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/des.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/des.cpp index 3d101f87..673c21ed 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/des.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/des.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -473,7 +473,7 @@ void DES_EDE3::ProcessAndXorBlock(const byte* in, const byte* xOr, uses ecx */ -#define AsmIPERM() {\ +#define AsmIPERM() \ AS2( rol ebx, 4 ) \ AS2( mov ecx, eax ) \ AS2( xor ecx, ebx ) \ @@ -504,7 +504,7 @@ void DES_EDE3::ProcessAndXorBlock(const byte* in, const byte* xOr, AS2( and ecx, 0xaaaaaaaa ) \ AS2( xor eax, ecx ) \ AS2( rol eax, 1 ) \ - AS2( xor ebx, ecx ) } + AS2( xor ebx, ecx ) /* Uses FPERM algorithm from above @@ -514,7 +514,7 @@ void DES_EDE3::ProcessAndXorBlock(const byte* in, const byte* xOr, uses ecx */ -#define AsmFPERM() {\ +#define AsmFPERM() \ AS2( ror ebx, 1 ) \ AS2( mov ecx, eax ) \ AS2( xor ecx, ebx ) \ @@ -545,7 +545,7 @@ void DES_EDE3::ProcessAndXorBlock(const byte* in, const byte* xOr, AS2( and ecx, 0xf0f0f0f0 ) \ AS2( xor eax, ecx ) \ AS2( xor ebx, ecx ) \ - AS2( ror eax, 4 ) } + AS2( ror eax, 4 ) @@ -642,31 +642,33 @@ void DES_EDE3::ProcessAndXorBlock(const byte* in, const byte* xOr, #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void DES_EDE3::AsmProcess(const byte* in, byte* out, void* box) const { #ifdef __GNUC__ - #define AS1(x) asm(#x); - #define AS2(x, y) asm(#x ", " #y); - - asm(".intel_syntax noprefix"); + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" #define PROLOG() \ - AS2( movd mm3, edi ) \ - AS2( movd mm4, ebx ) \ - AS2( movd mm5, esi ) \ - AS2( movd mm6, ebp ) \ - AS2( mov edx, DWORD PTR [ebp + 8] ) \ - AS2( mov esi, DWORD PTR [ebp + 12] ) \ - AS2( mov ebp, DWORD PTR [ebp + 20] ) - - // ebp restored at end - #define EPILOG() \ - AS2( movd edi, mm3 ) \ - AS2( movd ebx, mm4 ) \ - AS2( movd esi, mm5 ) \ - AS1( emms ) \ - asm(".att_syntax"); + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + "push ebx;" \ + "push ebp;" \ + "movd mm6, ebp;" \ + "movd mm7, ecx;" \ + "mov ebp, eax;" + #define EPILOG() \ + "pop ebp;" \ + "pop ebx;" \ + "emms;" \ + ".att_syntax;" \ + : \ + : "d" (this), "S" (in), "a" (box), "c" (out) \ + : "%edi", "memory", "cc" \ + ); #else #define AS1(x) __asm x @@ -756,7 +758,7 @@ void DES_EDE3::AsmProcess(const byte* in, byte* out, void* box) const AS1( bswap eax ) #ifdef __GNUC__ - AS2( mov esi, DWORD PTR [ebp + 16] ) // outBlock + AS2( movd esi, mm7 ) // outBlock #else AS2( mov esi, DWORD PTR [ebp + 12] ) // outBlock #endif diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/integer.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/integer.cpp index 8aef0759..b356e6be 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/integer.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/integer.cpp @@ -1,4 +1,5 @@ -/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +/* + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,8 +51,9 @@ #include <emmintrin.h> #endif #elif defined(_MSC_VER) && defined(_M_IX86) - #pragma message("You do not seem to have the Visual C++ Processor Pack ") +/* #pragma message("You do not seem to have the Visual C++ Processor Pack ") #pragma message("installed, so use of SSE2 intrinsics will be disabled.") +*/ #elif defined(__GNUC__) && defined(__i386__) /* #warning You do not have GCC 3.3 or later, or did not specify the -msse2 \ compiler option. Use of SSE2 intrinsics will be disabled. @@ -68,7 +70,7 @@ template <class T> CPP_TYPENAME AlignedAllocator<T>::pointer AlignedAllocator<T>::allocate( size_type n, const void *) { - if (n > max_size()) + if (n > this->max_size()) return 0; if (n == 0) return 0; @@ -275,7 +277,12 @@ DWord() {} word GetHighHalfAsBorrow() const {return 0-halfs_.high;} private: - struct dword_struct + union + { + #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE + dword whole_; + #endif + struct { #ifdef LITTLE_ENDIAN_ORDER word low; @@ -284,14 +291,7 @@ private: word high; word low; #endif - }; - - union - { - #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE - dword whole_; - #endif - struct dword_struct halfs_; + } halfs_; }; }; @@ -1194,24 +1194,20 @@ public: #define AS1(x) #x ";" #define AS2(x, y) #x ", " #y ";" #define AddPrologue \ - word res; \ __asm__ __volatile__ \ ( \ "push %%ebx;" /* save this manually, in case of -fPIC */ \ - "mov %3, %%ebx;" \ + "mov %2, %%ebx;" \ ".intel_syntax noprefix;" \ "push ebp;" #define AddEpilogue \ "pop ebp;" \ ".att_syntax prefix;" \ "pop %%ebx;" \ - "mov %%eax, %0;" \ - : "=g" (res) \ + : \ : "c" (C), "d" (A), "m" (B), "S" (N) \ : "%edi", "memory", "cc" \ - ); \ - return res; - + ); #define MulPrologue \ __asm__ __volatile__ \ ( \ @@ -2605,18 +2601,20 @@ void Integer::Decode(Source& source) void Integer::Decode(const byte* input, unsigned int inputLen, Signedness s) { unsigned int idx(0); - byte b = input[idx++]; + byte b = 0; + if (inputLen>0) + b = input[idx]; // peek sign_ = ((s==SIGNED) && (b & 0x80)) ? NEGATIVE : POSITIVE; while (inputLen>0 && (sign_==POSITIVE ? b==0 : b==0xff)) { - inputLen--; - b = input[idx++]; + idx++; // skip + if (--inputLen>0) + b = input[idx]; // peek } reg_.CleanNew(RoundupSize(BytesToWords(inputLen))); - --idx; for (unsigned int i=inputLen; i > 0; i--) { b = input[idx++]; diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/md5.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/md5.cpp index ee0d64ac..45cfa8a3 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/md5.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/md5.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -224,31 +224,31 @@ void MD5::Update(const byte* data, word32 len) #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void MD5::AsmTransform(const byte* data, word32 times) { #ifdef __GNUC__ - #define AS1(x) asm(#x); - #define AS2(x, y) asm(#x ", " #y); + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" #define PROLOG() \ - asm(".intel_syntax noprefix"); \ - AS2( movd mm3, edi ) \ - AS2( movd mm4, ebx ) \ - AS2( movd mm5, esi ) \ - AS2( movd mm6, ebp ) \ - AS2( mov ecx, DWORD PTR [ebp + 8] ) \ - AS2( mov edi, DWORD PTR [ebp + 12] ) \ - AS2( mov eax, DWORD PTR [ebp + 16] ) - + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + "push ebx;" \ + "push ebp;" #define EPILOG() \ - AS2( movd ebp, mm6 ) \ - AS2( movd esi, mm5 ) \ - AS2( movd ebx, mm4 ) \ - AS2( mov esp, ebp ) \ - AS2( movd edi, mm3 ) \ - AS1( emms ) \ - asm(".att_syntax"); + "pop ebp;" \ + "pop ebx;" \ + "emms;" \ + ".att_syntax;" \ + : \ + : "c" (this), "D" (data), "a" (times) \ + : "%esi", "%edx", "memory", "cc" \ + ); + #else #define AS1(x) __asm x #define AS2(x, y) __asm x, y @@ -294,7 +294,11 @@ void MD5::AsmTransform(const byte* data, word32 times) AS2( mov ecx, [esi + 8] ) // c AS2( mov edx, [esi + 12] ) // d -AS1(loopStart:) +#ifdef _MSC_VER + AS1( loopStart: ) // loopStart +#else + AS1( 0: ) // loopStart for some gas (need numeric for jump back +#endif // set up AS2( mov esi, ecx ) @@ -389,7 +393,11 @@ AS1(loopStart:) AS2( movd ebp, mm2 ) // times AS1( dec ebp ) AS2( movd mm2, ebp ) - AS1( jnz loopStart ) +#ifdef _MSC_VER + AS1( jnz loopStart ) // loopStart +#else + AS1( jnz 0b ) // loopStart +#endif EPILOG() diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/misc.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/misc.cpp index b576d3d5..fd9e8b92 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/misc.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/misc.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -84,17 +84,7 @@ namespace STL = STL_NAMESPACE; } -#ifdef __sun - -// Handler for pure virtual functions -namespace __Crun { - void pure_error() { - } -} - -#endif - -#if defined(__ICC) || defined(__INTEL_COMPILER) || (__GNUC__ > 2) +#if defined(__ICC) || defined(__INTEL_COMPILER) extern "C" { @@ -175,6 +165,14 @@ word Crop(word value, unsigned int size) #ifdef TAOCRYPT_X86ASM_AVAILABLE +#ifndef _MSC_VER + static jmp_buf s_env; + static void SigIllHandler(int) + { + longjmp(s_env, 1); + } +#endif + bool HaveCpuId() { diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rabbit.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rabbit.cpp index 2c0f6bec..5e32f383 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rabbit.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rabbit.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -198,7 +198,6 @@ void Rabbit::Process(byte* output, const byte* input, word32 msglen) { /* Temporary variables */ word32 i; - byte buffer[16]; /* Encrypt/decrypt all full blocks */ while (msglen >= 16) { @@ -227,17 +226,23 @@ void Rabbit::Process(byte* output, const byte* input, word32 msglen) /* Encrypt/decrypt remaining data */ if (msglen) { + + word32 tmp[4]; + byte* buffer = (byte*)tmp; + + memset(tmp, 0, sizeof(tmp)); /* help static analysis */ + /* Iterate the system */ NextState(Work); /* Generate 16 bytes of pseudo-random data */ - *(word32*)(buffer+ 0) = LITTLE32(workCtx_.x[0] ^ + tmp[0] = LITTLE32(workCtx_.x[0] ^ (workCtx_.x[5]>>16) ^ U32V(workCtx_.x[3]<<16)); - *(word32*)(buffer+ 4) = LITTLE32(workCtx_.x[2] ^ + tmp[1] = LITTLE32(workCtx_.x[2] ^ (workCtx_.x[7]>>16) ^ U32V(workCtx_.x[5]<<16)); - *(word32*)(buffer+ 8) = LITTLE32(workCtx_.x[4] ^ + tmp[2] = LITTLE32(workCtx_.x[4] ^ (workCtx_.x[1]>>16) ^ U32V(workCtx_.x[7]<<16)); - *(word32*)(buffer+12) = LITTLE32(workCtx_.x[6] ^ + tmp[3] = LITTLE32(workCtx_.x[6] ^ (workCtx_.x[3]>>16) ^ U32V(workCtx_.x[1]<<16)); /* Encrypt/decrypt the data */ diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/random.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/random.cpp index 084871c5..4b89b5b3 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/random.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/random.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include <time.h> #if defined(_WIN32) + #define _WIN32_WINNT 0x0400 #include <windows.h> #include <wincrypt.h> #else diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/ripemd.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/ripemd.cpp index f77010ca..5d03dc61 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/ripemd.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/ripemd.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -507,31 +507,31 @@ void RIPEMD160::Transform() #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void RIPEMD160::AsmTransform(const byte* data, word32 times) { #ifdef __GNUC__ - #define AS1(x) asm(#x); - #define AS2(x, y) asm(#x ", " #y); + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" #define PROLOG() \ - asm(".intel_syntax noprefix"); \ - AS2( movd mm3, edi ) \ - AS2( movd mm4, ebx ) \ - AS2( movd mm5, esi ) \ - AS2( movd mm6, ebp ) \ - AS2( mov ecx, DWORD PTR [ebp + 8] ) \ - AS2( mov edi, DWORD PTR [ebp + 12] ) \ - AS2( mov edx, DWORD PTR [ebp + 16] ) - + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + "push ebx;" \ + "push ebp;" #define EPILOG() \ - AS2( movd ebp, mm6 ) \ - AS2( movd esi, mm5 ) \ - AS2( movd ebx, mm4 ) \ - AS2( mov esp, ebp ) \ - AS2( movd edi, mm3 ) \ - AS1( emms ) \ - asm(".att_syntax"); + "pop ebp;" \ + "pop ebx;" \ + "emms;" \ + ".att_syntax;" \ + : \ + : "c" (this), "D" (data), "d" (times) \ + : "%esi", "%eax", "memory", "cc" \ + ); + #else #define AS1(x) __asm x #define AS2(x, y) __asm x, y @@ -569,7 +569,11 @@ void RIPEMD160::AsmTransform(const byte* data, word32 times) AS2( sub esp, 24 ) // make room for tmp a1 - e1 AS2( movd mm1, esi ) // store digest_ -AS1( loopStart: ) +#ifdef _MSC_VER + AS1( loopStart: ) // loopStart +#else + AS1( 0: ) // loopStart for some gas (need numeric for jump back +#endif AS2( movd mm2, edx ) // store times_ @@ -821,8 +825,14 @@ AS1( loopStart: ) AS2( movd edx, mm2 ) // times AS2( movd edi, mm0 ) // data, already advanced AS1( dec edx ) - AS1( jnz loopStart ) +#ifdef _MSC_VER + AS1( jnz loopStart ) // loopStart +#else + AS1( jnz 0b ) // loopStart +#endif + // inline adjust + AS2( add esp, 24 ) // fix room on stack EPILOG() } diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp index 69c59402..79a8a8f1 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp @@ -177,7 +177,7 @@ word32 RSA_BlockType1::UnPad(const byte* pkcsBlock, word32 pkcsBlockLen, // skip past the padding until we find the separator unsigned i=1; - while (i<pkcsBlockLen && pkcsBlock[i++]) { // null body + while (i<pkcsBlockLen && pkcsBlock[i++] == 0xFF) { // null body } if (!(i==pkcsBlockLen || pkcsBlock[i-1]==0)) return 0; diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/sha.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/sha.cpp index f67a4f55..4206f7f6 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/sha.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/sha.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -760,32 +760,32 @@ void SHA384::Transform() #ifdef _MSC_VER - __declspec(naked) + __declspec(naked) +#else + __attribute__ ((noinline)) #endif void SHA::AsmTransform(const byte* data, word32 times) { #ifdef __GNUC__ - #define AS1(x) asm(#x); - #define AS2(x, y) asm(#x ", " #y); + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" #define PROLOG() \ - asm(".intel_syntax noprefix"); \ - AS2( movd mm3, edi ) \ - AS2( movd mm4, ebx ) \ - AS2( movd mm5, esi ) \ - AS2( movd mm6, ebp ) \ - AS2( mov ecx, DWORD PTR [ebp + 8] ) \ - AS2( mov edi, DWORD PTR [ebp + 12] ) \ - AS2( mov eax, DWORD PTR [ebp + 16] ) - + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + "push ebx;" \ + "push ebp;" #define EPILOG() \ - AS2( movd ebp, mm6 ) \ - AS2( movd esi, mm5 ) \ - AS2( movd ebx, mm4 ) \ - AS2( mov esp, ebp ) \ - AS2( movd edi, mm3 ) \ - AS1( emms ) \ - asm(".att_syntax"); + "pop ebp;" \ + "pop ebx;" \ + "emms;" \ + ".att_syntax;" \ + : \ + : "c" (this), "D" (data), "a" (times) \ + : "%esi", "%edx", "memory", "cc" \ + ); + #else #define AS1(x) __asm x #define AS2(x, y) __asm x, y @@ -826,7 +826,11 @@ void SHA::AsmTransform(const byte* data, word32 times) AS2( sub esp, 68 ) // make room on stack -AS1( loopStart: ) +#ifdef _MSC_VER + AS1( loopStart: ) // loopStart +#else + AS1( 0: ) // loopStart for some gas (need numeric for jump back +#endif // byte reverse 16 words of input, 4 at a time, put on stack for W[] @@ -1011,8 +1015,14 @@ AS1( loopStart: ) AS1( dec ebp ) AS2( movd mm2, ebp ) - AS1( jnz loopStart ) +#ifdef _MSC_VER + AS1( jnz loopStart ) // loopStart +#else + AS1( jnz 0b ) // loopStart +#endif + // inline adjust + AS2( add esp, 68 ) // fix room on stack EPILOG() } diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/twofish.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/twofish.cpp index 235b712b..3051af21 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/twofish.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/twofish.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +55,7 @@ void Twofish::Process(byte* out, const byte* in, word32 sz) in += BLOCK_SIZE; } else if (mode_ == CBC) { - if (dir_ == ENCRYPTION) + if (dir_ == ENCRYPTION) { while (blocks--) { r_[0] ^= *(word32*)in; r_[1] ^= *(word32*)(in + 4); @@ -68,7 +68,8 @@ void Twofish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else + } + else { while (blocks--) { AsmDecrypt(in, out); @@ -82,6 +83,7 @@ void Twofish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } + } } } @@ -272,25 +274,27 @@ void Twofish::decrypt(const byte* inBlock, const byte* xorBlock, #if defined(DO_TWOFISH_ASM) #ifdef __GNUC__ - #define AS1(x) asm(#x); - #define AS2(x, y) asm(#x ", " #y); + #define AS1(x) #x ";" + #define AS2(x, y) #x ", " #y ";" #define PROLOG() \ - asm(".intel_syntax noprefix"); \ - AS2( movd mm3, edi ) \ - AS2( movd mm4, ebx ) \ - AS2( movd mm5, esi ) \ - AS2( movd mm6, ebp ) \ - AS2( mov edi, DWORD PTR [ebp + 8] ) \ - AS2( mov esi, DWORD PTR [ebp + 12] ) - + __asm__ __volatile__ \ + ( \ + ".intel_syntax noprefix;" \ + "push ebx;" \ + "push ebp;" \ + "movd mm3, eax;" \ + "movd mm6, ebp;" #define EPILOG() \ - AS2( movd esp, mm6 ) \ - AS2( movd esi, mm5 ) \ - AS2( movd ebx, mm4 ) \ - AS2( movd edi, mm3 ) \ - AS1( emms ) \ - asm(".att_syntax"); + "pop ebp;" \ + "pop ebx;" \ + "emms;" \ + ".att_syntax;" \ + : \ + : "D" (this), "S" (inBlock), "a" (outBlock) \ + : "%ecx", "%edx", "memory", "cc" \ + ); + #else #define AS1(x) __asm x #define AS2(x, y) __asm x, y @@ -424,6 +428,8 @@ void Twofish::decrypt(const byte* inBlock, const byte* xorBlock, #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void Twofish::AsmEncrypt(const byte* inBlock, byte* outBlock) const { @@ -472,7 +478,7 @@ void Twofish::AsmEncrypt(const byte* inBlock, byte* outBlock) const AS2( movd ebp, mm6 ) AS2( movd esi, mm0 ) // k_ #ifdef __GNUC__ - AS2( mov edi, [ebp + 16] ) // outBlock + AS2( movd edi, mm3 ) // outBlock #else AS2( mov edi, [ebp + 12] ) // outBlock #endif @@ -494,6 +500,8 @@ void Twofish::AsmEncrypt(const byte* inBlock, byte* outBlock) const #ifdef _MSC_VER __declspec(naked) +#else + __attribute__ ((noinline)) #endif void Twofish::AsmDecrypt(const byte* inBlock, byte* outBlock) const { @@ -542,7 +550,7 @@ void Twofish::AsmDecrypt(const byte* inBlock, byte* outBlock) const AS2( movd ebp, mm6 ) AS2( movd esi, mm0 ) // k_ #ifdef __GNUC__ - AS2( mov edi, [ebp + 16] ) // outBlock + AS2( movd edi, mm3 ) // outBlock #else AS2( mov edi, [ebp + 12] ) // outBlock #endif diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/test/test.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/test/test.cpp index 0643b79e..a7d5cb3e 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/test/test.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/test/test.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1165,12 +1165,12 @@ int rsa_test() RSAES_Encryptor enc(priv); byte message[] = "Everyone gets Friday off."; const word32 len = (word32)strlen((char*)message); - byte cipher[64]; + byte cipher[512]; enc.Encrypt(message, len, cipher, rng); RSAES_Decryptor dec(priv); - byte plain[64]; - dec.Decrypt(cipher, sizeof(plain), plain, rng); + byte plain[512]; + dec.Decrypt(cipher, priv.FixedCiphertextLength(), plain, rng); if (memcmp(plain, message, len)) return -70; @@ -1242,11 +1242,11 @@ int dh_test() int dsa_test() { Source source; - FileSource("../certs/dsa512.der", source); + FileSource("../certs/dsa1024.der", source); if (source.size() == 0) { - FileSource("../../certs/dsa512.der", source); // for testsuite + FileSource("../../certs/dsa1024.der", source); // for testsuite if (source.size() == 0) { - FileSource("../../../certs/dsa512.der", source); // win32 Debug dir + FileSource("../../../certs/dsa1024.der", source); // win32 Debug dir if (source.size() == 0) err_sys("where's your certs dir?", -89); } diff --git a/mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh b/mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh new file mode 100644 index 00000000..5ce29459 --- /dev/null +++ b/mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh @@ -0,0 +1,130 @@ +#!/bin/bash + +# test all yassl cipher suties +# + + +server_pid=$no_pid + + +do_cleanup() { + echo "in cleanup" + + if [[ $server_pid != $no_pid ]] + then + echo "killing server" + kill -9 $server_pid + fi +} + +do_trap() { + echo "got trap" + do_cleanup + exit -1 +} + +trap do_trap INT TERM + + +# make sure example server and client are built +if test ! -s ../examples/server/server; then + echo "Please build yaSSL first, example server missing" + exit -1 +fi + +if test ! -s ../examples/client/client; then + echo "Please build yaSSL first, example client missing" + exit -1 +fi + + +# non DSA suites +for suite in {"DHE-RSA-AES256-SHA","AES256-SHA","DHE-RSA-AES128-SHA","AES128-SHA","AES256-RMD","AES128-RMD","DES-CBC3-RMD","DHE-RSA-AES256-RMD","DHE-RSA-AES128-RMD","DHE-RSA-DES-CBC3-RMD","RC4-SHA","RC4-MD5","DES-CBC3-SHA","DES-CBC-SHA","EDH-RSA-DES-CBC3-SHA","EDH-RSA-DES-CBC-SHA"} +do + for client_auth in {y,n} + do + echo "Trying $suite client auth = $client_auth ..." + + if test -e server_ready; then + echo -e "removing exisitng server_ready file" + rm server_ready + fi + ../examples/server/server $client_auth & + server_pid=$! + + while [ ! -s server_ready ]; do + echo -e "waiting for server_ready file..." + sleep 0.1 + done + + ../examples/client/client $suite + client_result=$? + + wait $server_pid + server_result=$? + + server_pid=$no_pid + + if [[ $client_result != 0 ]] + then + echo "Client Error" + exit $client_result + fi + + if [[ $server_result != 0 ]] + then + echo "Server Error" + exit $server_result + fi + + done # end client auth loop +done # end non dsa suite list +echo -e "Non DSA Loop SUCCESS" + + + +# DSA suites +for suite in {"DHE-DSS-AES256-SHA","DHE-DSS-AES128-SHA","DHE-DSS-AES256-RMD","DHE-DSS-AES128-RMD","DHE-DSS-DES-CBC3-RMD","EDH-DSS-DES-CBC3-SHA","EDH-DSS-DES-CBC-SHA"} +do + for client_auth in {y,n} + do + echo "Trying $suite client auth = $client_auth ..." + + if test -e server_ready; then + echo -e "removing exisitng server_ready file" + rm server_ready + fi + # d signifies DSA + ../examples/server/server $client_auth d & + server_pid=$! + + while [ ! -s server_ready ]; do + echo -e "waiting for server_ready file..." + sleep 0.1 + done + + ../examples/client/client $suite + client_result=$? + + wait $server_pid + server_result=$? + + server_pid=$no_pid + + if [[ $client_result != 0 ]] + then + echo "Client Error" + exit $client_result + fi + + if [[ $server_result != 0 ]] + then + echo "Server Error" + exit $server_result + fi + + done # end client auth loop +done # end dsa suite list +echo -e "DSA Loop SUCCESS" + +exit 0 diff --git a/mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp b/mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp index 7f49565b..3e15ce81 100644 --- a/mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp +++ b/mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp @@ -131,9 +131,10 @@ struct func_args { int argc; char** argv; int return_code; + const char* file_ready; tcp_ready* signal_; - func_args(int c = 0, char** v = 0) : argc(c), argv(v) {} + func_args(int c = 0, char** v = 0) : argc(c), argv(v), file_ready(0) {} void SetSignal(tcp_ready* p) { signal_ = p; } }; @@ -146,6 +147,7 @@ void join_thread(THREAD_TYPE); // yaSSL const char* const yasslIP = "127.0.0.1"; const unsigned short yasslPort = 11111; +const unsigned short proxyPort = 12345; // client @@ -172,13 +174,13 @@ const char* const svrKey3 = "../../../certs/server-key.pem"; // server dsa const char* const dsaCert = "../certs/dsa-cert.pem"; -const char* const dsaKey = "../certs/dsa512.der"; +const char* const dsaKey = "../certs/dsa1024.der"; const char* const dsaCert2 = "../../certs/dsa-cert.pem"; -const char* const dsaKey2 = "../../certs/dsa512.der"; +const char* const dsaKey2 = "../../certs/dsa1024.der"; const char* const dsaCert3 = "../../../certs/dsa-cert.pem"; -const char* const dsaKey3 = "../../../certs/dsa512.der"; +const char* const dsaKey3 = "../../../certs/dsa1024.der"; // CA @@ -222,6 +224,13 @@ inline void store_ca(SSL_CTX* ctx) if (SSL_CTX_load_verify_locations(ctx, certSuite, 0) != SSL_SUCCESS) if (SSL_CTX_load_verify_locations(ctx, certDebug,0) != SSL_SUCCESS) err_sys("failed to use certificate: certs/client-cert.pem"); + + // DSA cert + if (SSL_CTX_load_verify_locations(ctx, dsaCert, 0) != SSL_SUCCESS) + if (SSL_CTX_load_verify_locations(ctx, dsaCert2, 0) != SSL_SUCCESS) + if (SSL_CTX_load_verify_locations(ctx, dsaCert3, 0) != SSL_SUCCESS) + err_sys("failed to use certificate: certs/dsa-cert.pem"); + } @@ -298,7 +307,7 @@ inline void set_dsaServerCerts(SSL_CTX* ctx) != SSL_SUCCESS) if (SSL_CTX_use_PrivateKey_file(ctx, dsaKey3,SSL_FILETYPE_ASN1) != SSL_SUCCESS) - err_sys("failed to use key file: certs/dsa512.der"); + err_sys("failed to use key file: certs/dsa1024.der"); } @@ -310,6 +319,12 @@ inline void set_args(int& argc, char**& argv, func_args& args) } +inline void set_file_ready(const char* name, func_args& args) +{ + args.file_ready = name; +} + + inline void tcp_set_nonblocking(SOCKET_T& sockfd) { #ifdef NON_BLOCKING @@ -349,7 +364,11 @@ inline void tcp_socket(SOCKET_T& sockfd, SOCKADDR_IN_T& addr) */ // end external testing later #else addr.sin_family = AF_INET_V; +#ifdef YASSL_PROXY_PORT + addr.sin_port = htons(proxyPort); +#else addr.sin_port = htons(yasslPort); +#endif addr.sin_addr.s_addr = inet_addr(yasslIP); #endif @@ -401,6 +420,16 @@ inline void tcp_listen(SOCKET_T& sockfd) } +inline void create_ready_file(func_args& args) +{ + FILE* f = fopen(args.file_ready, "w+"); + + if (f) { + fputs("ready", f); + fclose(f); + } +} + inline void tcp_accept(SOCKET_T& sockfd, SOCKET_T& clientfd, func_args& args) { @@ -418,6 +447,9 @@ inline void tcp_accept(SOCKET_T& sockfd, SOCKET_T& clientfd, func_args& args) pthread_mutex_unlock(&ready.mutex_); #endif + if (args.file_ready) + create_ready_file(args); + clientfd = accept(sockfd, (sockaddr*)&client, (ACCEPT_THIRD_T)&client_len); if (clientfd == (SOCKET_T) -1) { diff --git a/mysql-wsrep-5.6/include/atomic/nolock.h b/mysql-wsrep-5.6/include/atomic/nolock.h index 50096928..190901a2 100644 --- a/mysql-wsrep-5.6/include/atomic/nolock.h +++ b/mysql-wsrep-5.6/include/atomic/nolock.h @@ -1,7 +1,7 @@ #ifndef ATOMIC_NOLOCK_INCLUDED #define ATOMIC_NOLOCK_INCLUDED -/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. reserved. +/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. reserved. reserved. This program is free software; you can redistribute it and/or modify @@ -27,7 +27,7 @@ neither Visual C++ or gcc we still choose the Solaris implementation on Solaris (mainly for SunStudio compilers). */ -# if defined(_MSV_VER) +# if defined(_MSC_VER) # include "generic-msvc.h" # elif __GNUC__ # if defined(HAVE_SOLARIS_ATOMIC) diff --git a/mysql-wsrep-5.6/include/errmsg.h b/mysql-wsrep-5.6/include/errmsg.h index 598a7c6f..4b585774 100644 --- a/mysql-wsrep-5.6/include/errmsg.h +++ b/mysql-wsrep-5.6/include/errmsg.h @@ -1,7 +1,7 @@ #ifndef ERRMSG_INCLUDED #define ERRMSG_INCLUDED -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +32,9 @@ extern const char *client_errors[]; /* Error messages */ #define CR_MIN_ERROR 2000 /* For easier client code */ #define CR_MAX_ERROR 2999 #if !defined(ER) -#define ER(X) client_errors[(X)-CR_MIN_ERROR] +#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \ + client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR]) + #endif #define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ diff --git a/mysql-wsrep-5.6/include/my_aes.h b/mysql-wsrep-5.6/include/my_aes.h index 24ddb6e7..1631a306 100644 --- a/mysql-wsrep-5.6/include/my_aes.h +++ b/mysql-wsrep-5.6/include/my_aes.h @@ -1,7 +1,7 @@ #ifndef MY_AES_INCLUDED #define MY_AES_INCLUDED -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,46 +22,108 @@ C_MODE_START -#define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */ - -/* - my_aes_encrypt - Crypt buffer with AES encryption algorithm. - source - Pointer to data for encryption - source_length - size of encryption data - dest - buffer to place encrypted data (must be large enough) - key - Key to be used for encryption - kel_length - Length of the key. Will handle keys of any length +/** AES IV size is 16 bytes for all supported ciphers except ECB */ +#define MY_AES_IV_SIZE 16 + + +/** Supported AES cipher/block mode combos */ +enum my_aes_opmode +{ + my_aes_128_ecb, + my_aes_192_ecb, + my_aes_256_ecb, + my_aes_128_cbc, + my_aes_192_cbc, + my_aes_256_cbc, +#ifndef HAVE_YASSL + my_aes_128_cfb1, + my_aes_192_cfb1, + my_aes_256_cfb1, + my_aes_128_cfb8, + my_aes_192_cfb8, + my_aes_256_cfb8, + my_aes_128_cfb128, + my_aes_192_cfb128, + my_aes_256_cfb128, + my_aes_128_ofb, + my_aes_192_ofb, + my_aes_256_ofb, +#endif +}; + +#define MY_AES_BEGIN my_aes_128_ecb +#ifdef HAVE_YASSL +#define MY_AES_END my_aes_256_cbc +#else +#define MY_AES_END my_aes_256_ofb +#endif + +/* If bad data discovered during decoding */ +#define MY_AES_BAD_DATA -1 + +/** String representations of the supported AES modes. Keep in sync with my_aes_opmode */ +extern const char *my_aes_opmode_names[]; + +/** + Encrypt a buffer using AES + + @param source [in] Pointer to data for encryption + @param source_length [in] Size of encryption data + @param dest [out] Buffer to place encrypted data (must be large enough) + @param key [in] Key to be used for encryption + @param key_length [in] Length of the key. Will handle keys of any length + @param mode [in] encryption mode + @param iv [in] 16 bytes initialization vector if needed. Otherwise NULL + @return size of encrypted data, or negative in case of error +*/ - returns - size of encrypted data, or negative in case of error. +int my_aes_encrypt(const unsigned char *source, uint32 source_length, + unsigned char *dest, + const unsigned char *key, uint32 key_length, + enum my_aes_opmode mode, const unsigned char *iv); + +/** + Decrypt an AES encrypted buffer + + @param source Pointer to data for decryption + @param source_length size of encrypted data + @param dest buffer to place decrypted data (must be large enough) + @param key Key to be used for decryption + @param key_length Length of the key. Will handle keys of any length + @param mode encryption mode + @param iv 16 bytes initialization vector if needed. Otherwise NULL + @return size of original data. */ -int my_aes_encrypt(const char *source, int source_length, char *dest, - const char *key, int key_length); -/* - my_aes_decrypt - DeCrypt buffer with AES encryption algorithm. - source - Pointer to data for decryption - source_length - size of encrypted data - dest - buffer to place decrypted data (must be large enough) - key - Key to be used for decryption - kel_length - Length of the key. Will handle keys of any length +int my_aes_decrypt(const unsigned char *source, uint32 source_length, + unsigned char *dest, + const unsigned char *key, uint32 key_length, + enum my_aes_opmode mode, const unsigned char *iv); - returns - size of original data, or negative in case of error. +/** + Calculate the size of a buffer large enough for encrypted data + + @param source_length length of data to be encrypted + @param mode encryption mode + @return size of buffer required to store encrypted data */ +int my_aes_get_size(uint32 source_length, enum my_aes_opmode mode); -int my_aes_decrypt(const char *source, int source_length, char *dest, - const char *key, int key_length); +/** + Return true if the AES cipher and block mode requires an IV -/* - my_aes_get_size - get size of buffer which will be large enough for encrypted - data - source_length - length of data to be encrypted + SYNOPSIS + my_aes_needs_iv() + @param mode encryption mode - returns - size of buffer required to store encrypted data + @retval TRUE IV needed + @retval FALSE IV not needed */ -int my_aes_get_size(int source_length); +my_bool my_aes_needs_iv(my_aes_opmode opmode); + C_MODE_END diff --git a/mysql-wsrep-5.6/include/my_base.h b/mysql-wsrep-5.6/include/my_base.h index dbf80de4..b314d985 100644 --- a/mysql-wsrep-5.6/include/my_base.h +++ b/mysql-wsrep-5.6/include/my_base.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +204,9 @@ enum ha_extra_function { Prepare table for export (e.g. quiesce the table and write table metadata). */ - HA_EXTRA_EXPORT + HA_EXTRA_EXPORT, + /** Do secondary sort by handler::ref (rowid) after key sort. */ + HA_EXTRA_SECONDARY_SORT_ROWID }; /* Compatible option, to be deleted in 6.0 */ @@ -483,7 +485,8 @@ is the global server default. */ #define HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT 188 /* FTS query exceeds result cache limit */ #define HA_ERR_TEMP_FILE_WRITE_FAILURE 189 /* Temporary file write failure */ #define HA_ERR_INNODB_FORCED_RECOVERY 190 /* Innodb is in force recovery mode */ -#define HA_ERR_LAST 190 /* Copy of last error nr */ +#define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE 191 /* Too many words in a phrase */ +#define HA_ERR_LAST 191 /* Copy of last error nr */ /* Number of different errors */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) @@ -538,7 +541,6 @@ typedef ulong key_part_map; #define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */ #define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */ #define HA_STATE_EXTEND_BLOCK 2048 -#define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */ /* myisampack expects no more than 32 field types. */ enum en_fieldtype { diff --git a/mysql-wsrep-5.6/include/my_default.h b/mysql-wsrep-5.6/include/my_default.h index 3a9260f0..1c217d45 100644 --- a/mysql-wsrep-5.6/include/my_default.h +++ b/mysql-wsrep-5.6/include/my_default.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,6 +36,7 @@ int get_defaults_options(int argc, char **argv, char **group_suffix, char **login_path); int my_load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv, const char ***); +int check_file_permissions(const char *file_name); int load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv); int my_search_option_files(const char *conf_file, int *argc, diff --git a/mysql-wsrep-5.6/include/my_getopt.h b/mysql-wsrep-5.6/include/my_getopt.h index ef89bb80..dd9cd2f0 100644 --- a/mysql-wsrep-5.6/include/my_getopt.h +++ b/mysql-wsrep-5.6/include/my_getopt.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. This 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,6 +113,7 @@ extern int my_handle_options (int *argc, char ***argv, const struct my_option *longopts, my_get_one_option, const char **command_list); +extern void print_cmdline_password_warning(); extern void my_cleanup_options(const struct my_option *options); extern void my_cleanup_options(const struct my_option *options); extern void my_print_help(const struct my_option *options); diff --git a/mysql-wsrep-5.6/include/my_global.h b/mysql-wsrep-5.6/include/my_global.h index 4ad213fa..aadaffe5 100644 --- a/mysql-wsrep-5.6/include/my_global.h +++ b/mysql-wsrep-5.6/include/my_global.h @@ -333,9 +333,6 @@ C_MODE_END #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif -#ifdef HAVE_SYS_TIMEB_H -#include <sys/timeb.h> /* Avoid warnings on SCO */ -#endif #if TIME_WITH_SYS_TIME # include <sys/time.h> # include <time.h> @@ -763,38 +760,28 @@ inline unsigned long long my_double2ulonglong(double d) #define SIZE_T_MAX (~((size_t) 0)) #endif -#ifndef isfinite -#ifdef HAVE_FINITE -#define isfinite(x) finite(x) -#else -#define finite(x) (1.0 / fabs(x) > 0.0) -#endif /* HAVE_FINITE */ -#endif /* isfinite */ - #include <math.h> -#ifndef HAVE_ISNAN -#define isnan(x) ((x) != (x)) -#endif -C_MODE_START -extern double my_double_isnan(double x); -C_MODE_END -#ifdef HAVE_ISINF -/* Check if C compiler is affected by GCC bug #39228 */ -#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF) -/* Force store/reload of the argument to/from a 64-bit double */ -static inline double my_isinf(double x) -{ - volatile double t= x; - return isinf(t); -} +#if (__cplusplus >= 201103L) + /* For C++11 use the new std functions rather than C99 macros. */ + #include <cmath> + #define my_isfinite(X) std::isfinite(X) + #define my_isnan(X) std::isnan(X) + #define my_isinf(X) std::isinf(X) #else -/* System-provided isinf() is available and safe to use */ -#define my_isinf(X) isinf(X) -#endif -#else /* !HAVE_ISINF */ -#define my_isinf(X) (!finite(X) && !isnan(X)) -#endif + #ifdef HAVE_LLVM_LIBCPP /* finite is deprecated in libc++ */ + #define my_isfinite(X) isfinite(X) + #else + #define my_isfinite(X) finite(X) + #endif + #define my_isnan(X) isnan(X) + #ifdef HAVE_ISINF + /* System-provided isinf() is available and safe to use */ + #define my_isinf(X) isinf(X) + #else /* !HAVE_ISINF */ + #define my_isinf(X) (!my_isfinite(X) && !my_isnan(X)) + #endif +#endif /* __cplusplus >= 201103L */ /* Define missing math constants. */ #ifndef M_PI diff --git a/mysql-wsrep-5.6/include/my_pthread.h b/mysql-wsrep-5.6/include/my_pthread.h index 1d31f5b2..4e099c70 100644 --- a/mysql-wsrep-5.6/include/my_pthread.h +++ b/mysql-wsrep-5.6/include/my_pthread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -144,8 +144,18 @@ int pthread_attr_init(pthread_attr_t *connect_att); int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); int pthread_attr_destroy(pthread_attr_t *connect_att); int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void)); -struct tm *localtime_r(const time_t *timep,struct tm *tmp); -struct tm *gmtime_r(const time_t *timep,struct tm *tmp); + +static inline struct tm *localtime_r(const time_t *timep, struct tm *tmp) +{ + localtime_s(tmp, timep); + return tmp; +} + +static inline struct tm *gmtime_r(const time_t *clock, struct tm *res) +{ + gmtime_s(res, clock); + return res; +} void pthread_exit(void *a); int pthread_join(pthread_t thread, void **value_ptr); @@ -853,18 +863,7 @@ extern void **my_thread_var_dbug(); extern uint my_thread_end_wait_time; #define my_thread_var (_my_thread_var()) #define my_errno my_thread_var->thr_errno -/* - Keep track of shutdown,signal, and main threads so that my_end() will not - report errors with them -*/ - -/* Which kind of thread library is in use */ - -#define THD_LIB_OTHER 1 -#define THD_LIB_NPTL 2 -#define THD_LIB_LT 4 -extern uint thd_lib_detected; /* thread_safe_xxx functions are for critical statistic or counters. diff --git a/mysql-wsrep-5.6/include/my_rnd.h b/mysql-wsrep-5.6/include/my_rnd.h index cf57e8dc..7dc0234c 100644 --- a/mysql-wsrep-5.6/include/my_rnd.h +++ b/mysql-wsrep-5.6/include/my_rnd.h @@ -30,6 +30,7 @@ extern "C" { #endif double my_rnd_ssl(struct rand_struct *rand_st); +int my_rand_buffer(unsigned char *buffer, size_t buffer_size); #ifdef __cplusplus } diff --git a/mysql-wsrep-5.6/include/mysql/plugin.h b/mysql-wsrep-5.6/include/mysql/plugin.h index a14ad35d..3cf31af0 100644 --- a/mysql-wsrep-5.6/include/mysql/plugin.h +++ b/mysql-wsrep-5.6/include/mysql/plugin.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This 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/mysql-wsrep-5.6/include/mysql_version.h.in b/mysql-wsrep-5.6/include/mysql_version.h.in index ab774502..21ad1562 100644 --- a/mysql-wsrep-5.6/include/mysql_version.h.in +++ b/mysql-wsrep-5.6/include/mysql_version.h.in @@ -1,6 +1,7 @@ -/* Copyright (c) 1996, 1999-2004, 2007 MySQL AB - Use is subject to license terms - This file is public domain and comes with NO WARRANTY of any kind */ +/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB + & Detron HB, 1996, 1999-2004, 2007 MySQL AB. + This file is public domain and comes with NO WARRANTY of any kind +*/ /* Version numbers for protocol & mysqld */ diff --git a/mysql-wsrep-5.6/include/queues.h b/mysql-wsrep-5.6/include/queues.h index 3ece9c22..2581cec2 100644 --- a/mysql-wsrep-5.6/include/queues.h +++ b/mysql-wsrep-5.6/include/queues.h @@ -44,6 +44,7 @@ typedef struct st_queue { #define queue_element(queue,index) ((queue)->root[index+1]) #define queue_end(queue) ((queue)->root[(queue)->elements]) #define queue_replaced(queue) _downheap(queue,1) +#define queue_set_compare(queue, cmp) (queue)->compare= cmp #define queue_set_cmp_arg(queue, set_arg) (queue)->first_cmp_arg= set_arg #define queue_set_max_at_top(queue, set_arg) \ (queue)->max_at_top= set_arg ? -1 : 1 diff --git a/mysql-wsrep-5.6/include/t_ctype.h b/mysql-wsrep-5.6/include/t_ctype.h index c019189d..c53deb21 100644 --- a/mysql-wsrep-5.6/include/t_ctype.h +++ b/mysql-wsrep-5.6/include/t_ctype.h @@ -1,4 +1,5 @@ /* Copyright (C) 2000 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 diff --git a/mysql-wsrep-5.6/include/welcome_copyright_notice.h b/mysql-wsrep-5.6/include/welcome_copyright_notice.h index 4b00f0db..eb2bf260 100644 --- a/mysql-wsrep-5.6/include/welcome_copyright_notice.h +++ b/mysql-wsrep-5.6/include/welcome_copyright_notice.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 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 @@ -16,7 +16,7 @@ #ifndef _welcome_copyright_notice_h_ #define _welcome_copyright_notice_h_ -#define COPYRIGHT_NOTICE_CURRENT_YEAR "2014" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2015" /* This define specifies copyright notice which is displayed by every MySQL diff --git a/mysql-wsrep-5.6/libmysql/CMakeLists.txt b/mysql-wsrep-5.6/libmysql/CMakeLists.txt index a2ce148f..16a6a5e1 100644 --- a/mysql-wsrep-5.6/libmysql/CMakeLists.txt +++ b/mysql-wsrep-5.6/libmysql/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -183,7 +183,6 @@ ENDIF() MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development) # Visual Studio users need debug static library for debug projects -INSTALL_DEBUG_SYMBOLS(clientlib) IF(MSVC) INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug) INSTALL_DEBUG_TARGET(clientlib DESTINATION ${INSTALL_LIBDIR}/debug) diff --git a/mysql-wsrep-5.6/libmysql/authentication_win/CMakeLists.txt b/mysql-wsrep-5.6/libmysql/authentication_win/CMakeLists.txt index 8cf8862e..447a69ba 100644 --- a/mysql-wsrep-5.6/libmysql/authentication_win/CMakeLists.txt +++ b/mysql-wsrep-5.6/libmysql/authentication_win/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,7 +32,6 @@ TARGET_LINK_LIBRARIES(auth_win_client Secur32) SOURCE_GROUP(Headers REGULAR_EXPRESSION ".*h$") -INSTALL_DEBUG_SYMBOLS(auth_win_client) IF(MSVC) INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug) ENDIF() diff --git a/mysql-wsrep-5.6/libmysql/errmsg.c b/mysql-wsrep-5.6/libmysql/errmsg.c index f2c09f98..fa679d18 100644 --- a/mysql-wsrep-5.6/libmysql/errmsg.c +++ b/mysql-wsrep-5.6/libmysql/errmsg.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,6 +107,8 @@ const char** get_client_errmsgs() void init_client_errs(void) { + compile_time_assert(array_elements(client_errors) == + (CR_ERROR_LAST - CR_ERROR_FIRST + 2)); (void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST); } diff --git a/mysql-wsrep-5.6/libmysql/libmysql.c b/mysql-wsrep-5.6/libmysql/libmysql.c index 88f1b766..af8f3d6f 100644 --- a/mysql-wsrep-5.6/libmysql/libmysql.c +++ b/mysql-wsrep-5.6/libmysql/libmysql.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1335,6 +1335,10 @@ static my_bool my_realloc_str(NET *net, ulong length) res= net_realloc(net, buf_length + length); if (res) { + if (net->last_errno == ER_OUT_OF_RESOURCES) + net->last_errno= CR_OUT_OF_MEMORY; + else if (net->last_errno == ER_NET_PACKET_TOO_LARGE) + net->last_errno= CR_NET_PACKET_TOO_LARGE; strmov(net->sqlstate, unknown_sqlstate); strmov(net->last_error, ER(net->last_errno)); } @@ -4332,7 +4336,27 @@ int cli_read_binary_rows(MYSQL_STMT *stmt) /* end of data */ *prev_ptr= 0; mysql->warning_count= uint2korr(cp+1); - mysql->server_status= uint2korr(cp+3); + /* + OUT parameters result sets has SERVER_PS_OUT_PARAMS and + SERVER_MORE_RESULTS_EXISTS flags in first EOF_Packet only. + Last EOF_Packet of OUT parameters result sets have no + SERVER_MORE_RESULTS_EXISTS flag as described here: + http://dev.mysql.com/doc/internals/en/stored-procedures.html#out-parameter-set + Following code reads last EOF_Packet of result set and can clear + those flags in server_status if we don't preserve them. + Without SERVER_MORE_RESULTS_EXISTS flag mysql_stmt_next_result fails + to read OK_Packet after OUT parameters result set. + So we need to preserve SERVER_MORE_RESULTS_EXISTS flag for OUT + parameters result set. + */ + if (mysql->server_status & SERVER_PS_OUT_PARAMS) + { + mysql->server_status= uint2korr(cp+3) + | SERVER_PS_OUT_PARAMS + | (mysql->server_status & SERVER_MORE_RESULTS_EXISTS); + } + else + mysql->server_status= uint2korr(cp+3); DBUG_PRINT("info",("status: %u warning_count: %u", mysql->server_status, mysql->warning_count)); DBUG_RETURN(0); diff --git a/mysql-wsrep-5.6/libmysqld/CMakeLists.txt b/mysql-wsrep-5.6/libmysqld/CMakeLists.txt index aebae04b..a9244d9f 100644 --- a/mysql-wsrep-5.6/libmysqld/CMakeLists.txt +++ b/mysql-wsrep-5.6/libmysqld/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -129,3 +129,37 @@ IF(MSVC AND NOT DISABLE_SHARED) MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} COMPONENT Embedded) ENDIF() + +OPTION(WITH_EMBEDDED_SHARED_LIBRARY + "Generate shared version of embedded library (in addition to the static one)" + OFF) +IF(WITH_EMBEDDED_SHARED_LIBRARY) + MERGE_LIBRARIES(libmysqld SHARED + mysqlserver + EXPORTS ${CLIENT_API_FUNCTIONS} + OUTPUT_NAME "mysqld" + COMPONENT Embedded) + SET_TARGET_PROPERTIES(libmysqld PROPERTIES + VERSION "${SHARED_LIB_MAJOR_VERSION}.${SHARED_LIB_MINOR_VERSION}.0" + SOVERSION "${SHARED_LIB_MAJOR_VERSION}" + ) + + GET_TARGET_PROPERTY(libmysqld_link_flags libmysqld LINK_FLAGS) + IF(NOT libmysqld_link_flag) + SET(libmysqld_link_flags) + ENDIF() + SET(libmysqld_link_flags + "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${libmysqld_link_flags}") + SET_TARGET_PROPERTIES(libmysqld + PROPERTIES LINK_FLAGS "${libmysqld_link_flags}") + + IF(LINK_FLAG_NO_UNDEFINED) + SET(libmysqld_link_flags + "${libmysqld_link_flags} ${LINK_FLAG_NO_UNDEFINED}") + SET_TARGET_PROPERTIES(libmysqld + PROPERTIES LINK_FLAGS "${libmysqld_link_flags}") + ENDIF() + + SET_TARGET_PROPERTIES(libmysqld PROPERTIES CLEAN_DIRECT_OUTPUT 1) + SET_TARGET_PROPERTIES(mysqlserver PROPERTIES CLEAN_DIRECT_OUTPUT 1) +ENDIF() diff --git a/mysql-wsrep-5.6/libmysqld/examples/test-run b/mysql-wsrep-5.6/libmysqld/examples/test-run index e322180b..757f4f61 100755 --- a/mysql-wsrep-5.6/libmysqld/examples/test-run +++ b/mysql-wsrep-5.6/libmysqld/examples/test-run @@ -1,6 +1,7 @@ #! /bin/sh # Copyright (C) 2001, 2006 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 diff --git a/mysql-wsrep-5.6/libmysqld/lib_sql.cc b/mysql-wsrep-5.6/libmysqld/lib_sql.cc index 4e0e4969..33b50ea8 100644 --- a/mysql-wsrep-5.6/libmysqld/lib_sql.cc +++ b/mysql-wsrep-5.6/libmysqld/lib_sql.cc @@ -2,6 +2,9 @@ * Copyright (c) 2000 * SWsoft company * + * Modifications copyright (c) 2001, 2014. Oracle and/or its affiliates. + * All rights reserved. + * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * @@ -424,11 +427,7 @@ static void emb_free_embedded_thd(MYSQL *mysql) thd->clear_data_list(); thd->store_globals(); thd->release_resources(); - - mysql_mutex_lock(&LOCK_thread_count); remove_global_thread(thd); - mysql_mutex_unlock(&LOCK_thread_count); - delete thd; my_pthread_setspecific_ptr(THR_THD, 0); mysql->thd=0; diff --git a/mysql-wsrep-5.6/man/comp_err.1 b/mysql-wsrep-5.6/man/comp_err.1 index 65e7f45f..7d311abe 100644 --- a/mysql-wsrep-5.6/man/comp_err.1 +++ b/mysql-wsrep-5.6/man/comp_err.1 @@ -2,12 +2,12 @@ .\" Title: \fBcomp_err\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBCOMP_ERR\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBCOMP_ERR\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -124,8 +124,8 @@ The character set directory\&. The default is Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:O,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:O,/tmp/comp_err\&.trace\*(Aq\&. +d:t:O,\fIfile_name\fR\&. The default is +d:t:O,/tmp/comp_err\&.trace\&. .RE .sp .RS 4 @@ -264,7 +264,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/innochecksum.1 b/mysql-wsrep-5.6/man/innochecksum.1 index 7cb6cc33..bf8a4e3b 100644 --- a/mysql-wsrep-5.6/man/innochecksum.1 +++ b/mysql-wsrep-5.6/man/innochecksum.1 @@ -2,12 +2,12 @@ .\" Title: \fBinnochecksum\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBINNOCHECKSUM\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBINNOCHECKSUM\FR" "1" "01/16/2015" "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, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/msql2mysql.1 b/mysql-wsrep-5.6/man/msql2mysql.1 index aaca06fd..472e2e64 100644 --- a/mysql-wsrep-5.6/man/msql2mysql.1 +++ b/mysql-wsrep-5.6/man/msql2mysql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmsql2mysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMSQL2MYSQL\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMSQL2MYSQL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,6 +34,22 @@ msql2mysql \- convert mSQL programs for use with MySQL .HP \w'\fBmsql2mysql\fR\fB\fIC\-source\-file\fR\fR\fB\ \&.\&.\&.\fR\ 'u \fBmsql2mysql\fR\fB\fIC\-source\-file\fR\fR\fB \&.\&.\&.\fR .SH "DESCRIPTION" +.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 +This utility is deprecated in MySQL 5\&.6\&.17 and removed in MySQL 5\&.7 +.sp .5v +.RE .PP Initially, the MySQL C API was developed to be very similar to that for the mSQL database system\&. Because of this, mSQL programs often can be converted relatively easily for use with MySQL by changing the names of the C API functions\&. .PP @@ -69,7 +85,7 @@ utility to make the function name substitutions\&. See .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/my_print_defaults.1 b/mysql-wsrep-5.6/man/my_print_defaults.1 index 6f5e3d19..83b5f960 100644 --- a/mysql-wsrep-5.6/man/my_print_defaults.1 +++ b/mysql-wsrep-5.6/man/my_print_defaults.1 @@ -2,12 +2,12 @@ .\" Title: \fBmy_print_defaults\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMY_PRINT_DEFAULTS" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMY_PRINT_DEFAULTS" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -115,8 +115,8 @@ Read only the given option file\&. Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o,/tmp/my_print_defaults\&.trace\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o,/tmp/my_print_defaults\&.trace\&. .RE .sp .RS 4 @@ -168,7 +168,14 @@ 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\&. See +login 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 +\fBmysql_config_editor\fR +utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. .RE .sp @@ -222,7 +229,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/myisam_ftdump.1 b/mysql-wsrep-5.6/man/myisam_ftdump.1 index c35c27b9..d08a4f6f 100644 --- a/mysql-wsrep-5.6/man/myisam_ftdump.1 +++ b/mysql-wsrep-5.6/man/myisam_ftdump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisam_ftdump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAM_FTDUMP\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAM_FTDUMP\FR" "1" "01/16/2015" "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, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/myisamchk.1 b/mysql-wsrep-5.6/man/myisamchk.1 index 7e63cd0a..7d383979 100644 --- a/mysql-wsrep-5.6/man/myisamchk.1 +++ b/mysql-wsrep-5.6/man/myisamchk.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamchk\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMCHK\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMCHK\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -249,10 +249,8 @@ Section\ \&13.7.2.2, \(lqCHECK TABLE Syntax\(rq\&. \fBmyisamchk\fR supports the following options, which can be specified on the command line or in the [myisamchk] -group of an option file\&. -\fBmyisamchk\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +group of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .SH "MYISAMCHK GENERAL OPTIONS" .\" options: myisamchk .\" myisamchk: options @@ -308,8 +306,110 @@ Display a help message and exit\&. Options are presented in a single list\&. Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o,/tmp/myisamchk\&.trace\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o,/tmp/myisamchk\&.trace\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: defaults-extra-file option +.\" defaults-extra-file option: myisamchk +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: defaults-file option +.\" defaults-file option: myisamchk +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: defaults-group-suffix option +.\" defaults-group-suffix option: myisamchk +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmyisamchk\fR +normally reads the +[myisamchk] +group\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmyisamchk\fR +also reads the +[myisamchk_other] +group\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: no-defaults option +.\" no-defaults option: myisamchk +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" myisamchk: print-defaults option +.\" print-defaults option: myisamchk +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. .RE .sp .RS 4 @@ -2492,7 +2592,7 @@ instead of .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/myisamlog.1 b/mysql-wsrep-5.6/man/myisamlog.1 index c90c52ae..393dfb28 100644 --- a/mysql-wsrep-5.6/man/myisamlog.1 +++ b/mysql-wsrep-5.6/man/myisamlog.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMLOG\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMLOG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -228,7 +228,7 @@ Display version information\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/myisampack.1 b/mysql-wsrep-5.6/man/myisampack.1 index 58395a92..2dad2da5 100644 --- a/mysql-wsrep-5.6/man/myisampack.1 +++ b/mysql-wsrep-5.6/man/myisampack.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisampack\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMPACK\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMPACK\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -122,7 +122,7 @@ to rebuild its indexes\&. .PP \fBmyisampack\fR supports the following options\&. It also reads option files and supports the options for processing them described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .sp .RS 4 .ie n \{\ @@ -189,8 +189,8 @@ Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o\&. .RE .sp .RS 4 @@ -853,7 +853,7 @@ option to .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql-stress-test.pl.1 b/mysql-wsrep-5.6/man/mysql-stress-test.pl.1 index 1a259472..9fc64e78 100644 --- a/mysql-wsrep-5.6/man/mysql-stress-test.pl.1 +++ b/mysql-wsrep-5.6/man/mysql-stress-test.pl.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql-stress-test.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/10/2014 +.\" Date: 01/15/2015 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL\-STRESS\-TE" "1" "01/10/2014" "MySQL" "MySQL Database System" +.TH "\FBMYSQL\-STRESS\-TE" "1" "01/15/2015" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -498,7 +498,7 @@ Verbose mode\&. Print more information about what the program does\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 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 diff --git a/mysql-wsrep-5.6/man/mysql-test-run.pl.1 b/mysql-wsrep-5.6/man/mysql-test-run.pl.1 index f84323ce..a4d880d4 100644 --- a/mysql-wsrep-5.6/man/mysql-test-run.pl.1 +++ b/mysql-wsrep-5.6/man/mysql-test-run.pl.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql-test-run.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/10/2014 +.\" Date: 01/15/2015 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL\-TEST\-RUN\" "1" "01/10/2014" "MySQL" "MySQL Database System" +.TH "\FBMYSQL\-TEST\-RUN\" "1" "01/15/2015" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1582,7 +1582,7 @@ MTR_PORT_BASE\&. was added in MySQL 5\&.1\&.45 as a more logical alternative to \fB\-\-build\-thread\fR\&. If both are used, \fB\-\-port\-base\fR -takes presedence\&. +takes precedence\&. .RE .sp .RS 4 @@ -1797,7 +1797,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 backwards compatibility\&. +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\&. .RE .sp .RS 4 @@ -2551,7 +2551,7 @@ in their name\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 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 diff --git a/mysql-wsrep-5.6/man/mysql.1 b/mysql-wsrep-5.6/man/mysql.1 index 723d8b21..4cef6582 100644 --- a/mysql-wsrep-5.6/man/mysql.1 +++ b/mysql-wsrep-5.6/man/mysql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -121,10 +121,8 @@ supports the following options, which can be specified on the command line or in [mysql] and [client] -groups of an option file\&. -\fBmysql\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -160,11 +158,32 @@ to disable rehashing\&. That causes \fBmysql\fR to start faster, but you must issue the rehash -command if you want to use name completion\&. +command or its +\e# +shortcut if you want to use name completion\&. .sp To complete a name, enter the first part and press Tab\&. If the name is unambiguous, \fBmysql\fR completes it\&. Otherwise, you can press Tab again to see the possible names that begin with what you have typed so far\&. Completion does not occur if there is no default database\&. +.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 +This feature requires a MySQL client that is compiled with the +\fBreadline\fR +library\&. Typically, the +\fBreadline\fR +library is not available on Windows\&. +.sp .5v +.RE .RE .sp .RS 4 @@ -260,7 +279,7 @@ This option was added in MySQL 5\&.6\&.3\&. .\" bind-address option: mysql \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR .sp -On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&. +On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. .sp This option is supported beginning with MySQL 5\&.6\&.1\&. .RE @@ -394,8 +413,8 @@ The database to use\&. This is useful primarily in an option file\&. Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o,/tmp/mysql\&.trace\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o,/tmp/mysql\&.trace\&. .RE .sp .RS 4 @@ -463,7 +482,7 @@ as the default character set for the client and connection\&. .sp A common issue that can occur when the operating system uses utf8 -or another multi\-byte character set is that output from the +or another multibyte character set is that output from the \fBmysql\fR client is formatted incorrectly, due to the fact that the MySQL client uses the latin1 @@ -481,6 +500,70 @@ Section\ \&10.5, \(lqCharacter Set Configuration\(rq, for more information\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql: defaults-extra-file option +.\" defaults-extra-file option: mysql +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: defaults-file option +.\" defaults-file option: mysql +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql: defaults-group-suffix option +.\" defaults-group-suffix option: mysql +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysql\fR +normally reads the +[client] +and +[mysql] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysql\fR +also reads the +[client_other] +and +[mysql_other] +groups\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: delimiter option .\" delimiter option: mysql \fB\-\-delimiter=\fR\fB\fIstr\fR\fR @@ -525,7 +608,7 @@ the section called \(lqMYSQL COMMANDS\(rq\&. Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.3.7.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.3.8.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -543,7 +626,7 @@ Section\ \&6.3.7.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) .sp Execute the statement and quit\&. The default output format is like that produced with \fB\-\-batch\fR\&. See -Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq, for some examples\&. With this option, +Section\ \&4.2.4, \(lqUsing Options on the Command Line\(rq, for some examples\&. With this option, \fBmysql\fR does not use the history file\&. .RE @@ -696,6 +779,31 @@ has no effect if the server does not also support it\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql: login-path option +.\" login-path option: mysql +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: named-commands option .\" named-commands option: mysql \fB\-\-named\-commands\fR, @@ -727,7 +835,7 @@ the section called \(lqMYSQL COMMANDS\(rq\&. \fB\-A\fR .sp This has the same effect as -\fB\-skip\-auto\-rehash\fR\&. See the description for +\fB\-\-skip\-auto\-rehash\fR\&. See the description for \fB\-\-auto\-rehash\fR\&. .RE .sp @@ -755,6 +863,33 @@ Do not beep when errors occur\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql: no-defaults option +.\" no-defaults option: mysql +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: one-database option .\" one-database option: mysql \fB\-\-one\-database\fR, @@ -963,6 +1098,21 @@ The TCP/IP port number to use for the connection\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql: print-defaults option +.\" print-defaults option: mysql +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: prompt option .\" prompt option: mysql \fB\-\-prompt=\fR\fB\fIformat_str\fR\fR @@ -1130,7 +1280,8 @@ to disable it\&. \fBNote\fR .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\&. +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\&. .sp .5v .RE .RE @@ -1156,7 +1307,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.7.4, \(lqThe SHA-256 Authentication Plugin\(rq\&. +Section\ \&6.3.8.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 @@ -1172,6 +1323,26 @@ and renamed in 5\&.6\&.7 to .sp -1 .IP \(bu 2.3 .\} +.\" mysql: shared-memory-base-name option +.\" shared-memory-base-name option: mysql +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is +MYSQL\&. The shared\-memory name is case sensitive\&. +.sp +The server must be started with the +\fB\-\-shared\-memory\fR +option to enable shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql: show-warnings option .\" show-warnings option: mysql \fB\-\-show\-warnings\fR @@ -1281,7 +1452,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.9.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. .RE .sp .RS 4 @@ -1753,8 +1924,8 @@ is set to something other than the default of \(lq;\(rq, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets \(lq;\(rq as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution (see -Section\ \&22.8.17, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see -Section\ \&19.1, \(lqDefining Stored Programs\(rq)\&. +Section\ \&23.8.17, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see +Section\ \&20.1, \(lqDefining Stored Programs\(rq)\&. .RE .sp .RS 4 @@ -1885,7 +2056,7 @@ tee\&. nowarning, \ew .sp -Enable display of warnings after each statement\&. +Disable display of warnings after each statement\&. .RE .sp .RS 4 @@ -2566,7 +2737,7 @@ prompt=(\e\eu@\e\eh) [\e\ed]>\e\e_ In this example, note that the backslashes are doubled\&. If you set the prompt using the prompt option in an option file, it is advisable to double the backslashes when using the special prompt options\&. There is some overlap in the set of permissible prompt options and the set of special escape sequences that are recognized in option files\&. (The rules for escape sequences in option files are listed in -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.) The overlap may cause you problems if you use single backslashes\&. For example, +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&.) The overlap may cause you problems if you use single backslashes\&. For example, \es is interpreted as a space rather than as the current seconds value\&. The following example shows how to define a prompt within an option file to include the current time in HH:MM:SS> @@ -2631,8 +2802,7 @@ client logs statements executed interactively to a history file\&. By default, t in your home directory\&. To specify a different file, set the value of the MYSQL_HISTFILE environment variable\&. - How Logging Occurs -.PP +How Logging Occurs.PP Statement logging occurs as follows: .sp .RS 4 @@ -2787,8 +2957,7 @@ shell> \fBmysql \-\-histignore="*UPDATE*:*DELETE*"\fR .RE .\} .sp - Controlling the History File -.PP +Controlling the History File.PP The \&.mysql_history file should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords\&. See @@ -2950,7 +3119,7 @@ mysql> SHOW BINARY LOGS; .RE .\} .PP -The search string can contain the the wildcard characters +The search string can contain the wildcard characters \(lq%\(rq and \(lq_\(rq\&. These have the same meaning as for pattern\-matching operations performed with the @@ -3426,11 +3595,11 @@ client with the option\&. .PP For more information about auto\-reconnect and its effect on state information when a reconnection occurs, see -Section\ \&22.8.16, \(lqControlling Automatic Reconnection Behavior\(rq\&. +Section\ \&23.8.16, \(lqControlling Automatic Reconnection Behavior\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql.server.1 b/mysql-wsrep-5.6/man/mysql.server.1 index eb975fa7..8fe9b922 100644 --- a/mysql-wsrep-5.6/man/mysql.server.1 +++ b/mysql-wsrep-5.6/man/mysql.server.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql.server\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL\&.SERVER\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL\&.SERVER\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -36,7 +36,7 @@ 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 Mac OS X Startup Item for MySQL\&. +\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\&. .PP \fBmysql\&.server\fR can be found in the @@ -49,7 +49,7 @@ script will be installed in the /etc/init\&.d directory with the name mysql\&. You need not install it manually\&. See -Section\ \&2.5.3, \(lqInstalling MySQL on Linux Using RPM Packages\(rq, for more information on the Linux RPM packages\&. +Section\ \&2.5.5, \(lqInstalling MySQL on Linux Using RPM Packages\(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\&. @@ -128,7 +128,7 @@ The path name of the file in which the server should write its process ID\&. .\} .\" mysql.server: service-startup-timeout option .\" service-startup-timeout option: mysql.server -\fB\-\-service\-startup\-timeout=\fR\fB\fIfile_name\fR\fR +\fB\-\-service\-startup\-timeout=\fR\fB\fIseconds\fR\fR .sp How long in seconds to wait for confirmation of server startup\&. If the server does not start within this time, \fBmysql\&.server\fR @@ -170,7 +170,7 @@ The login user name to use for running .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_client_test.1 b/mysql-wsrep-5.6/man/mysql_client_test.1 index 06985def..5b590540 100644 --- a/mysql-wsrep-5.6/man/mysql_client_test.1 +++ b/mysql-wsrep-5.6/man/mysql_client_test.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_client_test\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/10/2014 +.\" Date: 01/15/2015 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL_CLIENT_TEST" "1" "01/10/2014" "MySQL" "MySQL Database System" +.TH "\FBMYSQL_CLIENT_TEST" "1" "01/15/2015" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -335,7 +335,7 @@ mysql\-test/var\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 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 diff --git a/mysql-wsrep-5.6/man/mysql_config.1 b/mysql-wsrep-5.6/man/mysql_config.1 index 486bd140..1d33b086 100644 --- a/mysql-wsrep-5.6/man/mysql_config.1 +++ b/mysql-wsrep-5.6/man/mysql_config.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONFIG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -248,7 +248,7 @@ shell> \fBgcc \-o progname progname\&.o `mysql_config \-\-libs`\fR .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_config_editor.1 b/mysql-wsrep-5.6/man/mysql_config_editor.1 index 49228fdb..2c45bc34 100644 --- a/mysql-wsrep-5.6/man/mysql_config_editor.1 +++ b/mysql-wsrep-5.6/man/mysql_config_editor.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config_editor\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG_EDIT" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONFIG_EDIT" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -106,7 +106,7 @@ host = 127\&.0\&.0\&.1 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.3.3, \(lqUsing Option Files\(rq\&. +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .PP Invoke mysql_config_editor @@ -206,7 +206,7 @@ command: .RS 4 .\} .nf -shell> mysql_config_editor print \-\-all +shell> \fBmysql_config_editor print \-\-all\fR [local] user = localuser password = ***** @@ -284,8 +284,7 @@ file, if it exists, is read in all cases, even when the 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\&. - \fBmysql_config_editor\fR Commands -.PP +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, @@ -667,8 +666,7 @@ prints a warning and prompts for confirmation\&. To suppress the warning and pro \fB\-\-skip\-warn\fR option\&. .RE - \fBmysql_config_editor\fR Options -.PP +mysql_config_editor Options.PP \fBmysql_config_editor\fR supports the following options\&. .sp @@ -724,8 +722,8 @@ command, print all login paths in the login file\&. Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o,/tmp/mysql_config_editor\&.trace\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o\&. .RE .sp .RS 4 @@ -743,7 +741,7 @@ string is .sp For the set -command, the host name to write to to the login path\&. For the +command, the host name to write to the login path\&. For the remove command, removes the host name from the login path\&. .RE @@ -775,7 +773,7 @@ option, to enable users to specify which login path to use for connecting to a M \fB\-\-login\-path\fR must be the first option given, which is not true for \fBmysql_config_editor\fR\&. See -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .RE .sp .RS 4 @@ -926,7 +924,7 @@ to disable it\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_convert_table_format.1 b/mysql-wsrep-5.6/man/mysql_convert_table_format.1 index d3a04eb9..0b86e454 100644 --- a/mysql-wsrep-5.6/man/mysql_convert_table_format.1 +++ b/mysql-wsrep-5.6/man/mysql_convert_table_format.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_convert_table_format\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONVERT_TAB" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONVERT_TAB" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,6 +34,22 @@ mysql_convert_table_format \- convert tables to use a given storage engine .HP \w'\fBmysql_convert_table_format\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIdb_name\fR\fR\ 'u \fBmysql_convert_table_format [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR .SH "DESCRIPTION" +.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 +This utility is deprecated in MySQL 5\&.6\&.17 and removed in MySQL 5\&.7 +.sp .5v +.RE .PP \fBmysql_convert_table_format\fR converts the tables in a database to use a particular storage engine (MyISAM @@ -225,7 +241,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_find_rows.1 b/mysql-wsrep-5.6/man/mysql_find_rows.1 index 537509f1..18f6af87 100644 --- a/mysql-wsrep-5.6/man/mysql_find_rows.1 +++ b/mysql-wsrep-5.6/man/mysql_find_rows.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_find_rows\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_FIND_ROWS\F" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_FIND_ROWS\F" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,6 +34,22 @@ mysql_find_rows \- extract SQL statements from files .HP \w'\fBmysql_find_rows\ [\fR\fB\fIoptions\fR\fR\fB]\ [\fR\fB\fIfile_name\fR\fR\fB\ \&.\&.\&.]\fR\ 'u \fBmysql_find_rows [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIfile_name\fR\fR\fB \&.\&.\&.]\fR .SH "DESCRIPTION" +.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 +This utility is deprecated in MySQL 5\&.6\&.17 and removed in MySQL 5\&.7 +.sp .5v +.RE .PP \fBmysql_find_rows\fR reads files containing SQL statements and extracts statements that match a given regular expression or that contain @@ -160,7 +176,7 @@ Start output from this row\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_fix_extensions.1 b/mysql-wsrep-5.6/man/mysql_fix_extensions.1 index 3023ae5e..6c6f7152 100644 --- a/mysql-wsrep-5.6/man/mysql_fix_extensions.1 +++ b/mysql-wsrep-5.6/man/mysql_fix_extensions.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_fix_extensions\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_FIX_EXTENSI" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_FIX_EXTENSI" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,6 +34,22 @@ mysql_fix_extensions \- normalize table file name extensions .HP \w'\fBmysql_fix_extensions\ \fR\fB\fIdata_dir\fR\fR\ 'u \fBmysql_fix_extensions \fR\fB\fIdata_dir\fR\fR .SH "DESCRIPTION" +.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 +This utility is deprecated in MySQL 5\&.6\&.17 and removed in MySQL 5\&.7 +.sp .5v +.RE .PP \fBmysql_fix_extensions\fR converts the extensions for @@ -70,7 +86,7 @@ shell> \fBmysql_fix_extensions \fR\fB\fIdata_dir\fR\fR .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_install_db.1 b/mysql-wsrep-5.6/man/mysql_install_db.1 index 49bf6ff3..8b9ce8be 100644 --- a/mysql-wsrep-5.6/man/mysql_install_db.1 +++ b/mysql-wsrep-5.6/man/mysql_install_db.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_install_db\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_INSTALL_DB\" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_INSTALL_DB\" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -60,12 +60,10 @@ assumes it to be in use and writes a new file named my\-new\&.cnf instead\&. .PP -With one exception, the settings in the default option file are commented and have no effect\&. The exception is that the file changes the +With one exception, the settings in the default option file are commented and have no effect\&. The exception is that the file sets the sql_mode -system variable from its default of -NO_ENGINE_SUBSTITUTION -to also include -STRICT_TRANS_TABLES\&. This setting produces a server configuration that results in errors rather than warnings for bad data in operations that modify transactional tables\&. See +system variable to +NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES\&. This setting produces a server configuration that results in errors rather than warnings for bad data in operations that modify transactional tables\&. See Section\ \&5.1.7, \(lqServer SQL Modes\(rq\&. .PP To invoke @@ -82,13 +80,12 @@ shell> \fBmysql_install_db [\fR\fB\fIoptions\fR\fR\fB]\fR .\} .PP Because the MySQL server, -\fBmysqld\fR, needs to access the data directory when it runs later, you should either run +\fBmysqld\fR, must access the data directory when it runs later, you should either run \fBmysql_install_db\fR from the same system account that will be used for running -\fBmysqld\fR -or run it as +\fBmysqld\fR, or run it as root -and use the +and specify the \fB\-\-user\fR option to indicate the user name that \fBmysqld\fR @@ -111,15 +108,45 @@ shell> \fBscripts/mysql_install_db \-\-user=mysql \e\fR .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 +After \fBmysql_install_db\fR -needs to invoke -\fBmysqld\fR -with the -\fB\-\-bootstrap\fR +sets up the +InnoDB +system tablespace, changes to some tablespace characteristics require setting up a whole new +instance\&. This includes the file name of the first file in the system tablespace and the number of undo logs\&. If you do not want to use the default values, make sure that the settings for the +innodb_data_file_path and -\fB\-\-skip\-grant\-tables\fR -options\&. +innodb_log_file_size +configuration parameters are in place in the MySQL +configuration file +before running +\fBmysql_install_db\fR\&. Also make sure to specify as necessary other parameters that affect the creation and location of +InnoDB +files, such as +innodb_data_home_dir +and +innodb_log_group_home_dir\&. +.PP +If those options are in your configuration file but that file is not in a location that MySQL reads by default, specify the file location using the +\fB\-\-defaults\-extra\-file\fR +option when you run +\fBmysql_install_db\fR\&. +.sp .5v +.RE .if n \{\ .sp .\} @@ -143,20 +170,6 @@ or set TMPDIR to point to the system temporary directory (usually /tmp)\&. -.PP -After -\fBmysql_install_db\fR -sets up the -InnoDB -system tablespace, changes to some of tablespace characteristics require setting up a whole new -instance\&. This includes the file name of the first file in the system tablespace and the number of undo logs\&. If you do not want to use the default values, make sure that the settings for the -innodb_data_file_path -and -innodb_log_file_size -configuration options are in place in the MySQL -configuration file -before running -\fBmysql_install_db\fR\&. .sp .5v .RE .PP @@ -168,11 +181,23 @@ group of an option file\&. (Options that are common to can also be specified in the [mysqld] group\&.) Other options are passed to -\fBmysqld\fR\&. For information about option files, see -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. -\fBmysql_install_db\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +\fBmysqld\fR\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_install_db: help option +.\" help option: mysql_install_db +\fB\-\-help\fR +.sp +Display a help message and exit\&. +.RE .sp .RS 4 .ie n \{\ @@ -197,12 +222,41 @@ The path to the MySQL installation directory\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql_install_db: builddir option +.\" builddir option: mysql_install_db +\fB\-\-builddir=\fR\fB\fIpath\fR\fR +.sp +For use with +\fB\-\-srcdir\fR +and out\-of\-source builds\&. Set this to the location of the directory where the built files reside\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_install_db: cross-bootstrap option +.\" cross-bootstrap option: mysql_install_db +\fB\-\-cross\-bootstrap\fR +.sp +For internal use\&. This option is used for building system tables on one host intended for another\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_install_db: datadir option .\" datadir option: mysql_install_db -.\" mysql_install_db: ldata option -.\" ldata option: mysql_install_db -\fB\-\-datadir=\fR\fB\fIpath\fR\fR, -\fB\-\-ldata=\fR\fB\fIpath\fR\fR +\fB\-\-datadir=\fR\fB\fIpath\fR\fR .sp The path to the MySQL data directory\&. Beginning with MySQL 5\&.6\&.8, \fBmysql_install_db\fR @@ -217,13 +271,98 @@ is more strict about the option value\&. Only the last component of the path nam .sp -1 .IP \(bu 2.3 .\} +.\" defaults-extra-file option +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" defaults-file option +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_install_db: force option .\" force option: mysql_install_db \fB\-\-force\fR .sp Cause \fBmysql_install_db\fR -to run even if DNS does not work\&. Grant table entries that normally use host names will use IP addresses\&. +to run even if DNS does not work\&. Grant table entries normally created using host names will use IP addresses instead\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_install_db: keep-my-cnf option +.\" keep-my-cnf option: mysql_install_db +\fB\-\-keep\-my\-cnf\fR +.sp +Tell +\fBmysql_install_db\fR +preserve any existing +my\&.cnf +file and not create a new default +my\&.cnf +file\&. This option was added in MySQL 5\&.6\&.20\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_install_db: ldata option +.\" ldata option: mysql_install_db +\fB\-\-ldata=\fR\fB\fIpath\fR\fR +.sp +A synonym for +\fB\-\-datadir\fR\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" no-defaults option +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. .RE .sp .RS 4 @@ -252,9 +391,9 @@ causes it to perform the following actions in addition to its normal operation: .sp -1 .IP \(bu 2.3 .\} -Create a random password, assign it to the initial MySQL +The installation process creates a random password, assigns it to the initial MySQL root -accounts, and set the +accounts, and sets the \(lqpassword expired\(rq flag for those accounts\&. .RE @@ -267,7 +406,10 @@ flag for those accounts\&. .sp -1 .IP \(bu 2.3 .\} -Write the initial password file to the +.\" .mysql_secret file +The initial random +root +password is written to the \&.mysql_secret file in the directory named by the HOME @@ -295,14 +437,14 @@ is created with mode 600 to be accessible only to the system user for whom it is .sp -1 .IP \(bu 2.3 .\} -Remove the anonymous\-user MySQL accounts\&. +No anonymous\-user MySQL accounts are created\&. .RE .sp As a result of these actions, it is necessary after installation to start the server, connect as root using the password written to the \&.mysql_secret -file, and to assign a new +file, and specify a new root password\&. Until this is done, root @@ -403,9 +545,9 @@ looks for support files such as the error message file and the file for populati The system (login) user name to use for running \fBmysqld\fR\&. Files and directories created by \fBmysqld\fR -will be owned by this user\&. You must be +will be owned by this user\&. You must be the system root -to use this option\&. By default, +user to use this option\&. By default, \fBmysqld\fR runs using your current login name and files and directories that it creates will be owned by you\&. .RE @@ -442,7 +584,7 @@ For internal use\&. This option is used for creating Windows distributions\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_plugin.1 b/mysql-wsrep-5.6/man/mysql_plugin.1 index e8f5100c..b2339988 100644 --- a/mysql-wsrep-5.6/man/mysql_plugin.1 +++ b/mysql-wsrep-5.6/man/mysql_plugin.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_plugin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_PLUGIN\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_PLUGIN\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -163,8 +163,8 @@ recognizes the \fB\-\-basedir\fR, \fB\-\-datadir\fR, and \fB\-\-plugin\-dir\fR -options and ignores others\&. For information about option files, see -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. +options and ignores others\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -370,7 +370,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_secure_installation.1 b/mysql-wsrep-5.6/man/mysql_secure_installation.1 index 526156c1..9b3384bf 100644 --- a/mysql-wsrep-5.6/man/mysql_secure_installation.1 +++ b/mysql-wsrep-5.6/man/mysql_secure_installation.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_secure_installation\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_SECURE_INST" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_SECURE_INST" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -110,7 +110,7 @@ When executed, the script prompts you to determine which actions to perform\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_setpermission.1 b/mysql-wsrep-5.6/man/mysql_setpermission.1 index 8c6cd6c3..822e10c3 100644 --- a/mysql-wsrep-5.6/man/mysql_setpermission.1 +++ b/mysql-wsrep-5.6/man/mysql_setpermission.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_setpermission\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_SETPERMISSI" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_SETPERMISSI" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,6 +34,22 @@ mysql_setpermission \- interactively set permissions in grant tables .HP \w'\fBmysql_setpermission\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBmysql_setpermission [\fR\fB\fIoptions\fR\fR\fB]\fR .SH "DESCRIPTION" +.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 +This utility is deprecated in MySQL 5\&.6\&.17 and removed in MySQL 5\&.7 +.sp .5v +.RE .PP \fBmysql_setpermission\fR is a Perl script that was originally written and contributed by Luuk de Boer\&. It interactively sets permissions in the MySQL grant tables\&. @@ -172,7 +188,7 @@ The MySQL user name to use when connecting to the server\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 b/mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 index 0d52d8dc..80d6b2dd 100644 --- a/mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 +++ b/mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_tzinfo_to_sql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_TZINFO_TO_S" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_TZINFO_TO_S" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,7 +42,7 @@ program loads the time zone tables in the mysql database\&. It is used on systems that have a zoneinfo -database (the set of files describing time zones)\&. Examples of such systems are Linux, FreeBSD, Solaris, and Mac OS X\&. One likely location for these files is the +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 on Solaris)\&. If your system does not have a zoneinfo database, you can use the downloadable package described in @@ -122,7 +122,7 @@ After running .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_upgrade.1 b/mysql-wsrep-5.6/man/mysql_upgrade.1 index de7fb92a..d0f89e75 100644 --- a/mysql-wsrep-5.6/man/mysql_upgrade.1 +++ b/mysql-wsrep-5.6/man/mysql_upgrade.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_upgrade\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_UPGRADE\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_UPGRADE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,14 +42,21 @@ examines all tables in all databases for incompatibilities with the current vers \fBmysql_upgrade\fR also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added\&. .PP -\fBmysql_upgrade\fR -should be executed each time you upgrade MySQL\&. -.PP If \fBmysql_upgrade\fR finds that a table has a possible incompatibility, it performs a table check and, if problems are found, attempts a table repair\&. If the table cannot be repaired, see Section\ \&2.11.4, \(lqRebuilding or Repairing Tables or Indexes\(rq for manual table repair strategies\&. +.PP +You should execute +\fBmysql_upgrade\fR +each time you upgrade MySQL\&. +.PP +If you install MySQL from RPM packages on Linux, you must install the server and client RPMs\&. +\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\&.) .if n \{\ .sp .\} @@ -93,7 +100,7 @@ Section\ \&2.11.1, \(lqUpgrading MySQL\(rq, for instructions on determining whet .RE .PP To use -\fBmysql_upgrade\fR, make sure that the server is running, and then invoke it like this: +\fBmysql_upgrade\fR, make sure that the server is running\&. Then invoke it like this: .sp .if n \{\ .RS 4 @@ -108,6 +115,26 @@ shell> \fBmysql_upgrade [\fR\fB\fIoptions\fR\fR\fB]\fR After running \fBmysql_upgrade\fR, stop the server and restart it so that any changes made to the system tables take effect\&. .PP +If you have multiple MySQL server instances running, invoke +\fBmysql_upgrade\fR +with connection parameters appropriate for connecting to the desired server\&. For example, with servers running on the local host on parts 3306 through 3308, upgrade each of them by connecting to the appropriate port: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysql_upgrade \-\-protocol=tcp \-P 3306 [\fR\fB\fIother_options\fR\fR\fB]\fR +shell> \fBmysql_upgrade \-\-protocol=tcp \-P 3307 [\fR\fB\fIother_options\fR\fR\fB]\fR +shell> \fBmysql_upgrade \-\-protocol=tcp \-P 3308 [\fR\fB\fIother_options\fR\fR\fB]\fR +.fi +.if n \{\ +.RE +.\} +.PP +For local host connections on Unix, the +\fB\-\-protocol=tcp\fR +option forces a connection using TCP/IP rather than the Unix socket file\&. +.PP \fBmysql_upgrade\fR executes the following commands to check and repair tables and to upgrade the system tables: .sp @@ -115,9 +142,15 @@ executes the following commands to check and repair tables and to upgrade the sy .RS 4 .\} .nf -mysqlcheck \-\-all\-databases \-\-check\-upgrade \-\-auto\-repair -mysql < \fIfix_priv_tables\fR -mysqlcheck \-\-all\-databases \-\-check\-upgrade \-\-fix\-db\-names \-\-fix\-table\-names +mysqlcheck \-\-no\-defaults \-\-databases + \-\-fix\-db\-names \-\-fix\-table\-names mysql +mysqlcheck \-\-no\-defaults \-\-check\-upgrade \-\-databases + \-\-auto\-repair mysql +mysql < fix_priv_tables +mysqlcheck \-\-no\-defaults \-\-all\-databases + \-\-skip\-database=mysql \-\-fix\-db\-names \-\-fix\-table\-names +mysqlcheck \-\-no\-defaults \-\-check\-upgrade \-\-all\-databases + \-\-skip\-database=mysql \-\-auto\-repair .fi .if n \{\ .RE @@ -133,6 +166,28 @@ Notes about the preceding commands: .sp -1 .IP \(bu 2.3 .\} +\fBmysql_upgrade\fR +also adds +\fB\-\-write\-binlog\fR +or +\fB\-\-skip\-write\-binlog\fR +to the +\fBmysqlcheck\fR +commands, depending on whether the +\fB\-\-write\-binlog\fR +option was specified on the +\fBmysql_upgrade\fR +command\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} Because \fBmysql_upgrade\fR invokes @@ -181,6 +236,7 @@ All checked and repaired tables are marked with the current MySQL version number with the same version of the server, it can tell whether there is any need to check or repair the table again\&. .\" mysql_upgrade_info file: mysql_upgrade .\" mysql_upgrade: mysql_upgrade_info file +.\" data directory: mysql_upgrade_info file .PP \fBmysql_upgrade\fR also saves the MySQL version number in a file named @@ -189,18 +245,13 @@ in the data directory\&. This is used to quickly check whether all tables have b \fB\-\-force\fR option\&. .PP -If you install MySQL from RPM packages on Linux, you must install the server and client RPMs\&. -\fBmysql_upgrade\fR -is included in the server RPM but requires the client RPM because the latter includes -\fBmysqlcheck\fR\&. (See -Section\ \&2.5.3, \(lqInstalling MySQL on Linux Using RPM Packages\(rq\&.) -.PP \fBmysql_upgrade\fR does not upgrade the contents of the help tables\&. For upgrade instructions, see Section\ \&5.1.10, \(lqServer-Side Help\(rq\&. .PP +By default, \fBmysql_upgrade\fR -runs by default as the MySQL +runs as the MySQL root user\&. If the root @@ -221,7 +272,7 @@ shell> \fBmysql \-u root \-p\fR Enter password: \fB****\fR <\- enter root password here mysql> \fBSET PASSWORD = PASSWORD(\*(Aqroot\-password\*(Aq);\fR mysql> \fBquit\fR -shell> \fBmysql_upgrade\fR +shell> \fBmysql_upgrade [\fR\fB\fIoptions\fR\fR\fB]\fR .fi .if n \{\ .RE @@ -232,13 +283,9 @@ supports the following options, which can be specified on the command line or in [mysql_upgrade] and [client] -groups of an option file\&. Other options are passed to -\fBmysqlcheck\fR\&. For example, it might be necessary to specify the -\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR -option\&. -\fBmysql_upgrade\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +groups of an option file\&. Unrecognized options are passed to +\fBmysqlcheck\fR\&. For information about option files, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -265,7 +312,7 @@ Display a short help message and exit\&. .\} .\" mysql_upgrade: basedir option .\" basedir option: mysql_upgrade -\fB\-\-basedir=\fR\fB\fIpath\fR\fR +\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR .sp The path to the MySQL installation directory\&. This option is accepted for backward compatibility but ignored\&. It is removed in MySQL 5\&.7\&. .RE @@ -278,9 +325,40 @@ The path to the MySQL installation directory\&. This option is accepted for back .sp -1 .IP \(bu 2.3 .\} +.\" mysql_upgrade: character-sets-dir option +.\" character-sets-dir option: mysql_upgrade +\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +.sp +The directory where character sets are installed\&. See +Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: compress option +.\" compress option: mysql_upgrade +\fB\-\-compress\fR +.sp +Compress all information sent between the client and the server if both support compression\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_upgrade: datadir option .\" datadir option: mysql_upgrade -\fB\-\-datadir=\fR\fB\fIpath\fR\fR +\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR .sp The path to the data directory\&. This option is accepted for backward compatibility but ignored\&. It is removed in MySQL 5\&.7\&. .RE @@ -293,6 +371,26 @@ The path to the data directory\&. This option is accepted for backward compatibi .sp -1 .IP \(bu 2.3 .\} +.\" mysql_upgrade: debug option +.\" debug option: mysql_upgrade +\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR, +\fB\-# [\fR\fB\fIdebug_options\fR\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,/tmp/mysql_upgrade\&.trace\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_upgrade: debug-check option .\" debug-check option: mysql_upgrade \fB\-\-debug\-check\fR @@ -342,15 +440,95 @@ This option was added in MySQL 5\&.6\&.2\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql_upgrade: default-character-set option +.\" default-character-set option: mysql_upgrade +\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR +.sp +Use +\fIcharset_name\fR +as the default character set\&. See +Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: defaults-extra-file option +.\" defaults-extra-file option: mysql_upgrade +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: defaults-file option +.\" defaults-file option: mysql_upgrade +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: defaults-group-suffix option +.\" defaults-group-suffix option: mysql_upgrade +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysql_upgrade\fR +normally reads the +[client] +and +[mysql_upgrade] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysql_upgrade\fR +also reads the +[client_other] +and +[mysql_upgrade_other] +groups\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_upgrade: force option .\" force option: mysql_upgrade \fB\-\-force\fR .sp Ignore the mysql_upgrade_info -file and force execution of -\fBmysqlcheck\fR -even if +file and force execution even if \fBmysql_upgrade\fR has already been executed for the current version of MySQL\&. .RE @@ -363,6 +541,119 @@ has already been executed for the current version of MySQL\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql_upgrade: host option +.\" host option: mysql_upgrade +\fB\-\-host=\fR\fB\fIhost_name\fR\fR, +\fB\-h \fR\fB\fIhost_name\fR\fR +.sp +Connect to the MySQL server on the given host\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: login-path option +.\" login-path option: mysql_upgrade +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: no-defaults option +.\" no-defaults option: mysql_upgrade +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: password option +.\" password option: mysql_upgrade +\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR, +\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR +.sp +The password to use when connecting to the server\&. If you use the short option form (\fB\-p\fR), you +\fIcannot\fR +have a space between the option and the password\&. If you omit the +\fIpassword\fR +value following the +\fB\-\-password\fR +or +\fB\-p\fR +option on the command line, +\fBmysql_upgrade\fR +prompts for one\&. +.sp +Specifying a password on the command line should be considered insecure\&. See +Section\ \&6.1.2.1, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: pipe option +.\" pipe option: mysql_upgrade +\fB\-\-pipe\fR, +\fB\-W\fR +.sp +On Windows, connect to the server using a named pipe\&. This option applies only if the server supports named\-pipe connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_upgrade: plugin-dir option .\" plugin-dir option: mysql_upgrade \fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR @@ -385,9 +676,111 @@ This option was added in MySQL 5\&.6\&.2\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql_upgrade: port option +.\" port option: mysql_upgrade +\fB\-\-port=\fR\fB\fIport_num\fR\fR, +\fB\-P \fR\fB\fIport_num\fR\fR +.sp +The TCP/IP port number to use for the connection\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: print-defaults option +.\" print-defaults option: mysql_upgrade +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: protocol option +.\" protocol option: mysql_upgrade +\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR +.sp +The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see +Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: shared-memory-base-name option +.\" shared-memory-base-name option: mysql_upgrade +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is +MYSQL\&. The shared\-memory name is case sensitive\&. +.sp +The server must be started with the +\fB\-\-shared\-memory\fR +option to enable shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: socket option +.\" socket option: mysql_upgrade +\fB\-\-socket=\fR\fB\fIpath\fR\fR, +\fB\-S \fR\fB\fIpath\fR\fR +.sp +For connections to +localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql_upgrade: SSL options +.\" SSL options: mysql_upgrade +\fB\-\-ssl*\fR +.sp +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\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_upgrade: tmpdir option .\" tmpdir option: mysql_upgrade -\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR, +\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR, \fB\-t \fR\fB\fIpath\fR\fR .sp The path name of the directory to use for creating temporary files\&. @@ -481,7 +874,7 @@ Cause binary logging to be enabled while runs\&. In MySQL 5\&.6\&.6 and earlier, this was the default behavior\&. (To disable binary logging during the upgrade, it was necessary to use the inverse of this option, by starting the program with \fB\-\-skip\-write\-binlog\fR\&.) Beginning with MySQL 5\&.6\&.7, binary logging by \fBmysql_upgrade\fR -is disabled by default (Bug #14221043), and you must invoke the program explicitly with +is disabled by default (Bug #14221043)\&. Invoke the program explicitly with \fB\-\-write\-binlog\fR if you want its actions to be written to the binary log\&. (Also beginning with MySQL 5\&.6\&.7, the \fB\-\-skip\-write\-binlog\fR @@ -494,12 +887,12 @@ is not recommended with a MySQL Server that is running with global transaction i might need to perform on system tables using a nontransactional storage engine such as MyISAM to fail\&. See -Section\ \&16.1.3.4, \(lqRestrictions on Replication with GTIDs\(rq, for more information\&. +Section\ \&17.1.3.4, \(lqRestrictions on Replication with GTIDs\(rq, for more information\&. .RE .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_waitpid.1 b/mysql-wsrep-5.6/man/mysql_waitpid.1 index 53accda8..bb9be3af 100644 --- a/mysql-wsrep-5.6/man/mysql_waitpid.1 +++ b/mysql-wsrep-5.6/man/mysql_waitpid.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_waitpid\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_WAITPID\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_WAITPID\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -40,6 +40,8 @@ signals a process to terminate and waits for the process to exit\&. It uses the kill() system call and Unix signals, so it runs on Unix and Unix\-like systems\&. .PP +This program is deprecated as of MySQL 5\&.6\&.19 and is removed in MySQL 5\&.7\&. +.PP Invoke \fBmysql_waitpid\fR like this: @@ -129,7 +131,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysql_zap.1 b/mysql-wsrep-5.6/man/mysql_zap.1 index b518a647..9928a46f 100644 --- a/mysql-wsrep-5.6/man/mysql_zap.1 +++ b/mysql-wsrep-5.6/man/mysql_zap.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_zap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_ZAP\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_ZAP\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -40,6 +40,8 @@ kills processes that match a pattern\&. It uses the \fBps\fR command and Unix signals, so it runs on Unix and Unix\-like systems\&. .PP +This program is deprecated as of MySQL 5\&.6\&.19 and is removed in MySQL 5\&.7\&. +.PP Invoke \fBmysql_zap\fR like this: @@ -125,7 +127,7 @@ Test mode\&. Display information about each process but do not kill it\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqlaccess.1 b/mysql-wsrep-5.6/man/mysqlaccess.1 index 615e5060..7cabeb6c 100644 --- a/mysql-wsrep-5.6/man/mysqlaccess.1 +++ b/mysql-wsrep-5.6/man/mysqlaccess.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlaccess\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLACCESS\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLACCESS\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -34,6 +34,22 @@ mysqlaccess \- client for checking access privileges .HP \w'\fBmysqlaccess\ [\fR\fB\fIhost_name\fR\fR\fB\ [\fR\fB\fIuser_name\fR\fR\fB\ [\fR\fB\fIdb_name\fR\fR\fB]]]\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u \fBmysqlaccess [\fR\fB\fIhost_name\fR\fR\fB [\fR\fB\fIuser_name\fR\fR\fB [\fR\fB\fIdb_name\fR\fR\fB]]] [\fR\fB\fIoptions\fR\fR\fB]\fR .SH "DESCRIPTION" +.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 +This utility is deprecated in MySQL 5\&.6\&.17 and removed in MySQL 5\&.7 +.sp .5v +.RE .PP \fBmysqlaccess\fR is a diagnostic tool that Yves Carlier has provided for the MySQL distribution\&. It checks the access privileges for a host name, user name, and database combination\&. Note that @@ -432,7 +448,7 @@ error will occur when you run .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqladmin.1 b/mysql-wsrep-5.6/man/mysqladmin.1 index d8fd49d2..bc36a2dd 100644 --- a/mysql-wsrep-5.6/man/mysqladmin.1 +++ b/mysql-wsrep-5.6/man/mysqladmin.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqladmin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLADMIN\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLADMIN\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -84,7 +84,7 @@ debug Tell the server to write debug information to the error log\&. Format and content of this information is subject to change\&. .sp This includes information about the Event Scheduler\&. See -Section\ \&19.4.5, \(lqEvent Scheduler Status\(rq\&. +Section\ \&20.4.5, \(lqEvent Scheduler Status\(rq\&. .RE .sp .RS 4 @@ -577,10 +577,8 @@ supports the following options, which can be specified on the command line or in [mysqladmin] and [client] -groups of an option file\&. -\fBmysqladmin\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -610,7 +608,7 @@ Display a help message and exit\&. .\" bind-address option: mysqladmin \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR .sp -On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&. +On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. .sp This option is supported beginning with MySQL 5\&.6\&.1\&. .RE @@ -681,8 +679,8 @@ option is given\&. Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o,/tmp/mysqladmin\&.trace\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o,/tmp/mysqladmin\&.trace\&. .RE .sp .RS 4 @@ -757,6 +755,70 @@ Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqladmin: defaults-extra-file option +.\" defaults-extra-file option: mysqladmin +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: defaults-file option +.\" defaults-file option: mysqladmin +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: defaults-group-suffix option +.\" defaults-group-suffix option: mysqladmin +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysqladmin\fR +normally reads the +[client] +and +[mysqladmin] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysqladmin\fR +also reads the +[client_other] +and +[mysqladmin_other] +groups\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqladmin: enable-cleartext-plugin option .\" enable-cleartext-plugin option: mysqladmin \fB\-\-enable\-cleartext\-plugin\fR @@ -764,7 +826,7 @@ Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.3.7.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.3.8.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -809,6 +871,31 @@ Connect to the MySQL server on the given host\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqladmin: login-path option +.\" login-path option: mysqladmin +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqladmin: no-beep option .\" no-beep option: mysqladmin \fB\-\-no\-beep\fR, @@ -825,6 +912,33 @@ Suppress the warning beep that is emitted by default for errors such as a failur .sp -1 .IP \(bu 2.3 .\} +.\" mysqladmin: no-defaults option +.\" no-defaults option: mysqladmin +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqladmin: password option .\" password option: mysqladmin \fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR, @@ -906,6 +1020,21 @@ The TCP/IP port number to use for the connection\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqladmin: print-defaults option +.\" print-defaults option: mysqladmin +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqladmin: protocol option .\" protocol option: mysqladmin \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR @@ -942,6 +1071,59 @@ command\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqladmin: secure-auth option +.\" secure-auth option: mysqladmin +\fB\-\-secure\-auth\fR +.sp +Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use +\fB\-\-skip\-secure\-auth\fR +to disable it\&. This option was added in MySQL 5\&.6\&.17\&. +.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 +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\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqladmin: shared-memory-base-name option +.\" shared-memory-base-name option: mysqladmin +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is +MYSQL\&. The shared\-memory name is case sensitive\&. +.sp +The server must be started with the +\fB\-\-shared\-memory\fR +option to enable shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqladmin: silent option .\" silent option: mysqladmin \fB\-\-silent\fR, @@ -1006,7 +1188,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.9.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. .RE .sp .RS 4 @@ -1127,7 +1309,7 @@ The maximum number of seconds to wait for server shutdown\&. The default value i .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqlbinlog.1 b/mysql-wsrep-5.6/man/mysqlbinlog.1 index 1ac5968c..0eb82b81 100644 --- a/mysql-wsrep-5.6/man/mysqlbinlog.1 +++ b/mysql-wsrep-5.6/man/mysqlbinlog.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbinlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLBINLOG\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLBINLOG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -43,7 +43,7 @@ utility\&. You can also use \fBmysqlbinlog\fR to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&. The binary log and relay log are discussed further in Section\ \&5.2.4, \(lqThe Binary Log\(rq, and -Section\ \&16.2.2, \(lqReplication Relay and Status Logs\(rq\&. +Section\ \&17.2.2, \(lqReplication Relay and Status Logs\(rq\&. .PP Invoke \fBmysqlbinlog\fR @@ -74,7 +74,7 @@ shell> \fBmysqlbinlog binlog\&.0000003\fR .PP The output includes events contained in binlog\&.000003\&. For statement\-based logging, event information includes the SQL statement, the ID of the server on which it was executed, the timestamp when the statement was executed, how much time it took, and so forth\&. For row\-based logging, the event indicates a row change rather than an SQL statement\&. See -Section\ \&16.1.2, \(lqReplication Formats\(rq, for information about logging modes\&. +Section\ \&17.1.2, \(lqReplication Formats\(rq, for information about logging modes\&. .PP Events are preceded by header comments that provide additional information\&. For example: .sp @@ -92,7 +92,7 @@ Events are preceded by header comments that provide additional information\&. Fo .PP In the first line, the number following at -indicates the starting position of the event in the binary log file\&. +indicates the file offset, or starting position, of the event in the binary log file\&. .PP The second line starts with a date and time indicating when the statement started on the server where the event originated\&. For replication, this timestamp is propagated to slave servers\&. server id @@ -107,6 +107,22 @@ exec_time is the time spent executing the event, on a master server\&. On a slave, it is the difference of the end execution time on the slave minus the beginning execution time on the master\&. The difference serves as an indicator of how much replication lags behind the master\&. error_code indicates the result from executing the event\&. Zero means that no error occurred\&. +.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 +When using event groups, the file offsets of events may be grouped together and the comments of events may be grouped together\&. Do not mistake these grouped events for blank file offsets\&. +.sp .5v +.RE .PP The output from \fBmysqlbinlog\fR @@ -128,15 +144,21 @@ option\&. To read remote binary logs, the connection parameter options can be gi \fB\-\-read\-from\-remote\-server\fR option\&. .PP +When running +\fBmysqlbinlog\fR +against a large binary log, be careful that the filesystem has enough space for the resulting files\&. To configure the directory that +\fBmysqlbinlog\fR +uses for temporary files, use the +TMPDIR +environment variable\&. +.PP \fBmysqlbinlog\fR supports the following options, which can be specified on the command line or in the [mysqlbinlog] and [client] -groups of an option file\&. -\fBmysqlbinlog\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -267,7 +289,7 @@ the section called \(lqMYSQLBINLOG ROW EVENT DISPLAY\(rq\&. .\" bind-address option: mysqlbinlog \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR .sp -On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&. +On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. .sp This option is supported beginning with MySQL 5\&.6\&.1\&. .RE @@ -286,9 +308,7 @@ This option is supported beginning with MySQL 5\&.6\&.1\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s ^ l l s ^ l l s. @@ -298,21 +318,8 @@ T}:T{ \-\-binlog\-row\-event\-max\-size=# T} T{ -\fBOption\-File Format\fR +\fBPermitted Values\fR (64\-bit platforms) T}:T{ -binlog\-row\-event\-max\-size -T} -T{ -\ \& -T}:T{ -\fBPermitted Values\fR -T} -:T{ -\fBPlatform Bit Size\fR -T}:T{ -64 -T} -:T{ \fBType\fR T}:T{ numeric @@ -323,9 +330,14 @@ T}:T{ 4294967040 T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +256 +T} +:T{ +\fBMax Value\fR T}:T{ -256 \&.\&. 18446744073709547520 +18446744073709547520 T} .TE .sp 1 @@ -356,6 +368,31 @@ Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: connection-server-id option +.\" connection-server-id option: mysqlbinlog +\fB\-\-connection\-server\-id=\fR\fB\fIserver_id\fR\fR +.sp +This option is used to test a MySQL server for support of the +BINLOG_DUMP_NON_BLOCK +connection flag, which was inadvertently removed in MySQL 5\&.6\&.5, and restored in MySQL 5\&.6\&.20 (Bug #18000079, Bug #71178)\&. It is not required for normal operation\&. +.sp +The effective default and minimum values for this option depend on whether +\fBmysqlbinlog\fR +is run in blocking mode or non\-blocking mode\&. When +\fBmysqlbinlog\fR +is run in blocking mode, the default (and minimum) value is 1; when run in non\-blocking mode, the default (and minimum) value is 0\&. +.sp +This option was added in MySQL 5\&.6\&.20\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: database option .\" database option: mysqlbinlog \fB\-\-database=\fR\fB\fIdb_name\fR\fR, @@ -517,8 +554,8 @@ option did not work correctly with a log written by a GTID\-enabled MySQL server Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o,/tmp/mysqlbinlog\&.trace\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o,/tmp/mysqlbinlog\&.trace\&. .RE .sp .RS 4 @@ -577,6 +614,70 @@ This option was added in MySQL 5\&.6\&.2\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: defaults-extra-file option +.\" defaults-extra-file option: mysqlbinlog +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: defaults-file option +.\" defaults-file option: mysqlbinlog +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: defaults-group-suffix option +.\" defaults-group-suffix option: mysqlbinlog +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysqlbinlog\fR +normally reads the +[client] +and +[mysqlbinlog] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysqlbinlog\fR +also reads the +[client_other] +and +[mysqlbinlog_other] +groups\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: disable-log-bin option .\" disable-log-bin option: mysqlbinlog \fB\-\-disable\-log\-bin\fR, @@ -743,6 +844,58 @@ or any other MySQL program\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: login-path option +.\" login-path option: mysqlbinlog +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlbinlog: no-defaults option +.\" no-defaults option: mysqlbinlog +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: offset option .\" offset option: mysqlbinlog \fB\-\-offset=\fR\fB\fIN\fR\fR, @@ -830,6 +983,21 @@ The TCP/IP port number to use for connecting to a remote server\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: print-defaults option +.\" print-defaults option: mysqlbinlog +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: protocol option .\" protocol option: mysqlbinlog \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR @@ -966,6 +1134,39 @@ option value is treated as a prefix that modifies output file names\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: secure-auth option +.\" secure-auth option: mysqlbinlog +\fB\-\-secure\-auth\fR +.sp +Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use +\fB\-\-skip\-secure\-auth\fR +to disable it\&. This option was added in MySQL 5\&.6\&.17\&. +.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 +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\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: server-id option .\" server-id option: mysqlbinlog \fB\-\-server\-id=\fR\fB\fIid\fR\fR @@ -1027,6 +1228,26 @@ statement to the output to specify the character set to be used for processing l .sp -1 .IP \(bu 2.3 .\} +.\" mysqlbinlog: shared-memory-base-name option +.\" shared-memory-base-name option: mysqlbinlog +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is +MYSQL\&. The shared\-memory name is case sensitive\&. +.sp +The server must be started with the +\fB\-\-shared\-memory\fR +option to enable shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlbinlog: short-form option .\" short-form option: mysqlbinlog \fB\-\-short\-form\fR, @@ -1047,7 +1268,23 @@ Display only the statements contained in the log, without any extra information .\" skip-gtids option: mysqlbinlog \fB\-\-skip\-gtids[=(true|false)]\fR .sp -Do not display any GTIDs\&. Not recommended in production\&. Added in MySQL 5\&.6\&.5\&. +Do not display any GTIDs in the output\&. This is needed when writing to a dump file from one or more binary logs containing GTIDs, as shown in this example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysqlbinlog \-\-skip\-gtids binlog\&.000001 > /tmp/dump\&.sql\fR +shell> \fBmysqlbinlog \-\-skip\-gtids binlog\&.000002 >> /tmp/dump\&.sql\fR +shell> \fBmysql \-u root \-p \-e "source /tmp/dump\&.sql"\fR +.fi +.if n \{\ +.RE +.\} +.sp +The use of this option is otherwise not normally recommended in production\&. +.sp +This option was added in MySQL 5\&.6\&.5\&. .RE .sp .RS 4 @@ -2262,7 +2499,7 @@ for variable\-length strings\&. .sp -1 .IP \(bu 2.3 .\} -For multi\-byte character sets, the maximum number of bytes per character is not present in the binary log, so the length for string types is displayed in bytes rather than in characters\&. For example, +For multibyte character sets, the maximum number of bytes per character is not present in the binary log, so the length for string types is displayed in bytes rather than in characters\&. For example, STRING(4) will be used as the data type for values from either of these column types: .sp @@ -2514,8 +2751,7 @@ With \fB\-\-to\-last\-log\fR to read to the last log file because that option is implied\&. .RE - Output File Naming -.PP +Output File Naming.PP Without \fB\-\-raw\fR, \fBmysqlbinlog\fR @@ -2573,8 +2809,7 @@ T}:T{ T} .TE .sp 1 - Example: \fBmysqldump\fR + \fBmysqlbinlog\fR for Backup and Restore -.PP +Example: mysqldump + mysqlbinlog for Backup and Restore.PP The following example describes a simple scenario that shows how to use \fBmysqldump\fR and @@ -2747,7 +2982,7 @@ specifies a nonzero server ID\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqlbug.1 b/mysql-wsrep-5.6/man/mysqlbug.1 index 9fc3f3af..c9504160 100644 --- a/mysql-wsrep-5.6/man/mysqlbug.1 +++ b/mysql-wsrep-5.6/man/mysqlbug.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbug\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLBUG\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLBUG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -35,14 +35,14 @@ mysqlbug \- generate bug report \fBmysqlbug\fR .SH "DESCRIPTION" .PP -This program is obsolete\&. +This program is obsolete\&. It is deprecated as of MySQL 5\&.6\&.19 and is removed in MySQL 5\&.7\&. .PP The normal way to report bugs is to visit \m[blue]\fB\%http://bugs.mysql.com/\fR\m[], which is the address for our bugs database\&. This database is public and can be browsed and searched by anyone\&. If you log in to the system, you can enter new reports\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqlcheck.1 b/mysql-wsrep-5.6/man/mysqlcheck.1 index 6f6ba9cb..70585a8b 100644 --- a/mysql-wsrep-5.6/man/mysqlcheck.1 +++ b/mysql-wsrep-5.6/man/mysqlcheck.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlcheck\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLCHECK\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLCHECK\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -204,10 +204,8 @@ supports the following options, which can be specified on the command line or in [mysqlcheck] and [client] -groups of an option file\&. -\fBmysqlcheck\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -240,7 +238,13 @@ Display a help message and exit\&. .sp Check all tables in all databases\&. This is the same as using the \fB\-\-databases\fR -option and naming all the databases on the command line\&. +option and naming all the databases on the command line, except that the +INFORMATION_SCHEMA +and +performace_schema +databases are not dumped\&. They can be dumped by explicitly naming them with the +\fB\-\-databases\fR +option\&. .RE .sp .RS 4 @@ -302,7 +306,7 @@ If a checked table is corrupted, automatically fix it\&. Any necessary repairs a .\" bind-address option: mysqlcheck \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR .sp -On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&. +On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. .sp This option is supported beginning with MySQL 5\&.6\&.1\&. .RE @@ -410,6 +414,16 @@ Compress all information sent between the client and the server if both support 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\&. +.sp +This option may be used to dump the +INFORMATION_SCHEMA +and +performace_schema +databases, which normally are not dumped even with the +\fB\-\-all\-databases\fR +option\&. (Also use the +\fB\-\-skip\-lock\-tables\fR +option\&.) .RE .sp .RS 4 @@ -428,8 +442,8 @@ treats the first name argument on the command line as a database name and follow Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o\&. .RE .sp .RS 4 @@ -488,6 +502,70 @@ Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlcheck: defaults-extra-file option +.\" defaults-extra-file option: mysqlcheck +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: defaults-file option +.\" defaults-file option: mysqlcheck +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: defaults-group-suffix option +.\" defaults-group-suffix option: mysqlcheck +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysqlcheck\fR +normally reads the +[client] +and +[mysqlcheck] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysqlcheck\fR +also reads the +[client_other] +and +[mysqlcheck_other] +groups\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlcheck: extended option .\" extended option: mysqlcheck \fB\-\-extended\fR, @@ -602,6 +680,31 @@ Connect to the MySQL server on the given host\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlcheck: login-path option +.\" login-path option: mysqlcheck +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlcheck: medium-check option .\" medium-check option: mysqlcheck \fB\-\-medium\-check\fR, @@ -620,6 +723,33 @@ operation\&. This finds only 99\&.99% of all errors, which should be good enough .sp -1 .IP \(bu 2.3 .\} +.\" mysqlcheck: no-defaults option +.\" no-defaults option: mysqlcheck +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlcheck: optimize option .\" optimize option: mysqlcheck \fB\-\-optimize\fR, @@ -719,6 +849,21 @@ The TCP/IP port number to use for the connection\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlcheck: print-defaults option +.\" print-defaults option: mysqlcheck +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlcheck: protocol option .\" protocol option: mysqlcheck \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR @@ -769,6 +914,59 @@ Perform a repair that can fix almost anything except unique keys that are not un .sp -1 .IP \(bu 2.3 .\} +.\" mysqlcheck: secure-auth option +.\" secure-auth option: mysqlcheck +\fB\-\-secure\-auth\fR +.sp +Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use +\fB\-\-skip\-secure\-auth\fR +to disable it\&. This option was added in MySQL 5\&.6\&.17\&. +.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 +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\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlcheck: shared-memory-base-name option +.\" shared-memory-base-name option: mysqlcheck +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is +MYSQL\&. The shared\-memory name is case sensitive\&. +.sp +The server must be started with the +\fB\-\-shared\-memory\fR +option to enable shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlcheck: silent option .\" silent option: mysqlcheck \fB\-\-silent\fR, @@ -825,7 +1023,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.9.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. .RE .sp .RS 4 @@ -945,7 +1143,7 @@ when these statements should not be sent to replication slaves or run when using .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqld.8 b/mysql-wsrep-5.6/man/mysqld.8 index 482e593c..4913cd1d 100644 --- a/mysql-wsrep-5.6/man/mysqld.8 +++ b/mysql-wsrep-5.6/man/mysqld.8 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD\FR" "8" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD\FR" "8" "01/16/2015" "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, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqld_multi.1 b/mysql-wsrep-5.6/man/mysqld_multi.1 index 20e0835f..ce737a58 100644 --- a/mysql-wsrep-5.6/man/mysqld_multi.1 +++ b/mysql-wsrep-5.6/man/mysqld_multi.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_multi\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD_MULTI\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD_MULTI\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -301,9 +301,9 @@ binary to be used to stop servers\&. .sp The \fBmysqld\fR -binary to be used\&. Note that you can specify +binary to be used\&. You can specify \fBmysqld_safe\fR -as the value for this option also\&. If you use +as the value for this option\&. If you use \fBmysqld_safe\fR to start the server, you can include the mysqld @@ -359,7 +359,7 @@ rather than to the log file\&. By default, output goes to the log file\&. \fB\-\-password=\fR\fB\fIpassword\fR\fR .sp The password of the MySQL account to use when invoking -\fBmysqladmin\fR\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&. +\fBmysqladmin\fR\&. The password value is not optional for this option, unlike for other MySQL programs\&. .RE .sp .RS 4 @@ -539,7 +539,7 @@ mysql> \fBGRANT SHUTDOWN ON *\&.*\fR See Section\ \&6.2, \(lqThe MySQL Access Privilege System\(rq\&. You have to do this for each \fBmysqld\fR -server\&. Change the connection parameters appropriately when connecting to each one\&. Note that the host name part of the account name must permit you to connect as +server\&. Change the connection parameters appropriately when connecting to each one\&. The host name part of the account name must permit you to connect as multi_admin from the host where you want to run \fBmysqld_multi\fR\&. @@ -586,7 +586,7 @@ monitors its \fBmysqld\fR process and restarts it if the process terminates due to a signal sent using kill \-9 -or for other reasons, such as a segmentation fault\&. Please note that the +or for other reasons, such as a segmentation fault\&. The \fBmysqld_safe\fR script might require that you start it from a certain place\&. This means that you might have to change location to a certain directory before running \fBmysqld_multi\fR\&. If you have problems starting, please see the @@ -686,11 +686,11 @@ user = jani .\} .PP See -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqld_safe.1 b/mysql-wsrep-5.6/man/mysqld_safe.1 index 33c061a4..b0863bc3 100644 --- a/mysql-wsrep-5.6/man/mysqld_safe.1 +++ b/mysql-wsrep-5.6/man/mysqld_safe.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_safe\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD_SAFE\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD_SAFE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -70,7 +70,7 @@ are passed to if they are specified on the command line, but ignored if they are specified in the [mysqld_safe] group of an option file\&. See -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .PP \fBmysqld_safe\fR reads all options from the @@ -100,13 +100,15 @@ For backward compatibility, \fBmysqld_safe\fR also reads [safe_mysqld] -sections, although you should rename such sections to +sections, although it is preferable to rename +[safe_mysqld] +sections to [mysqld_safe] -in MySQL 5\&.6 installations\&. +sections\&. .PP \fBmysqld_safe\fR supports the following options\&. It also reads option files and supports the options for processing them described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. .sp .RS 4 .ie n \{\ @@ -472,11 +474,26 @@ Do not read any option files\&. This must be the first option on the command lin The number of files that \fBmysqld\fR should be able to open\&. The option value is passed to -\fBulimit \-n\fR\&. Note that you need to start +\fBulimit \-n\fR\&. +.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 +You must start \fBmysqld_safe\fR as root -for this to work properly! +for this to function properly\&. +.sp .5v +.RE .RE .sp .RS 4 @@ -588,7 +605,7 @@ When syslog is used, the daemon\&.err -syslog priority/facility is used for all log messages\&. +syslog facility/severity is used for all log messages\&. .RE .sp .RS 4 @@ -608,11 +625,11 @@ syslog, messages from \fBmysqld_safe\fR and \fBmysqld\fR -are written with a tag of +are written with identifiers of mysqld_safe and -mysqld, respectively\&. To specify a suffix for the tag, use -\fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR, which modifies the tags to be +mysqld, respectively\&. To specify a suffix for the identifiers, use +\fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR, which modifies the identifiers to be mysqld_safe\-\fItag\fR and mysqld\-\fItag\fR\&. @@ -755,7 +772,7 @@ shell> \fBbin/mysqld_safe &\fR .PP If \fBmysqld_safe\fR -fails, even when invoked from the MySQL installation directory, you can specify the +fails, even when invoked from the MySQL installation directory, specify the \fB\-\-ledir\fR and \fB\-\-datadir\fR @@ -790,11 +807,7 @@ options for controlling the destination of these messages: .sp -1 .IP \(bu 2.3 .\} -\fB\-\-syslog\fR: Write error messages to -syslog -on systems that support the -\fBlogger\fR -program\&. +\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR: Write error messages to the named error file\&. .RE .sp .RS 4 @@ -805,11 +818,11 @@ program\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-skip\-syslog\fR: Do not write error messages to -syslog\&. Messages are written to the default error log file (\fIhost_name\fR\&.err -in the data directory), or to a named file if the -\fB\-\-log\-error\fR -option is given\&. +\fB\-\-syslog\fR: Write error messages to +syslog +on systems that support the +\fBlogger\fR +program\&. .RE .sp .RS 4 @@ -820,16 +833,20 @@ option is given\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR: Write error messages to the named error file\&. +\fB\-\-skip\-syslog\fR: Do not write error messages to +syslog\&. Messages are written to the default error log file (\fIhost_name\fR\&.err +in the data directory), or to a named file if the +\fB\-\-log\-error\fR +option is given\&. .RE .PP If none of these options is given, the default is \fB\-\-skip\-syslog\fR\&. .PP If -\fB\-\-syslog\fR -and \fB\-\-log\-error\fR +and +\fB\-\-syslog\fR are both given, a warning is issued and \fB\-\-log\-error\fR takes precedence\&. @@ -840,24 +857,10 @@ writes a message, notices go to the logging destination (syslog or the error log file) and stdout\&. Errors go to the logging destination and stderr\&. -.PP -Normally, you should not edit the -\fBmysqld_safe\fR -script\&. Instead, configure -\fBmysqld_safe\fR -by using command\-line options or options in the -[mysqld_safe] -section of a -my\&.cnf -option file\&. In rare cases, it might be necessary to edit -\fBmysqld_safe\fR -to get it to start the server properly\&. However, if you do this, your modified version of -\fBmysqld_safe\fR -might be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqldump.1 b/mysql-wsrep-5.6/man/mysqldump.1 index 516a4386..74719081 100644 --- a/mysql-wsrep-5.6/man/mysqldump.1 +++ b/mysql-wsrep-5.6/man/mysqldump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqldump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLDUMP\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLDUMP\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -69,8 +69,7 @@ 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\&. - Performance and Scalability Considerations -.PP +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\&. .PP @@ -99,7 +98,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\ \&24.2, \(lqMySQL Enterprise Backup\(rq\&. +Section\ \&25.2, \(lqMySQL Enterprise Backup\(rq\&. .RE .sp .RS 4 @@ -144,8 +143,7 @@ option\&. For additional information about \fBmysqldump\fR, see Section\ \&7.4, \(lqUsing mysqldump for Backups\(rq\&. - Syntax -.PP +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 @@ -172,19 +170,15 @@ To see a list of the options your version of \fBmysqldump\fR supports, issue the command \fBmysqldump \-\-help\fR\&. - Option Syntax \- Alphabetical Summary -.PP +Option Syntax \- Alphabetical Summary.PP \fBmysqldump\fR supports the following options, which can be specified on the command line or in the [mysqldump] and [client] -groups of an option file\&. -\fBmysqldump\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. - Connection Options -.PP +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. +Connection Options.PP The \fBmysqldump\fR command logs into a MySQL server to extract information\&. The following options specify how to connect to the MySQL server, either on the same machine or a remote system\&. @@ -201,7 +195,7 @@ command logs into a MySQL server to extract information\&. The following options .\" bind-address option: mysqldump \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR .sp -On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&. +On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. .sp This option is supported beginning with MySQL 5\&.6\&.1\&. .RE @@ -263,6 +257,31 @@ localhost\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: login-path option +.\" login-path option: mysqldump +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: password option .\" password option: mysqldump \fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR, @@ -360,6 +379,39 @@ Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: secure-auth option +.\" secure-auth option: mysqldump +\fB\-\-secure\-auth\fR +.sp +Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use +\fB\-\-skip\-secure\-auth\fR +to disable it\&. This option was added in MySQL 5\&.6\&.17\&. +.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 +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\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: socket option .\" socket option: mysqldump \fB\-\-socket=\fR\fB\fIpath\fR\fR, @@ -384,7 +436,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.9.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. .RE .sp .RS 4 @@ -444,8 +496,115 @@ length\&. If you increase this variable, ensure that the net_buffer_length variable in the MySQL server is at least this large\&. .RE - DDL Options -.PP +Option\-File Options.PP +These options are used to control which option files to read\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: defaults-extra-file option +.\" defaults-extra-file option: mysqldump +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: defaults-file option +.\" defaults-file option: mysqldump +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: defaults-group-suffix option +.\" defaults-group-suffix option: mysqldump +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysqldump\fR +normally reads the +[client] +and +[mysqldump] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysqldump\fR +also reads the +[client_other] +and +[mysqldump_other] +groups\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: no-defaults option +.\" no-defaults option: mysqldump +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqldump: print-defaults option +.\" print-defaults option: mysqldump +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +DDL Options.PP Usage scenarios for \fBmysqldump\fR include setting up an entire new MySQL instance (including database tables), and replacing data inside an existing instance with existing databases and tables\&. The following options let you specify which things to tear down and set up when restoring a dump, by encoding various DDL statements within the dump file\&. @@ -632,8 +791,7 @@ statements rather than INSERT statements\&. .RE - Debug Options -.PP +Debug Options.PP The following options print debugging information, encode debugging information in the dump file, or let the dump operation proceed regardless of potential problems\&. .sp .RS 4 @@ -684,8 +842,8 @@ Write additional information in the dump file such as program version, server ve Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default value is -\*(Aqd:t:o,/tmp/mysqldump\&.trace\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default value is +d:t:o,/tmp/mysqldump\&.trace\&. .RE .sp .RS 4 @@ -830,8 +988,7 @@ option\&. .sp Verbose mode\&. Print more information about what the program does\&. .RE - Help Options -.PP +Help Options.PP The following options display information about the \fBmysqldump\fR command itself\&. @@ -867,8 +1024,7 @@ Display a help message and exit\&. .sp Display version information and exit\&. .RE - Internationalization Options -.PP +Internationalization Options.PP The following options change how the \fBmysqldump\fR command represents character data with national language settings\&. @@ -907,8 +1063,7 @@ as the default character set\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. If no character set is specified, \fBmysqldump\fR uses -utf8, and earlier versions use -latin1\&. +utf8\&. .RE .sp .RS 4 @@ -949,8 +1104,7 @@ SET NAMES statement, use \fB\-\-skip\-set\-charset\fR\&. .RE - Replication Options -.PP +Replication Options.PP The \fBmysqldump\fR command is frequently used to create an empty instance, or an instance including data, on a slave server in a replication configuration\&. The following options apply to dumping and restoring data on replication master and slave servers\&. @@ -1104,7 +1258,7 @@ option, which overrides and causes it to be ignored if both options are used\&. .sp Prior to MySQL 5\&.6\&.4, this option was required for dumping the replication log tables (see -Section\ \&16.2.2, \(lqReplication Relay and Status Logs\(rq)\&. +Section\ \&17.2.2, \(lqReplication Relay and Status Logs\(rq)\&. .RE .sp .RS 4 @@ -1158,8 +1312,7 @@ T} .sp 1 This option was added in MySQL 5\&.6\&.9\&. .RE - Format Options -.PP +Format Options.PP The following options specify how to represent the entire dump file or certain kinds of data in the dump file\&. They also control whether certain optional information is written to the dump file\&. .sp .RS 4 @@ -1568,8 +1721,7 @@ Prior to MySQL 5\&.6\&.5, this option prevented the \fB\-\-routines\fR option from working correctly\(emthat is, no stored routines, triggers, or events could be dumped in XML format\&. (Bug #11760384, Bug #52792) .RE - Filtering Options -.PP +Filtering Options.PP The following options control which kinds of schema objects are written to the dump file: by category, such as triggers or events; by name, for example, choosing which databases and tables to dump; or even filtering rows from the table data using a WHERE clause\&. @@ -1596,7 +1748,7 @@ slave_master_info and slave_relay_log_info tables (see -Section\ \&16.2.2, \(lqReplication Relay and Status Logs\(rq) were not included by this option\&. +Section\ \&17.2.2, \(lqReplication Relay and Status Logs\(rq) were not included by this option\&. .RE .sp .RS 4 @@ -1775,8 +1927,7 @@ Examples: .RE .\} .RE - Performance Options -.PP +Performance Options.PP The following options are the most relevant for the performance particularly of the restore operations\&. For large data sets, restore operation (processing the INSERT statements in the dump file) is the most time\-consuming part\&. When it is urgent to restore data quickly, plan and test the performance of this stage in advance\&. For restore times measured in hours, you might prefer an alternative backup and restore solution, such as @@ -1942,8 +2093,7 @@ See the description for the \fB\-\-opt\fR option\&. .RE - Transactional Options -.PP +Transactional Options.PP The following options trade off the performance of the dump operation, against the reliability and consistency of the exported data\&. .sp .RS 4 @@ -2120,6 +2270,26 @@ table, but makes the dump operation take considerably longer\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: shared-memory-base-name option +.\" shared-memory-base-name option: mysqldump +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is +MYSQL\&. The shared\-memory name is case sensitive\&. +.sp +The server must be started with the +\fB\-\-shared\-memory\fR +option to enable shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: single-transaction option .\" single-transaction option: mysqldump \fB\-\-single\-transaction\fR @@ -2168,7 +2338,7 @@ option with the \fB\-\-quick\fR option\&. .RE - Option Groups +Option Groups .sp .RS 4 .ie n \{\ @@ -2209,8 +2379,7 @@ When you selectively enable or disable the effect of a group option, order is im would not have the intended effect; it is the same as \fB\-\-skip\-opt\fR by itself\&. - Examples -.PP +Examples.PP To make a backup of an entire database: .sp .if n \{\ @@ -2296,7 +2465,7 @@ provides a way of making an online backup: .RS 4 .\} .nf -shell> \fBmysqldump \-\-all\-databases \-\-single\-transaction > all_databases\&.sql\fR +shell> \fBmysqldump \-\-all\-databases \-\-master\-data \-\-single\-transaction > all_databases\&.sql\fR .fi .if n \{\ .RE @@ -2385,26 +2554,23 @@ for all features except index disabling and table locking, use \fB\-\-disable\-keys\fR \fB\-\-lock\-tables\fR\&. .RE - Restrictions - .\" mysqldump: views +Restrictions.\" mysqldump: views .\" mysqldump: problems .\" mysqldump: workarounds .PP \fBmysqldump\fR does not dump the INFORMATION_SCHEMA -database by default\&. To dump -INFORMATION_SCHEMA, name it explicitly on the command line and also use the +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 +\fB\-\-databases\fR option\&. .PP \fBmysqldump\fR -never dumps the -performance_schema -database\&. -.PP -\fBmysqldump\fR -also does not dump the MySQL Cluster +does not dump the MySQL Cluster ndbinfo information database\&. .PP @@ -2419,12 +2585,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\ \&E.5, \(lqRestrictions on Views\(rq +Section\ \&D.5, \(lqRestrictions on Views\(rq for a workaround\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqldumpslow.1 b/mysql-wsrep-5.6/man/mysqldumpslow.1 index fa140a33..4f7fc912 100644 --- a/mysql-wsrep-5.6/man/mysqldumpslow.1 +++ b/mysql-wsrep-5.6/man/mysqldumpslow.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqldumpslow\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLDUMPSLOW\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLDUMPSLOW\FR" "1" "01/16/2015" "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, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqlhotcopy.1 b/mysql-wsrep-5.6/man/mysqlhotcopy.1 index 5180dda9..9e585051 100644 --- a/mysql-wsrep-5.6/man/mysqlhotcopy.1 +++ b/mysql-wsrep-5.6/man/mysqlhotcopy.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlhotcopy\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLHOTCOPY\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLHOTCOPY\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -38,6 +38,22 @@ mysqlhotcopy \- a database backup program .HP \w'\fBmysqlhotcopy\ \fR\fB\fIarguments\fR\fR\ 'u \fBmysqlhotcopy \fR\fB\fIarguments\fR\fR .SH "DESCRIPTION" +.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 +This utility is deprecated in MySQL 5\&.6\&.20 and removed in MySQL 5\&.7 +.sp .5v +.RE .PP \fBmysqlhotcopy\fR is a Perl script that was originally written and contributed by Tim Bunce\&. It uses @@ -113,8 +129,8 @@ supports the following options, which can be specified on the command line or in [mysqlhotcopy] and [client] -groups of an option file\&. For information about option files, see -Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&. +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -542,7 +558,7 @@ shell> \fBperldoc mysqlhotcopy\fR .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqlimport.1 b/mysql-wsrep-5.6/man/mysqlimport.1 index dc84b2f6..a42b7050 100644 --- a/mysql-wsrep-5.6/man/mysqlimport.1 +++ b/mysql-wsrep-5.6/man/mysqlimport.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlimport\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLIMPORT\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLIMPORT\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -78,10 +78,8 @@ supports the following options, which can be specified on the command line or in [mysqlimport] and [client] -groups of an option file\&. -\fBmysqlimport\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -111,7 +109,7 @@ Display a help message and exit\&. .\" bind-address option: mysqlimport \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR .sp -On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&. +On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. .sp This option is supported beginning with MySQL 5\&.6\&.1\&. .RE @@ -180,8 +178,8 @@ Compress all information sent between the client and the server if both support Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o\&. .RE .sp .RS 4 @@ -258,6 +256,70 @@ This option was added in MySQL 5\&.6\&.2\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlimport: defaults-extra-file option +.\" defaults-extra-file option: mysqlimport +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlimport: defaults-file option +.\" defaults-file option: mysqlimport +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlimport: defaults-group-suffix option +.\" defaults-group-suffix option: mysqlimport +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysqlimport\fR +normally reads the +[client] +and +[mysqlimport] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysqlimport\fR +also reads the +[client_other] +and +[mysqlimport_other] +groups\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlimport: delete option .\" delete option: mysqlimport \fB\-\-delete\fR, @@ -423,6 +485,31 @@ tables for writing before processing any text files\&. This ensures that all tab .sp -1 .IP \(bu 2.3 .\} +.\" mysqlimport: login-path option +.\" login-path option: mysqlimport +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlimport: low-priority option .\" low-priority option: mysqlimport \fB\-\-low\-priority\fR @@ -443,6 +530,33 @@ MERGE)\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlimport: no-defaults option +.\" no-defaults option: mysqlimport +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlimport: password option .\" password option: mysqlimport \fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR, @@ -526,6 +640,21 @@ The TCP/IP port number to use for the connection\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlimport: print-defaults option +.\" print-defaults option: mysqlimport +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlimport: protocol option .\" protocol option: mysqlimport \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR @@ -564,6 +693,59 @@ options control handling of input rows that duplicate existing rows on unique ke .sp -1 .IP \(bu 2.3 .\} +.\" mysqlimport: secure-auth option +.\" secure-auth option: mysqlimport +\fB\-\-secure\-auth\fR +.sp +Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use +\fB\-\-skip\-secure\-auth\fR +to disable it\&. This option was added in MySQL 5\&.6\&.17\&. +.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 +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\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlimport: shared-memory-base-name option +.\" shared-memory-base-name option: mysqlimport +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is +MYSQL\&. The shared\-memory name is case sensitive\&. +.sp +The server must be started with the +\fB\-\-shared\-memory\fR +option to enable shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlimport: silent option .\" silent option: mysqlimport \fB\-\-silent\fR, @@ -604,7 +786,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.9.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. .RE .sp .RS 4 @@ -708,7 +890,7 @@ shell> \fBmysql \-e \*(AqSELECT * FROM imptest\*(Aq test\fR .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqlshow.1 b/mysql-wsrep-5.6/man/mysqlshow.1 index bb1f3526..b4943488 100644 --- a/mysql-wsrep-5.6/man/mysqlshow.1 +++ b/mysql-wsrep-5.6/man/mysqlshow.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlshow\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLSHOW\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLSHOW\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -125,10 +125,8 @@ supports the following options, which can be specified on the command line or in [mysqlshow] and [client] -groups of an option file\&. -\fBmysqlshow\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -158,7 +156,7 @@ Display a help message and exit\&. .\" bind-address option: mysqlshow \fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR .sp -On a computer having multiple network interfaces, this option can be used to select which interface is employed when connecting to the MySQL server\&. +On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&. .sp This option is supported beginning with MySQL 5\&.6\&.1\&. .RE @@ -227,8 +225,8 @@ tables\&. Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o\&. .RE .sp .RS 4 @@ -305,6 +303,70 @@ This option was added in MySQL 5\&.6\&.2\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlshow: defaults-extra-file option +.\" defaults-extra-file option: mysqlshow +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: defaults-file option +.\" defaults-file option: mysqlshow +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: defaults-group-suffix option +.\" defaults-group-suffix option: mysqlshow +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysqlshow\fR +normally reads the +[client] +and +[mysqlshow] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysqlshow\fR +also reads the +[client_other] +and +[mysqlshow_other] +groups\&. +.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, @@ -337,6 +399,58 @@ Show table indexes\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlshow: login-path option +.\" login-path option: mysqlshow +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: no-defaults option +.\" no-defaults option: mysqlshow +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlshow: password option .\" password option: mysqlshow \fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR, @@ -420,6 +534,21 @@ The TCP/IP port number to use for the connection\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlshow: print-defaults option +.\" print-defaults option: mysqlshow +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlshow: protocol option .\" protocol option: mysqlshow \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR @@ -436,6 +565,59 @@ Section\ \&4.2.2, \(lqConnecting to the MySQL Server\(rq\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlshow: secure-auth option +.\" secure-auth option: mysqlshow +\fB\-\-secure\-auth\fR +.sp +Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use +\fB\-\-skip\-secure\-auth\fR +to disable it\&. This option was added in MySQL 5\&.6\&.17\&. +.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 +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\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlshow: shared-memory-base-name option +.\" shared-memory-base-name option: mysqlshow +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is +MYSQL\&. The shared\-memory name is case sensitive\&. +.sp +The server must be started with the +\fB\-\-shared\-memory\fR +option to enable shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlshow: show-table-type option .\" show-table-type option: mysqlshow \fB\-\-show\-table\-type\fR, @@ -480,7 +662,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.9.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. .RE .sp .RS 4 @@ -549,7 +731,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqlslap.1 b/mysql-wsrep-5.6/man/mysqlslap.1 index fae287a6..496a230e 100644 --- a/mysql-wsrep-5.6/man/mysqlslap.1 +++ b/mysql-wsrep-5.6/man/mysqlslap.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlslap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLSLAP\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLSLAP\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -162,10 +162,8 @@ supports the following options, which can be specified on the command line or in [mysqlslap] and [client] -groups of an option file\&. -\fBmysqlslap\fR -also supports the options for processing option files described at -Section\ \&4.2.3.4, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +groups of an option file\&. For information about option files used by MySQL programs, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .sp .RS 4 .ie n \{\ @@ -466,8 +464,8 @@ Generate output in comma\-separated values format\&. The output goes to the name Write a debugging log\&. A typical \fIdebug_options\fR string is -\*(Aqd:t:o,\fIfile_name\fR\*(Aq\&. The default is -\*(Aqd:t:o,/tmp/mysqlslap\&.trace\*(Aq\&. +d:t:o,\fIfile_name\fR\&. The default is +d:t:o,/tmp/mysqlslap\&.trace\&. .RE .sp .RS 4 @@ -527,6 +525,70 @@ This option was added in MySQL 5\&.6\&.2\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlslap: defaults-extra-file option +.\" defaults-extra-file option: mysqlslap +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR +.sp +Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlslap: defaults-file option +.\" defaults-file option: mysqlslap +\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR +.sp +Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&. +\fIfile_name\fR +is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlslap: defaults-group-suffix option +.\" defaults-group-suffix option: mysqlslap +\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR +.sp +Read not only the usual option groups, but also groups with the usual names and a suffix of +\fIstr\fR\&. For example, +\fBmysqlslap\fR +normally reads the +[client] +and +[mysqlslap] +groups\&. If the +\fB\-\-defaults\-group\-suffix=_other\fR +option is given, +\fBmysqlslap\fR +also reads the +[client_other] +and +[mysqlslap_other] +groups\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlslap: delimiter option .\" delimiter option: mysqlslap \fB\-\-delimiter=\fR\fB\fIstr\fR\fR, @@ -567,7 +629,7 @@ statements\&. The default is 0 (connections are not detached)\&. Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.3.7.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.3.8.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -626,6 +688,31 @@ The number of times to run the tests\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlslap: login-path option +.\" login-path option: mysqlslap +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +.sp +Read options from the named login path in the +\&.mylogin\&.cnf +login 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 +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlslap: no-drop option .\" no-drop option: mysqlslap \fB\-\-no\-drop\fR @@ -643,6 +730,33 @@ from dropping any schema it creates during the test run\&. This option was added .sp -1 .IP \(bu 2.3 .\} +.\" mysqlslap: no-defaults option +.\" no-defaults option: mysqlslap +\fB\-\-no\-defaults\fR +.sp +Do not read any option files\&. If program startup fails due to reading unknown options from an option file, +\fB\-\-no\-defaults\fR +can be used to prevent them from being read\&. +.sp +The exception is that the +\&.mylogin\&.cnf +file, if it exists, is read in all cases\&. This permits passwords to be specified in a safer way than on the command line even when +\fB\-\-no\-defaults\fR +is used\&. (\&.mylogin\&.cnf +is created by the +\fBmysql_config_editor\fR +utility\&. See +\fBmysql_config_editor\fR(1)\&.) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlslap: number-char-cols option .\" number-char-cols option: mysqlslap \fB\-\-number\-char\-cols=\fR\fB\fIN\fR\fR, @@ -828,21 +942,6 @@ The file or string containing the statement to execute after the tests have comp .sp -1 .IP \(bu 2.3 .\} -.\" mysqlslap: shared-memory-base-name option -.\" shared-memory-base-name option: mysqlslap -\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR -.sp -On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. This option applies only if the server supports shared\-memory connections\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" mysqlslap: post-system option .\" post-system option: mysqlslap \fB\-\-post\-system=\fR\fB\fIstr\fR\fR @@ -892,6 +991,21 @@ before running the tests\&. This execution is not counted for timing purposes\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlslap: print-defaults option +.\" print-defaults option: mysqlslap +\fB\-\-print\-defaults\fR +.sp +Print the program name and all options that it gets from option files\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlslap: protocol option .\" protocol option: mysqlslap \fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR @@ -926,6 +1040,54 @@ statement to use for retrieving data\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlslap: secure-auth option +.\" secure-auth option: mysqlslap +\fB\-\-secure\-auth\fR +.sp +Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use +\fB\-\-skip\-secure\-auth\fR +to disable it\&. This option was added in MySQL 5\&.6\&.17\&. +.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 +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\&. +.sp .5v +.RE +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysqlslap: shared-memory-base-name option +.\" shared-memory-base-name option: mysqlslap +\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR +.sp +On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. This option applies only if the server supports shared\-memory connections\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlslap: silent option .\" silent option: mysqlslap \fB\-\-silent\fR, @@ -966,7 +1128,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.9.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. .RE .sp .RS 4 @@ -1019,7 +1181,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/mysqltest.1 b/mysql-wsrep-5.6/man/mysqltest.1 index bf05cfbc..98def1e5 100644 --- a/mysql-wsrep-5.6/man/mysqltest.1 +++ b/mysql-wsrep-5.6/man/mysqltest.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqltest\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/10/2014 +.\" Date: 01/15/2015 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQLTEST\FR" "1" "01/10/2014" "MySQL" "MySQL Database System" +.TH "\FBMYSQLTEST\FR" "1" "01/15/2015" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -909,7 +909,7 @@ statement is wrapped inside a view\&. This option was added in MySQL 5\&.0\&.19\ .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 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 @@ -921,7 +921,7 @@ You should have received a copy of the GNU General Public License along with the .IP " 1." 4 The SHA-256 Authentication Plugin .RS 4 -\%http://dev.mysql.com/doc/refman/5.6/en/sha256-authentication-plugin.html +\%http://dev.mysql.com/doc/refman/5.7/en/sha256-authentication-plugin.html .RE .SH "SEE ALSO" For more information, please refer to the MySQL Reference Manual, diff --git a/mysql-wsrep-5.6/man/ndb-common-options.1 b/mysql-wsrep-5.6/man/ndb-common-options.1 index 360f0810..e21c2c34 100644 --- a/mysql-wsrep-5.6/man/ndb-common-options.1 +++ b/mysql-wsrep-5.6/man/ndb-common-options.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "OPTIONS COMMON TO MY" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "OPTIONS COMMON TO MY" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -97,7 +97,7 @@ The options in the following table are common to all MySQL Cluster executables ( .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.30.\ \&Common MySQL Cluster Program Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.98.\ \& This table describes command-line options common to all MySQL Cluster programs .TS allbox tab(:); lB lB lB. @@ -106,7 +106,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -129,7 +129,7 @@ T}:T{ Display help message and exit T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -139,22 +139,22 @@ T{ .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\&. +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 +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 the management - server +Set the host (and port, if desired) for connecting to management + server T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -163,7 +163,7 @@ T}:T{ Set node id for this node T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -172,26 +172,26 @@ T}:T{ Select nodes for transactions in a more optimal way T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --character-sets-dir=path T}:T{ -Directory where character sets are +Directory where character sets are installed T}:T{ .PP -All MySQL 5\&.6 based releases +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 +Enable output from debug calls. Can be used only for versions + compiled with debugging enabled T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -200,7 +200,7 @@ T}:T{ Write core on errors (defaults to TRUE in debug builds) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -211,16 +211,16 @@ T}:T{ Output version information and exit T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 .PP For options specific to individual MySQL Cluster programs, see -Section\ \&17.4, \(lqMySQL Cluster Programs\(rq\&. +Section\ \&18.4, \(lqMySQL Cluster Programs\(rq\&. .PP See -Section\ \&17.3.4.2, \(lqMySQL Server Options for MySQL Cluster\(rq, for +Section\ \&18.3.4.2, \(lqMySQL Server Options for MySQL Cluster\(rq, for \fBmysqld\fR options relating to MySQL Cluster\&. .sp @@ -241,7 +241,6 @@ options relating to MySQL Cluster\&. .TS allbox tab(:); l l s s -l l s s l l s s. T{ \fBCommand\-Line Format\fR @@ -253,11 +252,6 @@ T{ T}:T{ \-\-usage T} -T{ -\ \& -T}:T{ -\-? -T} .TE .sp 1 Prints a short list with descriptions of the available command options\&. @@ -277,8 +271,7 @@ Prints a short list with descriptions of the available command options\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -286,11 +279,8 @@ T}:T{ \-\-character\-sets\-dir=path T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ file name @@ -322,9 +312,7 @@ Tells the program where to find character set information\&. allbox tab(:); l l s s l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -337,16 +325,8 @@ T}:T{ \-\-connect\-string=connectstring T} T{ -\ \& -T}:T{ -\-c -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -371,7 +351,7 @@ shell> \fBndbd \-\-ndb\-connectstring="nodeid=2;host=ndb_mgmd\&.mysql\&.com:1186 .\} .sp For more information, see -Section\ \&17.3.2.3, \(lqMySQL Cluster Connection Strings\(rq\&. +Section\ \&18.3.2.3, \(lqMySQL Cluster Connection Strings\(rq\&. .RE .sp .RS 4 @@ -387,8 +367,7 @@ Section\ \&17.3.2.3, \(lqMySQL Cluster Connection Strings\(rq\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -396,11 +375,8 @@ T}:T{ \-\-core\-file T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -440,8 +416,7 @@ is disabled by default\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -449,11 +424,8 @@ T}:T{ \-\-debug=options T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -483,9 +455,7 @@ process\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -493,16 +463,8 @@ T}:T{ \-\-ndb\-mgmd\-host=host[:port] T} T{ -\fBOption\-File Format\fR -T}:T{ -ndb\-mgmd\-host -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -532,8 +494,7 @@ option instead\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -541,11 +502,8 @@ T}:T{ \-\-ndb\-nodeid=# T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -559,7 +517,7 @@ T} .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\ \&17.1.6.2, \(lqLimits and Differences of MySQL Cluster from Standard MySQL Limits\(rq, for more information\&. +Section\ \&18.1.6.2, \(lqLimits and Differences of MySQL Cluster from Standard MySQL Limits\(rq, for more information\&. .RE .sp .RS 4 @@ -575,8 +533,7 @@ Section\ \&17.1.6.2, \(lqLimits and Differences of MySQL Cluster from Standard M .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -584,11 +541,8 @@ T}:T{ \-\-ndb\-optimized\-node\-selection T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -617,29 +571,23 @@ Optimize selection of nodes for transactions\&. Enabled by default\&. \fB\-V\fR .TS allbox tab(:); -l l s s l l s s. T{ \fBCommand\-Line Format\fR T}:T{ \-\-version T} -T{ -\ \& -T}:T{ -\-V -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\ \&17.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq), for more information\&. +Section\ \&18.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq), for more information\&. .RE .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_blob_tool.1 b/mysql-wsrep-5.6/man/ndb_blob_tool.1 index 3249a86d..13a702d5 100644 --- a/mysql-wsrep-5.6/man/ndb_blob_tool.1 +++ b/mysql-wsrep-5.6/man/ndb_blob_tool.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_BLOB_TOOL\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_BLOB_TOOL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -94,7 +94,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.14.\ \&ndb_blob_tool Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.82.\ \& This table describes command-line options for the ndb_blob_tool program .TS allbox tab(:); lB lB lB. @@ -103,7 +103,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -118,7 +118,7 @@ T}:T{ Check for orphan blob parts T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -126,10 +126,10 @@ T{ .PP -d T}:T{ -Database to find the table in\&. +Database to find the table in. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -138,7 +138,7 @@ T}:T{ Delete orphan blob parts T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -147,7 +147,7 @@ T}:T{ Write orphan keys to specified file T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -158,7 +158,7 @@ T}:T{ Verbose output T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -177,8 +177,7 @@ T} .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -186,11 +185,8 @@ T}:T{ \-\-check\-orphans T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -220,9 +216,7 @@ Check for orphaned BLOB parts in MySQL Cluster tables\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -230,16 +224,8 @@ T}:T{ \-\-database=db_name T} T{ -\ \& -T}:T{ -\-d -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -268,8 +254,7 @@ Specify the database to find the table in\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -277,11 +262,8 @@ T}:T{ \-\-delete\-orphans T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -310,8 +292,7 @@ Remove orphaned BLOB parts from MySQL Cluster tables\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -319,11 +300,8 @@ T}:T{ \-\-dump\-file=file T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ file name @@ -353,9 +331,7 @@ Writes a list of orphaned BLOB column parts to .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -363,16 +339,8 @@ T}:T{ \-\-verbose T} T{ -\ \& -T}:T{ -\-v -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -386,8 +354,7 @@ T} .sp 1 Provide extra information in the tool\*(Aqs output regarding its progress\&. .RE - Example -.PP +Example.PP First we create an NDB table in the @@ -479,11 +446,11 @@ BLOB column parts are created by NDB for this column\&. See -Section\ \&11.6, \(lqData Type Storage Requirements\(rq, for more information\&. +Section\ \&11.7, \(lqData Type Storage Requirements\(rq, for more information\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_config.1 b/mysql-wsrep-5.6/man/ndb_config.1 index 42cb9b6d..de1958ac 100644 --- a/mysql-wsrep-5.6/man/ndb_config.1 +++ b/mysql-wsrep-5.6/man/ndb_config.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_CONFIG\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_CONFIG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -69,7 +69,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.15.\ \&ndb_config Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.83.\ \& This table describes command-line options for the ndb_config program .TS allbox tab(:); lB lB lB. @@ -78,7 +78,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -100,20 +100,20 @@ T{ .PP --nodes T}:T{ -Print node information (DB section) only\&. +Print node information (DB section) only. T}:T{ .PP -All MySQL 5\&.6 based releases +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\&. +Print CONNECTIONS section information only. Cannot be used with + --nodes or --system option. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -124,7 +124,7 @@ T}:T{ One or more query options (attributes) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -133,7 +133,7 @@ T}:T{ Specify host T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -142,7 +142,7 @@ T}:T{ Specify node type T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -153,7 +153,7 @@ T}:T{ Get configuration of node with this ID T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -164,7 +164,7 @@ T}:T{ Field separator T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -175,76 +175,76 @@ T}:T{ Row separator T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --config-file=path T}:T{ -Set the path to config\&.ini file +Set the path to config.ini file T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --mycnf T}:T{ -Read configuration data from my\&.cnf file +Read configuration data from my.cnf file T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -c T}:T{ -Short form for \-\-ndb\-connectstring +Short form for --ndb-connectstring T}:T{ .PP -All MySQL 5\&.6 based releases +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\&. +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 +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\&. +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 +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\&. +Print SYSTEM section information only. Cannot be used with --nodes + or --connections option. T}:T{ .PP -All MySQL 5\&.6 based releases +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)\&. +Obtain configuration data from the node having this ID (must be a + data node). T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -265,7 +265,6 @@ T} .TS allbox tab(:); l l s s -l l s s l l s s. T{ \fBCommand\-Line Format\fR @@ -277,11 +276,6 @@ T{ T}:T{ \-\-usage T} -T{ -\ \& -T}:T{ -\-? -T} .TE .sp 1 Causes @@ -303,7 +297,7 @@ to print a list of available options, and then exit\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -313,11 +307,8 @@ T}:T{ \-\-config_from_node=# T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -328,9 +319,14 @@ T}:T{ none T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +1 +T} +:T{ +\fBMax Value\fR T}:T{ -1 \&.\&. 48 +48 T} .TE .sp 1 @@ -355,18 +351,12 @@ fails with an error\&. (To obtain configuration data from the management node in \fB\-V\fR .TS allbox tab(:); -l l s s l l s s. T{ \fBCommand\-Line Format\fR T}:T{ \-\-version T} -T{ -\ \& -T}:T{ -\-V -T} .TE .sp 1 Causes @@ -390,9 +380,7 @@ to print a version information string, and then exit\&. allbox tab(:); l l s s l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -405,16 +393,8 @@ T}:T{ \-\-connect\-string=connectstring T} T{ -\ \& -T}:T{ -\-c -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -427,7 +407,7 @@ 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\ \&17.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, and defaults to +Section\ \&18.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, and defaults to localhost:1186\&. .RE .sp @@ -445,8 +425,7 @@ localhost:1186\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -454,11 +433,8 @@ T}:T{ \-\-config\-file=path T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ file name @@ -488,8 +464,7 @@ is invoked, then an absolute path must be used\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -497,11 +472,8 @@ T}:T{ \-\-mycnf T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -534,9 +506,7 @@ file\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -544,16 +514,8 @@ T}:T{ \-\-query=string T} T{ -\ \& -T}:T{ -\-q -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -611,8 +573,7 @@ If a given parameter is not applicable to a certain type of node, than an empty .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -620,11 +581,8 @@ T}:T{ \-\-host=name T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -686,8 +644,7 @@ in the same fashion\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -695,11 +652,8 @@ T}:T{ \-\-ndb\-nodeid=# T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -730,8 +684,7 @@ is the preferred form\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -739,11 +692,8 @@ T}:T{ \-\-nodes T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -779,8 +729,7 @@ or .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -788,11 +737,8 @@ T}:T{ \-\-connections T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -828,8 +774,7 @@ or .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -837,11 +782,8 @@ T}:T{ \-\-system T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -880,8 +822,7 @@ options\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s ^ lt l s ^ ^ l s @@ -892,11 +833,8 @@ T}:T{ \-\-type=name T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ enumeration @@ -904,6 +842,7 @@ T} :T{ \fBDefault\fR T}:T{ +[none] T} :T{ \fBValid Values\fR @@ -941,9 +880,7 @@ ndb_mgmd) are returned\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -951,16 +888,8 @@ T}:T{ \-\-fields=string T} T{ -\ \& -T}:T{ -\-f -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1013,9 +942,7 @@ for the linefeed character), then it must be quoted\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1023,16 +950,8 @@ T}:T{ \-\-rows=string T} T{ -\ \& -T}:T{ -\-r -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1192,8 +1111,7 @@ Default: 0 (Min: 0, Max: 4294967039) .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1201,11 +1119,8 @@ T}:T{ \-\-configinfo \-\-xml T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -1229,7 +1144,7 @@ option\&. A portion of the resulting output is shown in this example: .\} .nf shell> \fBndb_config \-\-configinfo \-\-xml\fR -<configvariables protocolversion="1" ndbversionstring="5\&.6\&.14\-ndb\-7\&.3\&.4" +<configvariables protocolversion="1" ndbversionstring="5\&.6\&.22\-ndb\-7\&.3\&.9" ndbversion="458758" ndbversionmajor="7" ndbversionminor="0" ndbversionbuild="6"> <section name="SYSTEM"> @@ -1383,7 +1298,7 @@ with \fB\-\-configinfo\fR serves no purpose\&. .RE - Examples +Examples .sp .RS 4 .ie n \{\ @@ -1520,7 +1435,7 @@ option\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_cpcd.1 b/mysql-wsrep-5.6/man/ndb_cpcd.1 index 5d7c275f..c1b5d680 100644 --- a/mysql-wsrep-5.6/man/ndb_cpcd.1 +++ b/mysql-wsrep-5.6/man/ndb_cpcd.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_CPCD\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_CPCD\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -39,7 +39,7 @@ A utility having this name was formerly part of an internal automated test frame .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_delete_all.1 b/mysql-wsrep-5.6/man/ndb_delete_all.1 index 8224b3f3..cb1a796b 100644 --- a/mysql-wsrep-5.6/man/ndb_delete_all.1 +++ b/mysql-wsrep-5.6/man/ndb_delete_all.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DELETE_ALL\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DELETE_ALL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,7 +42,7 @@ table\&. In some cases, this can be much faster than DELETE or even TRUNCATE TABLE\&. - Usage +Usage .sp .if n \{\ .RS 4 @@ -70,7 +70,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.16.\ \&ndb_delete_all Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.84.\ \& This table describes command-line options for the ndb_delete_all program .TS allbox tab(:); lB lB lB. @@ -79,7 +79,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -88,14 +88,14 @@ l l l l l l. T{ .PP -\-\-database=dbname, +--database=dbname, .PP -\-d +-d T}:T{ Name of the database in which the table is found T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -103,28 +103,29 @@ T{ .PP -t T}:T{ -Perform the delete in a single transaction (may run out of operations) +Perform the delete in a single transaction (may run out of + operations) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-tupscan +--tupscan T}:T{ Run tup scan T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-diskscan +--diskscan T}:T{ Run disk scan T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -162,7 +163,7 @@ With very large tables, using this option may cause the number of operations ava .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_desc.1 b/mysql-wsrep-5.6/man/ndb_desc.1 index 7e71ede5..197054f8 100644 --- a/mysql-wsrep-5.6/man/ndb_desc.1 +++ b/mysql-wsrep-5.6/man/ndb_desc.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DESC\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DESC\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -39,7 +39,7 @@ ndb_desc \- describe NDB tables provides a detailed description of one or more NDB tables\&. - Usage +Usage .sp .if n \{\ .RS 4 @@ -52,8 +52,7 @@ ndb_desc \-c \fIconnect_string\fR \fIindex_name\fR \-d \fIdb_name\fR \-t \fItbl_ .RE .\} .sp - Sample Output -.PP +Sample Output.PP MySQL table creation and population statements: .sp .if n \{\ @@ -228,7 +227,7 @@ ALTER TABLESPACE ts_1 .\} .PP (For more information on the statements just shown and the objects created by them, see -Section\ \&17.5.12.1, \(lqMySQL Cluster Disk Data Objects\(rq, as well as +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 @@ -323,7 +322,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.17.\ \&ndb_desc Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.85.\ \& This table describes command-line options for the ndb_desc program .TS allbox tab(:); lB lB lB. @@ -332,7 +331,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -348,11 +347,11 @@ T{ .PP -b T}:T{ -Include partition information for BLOB tables in output\&. Requires that - the \-p option also be used +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 +All MySQL 5.6 based releases T} T{ .PP @@ -363,7 +362,7 @@ T}:T{ Name of database containing table T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -371,11 +370,11 @@ T{ .PP -n T}:T{ -Include partition\-to\-data\-node mappings in output\&. Requires that the \-p - option also be used +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 +All MySQL 5.6 based releases T} T{ .PP @@ -386,7 +385,7 @@ T}:T{ Display information about partitions T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -397,7 +396,7 @@ T}:T{ Number of times to retry the connection (once per second) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -405,11 +404,11 @@ T{ .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\&. +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 +All MySQL 5.6 based releases T} T{ .PP @@ -420,7 +419,7 @@ T}:T{ Use unqualified table names T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -551,7 +550,7 @@ Use unqualified table names\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_drop_index.1 b/mysql-wsrep-5.6/man/ndb_drop_index.1 index d8355945..a468fa99 100644 --- a/mysql-wsrep-5.6/man/ndb_drop_index.1 +++ b/mysql-wsrep-5.6/man/ndb_drop_index.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DROP_INDEX\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DROP_INDEX\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -40,7 +40,7 @@ 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 +Usage .sp .if n \{\ .RS 4 @@ -68,7 +68,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.18.\ \&ndb_drop_index Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.86.\ \& This table describes command-line options for the ndb_drop_index program .TS allbox tab(:); lB lB lB. @@ -77,20 +77,20 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l. T{ .PP -\-\-database=dbname, +--database=dbname, .PP -\-d +-d T}:T{ Name of the database in which the table is found T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -123,7 +123,7 @@ 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\&.14\-ndb\-7\&.3\&.4 +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 +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ @@ -154,7 +154,7 @@ utility (see .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_drop_table.1 b/mysql-wsrep-5.6/man/ndb_drop_table.1 index b212fa5e..7c73fcd5 100644 --- a/mysql-wsrep-5.6/man/ndb_drop_table.1 +++ b/mysql-wsrep-5.6/man/ndb_drop_table.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_DROP_TABLE\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_DROP_TABLE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -45,7 +45,7 @@ DROP TABLE statement on an NDB table\&. - Usage +Usage .sp .if n \{\ .RS 4 @@ -66,7 +66,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.19.\ \&ndb_drop_table Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.87.\ \& This table describes command-line options for the ndb_drop_table program .TS allbox tab(:); lB lB lB. @@ -75,27 +75,27 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l. T{ .PP -\-\-database=dbname, +--database=dbname, .PP -\-d +-d T}:T{ Name of the database in which the table is found T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_error_reporter.1 b/mysql-wsrep-5.6/man/ndb_error_reporter.1 index cb9ff9f1..07c5c686 100644 --- a/mysql-wsrep-5.6/man/ndb_error_reporter.1 +++ b/mysql-wsrep-5.6/man/ndb_error_reporter.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_ERROR_REPORTE" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_ERROR_REPORTE" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -58,7 +58,7 @@ options were also added in this release (Bug #16602002)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.20.\ \&ndb_error_reporter Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.88.\ \& This table describes command-line options for the ndb_error_reporter program .TS allbox tab(:); lB lB lB. @@ -67,7 +67,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -78,42 +78,43 @@ T{ .PP --connection-timeout=timeout T}:T{ -Number of seconds to wait when connecting to nodes before timing out\&. +Number of seconds to wait when connecting to nodes before timing + out. T}:T{ .PP -ADDED: NDB 7\&.3\&.3 +ADDED: NDB 7.3.3 T} T{ .PP --dry-scp T}:T{ -Disable scp with remote hosts; used only for testing\&. +Disable scp with remote hosts; used only for testing. T}:T{ .PP -ADDED: NDB 7\&.3\&.3 +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 +Include file system data in error report; can use a large amount + of disk space T}:T{ .PP -All MySQL 5\&.6 based releases +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\&. +Skip all nodes in the node group having this ID. T}:T{ .PP -ADDED: NDB 7\&.3\&.3 +ADDED: NDB 7.3.3 T} .TE .sp 1 - Usage +Usage .sp .if n \{\ .RS 4 @@ -151,8 +152,7 @@ also accepts the options listed here: allbox tab(:); l l s s l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBIntroduced\fR @@ -165,11 +165,8 @@ T}:T{ \-\-connection\-timeout=timeout T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ integer @@ -198,8 +195,7 @@ Wait this many seconds when trying to connect to nodes before timing out\&. allbox tab(:); l l s s l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBIntroduced\fR @@ -212,11 +208,8 @@ T}:T{ \-\-dry\-scp T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -246,8 +239,7 @@ without using scp from remote hosts\&. Used for testing only\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -255,11 +247,8 @@ T}:T{ \-\-fs T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -292,8 +281,7 @@ send archives created using this option to Oracle unless you are specifically re allbox tab(:); l l s s l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBIntroduced\fR @@ -306,11 +294,8 @@ T}:T{ \-\-connection\-timeout=timeout T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ integer @@ -327,7 +312,7 @@ Skip all nodes belong to the node group having the supplied node group ID\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_index_stat.1 b/mysql-wsrep-5.6/man/ndb_index_stat.1 index b08a819e..6e5ed099 100644 --- a/mysql-wsrep-5.6/man/ndb_index_stat.1 +++ b/mysql-wsrep-5.6/man/ndb_index_stat.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_INDEX_STAT\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_INDEX_STAT\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -36,9 +36,10 @@ ndb_index_stat \- NDB index statistics utility .SH "DESCRIPTION" .PP \fBndb_index_stat\fR -\&.\&.\&. - Usage -.PP +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 @@ -66,22 +67,71 @@ 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:mytable index:PRIMARY fragCount:4 -sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0 -query cache: valid:1 sampleCount:0 totalBytes:0 -times in ms: save: 12\&.380 sort: 0\&.001 +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: @@ -108,8 +158,7 @@ shell> .RE .\} .sp - Options -.PP +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 @@ -120,7 +169,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.21.\ \&ndb_index_stat Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.89.\ \& This table describes command-line options for the ndb_index_stat program .TS allbox tab(:); lB lB lB. @@ -129,7 +178,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -148,146 +197,146 @@ l l l l l l. T{ .PP -\-\-database=name, +--database=name, .PP -\-d +-d T}:T{ -Name of the database containing the table\&. +Name of the database containing the table. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-delete +--delete T}:T{ -Delete index statistics for the given table, stopping any auto\-update - previously configured\&. +Delete index statistics for the given table, stopping any + auto-update previously configured. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-update +--update T}:T{ -Update index statistics for the given table, restarting any auto\-update - previously configured\&. +Update index statistics for the given table, restarting any + auto-update previously configured. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-dump +--dump T}:T{ -Print the query cache\&. +Print the query cache. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-query=# +--query=# T}:T{ -Perform a number of random range queries on first key attr (must be int - unsigned)\&. +Perform a number of random range queries on first key attr (must + be int unsigned). T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-sys\-drop +--sys-drop T}:T{ -Drop any statistics tables and events in NDB kernel (all statistics are - lost) +Drop any statistics tables and events in NDB kernel (all + statistics are lost) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-sys\-create +--sys-create T}:T{ -Create all statistics tables and events in NDB kernel, if none of them - already exist +Create all statistics tables and events in NDB kernel, if none of + them already exist T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-sys\-create\-if\-not\-exist +--sys-create-if-not-exist T}:T{ Create any statistics tables and events in NDB kernel that do not - already exist\&. + already exist. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-sys\-create\-if\-not\-valid +--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\&. +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 +All MySQL 5.6 based releases T} T{ .PP -\-\-sys\-check +--sys-check T}:T{ -Verify that NDB system index statistics and event tables exist\&. +Verify that NDB system index statistics and event tables exist. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-sys\-skip\-tables +--sys-skip-tables T}:T{ -Do not apply sys\-* options to tables\&. +Do not apply sys-* options to tables. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-sys\-skip\-events +--sys-skip-events T}:T{ -Do not apply sys\-* options to events\&. +Do not apply sys-* options to events. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-verbose, +--verbose, .PP -\-v +-v T}:T{ Turn on verbose output T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-loops=# +--loops=# T}:T{ -Set the number of times to perform a given command\&. Default is 0\&. +Set the number of times to perform a given command. Default is 0. T}:T{ .PP -All MySQL 5\&.6 based releases +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 -ndb_index_stat system options\&. +\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 \{\ @@ -304,8 +353,7 @@ ndb_index_stat system options\&. .TS allbox tab(:); l l s s -l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -315,16 +363,8 @@ T}:T{ \-\-database=name T} T{ -\ \& -T}:T{ -\-d -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -335,9 +375,12 @@ T}:T{ [none] T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +T} +:T{ +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -357,7 +400,7 @@ The name of the database that contains the table being queried\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -367,11 +410,8 @@ T}:T{ \-\-delete T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -379,12 +419,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +T} +:T{ +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -404,7 +447,7 @@ Delete the index statistics for the given table, stopping any auto\-update that .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -414,11 +457,8 @@ T}:T{ \-\-update T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -426,16 +466,19 @@ T} :T{ \fBDefault\fR T}:T{ -true +false +T} +:T{ +\fBMin Value\fR +T}:T{ T} :T{ -\fBRange\fR +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 -Update the index statistics for the given table, and restart any auto\-update that previously configured\&. +Update the index statistics for the given table, and restart any auto\-update that was previously configured\&. .RE .sp .RS 4 @@ -451,7 +494,7 @@ Update the index statistics for the given table, and restart any auto\-update th .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -461,11 +504,8 @@ T}:T{ \-\-dump T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -473,12 +513,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +T} +:T{ +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -498,7 +541,7 @@ Dump the contents of the query cache\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -508,11 +551,8 @@ T}:T{ \-\-query=# T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -523,17 +563,22 @@ T}:T{ 0 T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +0 +T} +:T{ +\fBMax Value\fR T}:T{ -0 \&.\&. MAX_INT +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\&. They cannot be mixed with -ndb_index_stat statistics options\&. +\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 \{\ @@ -548,7 +593,7 @@ ndb_index_stat statistics options\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -558,11 +603,8 @@ T}:T{ \-\-sys\-drop T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -570,12 +612,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false +T} +:T{ +\fBMin Value\fR +T}:T{ T} :T{ -\fBRange\fR +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -596,7 +641,7 @@ Drop all statistics tables and events in the NDB kernel\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -606,11 +651,8 @@ T}:T{ \-\-sys\-create T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -618,12 +660,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +T} +:T{ +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -643,7 +688,7 @@ Create all statistics tables and events in the NDB kernel\&. This works only if .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -653,11 +698,8 @@ T}:T{ \-\-sys\-create\-if\-not\-exist T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -665,12 +707,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false +T} +:T{ +\fBMin Value\fR +T}:T{ T} :T{ -\fBRange\fR +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -690,7 +735,7 @@ Create any NDB system statistics tables or events (or both) that do not already .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -700,11 +745,8 @@ T}:T{ \-\-sys\-create\-if\-not\-valid T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -712,12 +754,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false +T} +:T{ +\fBMin Value\fR +T}:T{ T} :T{ -\fBRange\fR +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -737,7 +782,7 @@ Create any NDB system statistics tables or events that do not already exist, aft .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -747,11 +792,8 @@ T}:T{ \-\-sys\-check T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -759,12 +801,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +T} +:T{ +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -784,7 +829,7 @@ Verify that all required system statistics tables and events exist in the NDB ke .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -794,11 +839,8 @@ T}:T{ \-\-sys\-skip\-tables T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -806,12 +848,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false +T} +:T{ +\fBMin Value\fR +T}:T{ T} :T{ -\fBRange\fR +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -833,7 +878,7 @@ options to any statistics tables\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -843,11 +888,8 @@ T}:T{ \-\-sys\-skip\-events T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -855,12 +897,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +T} +:T{ +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -882,8 +927,7 @@ options to any events\&. .TS allbox tab(:); l l s s -l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -893,16 +937,8 @@ T}:T{ \-\-verbose T} T{ -\ \& -T}:T{ -\-v -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -910,12 +946,15 @@ T} :T{ \fBDefault\fR T}:T{ -true +false +T} +:T{ +\fBMin Value\fR +T}:T{ T} :T{ -\fBRange\fR +\fBMax Value\fR T}:T{ -\&.\&. T} .TE .sp 1 @@ -935,7 +974,7 @@ Turn on verbose output\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -945,11 +984,8 @@ T}:T{ \-\-loops=# T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -960,9 +996,14 @@ T}:T{ 0 T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +0 +T} +:T{ +\fBMax Value\fR T}:T{ -0 \&.\&. MAX_INT +MAX_INT T} .TE .sp 1 @@ -971,7 +1012,7 @@ Repeat commands this number of times (for use in testing)\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_mgm.1 b/mysql-wsrep-5.6/man/ndb_mgm.1 index 382ebaa0..3b892e7e 100644 --- a/mysql-wsrep-5.6/man/ndb_mgm.1 +++ b/mysql-wsrep-5.6/man/ndb_mgm.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_MGM\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_MGM\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -87,7 +87,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.13.\ \&ndb_mgm Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.81.\ \& This table describes command-line options for the ndb_mgm program .TS allbox tab(:); lB lB lB. @@ -96,7 +96,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -110,7 +110,7 @@ T}:T{ Specify number of tries for connecting to ndb_mgmd (0 = infinite) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -121,7 +121,7 @@ T}:T{ Execute command and exit T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -140,18 +140,12 @@ T} \fB\-e \fR\fBcommand\fR .TS allbox tab(:); -l l s s l l s s. T{ \fBCommand\-Line Format\fR T}:T{ \-\-execute=name T} -T{ -\ \& -T}:T{ -\-e -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 @@ -176,7 +170,7 @@ or option works with the \fBmysql\fR command\-line client\&. See -Section\ \&4.2.3.1, \(lqUsing Options on the Command Line\(rq\&. +Section\ \&4.2.4, \(lqUsing Options on the Command Line\(rq\&. .if n \{\ .sp .\} @@ -208,9 +202,7 @@ be enclosed in quotation marks\&. Either single or double quotation marks may be .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -218,16 +210,8 @@ T}:T{ \-\-try\-reconnect=# T} T{ -\ \& -T}:T{ -\-t -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -247,11 +231,11 @@ before giving up and reporting an error instead\&. Additional information about using \fBndb_mgm\fR can be found in -Section\ \&17.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq\&. +Section\ \&18.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_mgmd.8 b/mysql-wsrep-5.6/man/ndb_mgmd.8 index 1f188b3c..28d1a8a4 100644 --- a/mysql-wsrep-5.6/man/ndb_mgmd.8 +++ b/mysql-wsrep-5.6/man/ndb_mgmd.8 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_MGMD\FR" "8" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_MGMD\FR" "8" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -54,7 +54,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.12.\ \&ndb_mgmd Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.80.\ \& This table describes command-line options for the ndb_mgmd program .TS allbox tab(:); lB lB lB. @@ -63,7 +63,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -86,16 +86,14 @@ T{ .PP --config-file=file, .PP --f, -.PP --c +-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 +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 +All MySQL 5.6 based releases T} T{ .PP @@ -103,10 +101,11 @@ T{ .PP --config-dir=directory T}:T{ -Specify the cluster management server\*(Aqs configuration cache directory +Specify the cluster management server's configuration cache + directory T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -115,7 +114,7 @@ T}:T{ Local bind address T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -126,7 +125,7 @@ T}:T{ Print full configuration and exit T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -137,7 +136,7 @@ T}:T{ Run ndb_mgmd in daemon mode (default) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -146,27 +145,27 @@ T}:T{ Do not run ndb_mgmd as a daemon T}:T{ .PP -All MySQL 5\&.6 based releases +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) + production; for testing purposes only) T}:T{ .PP -All MySQL 5\&.6 based releases +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\&. +A name to use when writing messages applying to this node in the + cluster log. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -175,77 +174,77 @@ T}:T{ Do not provide any node id checks T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --mycnf T}:T{ -Read cluster configuration data from the my\&.cnf file +Read cluster configuration data from the my.cnf file T}:T{ .PP -All MySQL 5\&.6 based releases +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 +Causes the management server to compare the configuration file + with its configuration cache T}:T{ .PP -All MySQL 5\&.6 based releases +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 +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 +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\&. +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 +All MySQL 5.6 based releases T} T{ .PP --config-cache[=TRUE|FALSE] T}:T{ -Enable the management server configuration cache; TRUE by default\&. +Enable the management server configuration cache; TRUE by default. T}:T{ .PP -All MySQL 5\&.6 based releases +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\&. +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 +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\&. +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 +All MySQL 5.6 based releases T} .TE .sp 1 @@ -263,8 +262,7 @@ T} .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -272,11 +270,8 @@ T}:T{ \-\-bind\-address=ip_address T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -309,8 +304,7 @@ is not specified, the management client attempts to use port 1186\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -318,11 +312,8 @@ T}:T{ \-\-no\-nodeid\-checks T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -351,8 +342,7 @@ Do not perform any checks of node IDs\&. allbox tab(:); l l s s l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -365,11 +355,8 @@ T}:T{ \-\-config\-dir=directory T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ file name @@ -399,8 +386,7 @@ is an alias for this option\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -408,11 +394,8 @@ T}:T{ \-\-config\-cache[=TRUE|FALSE] T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -431,7 +414,7 @@ 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\ \&17.3.2, \(lqMySQL Cluster Configuration Files\(rq)\&. You can do this by starting the +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 @@ -556,12 +539,7 @@ is used\&. (Bug #13428853) .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s -^ l l s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -569,31 +547,8 @@ T}:T{ \-\-config\-file=file T} T{ -\ \& -T}:T{ -\-f -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR T}:T{ -\&./config\&.ini -T} -T{ -\ \& -T}:T{ -\fBPermitted Values\fR -T} -:T{ \fBType\fR T}:T{ file name @@ -621,7 +576,7 @@ option, or because the management server could not find any configuration cache\ \fBndb_mgmd\fR was started with \fB\-\-config\-cache=OFF\fR\&. See -Section\ \&17.3.2, \(lqMySQL Cluster Configuration Files\(rq, for more information\&. +Section\ \&18.3.2, \(lqMySQL Cluster Configuration Files\(rq, for more information\&. .sp Formerly, using this option together with \fB\-\-initial\fR @@ -642,8 +597,7 @@ caused removal of the configuration cache even if the file was not found\&. This .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -651,11 +605,8 @@ T}:T{ \-\-mycnf T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -687,9 +638,7 @@ file\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -697,16 +646,8 @@ T}:T{ \-\-daemon T} T{ -\ \& -T}:T{ -\-d -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -740,8 +681,7 @@ on Windows platforms\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -749,11 +689,8 @@ T}:T{ \-\-interactive T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -785,8 +722,7 @@ client session is started as soon as the management server is running\&. This op .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -794,11 +730,8 @@ T}:T{ \-\-initial T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -811,7 +744,7 @@ 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\ \&17.3.2, \(lqMySQL Cluster Configuration Files\(rq)\&. Using the +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 @@ -834,7 +767,7 @@ When a management server starts, it checks for another management server in the 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\ \&17.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq, for more information\&. +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 @@ -854,8 +787,7 @@ option caused removal of the configuration cache even if the file was not found\ .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -863,11 +795,8 @@ T}:T{ \-\-log\-name=name T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -895,8 +824,7 @@ Provides a name to be used for this node in the cluster log\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -904,11 +832,8 @@ T}:T{ \-\-nodaemon T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -944,9 +869,7 @@ on Windows is to run in the foreground, making this option unnecessary on Window .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -954,16 +877,8 @@ T}:T{ \-\-print\-full\-config T} T{ -\ \& -T}:T{ -\-P -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -995,8 +910,7 @@ process prints information about the cluster setup including an extensive list o .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1004,11 +918,8 @@ T}:T{ \-\-reload T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -1021,7 +932,7 @@ 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\ \&17.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\&. +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 @@ -1040,7 +951,7 @@ When a management server starts, it checks for another management server in the 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\ \&17.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq, for more information\&. +Section\ \&18.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq, for more information\&. .RE .sp .RS 4 @@ -1056,7 +967,7 @@ Section\ \&17.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq, for .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -1066,11 +977,8 @@ T}:T{ \-\-nowait\-nodes=list T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -1080,9 +988,14 @@ T} T}:T{ T} :T{ -\fBRange\fR +\fBMin Value\fR T}:T{ -1 \&.\&. 255 +1 +T} +:T{ +\fBMax Value\fR +T}:T{ +255 T} .TE .sp 1 @@ -1165,7 +1078,7 @@ shell> \fBndbd \-c 192\&.168\&.0\&.150,192\&.168\&.0\&.151\fR 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\ \&17.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, for more information\&. +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 @@ -1199,7 +1112,7 @@ management server, its configuration must match that of the management server th 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\ \&17.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, for information about using connection strings\&. +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 @@ -1226,7 +1139,7 @@ is the unique node identifier\&. .\" 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\ \&17.3, \(lqConfiguration of MySQL Cluster NDB 7.3\(rq, discusses how to set up this file\&. +Section\ \&18.3, \(lqConfiguration of MySQL Cluster\(rq, discusses how to set up this file\&. .RE .sp .RS 4 @@ -1239,7 +1152,7 @@ Section\ \&17.3, \(lqConfiguration of MySQL Cluster NDB 7.3\(rq, discusses how t .\} 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\ \&17.5, \(lqManagement of MySQL Cluster\(rq\&. +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 @@ -1290,7 +1203,7 @@ is the process ID file used when running the management server as a daemon\&. allbox tab(:); l l s s l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1298,11 +1211,13 @@ T}:T{ \-\-install[=name] T} T{ -\ \& +\fBPlatform Specific\fR T}:T{ -\fBPermitted Values\fR +Windows T} -:T{ +T{ +\fBPermitted Values\fR +T}:T{ \fBType\fR T}:T{ string @@ -1353,7 +1268,7 @@ option has no effect on non\-Windows platforms\&. allbox tab(:); l l s s l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1361,11 +1276,13 @@ T}:T{ \-\-remove[=name] T} T{ -\ \& +\fBPlatform Specific\fR T}:T{ -\fBPermitted Values\fR +Windows T} -:T{ +T{ +\fBPermitted Values\fR +T}:T{ \fBType\fR T}:T{ string @@ -1389,7 +1306,7 @@ option has no effect on non\-Windows platforms\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_print_backup_file.1 b/mysql-wsrep-5.6/man/ndb_print_backup_file.1 index 055cb58d..ac788d18 100644 --- a/mysql-wsrep-5.6/man/ndb_print_backup_file.1 +++ b/mysql-wsrep-5.6/man/ndb_print_backup_file.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_BACKUP_" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_BACKUP_" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,7 +37,7 @@ ndb_print_backup_file \- print NDB backup file contents .PP \fBndb_print_backup_file\fR obtains diagnostic information from a cluster backup file\&. - Usage +Usage .sp .if n \{\ .RS 4 @@ -57,7 +57,7 @@ file) found in a cluster backup directory\&. These files are found in the data n 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\ \&17.5.3.1, \(lqMySQL Cluster Backup Concepts\(rq\&. +Section\ \&18.5.3.1, \(lqMySQL Cluster Backup Concepts\(rq\&. .PP Like \fBndb_print_schema_file\fR @@ -68,13 +68,12 @@ 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 +Additional Options.PP None\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_print_schema_file.1 b/mysql-wsrep-5.6/man/ndb_print_schema_file.1 index 769bcd67..d28b3a5f 100644 --- a/mysql-wsrep-5.6/man/ndb_print_schema_file.1 +++ b/mysql-wsrep-5.6/man/ndb_print_schema_file.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_SCHEMA_" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_SCHEMA_" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,7 +37,7 @@ ndb_print_schema_file \- print NDB schema file contents .PP \fBndb_print_schema_file\fR obtains diagnostic information from a cluster schema file\&. - Usage +Usage .sp .if n \{\ .RS 4 @@ -51,7 +51,7 @@ ndb_print_schema_file \fIfile_name\fR .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 FileSystemDir Files\fR\m[]\&\s-2\u[1]\d\s+2\&. +\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 @@ -62,13 +62,12 @@ 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 +Additional Options.PP None\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 @@ -78,7 +77,7 @@ You should have received a copy of the GNU General Public License along with the .sp .SH "NOTES" .IP " 1." 4 -MySQL Cluster Data Node FileSystemDir Files +MySQL Cluster Data Node File System Directory Files .RS 4 \%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html .RE diff --git a/mysql-wsrep-5.6/man/ndb_print_sys_file.1 b/mysql-wsrep-5.6/man/ndb_print_sys_file.1 index 4c0db434..a49701f3 100644 --- a/mysql-wsrep-5.6/man/ndb_print_sys_file.1 +++ b/mysql-wsrep-5.6/man/ndb_print_sys_file.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_PRINT_SYS_FIL" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_PRINT_SYS_FIL" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,7 +37,7 @@ ndb_print_sys_file \- print NDB system file contents .PP \fBndb_print_sys_file\fR obtains diagnostic information from a MySQL Cluster system file\&. - Usage +Usage .sp .if n \{\ .RS 4 @@ -54,7 +54,7 @@ is the name of a cluster system file (sysfile)\&. Cluster system files are locat 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 FileSystemDir Files\fR\m[]\&\s-2\u[1]\d\s+2\&. +\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 @@ -65,13 +65,12 @@ 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 +Additional Options.PP None\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 @@ -81,7 +80,7 @@ You should have received a copy of the GNU General Public License along with the .sp .SH "NOTES" .IP " 1." 4 -MySQL Cluster Data Node FileSystemDir Files +MySQL Cluster Data Node File System Directory Files .RS 4 \%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html .RE diff --git a/mysql-wsrep-5.6/man/ndb_restore.1 b/mysql-wsrep-5.6/man/ndb_restore.1 index f5c66580..e6b312a6 100644 --- a/mysql-wsrep-5.6/man/ndb_restore.1 +++ b/mysql-wsrep-5.6/man/ndb_restore.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_RESTORE\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_RESTORE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -48,7 +48,7 @@ directory\&. This program reads the files created as a result of the backup and 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\ \&17.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\&. +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 @@ -65,7 +65,7 @@ Section\ \&17.5.3.2, \(lqUsing The MySQL Cluster Management Client to Create a B .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\ \&17.5.8, \(lqMySQL Cluster Single User Mode\(rq, for more information\&. +Section\ \&18.5.8, \(lqMySQL Cluster Single User Mode\(rq, for more information\&. .sp .5v .RE .PP @@ -78,7 +78,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.23.\ \&ndb_restore Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.91.\ \& This table describes command-line options for the ndb_restore program .TS allbox tab(:); lB lB lB. @@ -87,7 +87,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -130,6 +130,8 @@ l l l l l l l l l l l l +l l l +l l l l l l. T{ .PP @@ -137,10 +139,10 @@ T{ .PP -c T}:T{ -Alias for \-\-connectstring\&. +Alias for --connectstring. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -151,7 +153,7 @@ T}:T{ Back up files from node with this ID T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -162,7 +164,7 @@ T}:T{ Restore from the backup with the given ID T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -173,7 +175,7 @@ T}:T{ Restore table data and logs into NDB Cluster using the NDB API T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -184,7 +186,7 @@ T}:T{ Restore metadata to NDB Cluster using the NDB API T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -192,11 +194,11 @@ T{ .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 +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 +All MySQL 5.6 based releases T} T{ .PP @@ -207,7 +209,7 @@ T}:T{ Allow attributes to be promoted when restoring data from backup T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -215,11 +217,11 @@ T{ .PP -P T}:T{ -Allow preservation of trailing spaces (including padding) when promoting - fixed\-width string types to variable\-width types +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 +All MySQL 5.6 based releases T} T{ .PP @@ -230,7 +232,7 @@ T}:T{ Do not restore objects relating to Disk Data T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -238,12 +240,12 @@ T{ .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\&. +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 +All MySQL 5.6 based releases T} T{ .PP @@ -254,7 +256,7 @@ T}:T{ Skip table structure check during restoring of data T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -265,17 +267,17 @@ T}:T{ Number of parallel transactions to use while restoring data T}:T{ .PP -All MySQL 5\&.6 based releases +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) +Print metadata, data and log to stdout (equivalent to --print_meta + --print_data --print_log) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -284,7 +286,7 @@ T}:T{ Print metadata to stdout T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -293,7 +295,7 @@ T}:T{ Print data to stdout T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -302,7 +304,7 @@ T}:T{ Print to stdout T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -311,7 +313,7 @@ T}:T{ Path to backup files directory T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -319,11 +321,11 @@ T{ .PP -f T}:T{ -Do not ignore system table during restore\&. Experimental only; not for - production use +Do not ignore system table during restore. Experimental only; not + for production use T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -331,11 +333,11 @@ T{ .PP -z T}:T{ -Nodegroup map for NDBCLUSTER storage engine\&. Syntax: list of - (source_nodegroup, destination_nodegroup) +Nodegroup map for NDBCLUSTER storage engine. Syntax: list of + (source_nodegroup, destination_nodegroup) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -344,7 +346,7 @@ T}:T{ Fields are enclosed with the indicated character T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -353,7 +355,7 @@ T}:T{ Fields are terminated by the indicated character T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -362,7 +364,7 @@ T}:T{ Fields are optionally enclosed with the indicated character T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -371,7 +373,7 @@ T}:T{ Lines are terminated by the indicated character T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -380,7 +382,7 @@ T}:T{ Print binary types in hexadecimal format T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -388,19 +390,19 @@ T{ .PP -T T}:T{ -Creates a tab\-separated \&.txt file for each table in the given path +Creates a tab-separated .txt file for each table in the given path T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --append T}:T{ -Append data to a tab\-delimited file +Append data to a tab-delimited file T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -409,17 +411,17 @@ T}:T{ Print status of restoration each given number of seconds T}:T{ .PP -All MySQL 5\&.6 based releases +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 + restored data T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -428,97 +430,110 @@ T}:T{ Level of verbosity in output T}:T{ .PP -All MySQL 5\&.6 based releases +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) +List of one or more databases to restore (excludes those not + named) T}:T{ .PP -All MySQL 5\&.6 based releases +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) +List of one or more databases to exclude (includes those not + named) T}:T{ .PP -All MySQL 5\&.6 based releases +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 +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 +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 same database - that are not not named); each table reference must include - the database name +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 +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\&. +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 +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\&. +Causes indexes from a backup to be ignored; may decrease time + needed to restore data. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --rebuild-indexes T}:T{ -Causes multi\-threaded ordered index rebuilding of indexes found in the - backup\&. +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 +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\&. +Causes missing blob tables in the backup file to be ignored. T}:T{ .PP -All MySQL 5\&.6 based releases +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\&. +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 +All MySQL 5.6 based releases T} T{ .PP @@ -527,7 +542,7 @@ T}:T{ Restores to a database with a different name than the original T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -535,25 +550,49 @@ T{ .PP -L T}:T{ -Allow lossy conversions of column values (type demotions or changes in - sign) when restoring data from backup +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 +All MySQL 5.6 based releases T} T{ .PP --restore-privilege-tables T}:T{ -Restore MySQL privilege tables that were previously moved to NDB\&. +Restore MySQL privilege tables that were previously moved to NDB. T}:T{ .PP -All MySQL 5\&.6 based releases +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 @@ -572,7 +611,7 @@ The option is used to specify a connection string which tells ndb_restore where to locate the cluster management server\&. (See -Section\ \&17.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, for information on connection strings\&.) If this option is not used, then +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 @@ -590,7 +629,7 @@ or section in config\&.ini that is not being used for a MySQL server or other application for this reason (see -Section\ \&17.3.2.7, \(lqDefining SQL and Other API Nodes in a MySQL Cluster\(rq)\&. +Section\ \&18.3.2.7, \(lqDefining SQL and Other API Nodes in a MySQL Cluster\(rq)\&. .PP You can verify that \fBndb_restore\fR @@ -713,7 +752,7 @@ column can be restored to a column of type INT or BIGINT\&. See -Section\ \&16.4.1.9.2, \(lqReplication of Columns Having Different Data Types\(rq, for a table of type conversions currently supported by attribute promotion\&. +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 @@ -756,6 +795,12 @@ 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 @@ -774,6 +819,10 @@ 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 @@ -791,9 +840,7 @@ following a successful restoration\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -801,16 +848,8 @@ T}:T{ \-\-lossy\-conversions T} T{ -\ \& -T}:T{ -\-L -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -828,7 +867,7 @@ This option is intended to complement the 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\ \&16.4.1.9.2, \(lqReplication of Columns Having Different Data Types\(rq, for information about specific type conversions currently supported by attribute demotion\&. +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\&. @@ -882,7 +921,7 @@ The 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\ \&17.5.3.2, \(lqUsing The MySQL Cluster Management Client to Create a Backup\(rq\&.) +Section\ \&18.5.3.2, \(lqUsing The MySQL Cluster Management Client to Create a Backup\(rq\&.) .if n \{\ .sp .\} @@ -910,7 +949,7 @@ having in the id column is updated if it already exists; such a row is inserted if it does not already exist\&. (See -Section\ \&17.6.9, \(lqMySQL Cluster Backups With MySQL Cluster Replication\(rq\&.) +Section\ \&18.6.9, \(lqMySQL Cluster Backups With MySQL Cluster Replication\(rq\&.) .PP .\" restore_data option (ndb_restore) \fB\-\-restore_data\fR @@ -942,7 +981,7 @@ to restore the privilege tables\&. This works only if the privilege tables were converted to NDB before the backup was taken\&. For more information, see -Section\ \&17.5.14, \(lqDistributed MySQL Privileges for MySQL Cluster\(rq\&. +Section\ \&18.5.14, \(lqDistributed MySQL Privileges for MySQL Cluster\(rq\&. .PP .\" backup_path option (ndb_restore) .\" ndb_restore: backup_path option @@ -971,7 +1010,7 @@ and 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\ \&17.2.8, \(lqUpgrading and Downgrading MySQL Cluster NDB 7.3\(rq, for more information\&. +Section\ \&18.2.8, \(lqUpgrading and Downgrading MySQL Cluster NDB 7.3\(rq, for more information\&. .if n \{\ .sp .\} @@ -1034,7 +1073,7 @@ stdout\&. TEXT and BLOB -column values are always truncated to the first 256 bytes in the output; this cannot currently be overridden when using +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 @@ -1057,18 +1096,12 @@ stdout, or to a file\&. These are similar to some of the options used with \fB\-T\fR .TS allbox tab(:); -l l s s l l s s. T{ \fBCommand\-Line Format\fR T}:T{ \-\-tab=path T} -T{ -\ \& -T}:T{ -\-T -T} .TE .sp 1 This option causes @@ -1093,8 +1126,7 @@ for the current directory\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1102,11 +1134,8 @@ T}:T{ \-\-fields\-enclosed\-by=char T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1134,8 +1163,7 @@ Each column values are enclosed by the string passed to this option (regardless .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1143,11 +1171,8 @@ T}:T{ \-\-fields\-optionally\-enclosed\-by T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1180,8 +1205,7 @@ ENUM)\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1189,11 +1213,8 @@ T}:T{ \-\-fields\-terminated\-by=char T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1246,8 +1267,7 @@ If this option is used, all binary values are output in hexadecimal format\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1255,11 +1275,8 @@ T}:T{ \-\-fields\-terminated\-by=char T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1413,7 +1430,7 @@ to their binary logs\&. This option stops \fBndb_restore\fR from restoring any MySQL Cluster Disk Data objects, such as tablespaces and log file groups; see -Section\ \&17.5.12, \(lqMySQL Cluster Disk Data Tables\(rq, for more information about these\&. +Section\ \&18.5.12, \(lqMySQL Cluster Disk Data Tables\(rq, for more information about these\&. .PP .\" ndb_restore: parallelism option .\" parallelism option (ndb_restore) @@ -1480,8 +1497,7 @@ One or more tables from a single database .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1489,11 +1505,8 @@ T}:T{ \-\-include\-databases=db\-list T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1511,8 +1524,7 @@ T} .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1520,11 +1532,8 @@ T}:T{ \-\-include\-tables=table\-list T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1637,8 +1646,7 @@ shell> \fBndb_restore [\&.\&.\&.] \-\-include\-databases=db1,db2 \-\-include\-ta .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1646,11 +1654,8 @@ T}:T{ \-\-exclude\-databases=db\-list T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1668,8 +1673,7 @@ T} .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1677,11 +1681,8 @@ T}:T{ \-\-exclude\-tables=table\-list T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -1903,6 +1904,30 @@ 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 @@ -1938,7 +1963,27 @@ You can use this option with \fBndb_restore\fR to cause multi\-threaded rebuilding of the ordered indexes while restoring a native NDB -backup\&. +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) @@ -1988,8 +2033,7 @@ backup\&. This can be used for restoring a backup made from a cluster running My .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -1997,11 +2041,8 @@ T}:T{ \-\-rewrite\-database=olddb,newdb T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -2079,6 +2120,58 @@ When restoring from multiple backup databases into a single target database usin .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 @@ -2108,7 +2201,7 @@ START SLAVE\&. This is a known issue in MySQL Cluster\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_select_all.1 b/mysql-wsrep-5.6/man/ndb_select_all.1 index 07138a76..467e8848 100644 --- a/mysql-wsrep-5.6/man/ndb_select_all.1 +++ b/mysql-wsrep-5.6/man/ndb_select_all.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SELECT_ALL\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SELECT_ALL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -40,7 +40,7 @@ prints all rows from an NDB table to stdout\&. - Usage +Usage .sp .if n \{\ .RS 4 @@ -61,7 +61,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.24.\ \&ndb_select_all Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.92.\ \& This table describes command-line options for the ndb_select_all program .TS allbox tab(:); lB lB lB. @@ -70,7 +70,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -96,7 +96,7 @@ T}:T{ Name of the database in which the table is found T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -107,7 +107,7 @@ T}:T{ Degree of parallelism T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -118,7 +118,7 @@ T}:T{ Lock type T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -129,7 +129,7 @@ T}:T{ Sort resultset according to index whose name is supplied T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -140,7 +140,7 @@ T}:T{ Sort resultset in descending order (requires order flag) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -151,7 +151,7 @@ T}:T{ Print header (set to 0|FALSE to disable headers in output) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -162,7 +162,7 @@ T}:T{ Output numbers in hexadecimal format T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -173,17 +173,17 @@ T}:T{ Set a column delimiter T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --disk T}:T{ Print disk references (useful only for Disk Data tables having - nonindexed columns) + nonindexed columns) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -192,7 +192,7 @@ T}:T{ Print rowid T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -201,7 +201,7 @@ T}:T{ Include GCI in output T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -210,7 +210,7 @@ T}:T{ Include GCI and row epoch in output T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -221,7 +221,7 @@ T}:T{ Scan in tup order T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -230,7 +230,7 @@ T}:T{ Do not print table column data T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -454,8 +454,8 @@ column providing information about the fragments in which rows are stored\&. Adds a GCI column to the output showing the global checkpoint at which each row was last updated\&. See -Section\ \&17.1, \(lqMySQL Cluster Overview\(rq, and -Section\ \&17.5.6.2, \(lqMySQL Cluster Log Events\(rq, for more information about checkpoints\&. +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 @@ -505,8 +505,7 @@ Scan the table in the order of the tuples\&. .sp Causes any table data to be omitted\&. .RE - Sample Output -.PP +Sample Output.PP Output from a MySQL SELECT statement: @@ -603,7 +602,7 @@ NDBT_ProgramExit: 0 \- OK .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_select_count.1 b/mysql-wsrep-5.6/man/ndb_select_count.1 index cd29f3a8..37fd7e42 100644 --- a/mysql-wsrep-5.6/man/ndb_select_count.1 +++ b/mysql-wsrep-5.6/man/ndb_select_count.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SELECT_COUNT\" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SELECT_COUNT\" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -40,7 +40,7 @@ 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 +Usage .sp .if n \{\ .RS 4 @@ -61,7 +61,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.25.\ \&ndb_select_count Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.93.\ \& This table describes command-line options for the ndb_select_count program .TS allbox tab(:); lB lB lB. @@ -70,7 +70,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -78,43 +78,43 @@ l l l l l l. T{ .PP -\-\-database=dbname, +--database=dbname, .PP -\-d +-d T}:T{ Name of the database in which the table is found T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-parallelism=#, +--parallelism=#, .PP -\-p +-p T}:T{ Degree of parallelism T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-lock=#, +--lock=#, .PP -\-l +-l T}:T{ Lock type T}:T{ .PP -All MySQL 5\&.6 based releases +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 +Sample Output .sp .if n \{\ .RS 4 @@ -131,7 +131,7 @@ NDBT_ProgramExit: 0 \- OK .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_setup.py.1 b/mysql-wsrep-5.6/man/ndb_setup.py.1 index 62ccebf9..773767a3 100644 --- a/mysql-wsrep-5.6/man/ndb_setup.py.1 +++ b/mysql-wsrep-5.6/man/ndb_setup.py.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SETUP\&.PY\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SETUP\&.PY\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,9 +42,8 @@ starts the MySQL Cluster Auto\-Installer and opens the installer\*(Aqs Start pag 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\ \&17.2.1, \(lqThe MySQL Cluster Auto-Installer\(rq\&. - Usage -.PP +Section\ \&18.2.1, \(lqThe MySQL Cluster Auto-Installer\(rq\&. +Usage.PP All platforms: .sp .if n \{\ @@ -79,7 +78,7 @@ The following table includes all options that are supported by the MySQL Cluster .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.26.\ \&ndb_setup\&.py Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.94.\ \& This table describes command-line options for the ndb_setup.py program .TS allbox tab(:); lB lB lB. @@ -88,7 +87,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -108,10 +107,10 @@ T{ .PP -s T}:T{ -Page that the web browser opens when starting\&. +Page that the web browser opens when starting. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -119,11 +118,11 @@ T{ .PP -a T}:T{ -File containing list of client certificates allowed to connect to the - server +File containing list of client certificates allowed to connect to + the server T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -131,11 +130,11 @@ T{ .PP -c T}:T{ -File containing X509 certificate that identifies the server\&. (Default: - cfg\&.pem) +File containing X509 certificate that identifies the server. + (Default: cfg.pem) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -143,11 +142,11 @@ T{ .PP -d T}:T{ -Python logging module debug level\&. One of DEBUG, INFO, WARNING - (default), ERROR, or CRITICAL\&. +Python logging module debug level. One of DEBUG, INFO, WARNING + (default), ERROR, or CRITICAL. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -158,7 +157,7 @@ T}:T{ Print help message T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -166,10 +165,11 @@ T{ .PP -k T}:T{ -Specify file containing private key (if not included in \-\-cert\-file) +Specify file containing private key (if not included in + --cert-file) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -180,7 +180,7 @@ T}:T{ Do not open the start page in a browser, merely start the tool T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -191,18 +191,19 @@ T}:T{ Specify the port used by the web server T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-server\-log\-file=file, +--server-log-file=file, .PP o T}:T{ -Log requests to this file\&. Use \*(Aq\-\*(Aq to force logging to stderr instead\&. +Log requests to this file. Use '-' to force logging to stderr + instead. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -213,18 +214,18 @@ T}:T{ The name of the server to connect with T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP -\-\-use\-https, +--use-https, .PP -\-S +-S T}:T{ -Use secure (HTTPS) client\-server connection +Use secure (HTTPS) client-server connection T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -244,9 +245,7 @@ T} .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -254,16 +253,8 @@ T}:T{ \-\-browser\-start\-page=filename T} T{ -\ \& -T}:T{ -\-s -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -294,9 +285,7 @@ index\&.html\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -304,16 +293,8 @@ T}:T{ \-\-ca\-certs\-file=filename T} T{ -\ \& -T}:T{ -\-a -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ file name @@ -343,9 +324,7 @@ Specify a file containing a list of client certificates which are allowed to con .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -353,16 +332,8 @@ T}:T{ \-\-cert\-file=filename T} T{ -\ \& -T}:T{ -\-c -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ file name @@ -393,9 +364,7 @@ cfg\&.pem\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s ^ lt l s ^ ^ l s @@ -407,16 +376,8 @@ T}:T{ \-\-debug\-level=level T} T{ -\ \& -T}:T{ -\-d -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ enumeration @@ -466,18 +427,12 @@ is the default\&. \fB\-h\fR .TS allbox tab(:); -l l s s l l s s. T{ \fBCommand\-Line Format\fR T}:T{ \-\-help T} -T{ -\ \& -T}:T{ -\-h -T} .TE .sp 1 Print a help message\&. @@ -498,9 +453,7 @@ Print a help message\&. .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -508,16 +461,8 @@ T}:T{ \-\-key\-file=file T} T{ -\ \& -T}:T{ -\-k -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ file name @@ -529,7 +474,7 @@ T}:T{ T} .TE .sp 1 -Specify a file containing the private key if this is not included in in the X509 certificate file (\fB\-\-cert\-file\fR)\&. The default is an empty string, which means that no such file is used\&. +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 @@ -546,18 +491,12 @@ Specify a file containing the private key if this is not included in in the X509 \fB\-n\fR .TS allbox tab(:); -l l s s l l s s. T{ \fBCommand\-Line Format\fR T}:T{ \-\-no\-browser T} -T{ -\ \& -T}:T{ -\-n -T} .TE .sp 1 Start the installation and configuration tool, but do not open the Start page in a browser\&. @@ -578,8 +517,7 @@ Start the installation and configuration tool, but do not open the Start page in .TS allbox tab(:); l l s s -l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -589,16 +527,8 @@ T}:T{ \-\-port=# T} T{ -\ \& -T}:T{ -\-p -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -609,9 +539,14 @@ T}:T{ 8081 T} :T{ -\fBRange\fR +\fBMin Value\fR T}:T{ -1 \&.\&. 65535 +1 +T} +:T{ +\fBMax Value\fR +T}:T{ +65535 T} .TE .sp 1 @@ -634,8 +569,7 @@ Set the port used by the web server\&. The default is 8081\&. allbox tab(:); l l s s l l s s -l l s s -^ l l s +l l l s ^ l l s ^ lt l s. T{ @@ -649,11 +583,8 @@ T}:T{ o T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ file name @@ -692,9 +623,7 @@ stderr, rather than to a file, use a .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -702,16 +631,8 @@ T}:T{ \-\-server\-name=name T} T{ -\ \& -T}:T{ -\-N -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -741,18 +662,12 @@ localhost\&. \fB\-S\fR .TS allbox tab(:); -l l s s l l s s. T{ \fBCommand\-Line Format\fR T}:T{ \-\-use\-https T} -T{ -\ \& -T}:T{ -\-S -T} .TE .sp 1 Make the browser use a secure (HTTPS) connection with the server\&. @@ -760,7 +675,7 @@ Make the browser use a secure (HTTPS) connection with the server\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_show_tables.1 b/mysql-wsrep-5.6/man/ndb_show_tables.1 index e99b7337..d84124d4 100644 --- a/mysql-wsrep-5.6/man/ndb_show_tables.1 +++ b/mysql-wsrep-5.6/man/ndb_show_tables.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SHOW_TABLES\F" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SHOW_TABLES\F" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -52,7 +52,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.27.\ \&ndb_show_tables Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.95.\ \& This table describes command-line options for the ndb_show_tables program .TS allbox tab(:); lB lB lB. @@ -61,7 +61,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -79,7 +79,7 @@ T}:T{ Specifies the database in which the table is found T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -90,7 +90,7 @@ T}:T{ Number of times to repeat output T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -101,7 +101,7 @@ T}:T{ Limit output to objects of this type T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -112,7 +112,7 @@ T}:T{ Do not qualify table names T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -123,7 +123,7 @@ T}:T{ Return output suitable for MySQL LOAD DATA INFILE statement T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -132,11 +132,11 @@ T}:T{ Show table temporary flag T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 - Usage +Usage .sp .if n \{\ .RS 4 @@ -307,7 +307,7 @@ API applications such as .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_size.pl.1 b/mysql-wsrep-5.6/man/ndb_size.pl.1 index e33fb2fe..149f3d3a 100644 --- a/mysql-wsrep-5.6/man/ndb_size.pl.1 +++ b/mysql-wsrep-5.6/man/ndb_size.pl.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_SIZE\&.PL\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_SIZE\&.PL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -38,7 +38,7 @@ ndb_size.pl \- NDBCLUSTER Size Requirement Estimator 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 +Requirements .sp .RS 4 .ie n \{\ @@ -102,7 +102,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.28.\ \&ndb_size\&.pl Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.96.\ \& This table describes command-line options for the ndb_size.pl program .TS allbox tab(:); lB lB lB. @@ -111,7 +111,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -129,11 +129,11 @@ 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) +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 +All MySQL 5.6 based releases T} T{ .PP @@ -142,7 +142,7 @@ T}:T{ Specify host and optional port as host[:port] T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -151,7 +151,7 @@ T}:T{ Specify a socket to connect to T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -160,7 +160,7 @@ T}:T{ Specify a MySQL user name T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -169,7 +169,7 @@ T}:T{ Specify a MySQL user password T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -178,25 +178,25 @@ T}:T{ Set output format (text or HTML) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --excludetables=tbl_list T}:T{ -Skip any tables in a comma\-separated list of tables +Skip any tables in a comma-separated list of tables T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --excludedbs=db_list T}:T{ -Skip any databases in a comma\-separated list of databases +Skip any databases in a comma-separated list of databases T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -205,17 +205,17 @@ T}:T{ Saves all queries to the database into the file specified T}:T{ .PP -All MySQL 5\&.6 based releases +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 + database T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -224,11 +224,11 @@ T}:T{ Designates a table to handle unique index size calculations T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 - Usage +Usage .sp .if n \{\ .RS 4 @@ -397,7 +397,7 @@ required per table and table row\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndb_waiter.1 b/mysql-wsrep-5.6/man/ndb_waiter.1 index 953b487c..8c7c83e5 100644 --- a/mysql-wsrep-5.6/man/ndb_waiter.1 +++ b/mysql-wsrep-5.6/man/ndb_waiter.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDB_WAITER\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDB_WAITER\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -142,7 +142,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.29.\ \&ndb_waiter Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.97.\ \& This table describes command-line options for the ndb_waiter program .TS allbox tab(:); lB lB lB. @@ -151,7 +151,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -169,7 +169,7 @@ T}:T{ Wait for cluster to reach NO CONTACT state T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -178,7 +178,7 @@ T}:T{ Wait for cluster to reach NOT STARTED state T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -187,7 +187,7 @@ T}:T{ Wait for cluster to enter single user mode T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -195,20 +195,20 @@ T{ .PP -t T}:T{ -Wait this many seconds, then exit whether or not cluster has reached - desired state; default is 2 minutes (120 seconds) +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 +All MySQL 5.6 based releases T} T{ .PP --nowait-nodes=list T}:T{ -List of nodes not to be waited for\&. +List of nodes not to be waited for. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -216,14 +216,14 @@ T{ .PP -w T}:T{ -List of nodes to be waited for\&. +List of nodes to be waited for. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 - Usage +Usage .sp .if n \{\ .RS 4 @@ -234,7 +234,7 @@ ndb_waiter [\-c \fIconnect_string\fR] .if n \{\ .RE .\} - Additional Options +Additional Options .sp .RS 4 .ie n \{\ @@ -481,7 +481,7 @@ Connecting to mgmsrv at (null)\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndbd.8 b/mysql-wsrep-5.6/man/ndbd.8 index fe62a840..449f7b0d 100644 --- a/mysql-wsrep-5.6/man/ndbd.8 +++ b/mysql-wsrep-5.6/man/ndbd.8 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBD\FR" "8" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBD\FR" "8" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -59,7 +59,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.10.\ \&ndbd Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.78.\ \& This table describes command-line options for the ndbd program .TS allbox tab(:); lB lB lB. @@ -68,7 +68,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -87,11 +87,11 @@ T{ .PP --initial T}:T{ -Perform initial start of ndbd, including cleaning the file system\&. - Consult the documentation before using this option +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 +All MySQL 5.6 based releases T} T{ .PP @@ -99,11 +99,11 @@ T{ .PP -n T}:T{ -Don\*(Aqt start ndbd immediately; ndbd waits for command to start from - ndb_mgmd +Don't start ndbd immediately; ndbd waits for command to start + from ndb_mgmd T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -111,10 +111,10 @@ T{ .PP -d T}:T{ -Start ndbd as daemon (default); override with \-\-nodaemon +Start ndbd as daemon (default); override with --nodaemon T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -123,36 +123,36 @@ T}:T{ Do not start ndbd as daemon; provided for testing purposes T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP --foreground T}:T{ Run ndbd in foreground, provided for debugging purposes (implies - \-\-nodaemon) + --nodaemon) T}:T{ .PP -All MySQL 5\&.6 based releases +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\&. +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 +All MySQL 5.6 based releases T} T{ .PP --initial-start T}:T{ -Perform partial initial start (requires \-\-nowait\-nodes) +Perform partial initial start (requires --nowait-nodes) T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -161,46 +161,47 @@ T}:T{ Local bind address T}:T{ .PP -All MySQL 5\&.6 based releases +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\&. +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 +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\&. +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 +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 +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 +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 +Time to wait between attempts to contact a management server, in + seconds T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -237,8 +238,7 @@ wherever the latter occurs in this section\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -246,11 +246,8 @@ T}:T{ \-\-bind\-address=name T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -279,9 +276,7 @@ to bind to a specific network interface (host name or IP address)\&. This option .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -289,16 +284,8 @@ T}:T{ \-\-daemon T} T{ -\ \& -T}:T{ -\-d -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -337,8 +324,7 @@ on Windows platforms\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -346,11 +332,8 @@ T}:T{ \-\-nodaemon T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -389,8 +372,7 @@ on Windows is to run in the foreground, making this option unnecessary on Window .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -398,11 +380,8 @@ T}:T{ \-\-foreground T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -443,8 +422,7 @@ on Windows platforms\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -452,11 +430,8 @@ T}:T{ \-\-initial T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -556,7 +531,7 @@ Backup files that have already been created by the affected node .IP \(bu 2.3 .\} MySQL Cluster Disk Data files (see -Section\ \&17.5.12, \(lqMySQL Cluster Disk Data Tables\(rq)\&. +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\&. @@ -581,8 +556,7 @@ necessary to do so\&. .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -590,11 +564,8 @@ T}:T{ \-\-initial\-start T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -660,8 +631,7 @@ option for .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -669,11 +639,8 @@ T}:T{ \-\-nowait\-nodes=list T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ string @@ -718,9 +685,7 @@ If you wanted to start up the same cluster as in the previous example without on .TS allbox tab(:); l l s s -l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -728,16 +693,8 @@ T}:T{ \-\-nostart T} T{ -\ \& -T}:T{ -\-n -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -756,7 +713,7 @@ not to start automatically\&. When this option is used, 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\ \&17.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq)\&. +Section\ \&18.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq)\&. .RE .sp .RS 4 @@ -774,7 +731,7 @@ Section\ \&17.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq)\&. allbox tab(:); l l s s l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -782,11 +739,13 @@ T}:T{ \-\-install[=name] T} T{ -\ \& +\fBPlatform Specific\fR T}:T{ -\fBPermitted Values\fR +Windows T} -:T{ +T{ +\fBPermitted Values\fR +T}:T{ \fBType\fR T}:T{ string @@ -842,7 +801,7 @@ option has no effect on non\-Windows platforms\&. allbox tab(:); l l s s l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -850,11 +809,13 @@ T}:T{ \-\-remove[=name] T} T{ -\ \& +\fBPlatform Specific\fR T}:T{ -\fBPermitted Values\fR +Windows T} -:T{ +T{ +\fBPermitted Values\fR +T}:T{ \fBType\fR T}:T{ string @@ -890,7 +851,7 @@ option has no effect on non\-Windows platforms\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -900,11 +861,8 @@ T}:T{ \-\-connect\-retries=# T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -915,9 +873,14 @@ T}:T{ 12 T} :T{ -\fBRange\fR +\fBMin Value\fR T}:T{ -\-1 \&.\&. 65535 +\-1 +T} +:T{ +\fBMax Value\fR +T}:T{ +65535 T} .TE .sp 1 @@ -940,7 +903,7 @@ option\&. .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -950,11 +913,8 @@ T}:T{ \-\-connect\-delay=# T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -965,9 +925,14 @@ T}:T{ 5 T} :T{ -\fBRange\fR +\fBMin Value\fR T}:T{ -0 \&.\&. 3600 +0 +T} +:T{ +\fBMax Value\fR +T}:T{ +3600 T} .TE .sp 1 @@ -1149,9 +1114,10 @@ shell> \fBndbd \-\-connect\-string="nodeid=2;host=ndb_mgmd\&.mysql\&.com:1186"\f .\} .PP See -Section\ \&17.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, for additional information about this issue\&. -\fBndbd\fR(8), describes other options for -\fBndbd\fR\&. +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 @@ -1175,11 +1141,11 @@ process can consume up to 2 CPUs if permitted to do so\&. 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\ \&17.1.6, \(lqKnown Limitations of MySQL Cluster\(rq\&. +Section\ \&18.1.6, \(lqKnown Limitations of MySQL Cluster\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 b/mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 index 1c81fd5b..fec5339d 100644 --- a/mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 +++ b/mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBD_REDO_LOG_REA" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBD_REDO_LOG_REA" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -55,7 +55,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.22.\ \&ndbd_redo_log_reader Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.90.\ \& This table describes command-line options for the ndbd_redo_log_reader program .TS allbox tab(:); lB lB lB. @@ -64,7 +64,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -77,7 +77,7 @@ T}:T{ Do not print records T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -86,7 +86,7 @@ T}:T{ Do not check records for errors T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -95,11 +95,11 @@ T}:T{ Print usage information T}:T{ .PP -ADDED: NDB 7\&.3\&.4 +ADDED: NDB 7.3.4 T} .TE .sp 1 - Usage +Usage .sp .if n \{\ .RS 4 @@ -116,7 +116,7 @@ is the name of a cluster redo log file\&. redo log files are located in the numb 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 FileSystemDir Files\fR\m[]\&\s-2\u[1]\d\s+2\&. +\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 @@ -131,8 +131,7 @@ The name of the file to be read may be followed by one or more of the options li .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -140,11 +139,8 @@ T}:T{ \-noprint T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -170,8 +166,7 @@ T} .TS allbox tab(:); l l s s -l l s s -^ l l s +l l l s ^ l l s. T{ \fBCommand\-Line Format\fR @@ -179,11 +174,8 @@ T}:T{ \-nocheck T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ boolean @@ -213,7 +205,7 @@ l l s s. T{ \fBIntroduced\fR T}:T{ -5\&.6\&.14\-ndb\-7\&.3\&.4 +5\&.6\&.15\-ndb\-7\&.3\&.4 T} T{ \fBCommand\-Line Format\fR @@ -239,7 +231,7 @@ must be run on a cluster data node, since it accesses the data node file system .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 @@ -249,7 +241,7 @@ You should have received a copy of the GNU General Public License along with the .sp .SH "NOTES" .IP " 1." 4 -MySQL Cluster Data Node FileSystemDir Files +MySQL Cluster Data Node File System Directory Files .RS 4 \%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html .RE diff --git a/mysql-wsrep-5.6/man/ndbinfo_select_all.1 b/mysql-wsrep-5.6/man/ndbinfo_select_all.1 index 8f99a468..0736aa7d 100644 --- a/mysql-wsrep-5.6/man/ndbinfo_select_all.1 +++ b/mysql-wsrep-5.6/man/ndbinfo_select_all.1 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBINFO_SELECT_AL" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBINFO_SELECT_AL" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -120,7 +120,7 @@ Options Common to MySQL Cluster Programs(1)\&. .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.11.\ \&ndbinfo_select_all Options and Variables: MySQL Cluster NDB 7.3 +.B Table\ \&18.79.\ \& This table describes command-line options for the ndbinfo_select_all program .TS allbox tab(:); lB lB lB. @@ -129,7 +129,7 @@ Format T}:T{ Description T}:T{ -Added / Removed +Added or Removed T} .T& l l l @@ -140,10 +140,10 @@ T{ .PP --delay=# T}:T{ -Set the delay in seconds between loops\&. Default is 5\&. +Set the delay in seconds between loops. Default is 5. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -151,10 +151,10 @@ T{ .PP -l T}:T{ -Set the number of times to perform the select\&. Default is 1\&. +Set the number of times to perform the select. Default is 1. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -162,10 +162,10 @@ T{ .PP -d T}:T{ -Name of the database where the table located\&. +Name of the database where the table located. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} T{ .PP @@ -173,10 +173,10 @@ T{ .PP -p T}:T{ -Set the degree of parallelism\&. +Set the degree of parallelism. T}:T{ .PP -All MySQL 5\&.6 based releases +All MySQL 5.6 based releases T} .TE .sp 1 @@ -194,7 +194,7 @@ T} .TS allbox tab(:); l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -204,11 +204,8 @@ T}:T{ \-\-delay=# T} T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -219,9 +216,14 @@ T}:T{ 5 T} :T{ -\fBRange\fR +\fBMin Value\fR T}:T{ -0 \&.\&. MAX_INT +0 +T} +:T{ +\fBMax Value\fR +T}:T{ +MAX_INT T} .TE .sp 1 @@ -245,8 +247,7 @@ is set to 0 or 1\&. .TS allbox tab(:); l l s s -l l s s -l l s s +l l l s ^ l l s ^ l l s ^ l l s. @@ -256,16 +257,8 @@ T}:T{ \-\-loops=# T} T{ -\ \& -T}:T{ -\-l -T} -T{ -\ \& -T}:T{ \fBPermitted Values\fR -T} -:T{ +T}:T{ \fBType\fR T}:T{ numeric @@ -276,9 +269,14 @@ T}:T{ 1 T} :T{ -\fBRange\fR +\fBMin Value\fR +T}:T{ +0 +T} +:T{ +\fBMax Value\fR T}:T{ -0 \&.\&. MAX_INT +MAX_INT T} .TE .sp 1 @@ -289,7 +287,7 @@ to set the time between loops\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/ndbmtd.8 b/mysql-wsrep-5.6/man/ndbmtd.8 index 3fd96d0c..b884308a 100644 --- a/mysql-wsrep-5.6/man/ndbmtd.8 +++ b/mysql-wsrep-5.6/man/ndbmtd.8 @@ -2,12 +2,12 @@ .\" 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/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBNDBMTD\FR" "8" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBNDBMTD\FR" "8" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -59,7 +59,7 @@ Command\-line options and configuration parameters used with also apply to \fBndbmtd\fR\&. For more information about these options and parameters, see \fBndbd\fR(8), and -Section\ \&17.3.2.6, \(lqDefining MySQL Cluster Data Nodes\(rq, respectively\&. +Section\ \&18.3.2.6, \(lqDefining MySQL Cluster Data Nodes\(rq, respectively\&. .PP \fBndbmtd\fR is also file system\-compatible with @@ -203,7 +203,7 @@ concurrently on different data nodes in the same MySQL Cluster\&. However, such .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/perror.1 b/mysql-wsrep-5.6/man/perror.1 index f04bcd2f..c6551e03 100644 --- a/mysql-wsrep-5.6/man/perror.1 +++ b/mysql-wsrep-5.6/man/perror.1 @@ -2,12 +2,12 @@ .\" Title: \fBperror\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBPERROR\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBPERROR\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -190,7 +190,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/replace.1 b/mysql-wsrep-5.6/man/replace.1 index 123a0032..cbb77293 100644 --- a/mysql-wsrep-5.6/man/replace.1 +++ b/mysql-wsrep-5.6/man/replace.1 @@ -2,12 +2,12 @@ .\" Title: \fBreplace\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBREPLACE\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBREPLACE\FR" "1" "01/16/2015" "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, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/resolve_stack_dump.1 b/mysql-wsrep-5.6/man/resolve_stack_dump.1 index 86e1a707..b0c0ad9e 100644 --- a/mysql-wsrep-5.6/man/resolve_stack_dump.1 +++ b/mysql-wsrep-5.6/man/resolve_stack_dump.1 @@ -2,12 +2,12 @@ .\" Title: \fBresolve_stack_dump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBRESOLVE_STACK_DUM" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBRESOLVE_STACK_DUM" "1" "01/16/2015" "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\ \&23.4.1.5, \(lqUsing a Stack Trace\(rq\&. +Section\ \&24.4.1.5, \(lqUsing a Stack Trace\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/man/resolveip.1 b/mysql-wsrep-5.6/man/resolveip.1 index e0ab41d5..4efad013 100644 --- a/mysql-wsrep-5.6/man/resolveip.1 +++ b/mysql-wsrep-5.6/man/resolveip.1 @@ -2,12 +2,12 @@ .\" Title: \fBresolveip\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/14/2014 +.\" Date: 01/16/2015 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBRESOLVEIP\FR" "1" "01/14/2014" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBRESOLVEIP\FR" "1" "01/16/2015" "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, 2014, Oracle and/or its affiliates. All rights reserved. +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 diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.daily b/mysql-wsrep-5.6/mysql-test/collections/default.daily index c72727bf..67c4c293 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.daily +++ b/mysql-wsrep-5.6/mysql-test/collections/default.daily @@ -19,6 +19,10 @@ perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experime # Additional modes for rpl. Multi-Threaded Slave perl mysql-test-run.pl --timer --debug-server --force --parallel=auto --comment=rpl_MTS-debug --vardir=var-mts-rpl-debug --experimental=collections/default.experimental --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl +# Additional GTID coverage (rpl suite with gtid_mode=ON) +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=rpl_gtid-debug --vardir=var-rpl_gtid-debug --suite=rpl --mysqld=--enforce-gtid-consistency --mysqld=--log-slave-updates --mysqld=--gtid-mode=on --skip-test-list=collections/disabled-gtid-on.list + + # Additional GTID coverage (binlog suite with gtid_mode=ON) perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=binlog_gtid-debug --vardir=var-binlog_gtid-debug --suite=binlog --mysqld=--binlog-checksum=CRC32 --mysqld=--enforce-gtid-consistency --mysqld=--log-slave-updates --mysqld=--gtid-mode=on --skip-test-list=collections/disabled-gtid-on.list diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.experimental b/mysql-wsrep-5.6/mysql-test/collections/default.experimental index cf4b0132..25194282 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.experimental +++ b/mysql-wsrep-5.6/mysql-test/collections/default.experimental @@ -14,7 +14,6 @@ main.index_merge_innodb # BUG#11754168 2012-05-08 jorgen Doing parts.partition_debug_innodb # Bug#14150368 2013-03-07 anitha Failing very frequently on PB2 rpl.rpl_delayed_slave # BUG#11764654 rpl_delayed_slave fails sporadically in pb -rpl.rpl_innodb_bug28430 # Bug#11754425 rpl.rpl_show_slave_running # BUG#12346048 2011-04-11 sven fails sporadically on pb2 rpl.rpl_spec_variables @solaris # Bug #17337114 2013-08-20 Luis Soares failing on pb2 with timeout for 'CHECK WARNINGS' rpl.rpl_gtid_logs_without_rotate_or_stop_event @windows # Bug#16207800 2013-02-09 anitha Fails very frequently on windows @@ -28,4 +27,3 @@ innodb.innodb_bug14676111 # bug#17026780 2013-07-08 anitha Or # normal developer builds. # Internal tests should *not* be listed in the public default.experimental! -i_innodb.innodb_bug14712710 bug#14765080 has been assigned to Thayu diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.push b/mysql-wsrep-5.6/mysql-test/collections/default.push index 62002ce5..872b97fc 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.push +++ b/mysql-wsrep-5.6/mysql-test/collections/default.push @@ -1,5 +1,5 @@ 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=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 --debug-server --force --parallel=auto --comment=main_embedded-debug --vardir=var-main_emebbed --suite=main --embedded --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 perl mysql-test-run.pl --timer --debug-server --force --parallel=auto --comment=rpl_binlog_n_mix_MTS-debug --vardir=var-mts-rpl-binlog-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl --skip-test-list=collections/disabled-per-push.list diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.release.done b/mysql-wsrep-5.6/mysql-test/collections/default.release.done index a27b3bf8..3d1016bb 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.release.done +++ b/mysql-wsrep-5.6/mysql-test/collections/default.release.done @@ -1 +1 @@ -/export/home/pb2/build/sb_0-11248614-1389713532.93/mysql-5.6.16-release-export-6194787_gpl/mysql-test/collections/default.release.in +/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/mysql-test/collections/default.release.in diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.weekly b/mysql-wsrep-5.6/mysql-test/collections/default.weekly index 35df86b8..2ea6dc0c 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.weekly +++ b/mysql-wsrep-5.6/mysql-test/collections/default.weekly @@ -47,6 +47,8 @@ perl mysql-test-run.pl --timer --force --debug-server --comment=memcached-debug # Non debug runs of default suites in normal modes perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal-non-debug --vardir=var-normal-non-debug --report-features --skip-test-list=collections/disabled-weekly.list +# Additional GTID coverage (rpl suite with gtid_mode=ON) +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=rpl_gtid-debug --vardir=var-rpl_gtid-debug --suite=rpl --mysqld=--enforce-gtid-consistency --mysqld=--log-slave-updates --mysqld=--gtid-mode=on --skip-test-list=collections/disabled-gtid-on.list --big-test --testcase-timeout=60 --suite-timeout=360 # Multi-Thread Slave diff --git a/mysql-wsrep-5.6/mysql-test/collections/disabled-gtid-on.list b/mysql-wsrep-5.6/mysql-test/collections/disabled-gtid-on.list index 9c994efb..828191fa 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/disabled-gtid-on.list +++ b/mysql-wsrep-5.6/mysql-test/collections/disabled-gtid-on.list @@ -3,3 +3,4 @@ binlog.binlog_variables_relay_log : No need to test. Binary log off binlog.binlog_base64_flag : No need to test. Binary log off. binlog.binlog_hexdump : No need to test. Binary log off. binlog.binlog_old_versions : No need to test. Binary log off. +rpl.rpl_server_uuid : No need to test. Non-transactional tables involved. diff --git a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_fill.inc b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_fill.inc new file mode 100644 index 00000000..44a7f5f7 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_fill.inc @@ -0,0 +1,53 @@ +# ==== Purpose ==== +# +# Add [position|datetime] data to mysqlbinlog. To generate a binary log with +# a few deterministic,increasing timestamps. +# +# ==== Implementation ==== + +# We need to set fixed timestamps in this test. +# Use a date in the future to keep a growing timestamp along the +# binlog (including the Start_log_event). This test will work +# unchanged everywhere, because mysql-test-run has fixed TZ, which it +# exports (so mysqlbinlog has same fixed TZ). +# +# ===== Assumption ======== +# As this is a generic file and be used by other test, So we have made an +# assumption that a table is already created with defination like +# CREATE TABLE t1 (a INT); +# + +# Binlog 1: +# One transaction with timestamp 2031-01-01 12:00:00 +--let $datetime_1= 2031-01-01 12:00:00 +eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_1"); +INSERT INTO t1 VALUES(1); +--let $pos_1= query_get_value(SHOW MASTER STATUS, Position, 1) + +# One transaction with timestamp 2032-01-01 12:00:00 +--let $datetime_2= 2032-01-01 12:00:00 +eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_2"); +INSERT INTO t1 VALUES(2); +--let $pos_2= query_get_value(SHOW MASTER STATUS, Position, 1) + +# One transaction with timestamp 2033-01-01 12:00:00 +eval SET TIMESTAMP= UNIX_TIMESTAMP("2033-01-01 12:00:00"); +INSERT INTO t1 VALUES(3); + +--let $file_1= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; + +#Binlog 2: +# One transaction with timestamp 2034-01-01 12:00:00 +SET TIMESTAMP= UNIX_TIMESTAMP("2034-01-01 12:00:00"); +INSERT INTO t1 VALUES(4); +--let $pos_3= query_get_value(SHOW MASTER STATUS, Position, 1) + +# One transaction with timestamp 2035-01-01 12:00:00 +--let $datetime_3= 2035-01-01 12:00:00 +eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_3"); +INSERT INTO t1 VALUES(5); + +--let $file_2= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; + diff --git a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_start_stop.inc b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_start_stop.inc index c0b13f53..982175ed 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_start_stop.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_start_stop.inc @@ -11,36 +11,7 @@ CREATE TABLE t1 (a INT); RESET MASTER; -# We need to set fixed timestamps in this test. -# Use a date in the future to keep a growing timestamp along the -# binlog (including the Start_log_event). This test will work -# unchanged everywhere, because mysql-test-run has fixed TZ, which it -# exports (so mysqlbinlog has same fixed TZ). ---let $datetime_1= 2031-01-01 12:00:00 -eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_1"); -INSERT INTO t1 VALUES(1); ---let $pos_1= query_get_value(SHOW MASTER STATUS, Position, 1) - ---let $datetime_2= 2032-01-01 12:00:00 -eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_2"); -INSERT INTO t1 VALUES(2); ---let $pos_2= query_get_value(SHOW MASTER STATUS, Position, 1) - -eval SET TIMESTAMP= UNIX_TIMESTAMP("2033-01-01 12:00:00"); -INSERT INTO t1 VALUES(3); - ---let $file_1= query_get_value(SHOW MASTER STATUS, File, 1) -FLUSH LOGS; - -SET TIMESTAMP= UNIX_TIMESTAMP("2034-01-01 12:00:00"); -INSERT INTO t1 VALUES(4); ---let $pos_3= query_get_value(SHOW MASTER STATUS, Position, 1) ---let $datetime_3= 2035-01-01 12:00:00 -eval SET TIMESTAMP= UNIX_TIMESTAMP("$datetime_3"); -INSERT INTO t1 VALUES(5); - ---let $file_2= query_get_value(SHOW MASTER STATUS, File, 1) -FLUSH LOGS; +--source extra/binlog_tests/binlog_mysqlbinlog_fill.inc --let $MYSQLD_DATADIR= `select @@datadir` @@ -80,12 +51,14 @@ FLUSH LOGS; --let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1 $file_2 --source extra/binlog_tests/mysqlbinlog_start_stop_1.inc + # ==== to-last-log ==== --let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1 ---let $option= --to-last-log +--let $options= --to-last-log --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc + --echo --echo ==== clean up ==== DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_1.inc b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_1.inc index 42748df5..7b1ca145 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_1.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_1.inc @@ -27,26 +27,26 @@ # $extra_options # Options for mysqlbinlog, specifying which input file to read. ---let $option= --base64-output=never +--let $options= --base64-output=never --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc ---let $option= --offset=2 +--let $options= --offset=2 --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc ---let $option= --start-position=$start_position +--let $options= --start-position=$start_position --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc ---let $option= --stop-position=$stop_position +--let $options= --stop-position=$stop_position --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc ---let $option= --start-position=$start_position --stop-position=$stop_position +--let $options= --start-position=$start_position --stop-position=$stop_position --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc ---let $option= "--start-datetime=$start_datetime" +--let $options= "--start-datetime=$start_datetime" --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc ---let $option= "--stop-datetime=$stop_datetime" +--let $options= "--stop-datetime=$stop_datetime" --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc ---let $option= "--start-datetime=$start_datetime" "--stop-datetime=$stop_datetime" +--let $options= "--start-datetime=$start_datetime" "--stop-datetime=$stop_datetime" --source extra/binlog_tests/mysqlbinlog_start_stop_2.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_2.inc b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_2.inc index 103f33d0..108cefec 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_2.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/mysqlbinlog_start_stop_2.inc @@ -20,15 +20,24 @@ # Pretty-print $option_text ---let $option_text= `SELECT SUBSTR(REPLACE('$option', '"', ''), 3)` -while (`SELECT LOCATE('=', '$option_text')`) +--let $option_text= `SELECT REPLACE('$options', '"', '')` +--let $eq_pos= `SELECT LOCATE('=', '$option_text')` +while ($eq_pos != 0) { - --let $dash_pos= `SELECT LOCATE('--', '$option_text')` - --let $option_text= `SELECT CONCAT(SUBSTR('$option_text', 1, LOCATE('=', '$option_text') - 1), IF($dash_pos, CONCAT(' ', SUBSTR('$option_text', $dash_pos + 2)), ''))` + --let $dash_pos= `SELECT LOCATE('--', '$option_text', $eq_pos)` + --let $left_part= `SELECT SUBSTR('$option_text', 1, $eq_pos - 1)` + --let $right_part= + if ($dash_pos != 0) { + --let $right_part= `SELECT CONCAT(' ', SUBSTR('$option_text', $dash_pos + 2))` + } + --let $option_text= $left_part$right_part + --let $eq_pos= `SELECT LOCATE('=', '$option_text')` } +--let $option_text= `SELECT REPLACE('$option_text', '--', '')` + --echo --echo ---- $option_text ---- # Print output --replace_regex /SET @@SESSION.GTID_NEXT= '.*'/SET @@SESSION.GTID_NEXT= 'GTID'/ /([0-9A-Fa-f\-]{36})\:[0-9]+\-[0-9]+/UUID:#-#/ ---exec $MYSQL_BINLOG --short-form $option $extra_options +--exec $MYSQL_BINLOG --short-form $options $extra_options diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/grep_pattern.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/grep_pattern.inc new file mode 100644 index 00000000..a51b57b8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/grep_pattern.inc @@ -0,0 +1,22 @@ +# Please set GREP_FILE and GREP_PATTERN environment variables +# to work this file properly. +--perl + use strict; + my $file= $ENV{'GREP_FILE'} or die "grep file not set"; + my $pattern= $ENV{'GREP_PATTERN'} or die "pattern is not set"; + open(FILE, "$file") or die("Unable to open $file: $!\n"); + my $count = 0; + print "Matching lines are:\n"; + while (<FILE>) { + my $line = $_; + if ($line =~ /$pattern/) { + print "$line\n"; + $count++; + } + } + if ($count == 0) { + print "None\n"; + } + print "Occurrences of the $pattern in the input file : $count\n"; + close(FILE); +EOF diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment.test index a7e8af22..ff68e306 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment.test @@ -8,7 +8,7 @@ eval create table t1 (a int not null auto_increment,b int, primary key (a)) engi insert into t1 values (NULL,1),(NULL,2),(NULL,3); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; drop table t1; @@ -19,7 +19,7 @@ delete from t1 where b=4; insert into t1 values (NULL,5),(NULL,6); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; @@ -38,7 +38,7 @@ set @@insert_id=400; insert into t1 values(NULL),(NULL); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; drop table t1; @@ -56,7 +56,7 @@ set @@insert_id=400; insert into t1 values(NULL),(NULL); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; drop table t1; @@ -74,7 +74,7 @@ set @@insert_id=600; insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; drop table t1; @@ -86,7 +86,7 @@ set @@session.auto_increment_increment=10, @@session.auto_increment_offset=1; eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc insert into t1 values(2),(12),(22),(32),(42); connection master; @@ -94,7 +94,7 @@ insert into t1 values (NULL),(NULL); insert into t1 values (3),(NULL),(NULL); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; # Test for BUG#20524 "auto_increment_* not observed when inserting @@ -129,7 +129,7 @@ set auto_increment_increment=1000; set auto_increment_offset=700; insert into t3 values(null); select * from t3 order by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 order by a; select * from t2 order by a; select * from t3 order by a; @@ -137,7 +137,7 @@ select * from t3 order by a; connection master; drop table t1,t2,t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables @@ -149,7 +149,7 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb INSERT INTO t1 VALUES (NULL), (NULL), (NULL); show create table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc show create table t1; connection master; @@ -200,7 +200,7 @@ SELECT * FROM t2; INSERT INTO t1 VALUES(4); INSERT INTO t2 VALUES(4); FLUSH LOGS; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; @@ -211,7 +211,7 @@ source include/diff_tables.inc; connection master; DROP TABLE t1; DROP TABLE t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; let $MYSQLD_DATADIR= `SELECT @@DATADIR`; @@ -230,7 +230,7 @@ connection slave; source include/start_slave.inc; connection master; --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved | $MYSQL test -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; @@ -243,7 +243,7 @@ source include/diff_tables.inc; DROP TABLE t1; DROP TABLE t2; SET SQL_MODE=''; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#56662 @@ -263,12 +263,12 @@ INSERT INTO t1(id,data) VALUES(0,2); SET SQL_MODE=0; COMMIT; SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # WL#5872 "avoid using global heap memory to remember autoincrement @@ -277,12 +277,12 @@ sync_slave_with_master; connection master; eval create table t1(a int auto_increment primary key) engine=$engine_type; insert into t1 values (null),(null),(1025),(null); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; let $diff_tables= master:t1, slave:t1; --source include/diff_tables.inc connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test index 30b25955..a6684959 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test @@ -26,7 +26,7 @@ connection master; INSERT INTO v16(c1) VALUES (23), (24); INSERT INTO v16(c1) VALUES (25), (26); commit; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo #Test if the results are consistent on master and slave --echo #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS' let $diff_tables= master:t3, slave:t3; @@ -37,7 +37,7 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; DROP VIEW v16; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test index f93d4353..1f166368 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test @@ -57,7 +57,7 @@ source include/show_binlog_events.inc; commit; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo #Test if the results are consistent on master and slave --echo #for 'INVOKES A TRIGGER with $trigger_action action' let $diff_tables= master:t2, slave:t2; @@ -75,5 +75,5 @@ DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; DROP FUNCTION f1_insert_triggered; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test index d7c26ea4..41900b9c 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test @@ -38,7 +38,7 @@ source include/show_binlog_events.inc; commit; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo #Test if the results are consistent on master and slave --echo #for 'CALLS A FUNCTION which INVOKES A TRIGGER with $insert_action action' let $diff_tables= master:t2, slave:t2; @@ -51,5 +51,5 @@ drop table t1; drop table t2; drop table t3; drop function f1_two_inserts_trigger; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc new file mode 100644 index 00000000..2ee30462 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc @@ -0,0 +1,483 @@ +# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error +# when generating new name. +# +# WHY +# === +# +# We want to check whether error is reported or not when +# new_file_impl fails (this may happen when rotation is not +# possible because there is some problem finding an +# unique filename). +# +# HOW +# === +# +# Test cases are documented inline. +# +# The size of the data is tuned to match file sizes and rotations, so +# it is only executed in statement-based replication. + +-- source include/have_innodb.inc +-- source include/have_debug.inc +-- source include/master-slave.inc +-- source include/have_binlog_format_statement.inc + +-- echo ####################################################################### +-- echo ####################### PART 1: MASTER TESTS ########################## +-- echo ####################################################################### + + +### ACTION: stopping slave as it is not needed for the first part of +### the test + +-- connection slave +-- source include/stop_slave.inc +-- connection master + +--disable_query_log +call mtr.add_suppression("Can't generate a unique log-filename"); +call mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +call mtr.add_suppression("Warning: [+-]?\d+ files and [+-]?\d+ streams is left open"); +call mtr.add_suppression("Error writing file .*"); +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."); +--enable_query_log + +--let $old_debug = `select @@global.debug` + +### ACTION: create a large file (> 4096 bytes) that will be later used +### in LOAD DATA INFILE to check binlog errors in its vacinity +-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data +-- let $MYSQLD_DATADIR= `select @@datadir` +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file' + +### ACTION: create a small file (< 4096 bytes) that will be later used +### in LOAD DATA INFILE to check for absence of binlog errors +### when file loading this file does not force flushing and +### rotating the binary log +-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data +-- let $MYSQLD_DATADIR= `select @@datadir` +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2' + +RESET MASTER; + +-- echo ###################### TEST #1 + +### ASSERTION: no problem flushing logs (should show two binlogs) +FLUSH LOGS; +-- echo # assert: must show two binlogs +-- source include/show_binary_logs.inc + +-- echo ###################### TEST #2 + +### ASSERTION: check that FLUSH LOGS actually fails and reports +### failure back to the user if find_uniq_filename fails +### (should show just one binlog) + +RESET MASTER; +--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 +-- error ER_NO_UNIQUE_LOGFILE +FLUSH LOGS; +-- echo # assert: must show one binlog +-- source include/show_binary_logs.inc + +### ACTION: clean up and move to next test +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log +RESET MASTER; + +-- echo ###################### TEST #3 + +### ACTION: create some tables (t1, t2, t4) and insert some values in +### table t1 +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB; +CREATE TABLE t4 (a VARCHAR(16384)) Engine=MyISAM; +INSERT INTO t1 VALUES (1); +RESET MASTER; + +### ASSERTION: we force rotation of the binary log because it exceeds +### the max_binlog_size option (should show three binary +### logs) + +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 + +# shows two binary logs +-- echo # assert: must show three binlog +-- source include/show_binary_logs.inc + +# clean up the table and the binlog to be used in next part of test +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #4 + +# Loading a row using LOAD DATA INFILE causing a binary log error +# should be rolled back. + +--disable_query_log +eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,info,debug,enter,return,query,error_unique_log_filename"), 'd,info,debug,enter,return,query,error_unique_log_filename'); +--enable_query_log + +# Table should be empty to start with +SELECT count(*) FROM t2; + +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 + +# show table +-- echo # assert: must still be empty since the LOAD DATA INFILE failed +SELECT count(*) FROM t2; + +# clean up the table and the binlog to be used in next part of test +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #5 + +### ASSERTION: load the small file into a transactional table and +### check that it succeeds + +--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 +-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2 + +# show table +-- echo # assert: must show one entry +SELECT count(*) FROM t2; + +# clean up the table and the binlog to be used in next part of test +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #6 + +# A failing LOAD DATA INFILE inside a transaction cause the commit to +# fail, rolling back the entire statement. + +--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 + +-- echo # Table should be empty +SELECT count(*) FROM t2; + +SET AUTOCOMMIT=0; +INSERT INTO t2 VALUES ('muse'); +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 +INSERT INTO t2 VALUES ('muse'); +-- error ER_NO_UNIQUE_LOGFILE +COMMIT; + +### ACTION: Show the contents of the table after the test +-- echo # Table should still be empty since the commit failed. +SELECT count(*) FROM t2; + +### ACTION: clean up and move to the next test +SET AUTOCOMMIT= 1; +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #7 + +### ASSERTION: check that on a non-transactional table, if rotation +### fails then an error is reported and an incident event +### is written to the current binary log. + +--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 +SELECT count(*) FROM t4; +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE 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; +RESET MASTER; + +-- echo ###################### TEST #8 + +### ASSERTION: check that statements end up in error but they succeed +### on changing the data. + +# Insert some rows into t2, we will both try to insert and delete from +# it. + +SET @xxx = REPEAT('xxx', 1000); +SET @yyy = REPEAT('yyy', 1000); +INSERT INTO t2 VALUES (@xxx),(@yyy); + +--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 +-- echo # must show 0 entries +SELECT count(*) FROM t4; +-- echo # must show 2 entries +SELECT count(*) FROM t2; + +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 +set @aaa = repeat('aaa',1000); +set @bbb = repeat('bbb',1000); +set @ccc = repeat('ccc',1000); +-- error ER_NO_UNIQUE_LOGFILE +INSERT INTO t2 VALUES (@aaa), (@bbb), (@ccc); + +-- echo # INFO: Count(*) Before Offending DELETEs +-- echo # assert: must show 1 entry +SELECT count(*) FROM t4; +-- echo # assert: must show 2 entries since the LOAD DATA INFILE and +-- echo # INSERT INTO above was rolled back due to error. Only the +-- echo # original rows remain +SELECT count(*) FROM t2; + +-- error ER_NO_UNIQUE_LOGFILE +DELETE FROM t4 WHERE a IN (@xxx, @yyy) OR 1; +-- error ER_NO_UNIQUE_LOGFILE +DELETE FROM t2 WHERE a IN (@aaa, @bbb, @ccc) OR 1; + +-- echo # INFO: Count(*) After Offending DELETEs +-- echo # assert: must show zero entries +SELECT count(*) FROM t4; +-- echo # assert: must show 2 entries: the original two rows +SELECT count(*) FROM t2; + +# remove fault injection +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log + +# Empty t2 for following testing +DELETE FROM t2; + +-- echo ###################### TEST #9 + +### ASSERTION: check that if we disable binlogging, then statements +### succeed. +--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 SQL_LOG_BIN=0; +INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd'); +INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh'); +-- echo # assert: must show four entries +SELECT count(*) FROM t2; +SELECT count(*) FROM t4; +DELETE FROM t2; +DELETE FROM t4; +-- echo # assert: must show zero entries +SELECT count(*) FROM t2; +SELECT count(*) FROM t4; +SET SQL_LOG_BIN=1; +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log + +-- echo ###################### TEST #10 + +### ASSERTION: check that error is reported if there is a failure +### while registering the index file and the binary log +### file or failure to write the rotate event. + +call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Could not open .*"); + +RESET MASTER; +SHOW WARNINGS; + +# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open +# normalize strerror message for solaris10-sparc-64bit as long as errno is OK +--disable_query_log +eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,fault_injection_registering_index"), 'd,fault_injection_registering_index'); +--enable_query_log +-- replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/ +-- error ER_CANT_OPEN_FILE +FLUSH LOGS; +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log + +-- error ER_NO_BINARY_LOGGING +SHOW BINARY LOGS; + +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; + +-- echo ###################### TEST #11 + +### ASSERTION: check that error is reported if there is a failure +### while opening the index file and the binary log file or +### failure to write the rotate event. + +# restart the server so that we have binlog again +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file +--disable_query_log +eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,fault_injection_openning_index"), 'd,fault_injection_openning_index'); +--enable_query_log +# normalize strerror message for solaris10-sparc-64bit as long as errno is OK +-- replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/ +-- error ER_CANT_OPEN_FILE +FLUSH LOGS; +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log + +-- error ER_FLUSH_MASTER_BINLOG_CLOSED +RESET MASTER; + +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; + +# restart the server so that we have binlog again +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +-- echo ###################### TEST #12 + +### ASSERTION: check that error is reported if there is a failure +### while writing the rotate event when creating a new log +### file. + +# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl +--disable_query_log +eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,fault_injection_new_file_rotate_event"), 'd,fault_injection_new_file_rotate_event'); +--enable_query_log +-- error ER_ERROR_ON_WRITE +FLUSH LOGS; +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log + +-- error ER_FLUSH_MASTER_BINLOG_CLOSED +RESET MASTER; +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; + +# restart the server so that we have binlog again +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +## clean up +--disable_query_log +eval SET GLOBAL debug= '$old_debug'; +--enable_query_log +DROP TABLE t1, t2, t4; +RESET MASTER; + +# restart slave again +-- connection slave +-- source include/start_slave.inc +-- connection master + +-- echo ####################################################################### +-- echo ####################### PART 2: SLAVE TESTS ########################### +-- echo ####################################################################### + +### setup +--source include/rpl_reset.inc +-- connection slave + +# slave suppressions + +call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); +call mtr.add_suppression("Error writing file .*"); +call mtr.add_suppression("Could not open .*"); +call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Can't generate a unique log-filename .*"); +-- echo ###################### TEST #13 + +#### ASSERTION: check against unique log filename error +-- let $io_thd_injection_fault_flag= error_unique_log_filename +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #14 + +#### ASSERTION: check against rotate failing +-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #15 + +#### ASSERTION: check against relay log open failure +-- let $io_thd_injection_fault_flag= fault_injection_registering_index +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #16 + +#### ASSERTION: check against relay log index open failure +-- let $io_thd_injection_fault_flag= fault_injection_openning_index +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +### clean up +-- source include/stop_slave_sql.inc +--disable_query_log +eval SET GLOBAL debug='$old_debug'; +--enable_query_log +RESET SLAVE; +RESET MASTER; +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_blackhole.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_blackhole.test index 1a0eeb3c..6476366a 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_blackhole.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_blackhole.test @@ -19,7 +19,7 @@ connection master; eval $statement; --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # Expect 0 SELECT COUNT(*) FROM t1; let $after = query_get_value("SHOW MASTER STATUS", Position, 1); diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_change_master.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_change_master.test index b24e45ab..a19cc605 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_change_master.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_change_master.test @@ -10,7 +10,7 @@ let $save_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); connection master; # Make SQL slave thread advance a bit create table t1(n int); -sync_slave_with_master; +--sync_slave_with_master select * from t1; # Now stop it and make I/O slave thread be ahead stop slave sql_thread; @@ -48,7 +48,7 @@ sync_with_master; select * from t1; connection master; drop table t1; -sync_slave_with_master; +--sync_slave_with_master # End of 4.1 tests @@ -67,7 +67,7 @@ insert into t1 values (2); # Note: the master positon saved by this will also be used by the # 'sync_with_master' below. -sync_slave_with_master; +--sync_slave_with_master # Check if the table t1 and t2 are identical on master and slave; --let $diff_tables= master:t1, slave:t1 @@ -102,7 +102,7 @@ source include/wait_for_slave_io_to_start.inc; eval set global relay_log_purge=$relay_log_purge; connection master; drop table t1; -sync_slave_with_master; +--sync_slave_with_master } # diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_charset.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_charset.test index 5009dff8..13e87798 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_charset.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_charset.test @@ -12,7 +12,7 @@ select "--- --master--" as ""; --enable_query_log show create database mysqltest2; show create database mysqltest3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --disable_query_log select "--- --slave--" as ""; --enable_query_log @@ -27,7 +27,7 @@ create database mysqltest3; select "--- --master--" as ""; --enable_query_log show create database mysqltest3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --disable_query_log select "--- --slave--" as ""; --enable_query_log @@ -47,7 +47,7 @@ insert into t1 (b) values(@@character_set_connection); insert into t1 (b) values(@@collation_connection); --echo --- --master-- select * from t1 order by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --- --slave-- select * from mysqltest2.t1 order by a; @@ -61,7 +61,7 @@ insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(LEAST("Müller","Muffler")); --echo --- --master-- select * from t1 order by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --- --slave-- select * from mysqltest2.t1 order by a; @@ -83,14 +83,14 @@ truncate table t1; insert into t1 (b) values(collation(@a)); --echo --- --master-- select * from t1 order by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --- --slave-- select * from mysqltest2.t1 order by a; connection master; drop database mysqltest2; drop database mysqltest3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Check that we can change global.collation_server (since 5.0.3) @@ -115,12 +115,12 @@ SET CHARACTER_SET_CLIENT=koi8r, CHARACTER_SET_RESULTS=koi8r; INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); select hex(c1), hex(c2) from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select hex(c1), hex(c2) from t1; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#6676: Derivation of variables must be correct on slave diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test index 7de4f421..5f15e57f 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test @@ -4,11 +4,11 @@ begin; insert into t1 values(1); flush tables with read lock; commit; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # cleanup connection master; unlock tables; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_conflicts.test index 08f122bc..db62c7cc 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_conflicts.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_conflicts.test @@ -61,8 +61,7 @@ connection master; CREATE TABLE t1(a INT PRIMARY KEY); --echo [on slave] -sync_slave_with_master; - +--source include/sync_slave_sql_with_master.inc --echo ==== Test: SQL thread sees 'INSERT' of existing key ==== @@ -121,7 +120,7 @@ DELETE FROM t1; INSERT INTO t1 VALUES (1); --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc DELETE FROM t1 WHERE a = 1; --echo ---- On master, remove the row that does not exist on slave ---- @@ -171,4 +170,4 @@ connection master; DROP TABLE t1; --echo [on slave] ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_crash_safe.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_crash_safe.inc index 2b109773..6a2d3720 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_crash_safe.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_crash_safe.inc @@ -95,7 +95,10 @@ if ($commands != '') { if ($failure != 'd,crash_after_apply') { - --let $outcome= O1 + if ($failure != 'd,crash_after_commit_before_update_pos') + { + --let $outcome= O1 + } } } --echo FAILURE $failure and OUTCOME $outcome diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_crash_safe.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_crash_safe.test index 63d69778..128d446e 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_crash_safe.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_crash_safe.test @@ -2,16 +2,17 @@ # This test case aims at checking if a slave does not go out of sync after # injecting crashes at specific points. The following scenarios are analyzed: # -# |------------+-----------------------+---------+---------+---------| -# | SCENARIO # | SCENARIO | CRASH-1 | CRASH-2 | CRASH-3 | -# |------------+-----------------------+---------+---------+---------| -# | 1 | T | O1 | O1 | O2 | -# | 2 | T-* | O1 | O1 | O2 | -# | 3 | B T T-* C | O1 | O1 | O2 | -# | 4 | B T-* T C | O1 | O1 | O2 | -# | 5 | N | O3 | O3 | O2 | -# | 6 | N-* | O3 | O3 | O2 | -# |------------+-----------------------+---------+---------+---------| +# Following table represents the outcomes when Rli are on table. +# |------------+-----------------------+---------+---------+---------+---------| +# | SCENARIO # | SCENARIO | CRASH-1 | CRASH-2 | CRASH-3 | CRASH-4 | +# |------------+-----------------------+---------+---------+---------+---------| +# | 1 | T | O1 | O1 | O2 | O2 | +# | 2 | T-* | O1 | O1 | O2 | O2 | +# | 3 | B T T-* C | O1 | O1 | O2 | O2 | +# | 4 | B T-* T C | O1 | O1 | O2 | O2 | +# | 5 | N | O3 | O3 | O2 | O3 | +# | 6 | N-* | O3 | O3 | O2 | O3 | +# |------------+-----------------------+---------+---------+---------+---------| # # Legend: # @@ -45,6 +46,9 @@ # CRASH-3 - crash_after_commit_and_update_pos - after committing and updating # the positions. # +# CRASH-4 - crash_after_commit_before_update_pos - after committing and +# updating positions in (FILE). +# # After injecting the faults, we expect the following outcomes: # # O1. In this case, the slave shall correctly recover to "S" without going out @@ -88,7 +92,7 @@ connection master; --echo # EXECUTE CASES CRASHING THE XID --echo ################################################################################### connection master; ---let $failures= d,crash_after_apply d,crash_before_update_pos d,crash_after_update_pos_before_apply +--let $failures= d,crash_after_apply d,crash_before_update_pos d,crash_after_update_pos_before_apply d,crash_after_commit_before_update_pos # # Executes a set of tests while there are crash points in $failures. # @@ -209,13 +213,13 @@ while ($failures != '') --echo # CHECK CONSISTENCY --echo ################################################################################### connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; let $MYSQLD_DATADIR= `SELECT @@datadir`; ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-crash-master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-crash-slave.sql +--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --set-gtid-purged=off --no-create-info test > $MYSQLD_DATADIR/test-crash-master.sql +--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --set-gtid-purged=off --no-create-info test > $MYSQLD_DATADIR/test-crash-slave.sql --diff_files $MYSQLD_DATADIR/test-crash-master.sql $MYSQLD_DATADIR/test-crash-slave.sql --echo ################################################################################### diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ddl.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ddl.test index 3b0348cc..9bd24641 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ddl.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ddl.test @@ -129,7 +129,7 @@ # Some preparations ############################################################### # The sync_slave_with_master is needed to make the xids deterministic. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --echo -------- switch to master ------- @@ -148,7 +148,7 @@ eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type; # slave uses MyISAM for the table mysqltest.t1. # This is not valid in case of suite/rpl_ndb/rpl_ndb_ddl.test which sources # also this script. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'mysqltest1' AND TABLE_NAME = 't1' @@ -186,7 +186,7 @@ eval CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=$temp_engine_type; # SET AUTOCOMMIT = 0; use mysqltest1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --echo -------- switch to slave -------- connection slave; @@ -326,7 +326,7 @@ let $my_master_commit= true; let $my_slave_commit= true; --source include/rpl_stmt_seq.inc SELECT * FROM mysqltest1.t7; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --echo -------- switch to slave -------- connection slave; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_deadlock.test index cd744df4..7af424e8 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_deadlock.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_deadlock.test @@ -181,9 +181,7 @@ START SLAVE; let $slave_sql_errno= 1205; # ER_LOCK_TIMEOUT let $show_slave_sql_error= 0; -let $rpl_debug= 1; source include/wait_for_slave_sql_error.inc; -let $rpl_debug= 0; rollback; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_delete_no_where.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_delete_no_where.test index 914bedc6..4ecdb724 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_delete_no_where.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_delete_no_where.test @@ -4,14 +4,14 @@ eval create table t1 (a int, b int) engine=$engine_type; insert into t1 values(1,1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; delete from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; # cleanup connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_do_table_filter_insensitive.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_do_table_filter_insensitive.inc new file mode 100644 index 00000000..02d4254d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_do_table_filter_insensitive.inc @@ -0,0 +1,16 @@ +# +# Bug #51639 +# This test verifies that 'do table'filters will follow +# the setting of lower_case_table_name to be case +# insensitive but accent sensitive when setting +# lower_case_table_name > 0 +# + +-- source include/master-slave.inc +-- source include/have_binlog_format_statement.inc + +-- source extra/rpl_tests/rpl_filters.test +let $replicate_do_table= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Table, 1); +--echo Replicate_Do_Table: $replicate_do_table + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_do_table_filter_sensitive.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_do_table_filter_sensitive.inc new file mode 100644 index 00000000..b04e2848 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_do_table_filter_sensitive.inc @@ -0,0 +1,16 @@ +# +# Bug #51639 +# This test verifies that 'do table'filters will follow +# the setting of lower_case_table_name to be case +# sensitive and accent sensitive when setting +# lower_case_table_name == 0 +# + +-- source include/master-slave.inc +-- source include/have_binlog_format_statement.inc + +-- source extra/rpl_tests/rpl_filters.test +let $replicate_do_table= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Table, 1); +--echo Replicate_Do_Table: $replicate_do_table + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_filters.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_filters.test index e2f42be3..d3e92626 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_filters.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_filters.test @@ -12,11 +12,10 @@ INSERT INTO t2 VALUES (1); -- echo # On master -- source include/show_binlog_events.inc --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- echo # On slave -- source include/show_binlog_events.inc -- connection master DROP DATABASE mydb; --- sync_slave_with_master - +-- source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test index 6f7d6e4c..d85ec247 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test @@ -32,7 +32,7 @@ flush tables; let $wait_binlog_event= flush tables; source include/wait_for_binlog_event.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Check that the slave is not confused. select * from t3; # Note that all this confusion may cause warnings 'table xx is open on rename' diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_foreign_key.test index db646a73..f20a31ab 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_foreign_key.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_foreign_key.test @@ -13,7 +13,7 @@ INSERT INTO t2 VALUES (NULL,LAST_INSERT_ID()); SET FOREIGN_KEY_CHECKS=1; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY b; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY b; @@ -25,13 +25,13 @@ SET FOREIGN_KEY_CHECKS=0; # error and error code for error ER_DUP_ENTRY. Bug 16677 --error 1022, ER_DUP_ENTRY INSERT INTO t3 VALUES (1),(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; SET FOREIGN_KEY_CHECKS=0; DROP TABLE IF EXISTS t1,t2,t3; SET FOREIGN_KEY_CHECKS=1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug #32468 delete rows event on a table with foreign key constraint fails @@ -50,7 +50,7 @@ set foreign_key_checks=0; delete from t1; --echo must sync w/o a problem (could not with the buggy code) -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select count(*) from t1 /* must be zero */; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_drop_table.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_drop_table.inc new file mode 100644 index 00000000..edd61462 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_drop_table.inc @@ -0,0 +1,48 @@ +# ==== Purpose ==== +# +# This include will try to issue the $statement after setting GTID_NEXT to the +# $next_gtid variable expecting $expected_error if it is defined and non-zero. +# +# If the $expected_error is defined and non-zero, this include will also +# rollback the statement to release the ownership of the previously set GTID. +# +# ==== Usage ==== +# +# --let $statement= XXX +# --let $next_gtid= 'UUID:NUMBER' +# [--$expected_error= ER_XXX] +# --source extra/rpl_tests/rpl_gtid_drop_table.inc +# +# Parameters: +# $statement +# The SQL statement to be executed. +# +# $next_gtid +# The GTID to be set as GTID_NEXT. +# +# $expected_error +# The error expected when issuing the command. +# Optional, not set means no expected error. + +if (!$statement) +{ + --die ERROR IN TEST: the "statement" variable must be set +} + +if (!$next_gtid) +{ + --die ERROR IN TEST: the "next_gtid" variable must be set +} + +--eval SET GTID_NEXT= $next_gtid +if ($expected_error) +{ + --echo ## Expecting error $expected_error after the statement + --error $expected_error + --eval $statement + ROLLBACK; +} +if (!$expected_error) +{ + --eval $statement +} diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtids_restart_slave_io_lost_trx.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtids_restart_slave_io_lost_trx.test new file mode 100644 index 00000000..902c6361 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtids_restart_slave_io_lost_trx.test @@ -0,0 +1,112 @@ +# +# This test will verify if the slave SQL thread and the slave IO thread behave +# correctly when the IO thread is restarted in the middle of a transaction. +# +# It is expected that the IO thread will retrieve again the partial transaction +# from the beginning and that the SQL thread will rollback the partially +# retrieved transaction before applying the fully retrieved one. +# +# This test will insert some data in the master and then will stop the slave +# IO thread right after queuing an event of a given type, starting the IO +# thread again to fully retrieve the partially received transaction. +# + +--source include/have_gtid.inc + +# As this test depends on the use of a User_var_log_event in a DML statement +# we have to use statement based replication. +--source include/have_binlog_format_statement.inc +--source include/force_restart.inc +# Enable auto_position protocol +--let $use_gtids= 1 +--let $rpl_gtid_utils= 1 +--source include/master-slave.inc +# Test should run only on debug build +source include/have_debug.inc; +source include/have_debug_sync.inc; + +# Initial setup +--connection master +CREATE TABLE t1(i INT) ENGINE=InnoDB; +# The following "FLUSH LOGS" will make the master to clear the "created" flag +# of the Format Description events in the next binlog files (and also in +# their replicated versions in the slave's relaylog). +FLUSH LOGS; +--source include/sync_slave_sql_with_master.inc +SET @save_debug=@@global.debug; + +# +# Actual test starts here. +# +# Test will do the following five iterations +# 1.Stop I/O thread after reading GTID_LOG_EVENT +# 2.Stop I/O thread after reading QUERY_LOG_EVENT +# 3.Stop I/O thread after reading XID_LOG_EVENT +# which is equal to I/O thread sync with master +# 4.Stop I/O thread after the gtid is in EXECUTED_GTID_SET +# i.e., after sync slave sql thread with master. +# 5.Stop I/O thread after reading USER_VAR_LOG_EVENT +# and after that make sure there are no missing gtid events +# i.e., we will verify this by doing diff between master:t1, +# slave:t1. + +--let $i=1 +while ($i <= 5) +{ + if ($i == 1) + { + SET GLOBAL DEBUG='d,stop_io_after_reading_gtid_log_event'; + } + if ($i == 2) + { + SET GLOBAL DEBUG='d,stop_io_after_reading_query_log_event'; + } + if ($i == 3) + { + # Stopping sql thread to make sure that case 3 is not equal to case 4. + --source include/stop_slave_sql.inc + SET GLOBAL DEBUG='d,stop_io_after_reading_xid_log_event'; + } + if ($i == 5) + { + SET GLOBAL DEBUG='d,stop_io_after_reading_user_var_log_event'; + } + --connection master + BEGIN; + --eval INSERT INTO t1 VALUES ($i) + --eval SET @v= $i * 100 + --eval INSERT INTO t1 VALUES (@v) + COMMIT; + --connection slave + if ($i == 4) + { + --connection master + --source include/sync_slave_sql_with_master.inc + --source include/stop_slave_io.inc + } + --source include/wait_for_slave_io_to_stop.inc + # Remove the debug point and restart the slave threads + SET GLOBAL DEBUG= @save_debug; + + --source include/start_slave_io.inc + if ($i == 3) + { + --source include/start_slave_sql.inc + } + # Do one more insert on master and then sync slave with master (to make sure + # that re-replicating the events are done successfully. + --connection master + --eval INSERT INTO t1 VALUES ($i) + --source include/sync_slave_sql_with_master.inc + # Now compare master and slave's t1 table data + # to prove that there are no missing gtids. + --let diff_tables= master:t1, slave:t1 + --source include/diff_tables.inc + --inc $i +} + +# Cleanup +--connection master +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_heartbeat_2slaves.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_heartbeat_2slaves.inc new file mode 100644 index 00000000..1ad4d11b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_heartbeat_2slaves.inc @@ -0,0 +1,133 @@ +############################################################# +# Author: Serge Kozlov <Serge.Kozlov@Sun.COM> +# Date: 02/19/2009 +# Purpose: Testing heartbeat for schema +# 1 master and 2 slaves +############################################################# +--let $rpl_topology= 1->2,1->3 +--source include/rpl_init.inc + +--let $rpl_connection_name= master +--let $rpl_server_number= 1 +--source include/rpl_connect.inc + +--let $rpl_connection_name= slave_1 +--let $rpl_server_number= 2 +--source include/rpl_connect.inc + +--let $rpl_connection_name= slave_2 +--let $rpl_server_number= 3 +--source include/rpl_connect.inc + +# +# Set different heartbeat periods for slaves +# +--connection slave_1 +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1; +--source include/start_slave.inc +--connection slave_2 +--source include/stop_slave.inc +--replace_column 2 #### +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1; +--source include/start_slave.inc + +# +# Testing heartbeat for one master and two slaves +# + +# Check that heartbeat events sent to both slaves with correct periods +--connection slave_1 +let $status_var= slave_received_heartbeats; +let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); +let $status_var_comparsion= >; +--source include/wait_for_status_var.inc +--echo Slave has received heartbeat event +--connection slave_2 +let $status_var= slave_received_heartbeats; +let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); +let $status_var_comparsion= >; +--source include/wait_for_status_var.inc +--let $assert_cond= [slave_1:SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > [slave_2:SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] +--let $assert_text= slave_1 should have received more heartbeats than slave_2 +--source include/assert.inc +--echo + +# Create topology master->slave_2->slave_1 and check that slave_1 +# receives heartbeat while slave_2 gets data. + +# slave_2 was started w/o --log-slave-updates because slave_2 should +# not send data from master to slave_1 + +--source include/rpl_stop_slaves.inc +--let $rpl_topology= 1->3->2 +--source include/rpl_change_topology.inc +--source include/rpl_start_slaves.inc +--connection slave_1 +--source include/stop_slave.inc +--replace_column 2 #### +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1; +--source include/start_slave.inc + +# Check heartbeat for new replication channel slave_2->slave +let $status_var= slave_received_heartbeats; +let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); +let $status_var_comparsion= >; +--source include/wait_for_status_var.inc +--echo slave_1 has received heartbeat event +--connection master +--echo [on master] +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); +INSERT INTO t1 VALUES (1, 'on master', ''); +SHOW TABLES; +--echo [on slave_2] +--let $sync_slave_connection= slave_2 +--source include/sync_slave_sql_with_master.inc +SHOW TABLES; +let $slave_2_pos_before= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); +--echo [on slave_1] +--let $sync_slave_connection= slave_1 +--source include/sync_slave_sql_with_master.inc +SHOW TABLES; +--connection master +--echo [on master] +--echo creating updates on master and send to slave_2 during 5 second +# Generate events on master and send to slave_2 during 5 second +let $i= 1; +let $j= 1; +let $k= 1; +--disable_query_log +while ($i) { + eval SET @c_text=REPEAT('1234567890', $j); + eval UPDATE t1 SET a=$j, c=@c_text; + --connection slave_2 + let $slave_2_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); + if (`SELECT ($k*($slave_2_pos - $slave_2_pos_before)) > 0`) { + --connection slave_1 + let $slave_1_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); + let $k= 0; + let $time_before = `SELECT NOW()`; + } + if (`SELECT ((1-$k)*TIMESTAMPDIFF(SECOND,'$time_before',NOW())) > 5`) { + let $i= 0; + } + --connection master + inc $j; + sleep 0.1; +} +--enable_query_log +--connection slave_1 +--echo [on slave_1] +--let $assert_cond= [SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > $slave_1_rcvd_heartbeats_before +--let $assert_text= slave_1 should have received heartbeats +--source include/assert.inc +--echo + +# +# Clean up +# +--echo *** Clean up *** +--connection master +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ignore_table_filter_insensitive.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ignore_table_filter_insensitive.inc new file mode 100644 index 00000000..63daed8b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ignore_table_filter_insensitive.inc @@ -0,0 +1,15 @@ +# +# Bug #51639 +# This test verifies that 'ignore table' filter will follow +# the setting of lower_case_table_name to be case insensitive +# but accent sensitive when setting lower_case_table_name>0 +# + +-- source include/master-slave.inc +-- source include/have_binlog_format_statement.inc + +-- source extra/rpl_tests/rpl_filters.test +let $replicate_ignore_table= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Table, 1); +--echo Replicate_Ignore_Table: $replicate_ignore_table + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ignore_table_filter_sensitive.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ignore_table_filter_sensitive.inc new file mode 100644 index 00000000..2e7dfe89 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_ignore_table_filter_sensitive.inc @@ -0,0 +1,15 @@ +# +# Bug #51639 +# This test verifies that 'ignore table' filter will follow +# the setting of lower_case_table_name to be case sensitive +# and accent sensitive when setting lower_case_table_name=0 +# + +-- source include/master-slave.inc +-- source include/have_binlog_format_statement.inc + +-- source extra/rpl_tests/rpl_filters.test +let $replicate_ignore_table= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Table, 1); +--echo Replicate_Ignore_Table: $replicate_ignore_table + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test index a509b698..c94160f2 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -658,7 +658,7 @@ SET AUTOCOMMIT= 1; --echo ################################################################################### --echo # CHECK CONSISTENCY --echo ################################################################################### ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:tt_1,slave:tt_1 --source include/diff_tables.inc @@ -672,4 +672,4 @@ DROP TABLE tt_1; DROP TABLE tt_2; DROP TABLE nt_1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index d158b659..5a687e46 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -24,7 +24,7 @@ let $query = "INSERT DELAYED INTO t1 VALUES (null, 'Dr. No'), (null, 'From Russi FLUSH TABLE t1; # another way to be sure INSERT DELAYED has inserted SELECT COUNT(*) FROM t1; # when bug existed slave failed below ("duplicate key" error at random INSERT) -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use mysqlslap; SELECT COUNT(*) FROM t1; @@ -52,7 +52,7 @@ if (`SELECT @@global.binlog_format != 'STATEMENT'`) } flush table t1; select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # when bug existed in statement-based binlogging, t1 on slave had # different content from on master select * from t1; @@ -74,7 +74,7 @@ if (`SELECT @@global.binlog_format != 'STATEMENT'`) } flush table t1; # to wait for INSERT DELAYED to be done select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # when bug existed in statement-based binlogging, query was binlogged # with error_code=0 so slave stopped select * from t1; @@ -83,7 +83,7 @@ select * from t1; connection master; USE test; DROP SCHEMA mysqlslap; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use test; connection master; @@ -129,7 +129,7 @@ if (`SELECT @@global.binlog_format = 'STATEMENT'`) } select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo On slave; if (`SELECT @@global.binlog_format = 'STATEMENT'`) { @@ -144,7 +144,7 @@ select * from t1; # clean up connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc if (`SELECT @@global.binlog_format != 'ROW'`) { #flush the logs after the test diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_id.test index 32d861bd..9a4baab2 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_id.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_id.test @@ -42,7 +42,7 @@ eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type; insert into t1 values (1),(2),(3); insert into t1 values (null); insert into t2 values (null,last_insert_id()); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 ORDER BY a; select * from t2 ORDER BY b; connection master; @@ -61,7 +61,7 @@ insert into t1 values (null),(null),(null); insert into t2 values (5,0); insert into t2 values (null,last_insert_id()); SET FOREIGN_KEY_CHECKS=1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t2; connection master; @@ -80,13 +80,13 @@ insert into t2 values (5,0); --disable_warnings ONCE insert into t2 (c) select * from t1 ORDER BY a; select * from t2 ORDER BY b; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 ORDER BY a; select * from t2 ORDER BY b; connection master; drop table t1; drop table t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # --echo # Bug#8412: Error codes reported in binary log for CHARACTER SET, @@ -100,10 +100,10 @@ SET FOREIGN_KEY_CHECKS=0; # Duplicate Key Errors --error 1022, ER_DUP_ENTRY INSERT INTO t1 VALUES (1),(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # --echo # Bug#14553: NULL in WHERE resets LAST_INSERT_ID @@ -119,7 +119,7 @@ insert into t2 (a) select a from t1 where a is null; insert into t2 (a) select a from t1 where a is null; --enable_warnings select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t2; connection master; @@ -205,7 +205,7 @@ call foo(); select * from t1; select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t2; connection master; @@ -232,7 +232,7 @@ set sql_log_bin=1; insert into t1 values(null,100); select * from t1 order by n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # make slave's table autoinc counter bigger insert into t1 values(null,200),(null,300); delete from t1 where b <> 100; @@ -243,7 +243,7 @@ select * from t1 order by n; connection master; replace into t1 values(null,100),(null,350); select * from t1 order by n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 order by n; # Same test as for REPLACE, but for ON DUPLICATE KEY UPDATE @@ -255,7 +255,7 @@ connection master; --disable_warnings ONCE insert into t1 values (NULL,400),(3,500),(NULL,600) on duplicate key UPDATE n=1000; select * from t1 order by n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 order by n; # and now test for the bug: @@ -265,7 +265,7 @@ eval create table t1 (n int primary key auto_increment not null, b int, unique(b)) engine=$engine_type; insert into t1 values(null,100); select * from t1 order by n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc insert into t1 values(null,200),(null,300); delete from t1 where b <> 100; select * from t1 order by n; @@ -274,12 +274,12 @@ connection master; --disable_warnings ONCE insert into t1 values(null,100),(null,350) on duplicate key update n=2; select * from t1 order by n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 order by n; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values" @@ -292,7 +292,7 @@ eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, --disable_warnings ONCE INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; SELECT * FROM t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; connection master; drop table t1; @@ -335,7 +335,7 @@ ON DUPLICATE KEY UPDATE t1.field_3 = t2.field_c; --enable_warnings SELECT * FROM t1 ORDER BY id; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY id; connection master; drop table t1, t2; @@ -382,7 +382,7 @@ CALL p1(); SELECT * FROM t1 ORDER BY id; SELECT * FROM t2 ORDER BY id; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY id; SELECT * FROM t2 ORDER BY id; @@ -463,7 +463,7 @@ SELECT f3(); SELECT * FROM t1 ORDER BY i; SELECT * FROM t2 ORDER BY i; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; SELECT * FROM t2; @@ -475,7 +475,7 @@ DROP FUNCTION f3; DROP TABLE t1, t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # --echo # End of 5.0 tests @@ -521,7 +521,7 @@ insert into t1 select insid(); select * from t1 order by id; select * from t2 order by id; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 order by id; select * from t2 order by id; @@ -546,7 +546,7 @@ call foo(); select * from t1 order by n; select * from t2 order by id; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 order by n; select * from t2 order by id; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test index f6152180..58593b70 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test @@ -19,7 +19,7 @@ create table t2(b int auto_increment, c int, primary key(b)); insert into t1 values (1),(2),(3); insert into t1 values (null); insert into t2 values (null,last_insert_id()); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 ORDER BY a; select * from t2 ORDER BY b; connection master; @@ -38,7 +38,7 @@ insert into t1 values (null),(null),(null); insert into t2 values (5,0); insert into t2 values (null,last_insert_id()); SET FOREIGN_KEY_CHECKS=1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t2; connection master; @@ -55,13 +55,13 @@ insert into t2 values (5,0); --disable_warnings ONCE insert into t2 (c) select * from t1 ORDER BY a; select * from t2 ORDER BY b; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 ORDER BY a; select * from t2 ORDER BY b; connection master; drop table t1; drop table t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug#8412: Error codes reported in binary log for CHARACTER SET, @@ -74,7 +74,7 @@ SET FOREIGN_KEY_CHECKS=0; # Duplicate Key Errors codes --error 1022, ER_DUP_ENTRY INSERT INTO t1 VALUES (1),(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_ignore.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_ignore.test index f422ef35..ef3d1cb7 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_ignore.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_ignore.test @@ -38,7 +38,7 @@ INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; --source include/assert.inc # Compare master and slave ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1 , slave:test.t1 --source include/diff_tables.inc @@ -66,6 +66,7 @@ if (`SELECT @@BINLOG_FORMAT != 'STATEMENT'`) } if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`) { + --source extra/rpl_tests/rpl_insert_ignore_gtid_on.inc --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 2, 1\', Info, 1]\' LIKE \'%$statement_file\' --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged. } @@ -109,6 +110,7 @@ if (`SELECT @@BINLOG_FORMAT != 'STATEMENT'`) } if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`) { + --source extra/rpl_tests/rpl_insert_ignore_gtid_on.inc --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 1, 1\', Info, 1]\' LIKE \'%$statement_file\' --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged. } @@ -118,4 +120,4 @@ if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`) # Clean up --connection master drop table t1, t2; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_ignore_gtid_on.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_ignore_gtid_on.inc new file mode 100644 index 00000000..5f95feb5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_insert_ignore_gtid_on.inc @@ -0,0 +1,17 @@ +if (!`SELECT COUNT(*) = 0 OR VARIABLE_VALUE != 'ON' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'GTID_MODE'`) +{ + --let $i=1 + --let $j=1 + while ($i) + { + --let $temp= query_get_value("SHOW BINLOG EVENTS", Pos, $j) + --let $temp2=`select $binlog_start - $temp` + if($temp2==0) + { + --let $binlog_offset= query_get_value(SHOW BINLOG EVENTS, End_log_pos, $j) + dec $i; + } + inc $j; + } + --let $binlog_start= $binlog_offset +} diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_kill_query.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_kill_query.inc new file mode 100644 index 00000000..4a94a143 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_kill_query.inc @@ -0,0 +1,129 @@ +# ==== Purpose ==== +# +# This is an auxiliary file used by rpl_kill_query.test. +# +# The purpose is to generate a statement that updates a +# non-transactional table, and kill the statement in the middle, +# so that it gets half-executed. +# +# ==== Usage ==== +# +# --let $database= DATABASE +# --let $table= TABLE +# --source include/rpl_kill_query.inc +# +# Parameters: +# $database +# The current database will be set to $database before executing the +# killed statement. +# +# $table +# The statement will modify this table. +# +# Assumptions: +# - $database should *not* be created before executing this script. +# +# ==== Implementation ==== +# +# Apparently, not all statements can be killed in the middle; a simple +# INSERT does not seem to work. One case that can be killed is an +# INSERT with a trigger; then there is a check for being killed in the +# trigger invocation. +# +# So our approach is to put a BEFORE INSERT trigger on the table. The +# trigger will execute fast for the first row, and go to sleep for the +# second row. This allows us to kill the query in the middle of the +# sleep. Then, we make sure to wait until *after* the first row is +# inserted, and *before* the sleep is finished. That ensures that at +# least one row is inserted in the trigger table, and not both rows +# are inserted in the main table, so the statement is half-executed, +# as required. +# +# To sleep on the second row, we use a SLEEP() inside a condition that +# is triggered only for the second row. +# +# To indicate to other threads that the first row has been inserted, +# we do SET @@GLOBAL.BINLOG_FORMAT = ROW before going to sleep. (It +# does not seem to be enough to wait for rows to be inserted in the +# main table or trigger table, probably since locks prevent other +# threads from seeing the partial insert even in a non-transactional +# table.) This will not affect execution since the global values is +# only used as default for new connections. +# +# As a sanity-check, we verify that after the query is killed, at most +# one row has been inserted in the main table, and at least one row +# has been inserted in the second table. + + +--let $_rkq_current_database_old= `SELECT DATABASE()` + +--let $assert_cond= @@GLOBAL.BINLOG_FORMAT = "STATEMENT" +--let $assert_text= Test only works if binlog_format is statement +--source include/assert.inc + +# Get connection id +--source include/rpl_connection_master.inc +--let $connection_id= `SELECT CONNECTION_ID()` + +# Create database, table, and trigger table +eval CREATE DATABASE $database; +eval USE $database; +eval CREATE TABLE $table (a INT) ENGINE = MyISAM; +eval CREATE TABLE trigger_table (a INT) ENGINE = MyISAM; + +# This master-only trigger will sleep for N seconds when the value N +# is inserted to a row. +SET SQL_LOG_BIN=0; +--delimiter | +eval +CREATE TRIGGER trig1 BEFORE INSERT ON $table FOR EACH ROW +BEGIN + IF NEW.a != 0 THEN + SET @@GLOBAL.BINLOG_FORMAT = 'row'; + DO SLEEP(1000000); + END IF; + INSERT INTO trigger_table VALUES (1); +END| +--delimiter ; +SET SQL_LOG_BIN=1; + +# Sleep 1000000 seconds before inserting the second row. +--send +eval INSERT INTO $table VALUES (0), (1); + +# Wait until the sleep for the second row happens. +--source include/rpl_connection_master1.inc + +--let $wait_condition= SELECT @@GLOBAL.BINLOG_FORMAT = 'ROW' +--let $show_rpl_debug_info= 1 +--source include/wait_condition.inc + +# Kill query. +--replace_result $connection_id <CONNECTION_ID> +eval KILL QUERY $connection_id; + +# Get the error message. +--source include/rpl_connection_master.inc +--error ER_QUERY_INTERRUPTED +reap; + +SET @@GLOBAL.BINLOG_FORMAT = 'STATEMENT'; + +# Check that at most one row was inserted in main table. +--let $assert_text= At most one row should be inserted in $database.$table +--let $assert_cond= COUNT(*) <= 1 FROM $database.$table +--source include/assert.inc + +# Check that at least one row was inserted in trigger table. +--let $assert_text= At least one row should be inserted in $database.trigger_table +--let $assert_cond= COUNT(*) >= 1 FROM $database.trigger_table +--source include/assert.inc + +# Clean up. +SET SQL_LOG_BIN=0; +eval DROP TRIGGER trig1; +SET SQL_LOG_BIN=1; +DROP TABLE trigger_table; +eval DROP TABLE $table; +eval DROP DATABASE $database; +--eval USE $_rkq_current_database_old diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loaddata.test index 4dda9219..70121194 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -45,7 +45,7 @@ create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)) insert into t3 select * from t2; --enable_warnings -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t3; @@ -57,7 +57,7 @@ drop table t2; drop table t3; create table t1(a int, b int, unique(b)); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # See if slave stops when there's a duplicate entry for key error in LOAD DATA @@ -238,7 +238,7 @@ connect (conn2,localhost,root,,*NO-ONE*); -- disconnect conn2 -- connection master --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- eval use $db1 let $diff_tables= master:$db1.t1, slave:$db1.t1; @@ -249,7 +249,7 @@ source include/diff_tables.inc; -- eval DROP DATABASE $db1 -- eval DROP DATABASE $db2 --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc # BUG#49479: LOAD DATA INFILE is binlogged without escaping field names -- source include/rpl_reset.inc @@ -260,7 +260,7 @@ CREATE TABLE t1 (`key` TEXT, `text` TEXT); LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ','; SELECT * FROM t1; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- connection master DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loaddata_s.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loaddata_s.inc new file mode 100644 index 00000000..23f3b7c5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loaddata_s.inc @@ -0,0 +1,26 @@ +# See if the slave logs (in its own binlog, with --log-slave-updates) a +# replicated LOAD DATA INFILE correctly when it has binlog_*_db rules. +# This is for BUG#1100 (LOAD DATA INFILE was half-logged). + +-- source include/have_binlog_format_mixed_or_statement.inc +-- source include/master-slave.inc + +connection slave; +# Not sure why we connect to slave and then try to reset master, but I will leave it [JBM] +reset master; + +connection master; +# 'test' is the current database +create table test.t1(a int, b int, unique(b)); +load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; + +# Test logging on slave; +--source include/sync_slave_sql_with_master.inc +select count(*) from test.t1; # check that LOAD was replicated +source include/show_binlog_events.inc; + +# Cleanup +connection master; +drop table test.t1; +--source include/sync_slave_sql_with_master.inc +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loadfile.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loadfile.test index 85620b58..6196dc00 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loadfile.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_loadfile.test @@ -21,7 +21,7 @@ delimiter ;| CALL test.p1(); SELECT * FROM test.t1 ORDER BY blob_column; save_master_pos; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; # Need to allow some time when NDB engine is used for # the injector thread to have time to populate binlog @@ -33,4 +33,4 @@ SELECT * FROM test.t1 ORDER BY blob_column; connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE test.t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_log.test index 9d161393..625096f1 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_log.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_log.test @@ -9,7 +9,7 @@ # test the slave immediately writes DROP TEMPORARY TABLE this_old_table). # We wait for the slave to have written all he wants to the binlog # (otherwise RESET MASTER may come too early). -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; --source include/wait_for_slave_to_stop.inc reset master; @@ -34,9 +34,22 @@ select count(*) from t1; source include/show_binlog_events.inc; let $binlog_limit= 1; -source include/show_binlog_events.inc; +if (!`SELECT COUNT(*) = 0 OR VARIABLE_VALUE != 'ON' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'GTID_MODE'`) +{ + # if GTID_MODE=ON, there is the extra event entry the binary log: Gtid_log_event + --let $binlog_limit= 2,1 +} -let $binlog_limit= 1,4; +source include/show_binlog_events.inc; +--let $from_event= 1 +--let $number_of_events= 4 +if (!`SELECT COUNT(*) = 0 OR VARIABLE_VALUE != 'ON' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'GTID_MODE'`) +{ + # if GTID_MODE=ON, there is the extra event entry the binary log: Gtid_log_event + --let $from_event= `SELECT $from_event * 2 + 1` + --let $number_of_events= `SELECT $number_of_events * 2 - 2` +} +let $binlog_limit= $from_event,$number_of_events; source include/show_binlog_events.inc; let $binlog_limit=; flush logs; @@ -65,7 +78,7 @@ eval create table t3 (a int)ENGINE=$engine_type; connection master; select * from t1 order by 1 asc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #check t1 on slave to ensure whether it's identical with on master select * from t1 order by 1 asc; @@ -85,7 +98,7 @@ source include/show_binlog_events.inc; --replace_column 2 # show binary logs; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --replace_column 2 # show binary logs; @@ -136,4 +149,4 @@ drop table t1; # End of 4.1 tests -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_max_relay_size.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_max_relay_size.test index d8cd4f2d..b17c2a7b 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_max_relay_size.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_max_relay_size.test @@ -89,7 +89,7 @@ flush logs; # log we just closed. But a trick to achieve this is do an update on the master. connection master; create table t1 (a int); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/check_slave_is_running.inc --echo # @@ -99,7 +99,7 @@ sync_slave_with_master; flush logs; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/check_slave_is_running.inc connection master; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc index a6aaabb5..1efbd5a9 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc @@ -119,9 +119,7 @@ if ($commands == recovery) --let $rpl_server_number= 2 --let $rpl_server_parameters= --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0 - --let $rpl_debug= 1 --source include/rpl_start_server.inc - --let $rpl_debug= 0 START SLAVE UNTIL SQL_AFTER_MTS_GAPS; --let $slave_param= Until_Condition @@ -134,9 +132,7 @@ if ($commands == recovery) --echo ** regular restart ** --let $rpl_server_number= 2 --let $rpl_server_parameters= --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1 - --let $rpl_debug= 1 --source include/rpl_restart_server.inc - --let $rpl_debug= 0 #### Checking if the recovery worked and the coordinator has an updated state. #### --connection slave diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.test index f2fdc689..b81797fc 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_crash_safe.test @@ -110,14 +110,14 @@ while ($count_debug_groups <= $max_groups) --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master let $MYSQLD_DATADIR= `SELECT @@datadir`; ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-mts-crash-master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-mts-crash-slave.sql +--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info --set-gtid-purged=off test > $MYSQLD_DATADIR/test-mts-crash-master.sql +--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info --set-gtid-purged=off test > $MYSQLD_DATADIR/test-mts-crash-slave.sql --diff_files $MYSQLD_DATADIR/test-mts-crash-master.sql $MYSQLD_DATADIR/test-mts-crash-slave.sql diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_execute_partial_trx_in_relay_log.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_execute_partial_trx_in_relay_log.inc new file mode 100644 index 00000000..bf91ef5a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_mts_execute_partial_trx_in_relay_log.inc @@ -0,0 +1,36 @@ +# ==== Implementation ==== +# +# 1. Set debug point to rotate relay log after table_map_event. +# 2. Wait for io thread to receive table_map_event and stop it. +# 3. Start the io thread after it is stopped. +# 4. Check that there is no failure on replication. +# + +# Initial setup +--source include/rpl_connection_master.inc +CREATE TABLE t1(i INT) ENGINE=InnoDB; +FLUSH LOGS; +--source include/sync_slave_sql_with_master.inc + +# Set debug point to rotate relay log after table_map_event. +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_table_map_event'; +--source include/rpl_connection_master.inc +INSERT INTO t1 VALUES (1); + +--source include/rpl_connection_slave.inc +# Wait for io thread to receive table_map_event and stop it. +--source include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; + +# Start the io thread after it is stopped. +--source include/start_slave_io.inc + +# Check that their is no failure on replication. +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.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/extra/rpl_tests/rpl_multi_query.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_query.test index ae2a3aa4..30333101 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_query.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_query.test @@ -17,7 +17,7 @@ insert into mysqltest.t1 values(3); insert into mysqltest.t1 values(4); insert into mysqltest.t1 values(5)/ delimiter ;/ -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from mysqltest.t1; connection master; source include/show_binlog_events.inc; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update.test index cdbdbc19..7fc1f411 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update.test @@ -23,7 +23,7 @@ SELECT * FROM t2 ORDER BY a; --disable_warnings ONCE UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update2.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update2.test index b85927a2..0d54aab5 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update2.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update2.test @@ -39,25 +39,24 @@ SELECT * FROM t2 ORDER BY a; connection master; drop table t1,t2; -sync_slave_with_master; - +--source include/sync_slave_sql_with_master.inc # # BUG#13236 multi-update with subquery & --replicate-ignore-table # reset master; - +connection slave; +RESET MASTER; connection master; CREATE TABLE t1 ( a INT ); INSERT INTO t1 VALUES (0); UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; connection master; drop table t1; -sync_slave_with_master; - +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update3.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update3.test index f7d4815e..faff4e21 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update3.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_multi_update3.test @@ -32,7 +32,7 @@ UPDATE t2, (SELECT a FROM t1 ORDER BY a) AS t SET t2.b = t.a+5 ; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; @@ -84,7 +84,7 @@ UPDATE t1 a, t2 AND a.a4 = 'foo' AND a.a5 = 'bar'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT * FROM t1; SELECT * FROM t2; @@ -151,7 +151,7 @@ SET a.x = b.x, ) WHERE b.x = 23; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT * FROM t1; @@ -212,7 +212,7 @@ select "-- MASTER AFTER JOIN --" as ""; select * from t1; select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select "-- SLAVE AFTER JOIN --" as ""; select * from t1; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_not_null.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_not_null.test index cbb6b787..e10b335f 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_not_null.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_not_null.test @@ -68,7 +68,7 @@ INSERT INTO t4(a,c) VALUES (4, 4); INSERT INTO t4(a) VALUES (5); --echo ************* SHOWING THE RESULT SETS WITH INSERTS ************* -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo TABLES t1 and t2 must be equal otherwise an error will be thrown. let $diff_tables= master:t1, slave:t1; @@ -96,7 +96,7 @@ UPDATE t1 set b= NULL, c= 300 where a= 1; REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300); --echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES ************* -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo TABLES t1 and t2 must be equal otherwise an error will be thrown. let $diff_tables= master:t1, slave:t1; @@ -110,7 +110,7 @@ DROP TABLE t2; DROP TABLE t3; DROP TABLE t4; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -134,7 +134,7 @@ INSERT INTO t1(a) VALUES (5); --echo ************* SHOWING THE RESULT SETS WITH INSERTS ************* --echo TABLES t1 and t2 must be different. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; SELECT a,b+0,c+0 FROM t1 ORDER BY a; connection slave; @@ -150,7 +150,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00'); --echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES ************* --echo TABLES t1 and t2 must be equal otherwise an error will be thrown. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; @@ -158,7 +158,7 @@ connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo ################################################################################ --echo # NULL ---> NOT NULL (STRICT MODE) @@ -336,7 +336,7 @@ UPDATE t3 SET b = NULL where a = 4; --echo ************* SHOWING THE RESULT SETS ************* connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; SELECT * FROM t1 ORDER BY a; @@ -357,4 +357,4 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_parallel_load.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_parallel_load.test index db4de7c8..0772aa4d 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_parallel_load.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_parallel_load.test @@ -47,7 +47,7 @@ while($i) --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; --disable_query_log @@ -227,7 +227,7 @@ while($i) } --disable_query_log - sync_slave_with_master; + --source include/sync_slave_sql_with_master.inc let $diff_tables=master:test$i1.tm_nk, slave:test$i1.tm_nk; @@ -266,4 +266,4 @@ while($i) --enable_result_log --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test index d83e6f4b..05faf554 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_parallel_load_innodb.test @@ -75,7 +75,7 @@ while($i) --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; --disable_query_log @@ -306,7 +306,7 @@ while($i) } --disable_query_log - sync_slave_with_master; + --source include/sync_slave_sql_with_master.inc let $diff_tables=master:test$i1.ti_nk, slave:test$i1.ti_nk; source include/diff_tables.inc; @@ -337,5 +337,5 @@ while($i) --enable_result_log --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_record_compare.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_record_compare.test index b674b76d..b6ae80fc 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_record_compare.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_record_compare.test @@ -14,14 +14,14 @@ INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); -- disable_warnings UPDATE t1 SET c5 = 'a'; -- enable_warnings --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc --connection master DROP TABLE t1; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit -- echo ## (1 column less and no varchar) @@ -35,14 +35,14 @@ INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); -- disable_warnings UPDATE t1 SET c5 = 'a'; -- enable_warnings --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc --connection master DROP TABLE t1; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- echo ## case #2 - X bit is wrongly set. @@ -53,12 +53,12 @@ DROP TABLE t1; INSERT INTO t1(c1) VALUES (10); INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc -- connection master DROP TABLE t1; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_relayrotate.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_relayrotate.test index 5f8c93c0..2b076ce3 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_relayrotate.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_relayrotate.test @@ -11,7 +11,7 @@ # We have to sync with master, to ensure slave had time to start properly # before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log. connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; stop slave; connection master; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_001.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_001.test index 8eb684e0..d51a2d47 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_001.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_001.test @@ -1,3 +1,4 @@ +--source include/not_gtid_enabled.inc let $LOAD_FILE= $MYSQLTEST_VARDIR/std_data/words.dat; CREATE TABLE t1 (word CHAR(20) NOT NULL); --replace_result $LOAD_FILE LOAD_FILE @@ -65,6 +66,7 @@ save_master_pos; # Try to cause a large relay log lag on the slave by locking t1 connection slave; +RESET MASTER; LOCK TABLES t1 READ; START SLAVE; UNLOCK TABLES; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_UUID.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_UUID.test index 368596d4..75949416 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_UUID.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_UUID.test @@ -44,7 +44,7 @@ select fn1(0); eval create table t2 (a int) engine=$engine_type; insert into t2 values(fn1(2)); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE test.t1; # Dump the databases and so we can see if they match diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_basic.test index cb747c0e..4ae6b144 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -18,7 +18,7 @@ let $slave_com_update_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_updat connection master; eval CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)$extra_index_t1) ENGINE = $type ; SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; # Testing insert @@ -26,7 +26,7 @@ connection master; INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X'); INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A'); SELECT * FROM t1 ORDER BY C1,C2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; # Testing delete @@ -35,7 +35,7 @@ SELECT * FROM t1 ORDER BY C1,C2; connection master; DELETE FROM t1 WHERE C1 = C2; SELECT * FROM t1 ORDER BY C1,C2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; # @@ -46,7 +46,7 @@ SELECT * FROM t1 ORDER BY C1,C2; connection master; UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C'; SELECT * FROM t1 ORDER BY C1,C2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; #BUG#12662190 - COM_COMMIT IS NOT INCREMENTED FROM THE BINARY LOGS ON SLAVE, COM_BEGIN IS @@ -80,7 +80,7 @@ let $slave_com_update_after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_update connection master; UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N'; SELECT * FROM t1 ORDER BY c1,c2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY c1,c2; # @@ -93,14 +93,14 @@ INSERT INTO t2 (6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81); SELECT * FROM t2 ORDER BY c1,c2; SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; connection master; UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1; SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; # Testing update with a condition that does not match any rows, but @@ -108,13 +108,13 @@ SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; connection master; UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999; SELECT * FROM t2 ORDER BY c1,c2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; connection master; DELETE FROM t2 WHERE c1 % 4 = 0; SELECT * FROM t2 ORDER BY c1,c2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; connection master; @@ -129,19 +129,19 @@ eval CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIM INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1); INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2); SELECT * FROM t3 ORDER BY C1,C2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; connection master; DELETE FROM t3 WHERE C1 = C2; SELECT * FROM t3 ORDER BY C1,C2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; connection master; UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C'; SELECT * FROM t3 ORDER BY C1,C2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; # @@ -154,7 +154,7 @@ eval CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT$extra_index_t6) ENGINE = $t INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3); INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6); SELECT * FROM t6 ORDER BY C3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; # Testing delete @@ -163,7 +163,7 @@ SELECT * FROM t6 ORDER BY C3; connection master; DELETE FROM t6 WHERE C1 = C2; SELECT * FROM t6 ORDER BY C3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; # @@ -174,7 +174,7 @@ SELECT * FROM t6 ORDER BY C3; connection master; UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C'; SELECT * FROM t6 ORDER BY C3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; # now mixing the 3 tables without begin/commit @@ -185,7 +185,7 @@ INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6); UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1; SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2; # @@ -203,7 +203,7 @@ eval CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFA INSERT INTO t4 SET C1 = 1; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; if (`select char_length('$bit_field_special') > 0`) { @@ -215,7 +215,7 @@ if (`select char_length('$bit_field_special') > 0`) { # connection master; eval CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = $type ; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --- on slave: original values --- INSERT INTO t7 VALUES (1,3), (2,6), (3,9); SELECT * FROM t7 ORDER BY C1; @@ -229,7 +229,7 @@ connection master; --echo --- on master: new values inserted --- INSERT INTO t7 VALUES (1,2), (2,4), (3,6); SELECT * FROM t7 ORDER BY C1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --echo --- on slave: old values should be overwritten by replicated values --- @@ -253,7 +253,7 @@ INSERT INTO t8 VALUES (11,99,33); INSERT INTO t8 VALUES (11,22,99); SELECT * FROM t8 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --- on slave --- SELECT * FROM t8 ORDER BY a; INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9); @@ -269,7 +269,7 @@ connection master; # We insert a row that will cause conflict on the primary key but not # on the other keys. INSERT INTO t8 VALUES (2,4,8); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --echo --- on slave --- @@ -284,7 +284,7 @@ SELECT * FROM t8 ORDER BY a; # Clean up t1 so that we can use it. connection master; DELETE FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Just to get a clean binary log --source include/rpl_reset.inc @@ -293,7 +293,7 @@ sync_slave_with_master; connection master; INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); --echo **** On Master **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # since bug#31552/31609 idempotency is not default any longer. In order # the following test DELETE FROM t1 to pass the mode is switched # temprorarily @@ -303,7 +303,7 @@ DELETE FROM t1 WHERE C1 = 'L'; connection master; DELETE FROM t1; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; source include/check_slave_is_running.inc; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; @@ -321,7 +321,8 @@ INSERT INTO t1 VALUES( '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); --echo **** On Slave **** -sync_slave_with_master slave; +--let $sync_slave_connection= slave +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; # @@ -330,7 +331,7 @@ SELECT * FROM t1; connection master; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#37426: RBR breaks for CHAR() UTF8 fields > 85 chars @@ -360,14 +361,14 @@ eval CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = $type ; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; connection master; eval CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = $type ; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; connection master; @@ -378,14 +379,14 @@ eval CREATE TABLE t4 (i INT NOT NULL, eval CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = $type ; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; connection master; eval CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = $type ; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; connection master; @@ -401,7 +402,7 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; connection master; INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; @@ -410,7 +411,7 @@ source include/diff_tables.inc; connection master; INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t2, slave:t2; source include/diff_tables.inc; @@ -429,7 +430,7 @@ call mtr.add_suppression("The slave coordinator and worker threads are stopped, connection master; INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t4, slave:t4; source include/diff_tables.inc; @@ -460,14 +461,14 @@ connection slave; connection master; INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t7, slave:t7; source include/diff_tables.inc; connection master; drop table t1, t2, t3, t4, t5, t6, t7; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#32709: Assertion failed: trx_data->empty(), file .\log.cc, line 1293 @@ -480,14 +481,14 @@ INSERT INTO t1 VALUES (1), (2), (3); --error ER_DUP_ENTRY UPDATE t1 SET a = 10; INSERT INTO t1 VALUES (4); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug #38230 Differences between master and slave after @@ -557,7 +558,7 @@ UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6; DELETE FROM t2 WHERE `pk` < 7 LIMIT 1; UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo *** results: t2 must be consistent **** let $diff_tables= master:t2, slave:t2; @@ -596,14 +597,14 @@ INSERT INTO t1 ( a ) VALUES ( 3 ); UPDATE t1 SET a = 0 WHERE a < 4; UPDATE t1 SET a = 8 WHERE a < 5; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug #39752: Replication failure on RBR + MyISAM + no PK @@ -666,9 +667,10 @@ INSERT INTO t1 ( a ) VALUES ( 1 ); UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3; --enable_warnings -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc if (`select char_length('$bit_field_special') > 0`) { + connection slave; SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; } @@ -677,4 +679,4 @@ source include/diff_tables.inc; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_blob.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_blob.test index 762daa81..139adee6 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_blob.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_blob.test @@ -33,10 +33,7 @@ INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024)); SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1; SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3; -save_master_pos; -connection slave; -sync_with_master; ---source include/wait_for_ndb_to_binlog.inc +--source include/sync_slave_sql_with_master.inc --echo --echo **** Data Insert Validation Slave Section test.t1 **** --echo @@ -56,10 +53,7 @@ UPDATE t1 set data=repeat('c',17*1024) where c1 = 2; --echo SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1; SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; -save_master_pos; -connection slave; -sync_with_master; ---source include/wait_for_ndb_to_binlog.inc +--source include/sync_slave_sql_with_master.inc --echo --echo **** Data Update Validation Slave Section test.t1 **** --echo @@ -127,10 +121,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=1; SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; -save_master_pos; -connection slave; -sync_with_master; ---source include/wait_for_ndb_to_binlog.inc +--source include/sync_slave_sql_with_master.inc --echo --echo **** Data Insert Validation Slave Section test.t2 **** --echo @@ -153,10 +144,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=1; SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; -save_master_pos; -connection slave; -sync_with_master; ---source include/wait_for_ndb_to_binlog.inc +--source include/sync_slave_sql_with_master.inc --echo --echo **** Data Update Validation Slave Section test.t2 **** --echo @@ -180,4 +168,4 @@ DROP TABLE IF EXISTS test.t2; # if cluster is shutdown while not all tables are # properly dropped, the table becomes inconsistent # and wrecks later test cases ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test index bad308ff..b635a755 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test @@ -1,6 +1,7 @@ # See if INSERT DELAYED gets replicated # Only in row-based, as we do SHOW BINLOG EVENTS +-- source include/not_gtid_enabled.inc -- source include/have_binlog_format_row.inc -- source include/master-slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_event_max_size.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_event_max_size.inc new file mode 100644 index 00000000..f0aed1e5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_event_max_size.inc @@ -0,0 +1,95 @@ +# +# Bug #49931 and Bug #49932 +# This test verifies if the slave I/O thread and slave SQL thread +# will check the bigger one of the values of 'max_allowed_packet' +# and 'binlog-row-event-max-size' when reading log event from +# binlog, and the added 'binlog-row-event-max-size' mysqlbinlog +# option works fine. +# + +source include/master-slave.inc; +source include/have_binlog_format_row.inc; + +--let $binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1) +--let $MYSQLD_DATADIR= `select @@datadir` + +let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); +CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, + data2 LONGBLOB, PRIMARY KEY(a)); + +let $start_pos= query_get_value("SHOW MASTER STATUS", Position, 1); +INSERT INTO t1 (data1, data2) VALUES (repeat('a',1000000), repeat('a', 1000000)); +let $end_pos= query_get_value("SHOW MASTER STATUS", Position, 1); +#FLUSH LOGS; +DELETE FROM t1 WHERE a = 1; +--echo # On master, test the inserted data is deleted +SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; + +let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`; +SET @@global.max_allowed_packet=4194304; +FLUSH LOGS; +--let $prefix=`SELECT UUID()` +--let $binlog_uuid_filename= $MYSQLTEST_VARDIR/tmp/$prefix-bin.log +--copy_file $MYSQLD_DATADIR/$binlog_filename $binlog_uuid_filename +--source include/rpl_reset.inc + +--echo # On master, test the added 'binlog-row-event-max-size' mysqlbinlog option +--echo # works fine and the data is inserted by executing the dumped ROW event +--exec $MYSQL_BINLOG --binlog-row-event-max-size=2097152 --start-position=$start_pos --stop-position=$end_pos $binlog_uuid_filename | $MYSQL test 2>&1 +SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; +eval set @@global.max_allowed_packet= $old_max_allowed_packet; + +INSERT INTO t1 (data1, data2) VALUES (repeat('a',1048576), repeat('a',1048576)); + +--source include/show_binlog_events2.inc + +--source include/sync_slave_sql_with_master.inc +--echo # On slave, test the row event data is replicated when the value of +--echo # the bigger one of max_allowed_packet and binlog_row_event_max_size +--echo # is larger than the required size. +SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; + +--echo # On slave, test the row event data is replicated when the value of +--echo # the bigger one of max_allowed_packet and binlog_row_event_max_size +--echo # is equal to the required size. +SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 2; + +connection master; +DROP TABLE t1; + +--source include/sync_slave_sql_with_master.inc +--source include/rpl_reset.inc + +--echo # Test it will cause ER_MASTER_FATAL_ERROR_READING_BINLOG when the value +--echo # of the bigger one of max_allowed_packet and binlog_row_event_max_size +--echo # is lower than the the required size. +connection master; + +CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, + data2 LONGBLOB, data3 LONGBLOB, PRIMARY KEY(a)); + +--source include/sync_slave_sql_with_master.inc +--connection master + +INSERT INTO t1 (data1, data2, data3) VALUES (repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet)); + +SELECT LENGTH(data1), LENGTH(data2), LENGTH(data3) FROM t1 WHERE a = 1; + +drop table t1; +--source include/sync_slave_sql_with_master.inc + +connection slave; +call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log: .*"); +call mtr.add_suppression("Found invalid event in binary log"); +call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); + +--echo ==== clean up ==== + +# clear errno +--source include/stop_slave.inc +RESET SLAVE; +RESET MASTER; + +--remove_file $binlog_uuid_filename +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_func003.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_func003.test index 6b58dc11..043af9f1 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_func003.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_func003.test @@ -54,14 +54,8 @@ INSERT INTO test.t1 VALUES (null,test.f1()); ROLLBACK; SET AUTOCOMMIT=1; -# Sync master and slave for all engines except NDB -if (`SELECT UPPER(LEFT('$engine_type', 3)) != 'NDB'`) { - sync_slave_with_master; - connection master; -} -# Sync master and slave for NDB engine -let $wait_time= 6; ---source include/wait_for_ndb_to_binlog.inc +--source include/sync_slave_sql_with_master.inc +connection master; # Time to dump the databases and so we can see if they match diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_idempotency.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_idempotency.test index b0e17fad..85b674c7 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_idempotency.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_idempotency.test @@ -31,7 +31,7 @@ set foreign_key_checks=1 /* ensure the check */; insert into ti1 values (1),(2),(3); insert into ti2 set a=2, b=2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; select * from ti1 order by b /* must be (1),(2),(3) */; @@ -48,7 +48,7 @@ delete from ti1 where b=1; select * from ti1 order by b /* must be (2),(3) */; # slave must catch up (expect some warnings in error.log) -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; @@ -59,7 +59,7 @@ connection master; insert into ti2 set a=3, b=3; # slave must catch up (expect some warnings in error.log) -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; @@ -104,7 +104,7 @@ set foreign_key_checks=1 /* ensure the check */; insert into ti1 values (1),(2),(3); insert into ti2 set a=2, b=2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; select * from ti1 order by b /* must be (1),(2),(3) */; @@ -135,13 +135,13 @@ set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; set global slave_exec_mode='STRICT'; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; --echo *** conspire the following insert failure @@ -169,13 +169,13 @@ set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; set global slave_exec_mode='STRICT'; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from ti2 order by b /* must be (2,2),(3,3) */; @@ -207,7 +207,7 @@ set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; set global slave_exec_mode='STRICT'; @@ -219,7 +219,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (-1),(-2),(-3); INSERT INTO t2 VALUES (-1),(-2),(-3); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; DELETE FROM t1 WHERE a = -2; @@ -239,7 +239,7 @@ enable_query_log; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; set global slave_exec_mode='STRICT'; @@ -257,7 +257,7 @@ enable_query_log; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; set global slave_exec_mode='STRICT'; @@ -279,7 +279,7 @@ enable_query_log; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; set global slave_exec_mode='STRICT'; @@ -299,7 +299,7 @@ enable_query_log; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; SET @@global.slave_exec_mode= @old_slave_exec_mode; @@ -308,6 +308,6 @@ SET @@global.slave_exec_mode= @old_slave_exec_mode; connection master; drop table t1,t2,ti2,ti1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= @old_slave_exec_mode; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_show_relaylog_events.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_show_relaylog_events.inc new file mode 100644 index 00000000..7d37c0bb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_show_relaylog_events.inc @@ -0,0 +1,20 @@ +# BUG#28777 SHOW BINLOG EVENTS does not work on relay log files +# +# GOAL +# ==== +# +# Test that SHOW BINLOG EVENTS and the new SHOW RELAYLOG EVENTS works after +# the patch, both on master and slave. +# +# HOW +# === +# +# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after +# some statements have been issued. + +-- source include/master-slave.inc +-- source include/have_binlog_format_row.inc +-- source include/not_mts_slave_parallel_workers.inc + +-- source extra/rpl_tests/rpl_show_relaylog_events.inc +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp002.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp002.test index 90c273eb..10b8edfa 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp002.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp002.test @@ -52,7 +52,7 @@ SELECT * FROM test.t2; let $message=< -- test 1 select slave after p1 -- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; SELECT * FROM test.t2; @@ -65,7 +65,7 @@ SELECT * FROM test.t2; let $message=< -- test 1 select slave after p2 -- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; SELECT * FROM test.t2; @@ -113,7 +113,7 @@ SELECT * FROM test.t2; let $message=< -- test 2 select Slave after p1 -- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; SELECT * FROM test.t2; @@ -128,7 +128,7 @@ SELECT * FROM test.t2; let $message=< -- test 1 select Slave after p2 -- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; SELECT * FROM test.t2; @@ -168,7 +168,7 @@ while ($n) ROLLBACK; select * from test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from test.t3; connection master; @@ -187,7 +187,7 @@ while ($n) COMMIT; select * from test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from test.t3; connection master; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp003.test index d2c2ea0c..ad282293 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp003.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp003.test @@ -54,9 +54,7 @@ SELECT release_lock("test"); connection master; SELECT * FROM test.t1; #show binlog events; ---source include/wait_for_ndb_to_binlog.inc -sync_slave_with_master; -connection slave; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; connection master; @@ -67,8 +65,7 @@ CALL test.p1(); SELECT release_lock("test"); SELECT * FROM test.t1; -sync_slave_with_master; -connection slave; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; connection master; #show binlog events from 720; @@ -76,6 +73,6 @@ connection master; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp006.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp006.test index 16a8374a..c69b6980 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp006.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp006.test @@ -54,11 +54,11 @@ END| delimiter ;| CALL p2(); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; CALL p1(); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -79,6 +79,6 @@ DROP PROCEDURE p2; diff_files $MYSQLTEST_VARDIR/tmp/sp006_master.sql $MYSQLTEST_VARDIR/tmp/sp006_slave.sql; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.1 test case diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp007.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp007.test index 492cd2d8..bdfabadf 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp007.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_row_sp007.test @@ -30,7 +30,7 @@ SELECT * FROM test.t1; let $message=< ---- Slave selects-- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; let $message=< ---- Master selects-- >; @@ -41,7 +41,7 @@ SELECT * FROM test.t1; let $message=< ---- Slave selects-- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; connection master; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_set_null.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_set_null.test index 3755c8bb..ed32e4ea 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_set_null.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_set_null.test @@ -35,7 +35,7 @@ -- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine INSERT INTO `t1` VALUES ( 1, 1 ); UPDATE t1 SET c1=NULL where c2=1; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc @@ -43,14 +43,14 @@ UPDATE t1 SET c1=NULL where c2=1; -- connection master # triggers switch to row mode when on mixed DELETE FROM t1 WHERE c2=1 LIMIT 1; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc -- connection master DROP TABLE t1; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- source include/rpl_reset.inc @@ -64,7 +64,7 @@ DROP TABLE t1; INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; SELECT * FROM t1; UPDATE t1 SET c1=NULL WHERE c1='w'; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc @@ -72,11 +72,11 @@ UPDATE t1 SET c1=NULL WHERE c1='w'; -- connection master # triggers switch to row mode when on mixed DELETE FROM t1 LIMIT 2; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc -- connection master DROP TABLE t1; --- sync_slave_with_master +-- source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc index a56e08ec..115beb01 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc @@ -18,7 +18,7 @@ INSERT INTO t1 VALUES (3); --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) --source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) --source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc @@ -49,7 +49,7 @@ DROP TABLE t1; --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) --source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) --source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stm_insert_delayed.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stm_insert_delayed.inc new file mode 100644 index 00000000..92d57625 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stm_insert_delayed.inc @@ -0,0 +1,10 @@ +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc +--source include/not_embedded.inc +--source include/not_windows.inc + +disable_query_log; +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +enable_query_log; +--source extra/rpl_tests/rpl_insert_delayed.test +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stm_mix_show_relaylog_events.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stm_mix_show_relaylog_events.inc new file mode 100644 index 00000000..4b9af69c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stm_mix_show_relaylog_events.inc @@ -0,0 +1,20 @@ +# BUG#28777 SHOW BINLOG EVENTS does not work on relay log files +# +# GOAL +# ==== +# +# Test that SHOW BINLOG EVENTS and the new SHOW RELAYLOG EVENTS works after +# the patch, both on master and slave. +# +# HOW +# === +# +# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after +# some statements have been issued. + +-- source include/master-slave.inc +-- source include/have_binlog_format_mixed_or_statement.inc +-- source include/not_mts_slave_parallel_workers.inc + +-- source extra/rpl_tests/rpl_show_relaylog_events.inc +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stop_slave.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stop_slave.test index 64e69ceb..3aaec3ad 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stop_slave.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stop_slave.test @@ -42,6 +42,10 @@ send STOP SLAVE SQL_THREAD; connection slave1; --echo # To resume slave SQL thread SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +# wait for the sql thread to come out of the +# waiting phase before resetting the signals +--let $wait_condition= select count(*)=0 from information_schema.processlist where state LIKE '%debug sync point%' and info LIKE '%INSERT INTO t1 VALUES (1)%' +--source include/wait_condition.inc SET DEBUG_SYNC= 'RESET'; --echo diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc index 7c7529d9..be50f38c 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc @@ -16,7 +16,7 @@ while ($i < $n) --enable_result_log --enable_query_log ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo # Build connections to master server --disable_query_log diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test index eeb54901..622792c7 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test @@ -18,7 +18,7 @@ INSERT INTO t1 SET name='Caleb', age=1; ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY, ALGORITHM=COPY; SELECT * FROM t1 ORDER BY id; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY id; connection master; DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_trig004.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_trig004.test index 1a738db2..031e6853 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_trig004.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_trig004.test @@ -35,10 +35,7 @@ INSERT INTO test.t2 VALUES (1, 0.0); #show binlog events; select * from test.t1; select * from test.t2; -let $wait_time= 10; ---source include/wait_for_ndb_to_binlog.inc -sync_slave_with_master; -connection slave; +--source include/sync_slave_sql_with_master.inc select * from test.t1; select * from test.t2; @@ -48,5 +45,5 @@ DROP TRIGGER test.t1_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_truncate_helper.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_truncate_helper.test index d1d0e06e..0d49738d 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_truncate_helper.test +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_truncate_helper.test @@ -4,11 +4,11 @@ connection master; eval CREATE TABLE t1 (a INT, b LONG) ENGINE=$engine; INSERT INTO t1 VALUES (1,1), (2,2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Master **** connection master; eval $trunc_stmt t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; @@ -19,15 +19,15 @@ connection master; SET @count := 1; eval CREATE TABLE t2 (a INT, b LONG) ENGINE=$engine; CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Master **** connection master; eval $trunc_stmt t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t2, slave:t2; source include/diff_tables.inc; connection master; DROP TABLE t1,t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/begin_include_file.inc b/mysql-wsrep-5.6/mysql-test/include/begin_include_file.inc index 90606389..d2116699 100644 --- a/mysql-wsrep-5.6/mysql-test/include/begin_include_file.inc +++ b/mysql-wsrep-5.6/mysql-test/include/begin_include_file.inc @@ -34,6 +34,7 @@ # # # At the beginning of include/my_file.inc: # --let $include_filename= my_file.inc +# [--let $include_silent= 1] # [--let $rpl_debug= 1] # --source include/begin_include_file.inc # @@ -74,6 +75,13 @@ if (!$_include_file_depth) if ($rpl_debug) { --echo $_include_file_indent==== BEGIN include/$include_filename ==== + # Print this text (just once) to prevent checking in result files containing + # debug info. + if (!$printed_this_should_not_be_checked_in) + { + --echo DO_NOT_CHECK_IN_THIS_LINE: \$rpl_debug should only be used for debugging. Never check in a test that has $rpl_debug=1. + --let $printed_this_should_not_be_checked_in= 1 + } } --let $_include_file_enabled_warnings= $ENABLED_WARNINGS$_include_file_enabled_warnings diff --git a/mysql-wsrep-5.6/mysql-test/include/change_file_perms.inc b/mysql-wsrep-5.6/mysql-test/include/change_file_perms.inc new file mode 100644 index 00000000..1157bf7e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/change_file_perms.inc @@ -0,0 +1,12 @@ +# $file_perms need to be in octal base +# Provide a file name and the required new file permissions. +# The file's permissions will be changed as per the input file +# permissions. + +--perl +use strict; +my $file_perms= $ENV{'_FILE_PERMS_'} or die "File permissions are not set"; +my $input_file= $ENV{'_INPUT_FILE_'} or die "Input file is not set"; +die ('Unable to find file \'$input_file\'') unless (-e $input_file); +chmod(oct($file_perms), $input_file) or die ('Unable to set file permissions for file \'$input_file\''); +EOF diff --git a/mysql-wsrep-5.6/mysql-test/include/check_ipv4_mapped.inc b/mysql-wsrep-5.6/mysql-test/include/check_ipv4_mapped.inc old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/include/default_my.cnf b/mysql-wsrep-5.6/mysql-test/include/default_my.cnf index 173292f5..d1d906d7 100644 --- a/mysql-wsrep-5.6/mysql-test/include/default_my.cnf +++ b/mysql-wsrep-5.6/mysql-test/include/default_my.cnf @@ -1,4 +1,5 @@ # Copyright (c) 2007 MySQL AB, 2009, 2010 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 diff --git a/mysql-wsrep-5.6/mysql-test/include/eval.inc b/mysql-wsrep-5.6/mysql-test/include/eval.inc index f2d3f889..2595983e 100644 --- a/mysql-wsrep-5.6/mysql-test/include/eval.inc +++ b/mysql-wsrep-5.6/mysql-test/include/eval.inc @@ -36,7 +36,6 @@ # # --let $eval_expr= [SHOW SLAVE STATUS, Relay_Log_Pos, 1] + 47 # [--let $eval_no_result= 1] -# [--let $eval_quiet= 1] # [--let $rpl_debug= 1] # --source include/eval.inc # --echo Result was '$eval_result' diff --git a/mysql-wsrep-5.6/mysql-test/include/func_aes_block.inc b/mysql-wsrep-5.6/mysql-test/include/func_aes_block.inc new file mode 100644 index 00000000..32808f40 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/func_aes_block.inc @@ -0,0 +1,130 @@ +# +# Parameters: +# +# $block_mode + + +--echo #### $block_mode + +SET @IVA=REPEAT('a', 16); +SET @IVB=REPEAT('b', 16); +SET @KEY1=REPEAT('c', 16); +SET @KEY2=REPEAT('d', 16); + + +--echo #### 128-$block_mode + +eval SET SESSION block_encryption_mode="aes-128-$block_mode"; + +--echo # must throw an error without an IV +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT AES_ENCRYPT('a', @KEY1); + +--echo block mode dependent. Must be non-0 and non-null +SELECT LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)); + +--echo block mode dependent +SELECT TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)); + +--echo # must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA); + +--echo # must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); + + +--echo #### 192-$block_mode + +eval SET SESSION block_encryption_mode="aes-192-$block_mode"; + +--echo # must throw an error without an IV +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT AES_ENCRYPT('a', @KEY1); + +--echo # must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); + +--echo # must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); + + +--echo #### 256-$block_mode + +eval SET SESSION block_encryption_mode="aes-256-$block_mode"; + +--echo # must throw an error without an IV +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT AES_ENCRYPT('a', @KEY1); + +--echo # must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); + +--echo # must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); + +SET SESSION block_encryption_mode=DEFAULT; + + +--echo #### 128, 192 and 256 bit $block_mode + + +eval CREATE TABLE aes_$block_mode(a VARCHAR(128), b128 VARCHAR(144), + b192 VARCHAR(144), b256 CHAR(144)); +eval INSERT INTO aes_$block_mode (a) VALUES (REPEAT('a', 128)); +eval INSERT INTO aes_$block_mode (a) VALUES (REPEAT(0x00313233, 32)); + +eval SET SESSION block_encryption_mode="aes-128-$block_mode"; +eval UPDATE aes_$block_mode SET b128 = AES_ENCRYPT(a, @KEY1, @IVA); + +eval SET SESSION block_encryption_mode="aes-192-$block_mode"; +eval UPDATE aes_$block_mode SET b192 = AES_ENCRYPT(a, @KEY1, @IVA); + +eval SET SESSION block_encryption_mode="aes-256-$block_mode"; +eval UPDATE aes_$block_mode SET b256 = AES_ENCRYPT(a, @KEY1, @IVA); + +--echo # must return 0 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE b128 = b192 OR B192 = b256 OR b128=b256; + +eval SET SESSION block_encryption_mode="aes-256-$block_mode"; + +--echo # must return 2 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b256, @KEY1, @IVA); + +--echo # must return 0 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b256, 'b', @IVA); + +--echo # must return 0 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); + +eval SET SESSION block_encryption_mode="aes-192-$block_mode"; + +--echo # must return 2 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b192, @KEY1, @IVA); + +--echo # must return 0 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b192, @KEY2, @IVA); + +--echo # must return 0 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); + +eval SET SESSION block_encryption_mode="aes-128-$block_mode"; + +--echo # must return 2 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b128, @KEY1, @IVA); + +--echo # must return 0 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b128, @KEY2, @IVA); + +--echo # must return 0 +eval SELECT COUNT(*) FROM aes_$block_mode WHERE a = AES_DECRYPT(b256, @KEY2, @IVB); + + +SET SESSION block_encryption_mode=DEFAULT; +eval DROP TABLE aes_$block_mode; + diff --git a/mysql-wsrep-5.6/mysql-test/include/get_file_permissions.inc b/mysql-wsrep-5.6/mysql-test/include/get_file_permissions.inc new file mode 100644 index 00000000..576bbd9f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/get_file_permissions.inc @@ -0,0 +1,9 @@ +--perl +use strict; +my $input_file= $ENV{'_INPUT_FILE_'} or die "Input file is not set"; +my $mode = (stat($input_file))[2]; +open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/permissions.inc") or die; +my $perm= $mode & 07777; +print FILE "let \$FILE_PERMISSIONS= $perm;\n"; +close FILE; +EOF diff --git a/mysql-wsrep-5.6/mysql-test/include/get_ndb_epochs.inc b/mysql-wsrep-5.6/mysql-test/include/get_ndb_epochs.inc new file mode 100644 index 00000000..0fd17807 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/get_ndb_epochs.inc @@ -0,0 +1,60 @@ +# ==== Purpose ==== +# +# Extract the epoch values from SHOW ENGINE NDB STATUS. +# +# ==== Usage ==== +# +# --source include/get_ndb_epochs.inc +# --echo $ndb_latest_epoch +# --echo $ndb_latest_trans_epoch +# --echo $ndb_latest_received_binlog_epoch +# --echo $ndb_latest_handled_binlog_epoch +# --echo $ndb_latest_applied_binlog_epoch +# +# ==== Parameters ==== +# +# $ndb_status_binlog_row +# The row number of the output of SHOW ENGINE NDB STATUS +# last was seen. +# No need to set explictly, but used between sourcing this +# include file several times, since it is highly probable +# (but not certain) that same row number also applies next +# time. + +if (!$ndb_status_binlog_row) +{ + let $ndb_status_binlog_row = 1; +} + +# Try two times, in case the row number of binlog state changes +# between two invocations of SHOW ENGINE NDB STATUS. +let $attempts= 2; +while ($attempts) +{ + let $q= query_get_value(SHOW ENGINE NDB STATUS, Status, $ndb_status_binlog_row); + if ( `SELECT '$q' = 'No such row'` ) + { + dec $attempts; + if (!$attempts) + { + echo ERROR IN TEST: No binlog row found in SHOW ENGINE NDB STATUS; + die ERROR IN TEST: No binlog row found in SHOW ENGINE NDB STATUS; + } + # row will be increased to 1 further down + let $ndb_status_binlog_row = 0; + } + if (`SELECT INSTR('$q', 'latest_epoch=')`) + { + let $attempts = 0 ; + } + if ($attempts) + { + inc $ndb_status_binlog_row; + } +} + +let $ndb_latest_epoch= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING('$q', INSTR('$q', 'latest_epoch=')), ',', 1), '=', -1)`; +let $ndb_latest_trans_epoch= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING('$q', INSTR('$q', 'latest_trans_epoch=')), ',', 1), '=', -1)`; +let $ndb_latest_received_binlog_epoch= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING('$q', INSTR('$q', 'latest_received_binlog_epoch=')), ',', 1), '=', -1)`; +let $ndb_latest_handled_binlog_epoch= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING('$q', INSTR('$q', 'latest_handled_binlog_epoch=')), ',', 1), '=', -1)`; +let $ndb_latest_applied_binlog_epoch= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING('$q', INSTR('$q', 'latest_applied_binlog_epoch=')), ',', 1), '=', -1)`; diff --git a/mysql-wsrep-5.6/mysql-test/include/gtid_step_assert.inc b/mysql-wsrep-5.6/mysql-test/include/gtid_step_assert.inc new file mode 100644 index 00000000..95725ab5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/gtid_step_assert.inc @@ -0,0 +1,96 @@ +# ==== Purpose ==== +# +# Assert that exactly one GTID (or a specified number) was added to +# @@GLOBAL.GTID_EXECUTED since last call to gtid_step_reset.inc or +# gtid_step_assert.inc +# +# ==== Usage ==== +# +# [--let $gtid_step_count= N] +# [--let $gtid_step_only_count= [0|1]] +# [--let $gtid_step_uuid= UUID] +# --source include/gtid_step_assert.inc +# +# Parameters: +# $gtid_step_count +# Assert that N GTIDs were added to @@GLOBAL.GTID_EXECUTED. If +# this is not given, the default value is 1. +# +# $gtid_step_only_count +# By default, this script checks the numeric component of the +# GTIDs added to @@GLOBAL.GTID_EXECUTED to see that the correct +# number was generated. If this parameter is nonzero, it only +# counts the number of added GTIDs to see that it is equal to +# $gtid_step_count, without caring that they were generated in +# order (or generated on this server). +# +# $gtid_step_uuid +# By default, when $gtid_step_count is not set, asserts that the +# uuid component of all GTIDs added to @@GLOBAL.GTID_EXECUTED is +# equal to @@GLOBAL.SERVER_UUID. If this parameter is given, uses +# that UUID instead. +# +# ==== Example ==== +# +# # (1) Remember the current position. +# --source include/gtid_step_reset.inc +# CREATE TABLE t1 (a INT); +# # (2) Assert that exactly one GTID was generated since (1). +# --source include/gtid_step_assert.inc +# INSERT INTO t1 VALUES (1); +# INSERT INTO t1 VALUES (2); +# # (3) Assert that exactly 2 GTIDs were generated since (2). +# --let $gtid_step_count= 2 +# --source include/gtid_step_assert.inc +# # (4) Assert that no GTID was generated since (3). +# --let $gtid_step_count= 0 +# --source include/gtid_step_assert.inc + +if ($uuidf == '') +{ + --die You must source gtid_utils.inc before using gtid_step_assert.inc +} + +--let $_gtid_step_count= 1 +if ($gtid_step_count != '') +{ + --let $_gtid_step_count= $gtid_step_count +} + +--let $_gtid_step_only_count= 0 +if ($gtid_step_only_count != '') +{ + --let $_gtid_step_only_count= $gtid_step_only_count +} + +--let $include_filename= gtid_step_assert.inc [count=$_gtid_step_count, only_count=$_gtid_step_only_count] +--source include/begin_include_file.inc + +--let $_gtid_step_uuid= $gtid_step_uuid +if ($_gtid_step_uuid == '') +{ + --let $_gtid_step_uuid= `SELECT @@GLOBAL.SERVER_UUID` +} + +--let $_gsa_extra_debug_eval_old= $extra_debug_eval +--let $extra_debug_eval= @@GLOBAL.GTID_EXECUTED, GTID_NEXT_GENERATED_SET("$gtid_step_last", "$_gtid_step_uuid", $_gtid_step_count), GTID_SUBTRACT(@@GLOBAL.GTID_EXECUTED, "$gtid_step_last") + +if ($_gtid_step_only_count) +{ + --let $assert_text= Exactly $_gtid_step_count GTIDs should have been committed since last invocation + --let $assert_cond= GTID_COUNT(GTID_SUBTRACT(@@GLOBAL.GTID_EXECUTED, "$gtid_step_last")) = $_gtid_step_count + --source include/assert.inc +} +if (!$_gtid_step_only_count) +{ + --let $assert_text= Exactly $_gtid_step_count GTIDs should have been generated since last invocation + --let $assert_cond= GTID_NEXT_GENERATED_SET("$gtid_step_last", "$_gtid_step_uuid", $_gtid_step_count) = GTID_SUBTRACT(@@GLOBAL.GTID_EXECUTED, "$gtid_step_last") + --source include/assert.inc +} + +--let $extra_debug_eval= $_gsa_extra_debug_eval_old + +--source include/gtid_step_reset.inc + +--let $include_filename= gtid_step_assert.inc +--source include/end_include_file.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/gtid_step_reset.inc b/mysql-wsrep-5.6/mysql-test/include/gtid_step_reset.inc new file mode 100644 index 00000000..4dcaeff5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/gtid_step_reset.inc @@ -0,0 +1,18 @@ +# ==== Purpose ==== +# +# Remember the current value of @@GLOBAL.GTID_EXECUTED to be used by +# subsequent calls to gtid_step_assert.inc +# +# ==== Usage ==== +# +# --source include/gtid_step_reset.inc +# +# See gtid_step_assert.inc for details and examples. + +--let $include_filename= gtid_step_reset.inc +--source include/begin_include_file.inc + +--let $gtid_step_last= `SELECT @@GLOBAL.GTID_EXECUTED` + +--let $include_filename= gtid_step_reset.inc +--source include/end_include_file.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/gtid_utils.inc b/mysql-wsrep-5.6/mysql-test/include/gtid_utils.inc index ba460c7e..c5ccf018 100644 --- a/mysql-wsrep-5.6/mysql-test/include/gtid_utils.inc +++ b/mysql-wsrep-5.6/mysql-test/include/gtid_utils.inc @@ -4,22 +4,33 @@ # The functions are typically useful to check assertions related to # GTIDs. The following functions are defined: # -# GTID_IS_EQUAL(g1, g2) -# True if g1 and g2 are the same set -# GTID_IS_DISJOINT(g1, g2) -# True if g1 and g2 are disjoint -# GTID_IS_DISJOINT_UNION(g1, g2, sum) -# True if sum is the disjoint union of g1 and g2 -# GTID_UNION(g1, g2) -# Return the union of g1 and g2 -# GTID_INTERSECTION(g1, g2) -# Return the union of g1 and g2 -# GTID_SYMMETRIC_DIFFERENCE(g1, g2) -# Return the symmetric difference of g1 and g2 -# GTID_SUBTRACT_UUID(gtid, uuid) +# GTID_IS_EQUAL(gtid_set_1, gtid_set_2) +# True if gtid_set_1 and gtid_set_2 are the same set +# GTID_IS_DISJOINT(gtid_set_1, gtid_set_2) +# True if gtid_set_1 and gtid_set_2 are disjoint +# GTID_IS_DISJOINT_UNION(gtid_set_1, gtid_set_2, sum) +# True if sum is the disjoint union of gtid_set_1 and gtid_set_2 +# GTID_NORMALIZE(gtid_set) +# Return the gtid set in a normalized form: all uuids in alphabetic +# order, all intervals compressed and in order, no whitespace, all +# lowercase. +# GTID_UNION(gtid_set_1, gtid_set_2) +# Return the union of gtid_set_1 and gtid_set_2 +# GTID_INTERSECTION(gtid_set_1, gtid_set_2) +# Return the intersection of gtid_set_1 and gtid_set_2 +# GTID_SYMMETRIC_DIFFERENCE(gtid_set_1, gtid_set_2) +# Return the symmetric difference of gtid_set_1 and gtid_set_2 +# GTID_SUBTRACT_UUID(gtid_set, uuid) # Remove the UUID from the GTID set -# GTID_INTERSECTION_WITH_UUID(gtid, uuid) +# GTID_INTERSECTION_WITH_UUID(gtid_set, uuid) # Return only the gtids with the given uuid from the GTID set +# GTID_COUNT(gtid_set) +# Return the number of gtids in the gtid_set. +# GTID_NEXT_GENERATED(gtid_set, uuid) +# Return the next GNO that will be generated for the given uuid. +# GTID_NEXT_GENERATED_SET(gtid_set, uuid, count) +# Return the GTID set consisting of the next 'count' GTIDs that will +# be generated for the given uuid. # GTID_COMPARE(old, diff, new) # The same as GTID_IS_DISJOINT_UNION, except it has the following # additional feature: if diff begins by '~', then it returns true @@ -38,10 +49,18 @@ # # ==== Usage ==== # +# You should not normally source this file directly; instead set +# $rpl_gtid_utils=1 before sourcing master-slave.inc or rpl_init.inc. +# Then, the functions are automatically dropped in rpl_end.inc, and +# RESET MASTER is executed so that the functions do not pollute the +# binary log. +# +# If you really need to use this file manually, do this: +# # 1. Create the stored functions at the beginning of the test script: # # --source include/gtid_utils.inc -# +# # 2. Use the functions as you like during the test script. # # 3. Delete the stored functions at the end of the test script: @@ -52,7 +71,10 @@ --let $include_filename= gtid_utils.inc --source include/begin_include_file.inc ---disable_query_log +if (!$rpl_debug) +{ + --disable_query_log +} --delimiter | @@ -75,60 +97,131 @@ --let $uuidf= ffffffff-ffff-ffff-ffff-ffffffffffff # Return nonzero if the two gtid_sets are equal. -CREATE FUNCTION GTID_IS_EQUAL(g1 TEXT(10000), g2 TEXT(10000)) +CREATE FUNCTION GTID_IS_EQUAL(gtid_set_1 TEXT(10000), gtid_set_2 TEXT(10000)) RETURNS INT -BEGIN - RETURN GTID_SUBSET(g1, g2) AND GTID_SUBSET(g2, g1); -END| +RETURN GTID_SUBSET(gtid_set_1, gtid_set_2) AND GTID_SUBSET(gtid_set_2, gtid_set_1)| # Return nonzero if the two gtid_sets are disjoint. -CREATE FUNCTION GTID_IS_DISJOINT(g1 TEXT(10000), g2 TEXT(10000)) +CREATE FUNCTION GTID_IS_DISJOINT(gtid_set_1 TEXT(10000), gtid_set_2 TEXT(10000)) RETURNS INT -BEGIN - RETURN GTID_SUBSET(g1, GTID_SUBTRACT(g1, g2)); -END| +RETURN GTID_SUBSET(gtid_set_1, GTID_SUBTRACT(gtid_set_1, gtid_set_2))| -# Return true if g1 union g2 = sum, and g1 and g2 are disjoint. -CREATE FUNCTION GTID_IS_DISJOINT_UNION(g1 TEXT(10000), g2 TEXT(10000), sum TEXT(10000)) +# Return true if gtid_set_1 union gtid_set_2 = sum, and gtid_set_1 and gtid_set_2 are disjoint. +CREATE FUNCTION GTID_IS_DISJOINT_UNION(gtid_set_1 TEXT(10000), gtid_set_2 TEXT(10000), sum TEXT(10000)) RETURNS INT -BEGIN - RETURN GTID_IS_EQUAL(GTID_SUBTRACT(sum, g1), g2) AND - GTID_IS_EQUAL(GTID_SUBTRACT(sum, g2), g1); -END| +RETURN GTID_IS_EQUAL(GTID_SUBTRACT(sum, gtid_set_1), gtid_set_2) AND + GTID_IS_EQUAL(GTID_SUBTRACT(sum, gtid_set_2), gtid_set_1)| -# Return the union of g1 and g2. -CREATE FUNCTION GTID_UNION(g1 TEXT(10000), g2 TEXT(10000)) +# Return a normalized form of the GTID (all uppercase, no whitespace, +# no duplicates, uuids in alphabetic order, intervals in numeric +# order). +CREATE FUNCTION GTID_NORMALIZE(g TEXT(10000)) RETURNS TEXT(10000) -BEGIN - RETURN GTID_SUBTRACT(CONCAT(g1, ',', g2), ''); -END| +RETURN GTID_SUBTRACT(g, '')| -# Return the intersection of g1 and g2. -CREATE FUNCTION GTID_INTERSECT(g1 TEXT(10000), g2 TEXT(10000)) +# Return the union of gtid_set_1 and gtid_set_2. +CREATE FUNCTION GTID_UNION(gtid_set_1 TEXT(10000), gtid_set_2 TEXT(10000)) RETURNS TEXT(10000) -BEGIN - RETURN GTID_SUBTRACT(g1, GTID_SUBTRACT(g1, g2)); -END| +RETURN GTID_NORMALIZE(CONCAT(gtid_set_1, ',', gtid_set_2))| -# Return the symmetric difference between g1 and g2. -CREATE FUNCTION GTID_SYMMETRIC_DIFFERENCE(g1 TEXT(10000), g2 TEXT(10000)) +# Return the intersection of gtid_set_1 and gtid_set_2. +CREATE FUNCTION GTID_INTERSECTION(gtid_set_1 TEXT(10000), gtid_set_2 TEXT(10000)) RETURNS TEXT(10000) -BEGIN - RETURN SUBTRACT(CONCAT(g1, ',', g2), GTID_INTERSECTION(g1, g2)); -END| +RETURN GTID_SUBTRACT(gtid_set_1, GTID_SUBTRACT(gtid_set_1, gtid_set_2))| + +# Return the symmetric difference between gtid_set_1 and gtid_set_2. +CREATE FUNCTION GTID_SYMMETRIC_DIFFERENCE(gtid_set_1 TEXT(10000), gtid_set_2 TEXT(10000)) +RETURNS TEXT(10000) +RETURN GTID_SUBTRACT(CONCAT(gtid_set_1, ',', gtid_set_2), GTID_INTERSECTION(gtid_set_1, gtid_set_2))| # Return the gtid with uuid removed. -CREATE FUNCTION GTID_SUBTRACT_UUID(gtid TEXT(10000), uuid TEXT(10000)) +CREATE FUNCTION GTID_SUBTRACT_UUID(gtid_set TEXT(10000), uuid TEXT(100)) RETURNS TEXT(10000) +RETURN GTID_SUBTRACT(gtid_set, CONCAT(UUID, ':1-', 1 << 63 - 1))| + +# Return the intersection of gtid and uuid. +CREATE FUNCTION GTID_INTERSECTION_WITH_UUID(gtid_set TEXT(10000), uuid TEXT(100)) +RETURNS TEXT(10000) +RETURN GTID_SUBTRACT(gtid_set, GTID_SUBTRACT_UUID(gtid_set, uuid))| + +# If the first argument is nonzero, return it, else return the second argument +CREATE FUNCTION IFZERO(a INT, b INT) +RETURNS INT +RETURN IF(a = 0, b, a)| + +# Like the builtin LOCATE, but returns length+1 rather than 0 if nothing found. +CREATE FUNCTION LOCATE2(needle TEXT(10000), haystack TEXT(10000), offset INT) +RETURNS INT +RETURN IFZERO(LOCATE(needle, haystack, offset), LENGTH(haystack) + 1)| + +# Return the number of GTIDs in the given GTID set. +CREATE FUNCTION GTID_COUNT(gtid_set TEXT(10000)) +RETURNS INT BEGIN - RETURN GTID_SUBTRACT(gtid, CONCAT(UUID, ':1-', 1 << 62)); + DECLARE result BIGINT DEFAULT 0; + DECLARE colon_pos INT; + DECLARE next_dash_pos INT; + DECLARE next_colon_pos INT; + DECLARE next_comma_pos INT; + SET gtid_set = GTID_NORMALIZE(gtid_set); + SET colon_pos = LOCATE2(':', gtid_set, 1); + WHILE colon_pos != LENGTH(gtid_set) + 1 DO + SET next_dash_pos = LOCATE2('-', gtid_set, colon_pos + 1); + SET next_colon_pos = LOCATE2(':', gtid_set, colon_pos + 1); + SET next_comma_pos = LOCATE2(',', gtid_set, colon_pos + 1); + IF next_dash_pos < next_colon_pos AND next_dash_pos < next_comma_pos THEN + SET result = result + + SUBSTR(gtid_set, next_dash_pos + 1, + LEAST(next_colon_pos, next_comma_pos) - (next_dash_pos + 1)) - + SUBSTR(gtid_set, colon_pos + 1, next_dash_pos - (colon_pos + 1)) + 1; + ELSE + SET result = result + 1; + END IF; + SET colon_pos = next_colon_pos; + END WHILE; + RETURN result; END| -# Return the intersection of gtid and uuid. -CREATE FUNCTION GTID_INTERSECT_UUID(gtid TEXT(10000), uuid TEXT(10000)) +# Return the next GNO (numeric component) to be generated for the given UUID +CREATE FUNCTION GTID_NEXT_GENERATED(gtid_set TEXT(10000), uuid TEXT(100)) +RETURNS INT +BEGIN + DECLARE gtid_uuid TEXT(10000) DEFAULT GTID_INTERSECTION_WITH_UUID(gtid_set, uuid); + DECLARE colon_pos INT DEFAULT LOCATE2(':', gtid_uuid, 1); + DECLARE next_dash_pos INT DEFAULT LOCATE2('-', gtid_uuid, colon_pos + 1); + DECLARE next_comma_pos INT DEFAULT LOCATE2(',', gtid_uuid, colon_pos + 1); + DECLARE next_colon_pos INT DEFAULT LOCATE2(':', gtid_uuid, colon_pos + 1); + IF gtid_uuid = '' THEN + RETURN 1; + ELSEIF SUBSTR(gtid_uuid, colon_pos + 1, + LEAST(next_dash_pos, next_comma_pos, next_colon_pos) - + (colon_pos + 1)) != '1' THEN + RETURN 1; + ELSEIF next_dash_pos < LEAST(next_comma_pos, next_colon_pos) THEN + RETURN SUBSTR(gtid_uuid, next_dash_pos + 1, + LEAST(next_comma_pos, next_colon_pos) - + (next_dash_pos + 1)) + 1; + ELSE + RETURN 2; + END IF; +END| + +# Return a GTID set consisting of the the next 'count' GTIDs that will +# be generated for the given UUID. +# This is inefficient if count is big, consider optimizing it if needed. +CREATE FUNCTION GTID_NEXT_GENERATED_SET(gtid_set TEXT(10000), uuid TEXT(100), count INT) RETURNS TEXT(10000) BEGIN - RETURN GTID_SUBTRACT(gtid, GTID_SUBTRACT_UUID(gtid, uuid)); + DECLARE result TEXT(10000) DEFAULT ''; + DECLARE number INT; + DECLARE new_gtid VARCHAR(100); + WHILE count > 0 DO + SET new_gtid = CONCAT(uuid, ':', GTID_NEXT_GENERATED(gtid_set, uuid)); + SET result = GTID_UNION(result, new_gtid); + SET gtid_set = GTID_UNION(gtid_set, new_gtid); + SET count = count - 1; + END WHILE; + RETURN result; END| # Return true if gtid_set 'new' is obtained by adding 'diff' to 'old', @@ -137,16 +230,7 @@ END| # removed) from 'new'. CREATE FUNCTION GTID_COMPARE(old TEXT(10000), diff TEXT(10000), new TEXT(10000)) RETURNS INT -BEGIN - DECLARE tilde_pos INT DEFAULT LOCATE('~', diff); - DECLARE to_add TEXT(10000); - DECLARE to_remove TEXT(10000); - IF tilde_pos != 0 THEN - RETURN GTID_IS_DISJOINT_UNION(new, SUBSTR(diff, 2), old); - ELSE - RETURN GTID_IS_DISJOINT_UNION(old, diff, new); - END IF; -END| +RETURN IF(SUBSTR(diff, 1, 1) != '~', GTID_IS_DISJOINT_UNION(old, diff, new), GTID_IS_DISJOINT_UNION(new, SUBSTR(diff, 2), old))| # convert strings like '1:4-5,97:1' to # '01010101-0101-0101-0101-010101010101:4-5,97979797-9797-9797-9797-979797979797:1' diff --git a/mysql-wsrep-5.6/mysql-test/include/gtid_utils_end.inc b/mysql-wsrep-5.6/mysql-test/include/gtid_utils_end.inc index 6219367c..425f6b4c 100644 --- a/mysql-wsrep-5.6/mysql-test/include/gtid_utils_end.inc +++ b/mysql-wsrep-5.6/mysql-test/include/gtid_utils_end.inc @@ -14,11 +14,17 @@ DROP FUNCTION GTID_IS_EQUAL; DROP FUNCTION GTID_IS_DISJOINT; DROP FUNCTION GTID_IS_DISJOINT_UNION; +DROP FUNCTION GTID_NORMALIZE; DROP FUNCTION GTID_UNION; -DROP FUNCTION GTID_INTERSECT; +DROP FUNCTION GTID_INTERSECTION; DROP FUNCTION GTID_SYMMETRIC_DIFFERENCE; DROP FUNCTION GTID_SUBTRACT_UUID; -DROP FUNCTION GTID_INTERSECT_UUID; +DROP FUNCTION GTID_INTERSECTION_WITH_UUID; +DROP FUNCTION IFZERO; +DROP FUNCTION LOCATE2; +DROP FUNCTION GTID_COUNT; +DROP FUNCTION GTID_NEXT_GENERATED; +DROP FUNCTION GTID_NEXT_GENERATED_SET; DROP FUNCTION GTID_COMPARE; DROP FUNCTION NUMBER_TO_UUID; DROP FUNCTION UUID_TO_NUMBER; diff --git a/mysql-wsrep-5.6/mysql-test/include/have_QC_Disabled.inc b/mysql-wsrep-5.6/mysql-test/include/have_QC_Disabled.inc old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/include/have_perfschema.inc b/mysql-wsrep-5.6/mysql-test/include/have_perfschema.inc index 9e998ac4..ce52b17f 100644 --- a/mysql-wsrep-5.6/mysql-test/include/have_perfschema.inc +++ b/mysql-wsrep-5.6/mysql-test/include/have_perfschema.inc @@ -1,4 +1,5 @@ # Copyright (C) 2010 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 diff --git a/mysql-wsrep-5.6/mysql-test/include/have_util_nc.inc b/mysql-wsrep-5.6/mysql-test/include/have_util_nc.inc new file mode 100644 index 00000000..2e95dcec --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/have_util_nc.inc @@ -0,0 +1,53 @@ +# ==== Purpose ==== +# +# Check if nc/netcat utility is available +# The variable $nc contains name of utility +# (nc or netcat) +# +# ==== Usage ==== +# +# --source include/have_util_nc.inc +# ... +# --exec $nc some options +# + +disable_result_log; +disable_query_log; + +--let $nc= +--let $_outfile= $MYSQLTEST_VARDIR/tmp/have_nc.tmp + +# find nc + +--error 0,1,127 +--exec nc -h > $_outfile 2>&1 +--eval SET @content = LOAD_FILE('$_outfile') +--remove_file $_outfile + +if (`SELECT LOCATE('usage', @content) > 0`) { + --let $nc= nc + SET @content=""; +} + +# find netcat + +if (`SELECT '$nc' = ''`) { + --error 0,1,127 + --exec netcat -h > $_outfile 2>&1 + --eval SET @content = LOAD_FILE('$_outfile') + --remove_file $_outfile +} + +if (`SELECT LOCATE('usage', @content) > 0`) { + --let $nc= netcat + SET @content=""; +} + +# Skip the test case if utility not found +if (`SELECT '$nc' = ''`) { + --skip nc/netcat not found +} + +enable_query_log; +enable_result_log; + diff --git a/mysql-wsrep-5.6/mysql-test/include/install_semisync.inc b/mysql-wsrep-5.6/mysql-test/include/install_semisync.inc index b85ec48e..b110022b 100644 --- a/mysql-wsrep-5.6/mysql-test/include/install_semisync.inc +++ b/mysql-wsrep-5.6/mysql-test/include/install_semisync.inc @@ -5,7 +5,6 @@ --source include/begin_include_file.inc --source include/not_embedded.inc ---source include/not_gtid_enabled.inc --source include/have_semisync_plugin.inc --connection master diff --git a/mysql-wsrep-5.6/mysql-test/include/linux.inc b/mysql-wsrep-5.6/mysql-test/include/linux.inc new file mode 100644 index 00000000..f2ef6387 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/linux.inc @@ -0,0 +1,5 @@ +if (`select convert(@@version_compile_os using latin1) IN ("Linux") = 0`) +{ + skip Needs Linux; +} + diff --git a/mysql-wsrep-5.6/mysql-test/include/master-slave.inc b/mysql-wsrep-5.6/mysql-test/include/master-slave.inc index 9cc177e5..99000fe7 100644 --- a/mysql-wsrep-5.6/mysql-test/include/master-slave.inc +++ b/mysql-wsrep-5.6/mysql-test/include/master-slave.inc @@ -12,12 +12,13 @@ # [--let $rpl_debug= 1] # [--let $slave_timeout= NUMBER] # [--let $use_gtids= 1] +# [--let $rpl_gtid_utils= 1] # --source include/master-slave.inc # # Parameters: # $rpl_check_server_ids, $rpl_skip_reset_master_and_slave, # $rpl_skip_change_master, $rpl_skip_start_slave, $rpl_debug, -# $slave_timeout, $use_gtids +# $slave_timeout, $use_gtids, $rpl_gtid_utils # See include/rpl_init.inc # # $rpl_server_count diff --git a/mysql-wsrep-5.6/mysql-test/include/memcache_config.inc b/mysql-wsrep-5.6/mysql-test/include/memcache_config.inc old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/include/rpl_change_topology.inc b/mysql-wsrep-5.6/mysql-test/include/rpl_change_topology.inc index 29960cf2..01035497 100644 --- a/mysql-wsrep-5.6/mysql-test/include/rpl_change_topology.inc +++ b/mysql-wsrep-5.6/mysql-test/include/rpl_change_topology.inc @@ -231,6 +231,16 @@ if (!$rpl_skip_change_master) { --echo \$_rpl_server='$_rpl_server' \$_rpl_master='$_rpl_master' } + if (!$use_gtids) + { + --let $rpl_connection_name= server_$_rpl_server + --source include/rpl_connection.inc + --let $_master_auto_position= query_get_value(SHOW SLAVE STATUS, Auto_Position, 1) + if ($_master_auto_position == 1) + { + CHANGE MASTER TO MASTER_AUTO_POSITION= 0; + } + } if ($_rpl_master != '') { # Get port number diff --git a/mysql-wsrep-5.6/mysql-test/include/rpl_connection_master1.inc b/mysql-wsrep-5.6/mysql-test/include/rpl_connection_master1.inc new file mode 100644 index 00000000..372a1d12 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/rpl_connection_master1.inc @@ -0,0 +1,2 @@ +let $rpl_connection_name= master1; +source include/rpl_connection.inc; diff --git a/mysql-wsrep-5.6/mysql-test/include/rpl_end.inc b/mysql-wsrep-5.6/mysql-test/include/rpl_end.inc index f671c442..541f0b99 100644 --- a/mysql-wsrep-5.6/mysql-test/include/rpl_end.inc +++ b/mysql-wsrep-5.6/mysql-test/include/rpl_end.inc @@ -16,6 +16,7 @@ # # [--let $rpl_only_running_threads= 1] # [--let $rpl_debug= 1] +# [--let $rpl_gtid_utils= 1] # --source include/rpl_end.inc # # Parameters: @@ -27,6 +28,9 @@ # $rpl_debug # See include/rpl_init.inc # +# $rpl_gtid_utils +# Source include/gtid_utils_end.inc on every server. +# # Note: # This script will fail if Last_SQL_Error or Last_IO_Error is # nonempty. If you expect an error in the SQL thread, you should @@ -82,6 +86,7 @@ while ($_rpl_server) # mtr configures server 2 to be a slave before it runs the test. We # have to restore that state now, so we change topology to 1->2. --let $rpl_topology= none +--let $use_gtids= 0 --source include/rpl_change_topology.inc @@ -90,6 +95,15 @@ while ($_rpl_server) --let $_rpl_one= _1 while ($_rpl_server) { + if ($rpl_gtid_utils) + { + # Drop gtid_utils + --let $rpl_connection_name= server_$_rpl_server + --source include/rpl_connection.inc + --source include/gtid_utils_end.inc + --connection default + } + # Unconfigure connections --disconnect server_$_rpl_server --disconnect server_$_rpl_server$_rpl_one --dec $_rpl_server diff --git a/mysql-wsrep-5.6/mysql-test/include/rpl_init.inc b/mysql-wsrep-5.6/mysql-test/include/rpl_init.inc index c7e407e5..f0f6e32f 100644 --- a/mysql-wsrep-5.6/mysql-test/include/rpl_init.inc +++ b/mysql-wsrep-5.6/mysql-test/include/rpl_init.inc @@ -51,6 +51,7 @@ # [--let $rpl_debug= 1] # [--let $slave_timeout= NUMBER] # [--let $use_gtids= 1] +# [--let $rpl_gtid_utils= 1] # --source include/rpl_init.inc # # Parameters: @@ -107,6 +108,10 @@ # $use_gtids # Use option MASTER_AUTO_POSITION = 1 to CHANGE MASTER. # +# $rpl_gtid_utils +# Create stored functions for GTID manipulation on every server (see +# gtid_utils.inc). +# # # ==== Side effects ==== # @@ -198,6 +203,10 @@ while ($_rpl_server) --let $rpl_connection_name= server_$_rpl_server --source include/rpl_connection.inc USE test; + if ($rpl_gtid_utils) + { + --source include/gtid_utils.inc + } if (!$rpl_skip_reset_master_and_slave) { RESET MASTER; @@ -245,6 +254,10 @@ 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'`) +{ + --let $use_gtids=1 +} --let $rpl_master_list= `SELECT REPEAT('x', $rpl_server_count * LENGTH($rpl_server_count))` --source include/rpl_change_topology.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/rpl_stop_server.inc b/mysql-wsrep-5.6/mysql-test/include/rpl_stop_server.inc index 98c7bb82..42898ca8 100644 --- a/mysql-wsrep-5.6/mysql-test/include/rpl_stop_server.inc +++ b/mysql-wsrep-5.6/mysql-test/include/rpl_stop_server.inc @@ -6,6 +6,7 @@ # # --let $rpl_server_number= N # [--let $rpl_debug= 1] +# [--let $rpl_force_stop= 1] # --source include/rpl_stop_server.inc # # Parameters: @@ -17,6 +18,8 @@ # # $rpl_debug # See include/rpl_init.inc +# $rpl_force_stop +# Kill the server immediately i.e., --shutdown_server 0 # # ==== See also ==== # @@ -48,11 +51,15 @@ if ($rpl_debug) # Send shutdown to the connected server and give # it 14 seconds to die before zapping it -shutdown_server 14; - +--let $shutdown_server_timeout= 14 +if ($rpl_force_stop) +{ + # if force_stop is set, shutdown server immediately(equal to killing the server) + --let $shutdown_server_timeout= 0 +} +shutdown_server $shutdown_server_timeout; --source include/wait_until_disconnected.inc - --let $rpl_connection_name= $_rpl_stop_server_old_connection --source include/rpl_connection.inc --dec $_include_file_depth diff --git a/mysql-wsrep-5.6/mysql-test/include/save_io_thread_pos.inc b/mysql-wsrep-5.6/mysql-test/include/save_io_thread_pos.inc index e59ee162..a266d871 100644 --- a/mysql-wsrep-5.6/mysql-test/include/save_io_thread_pos.inc +++ b/mysql-wsrep-5.6/mysql-test/include/save_io_thread_pos.inc @@ -28,7 +28,7 @@ if ($use_gtids) { - --let $_saved_gtids= query_get_value(SHOW SLAVE STATUS, Retrieved_Gtid_set, 1) + --let $_saved_gtids= query_get_value(SHOW SLAVE STATUS, Retrieved_Gtid_Set, 1) if ($rpl_debug) { --echo save_io_thread_pos.inc saved gtid='$_saved_gtids' diff --git a/mysql-wsrep-5.6/mysql-test/include/save_master_pos.inc b/mysql-wsrep-5.6/mysql-test/include/save_master_pos.inc index 16d6e974..fd54f09b 100644 --- a/mysql-wsrep-5.6/mysql-test/include/save_master_pos.inc +++ b/mysql-wsrep-5.6/mysql-test/include/save_master_pos.inc @@ -27,18 +27,21 @@ --let $include_filename= save_master_pos.inc --source include/begin_include_file.inc +# +# Always save master positions, this will be useful to check missing GTIDs. +# +--let $_saved_file= query_get_value(SHOW MASTER STATUS, File, 1) +--let $_saved_pos= query_get_value(SHOW MASTER STATUS, Position, 1) if ($use_gtids) { --let $_saved_gtids= `SELECT @@global.gtid_executed` if ($rpl_debug) { - --echo save_master_pos saved gtid='$_saved_gtids' + --echo save_master_pos saved gtid='$_saved_gtids', file='$_saved_file', pos='$_saved_pos' } } if (!$use_gtids) { - --let $_saved_file= query_get_value(SHOW MASTER STATUS, File, 1) - --let $_saved_pos= query_get_value(SHOW MASTER STATUS, Position, 1) if ($rpl_debug) { --echo save_master_pos saved file='$_saved_file', pos='$_saved_pos' diff --git a/mysql-wsrep-5.6/mysql-test/include/show_all_binlogs.inc b/mysql-wsrep-5.6/mysql-test/include/show_all_binlogs.inc new file mode 100644 index 00000000..e8985f93 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/show_all_binlogs.inc @@ -0,0 +1,66 @@ +# ==== Purpose ==== +# +# Print the contents of all binary logs to the result log. This must +# only be used for debugging. +# +# ==== Usage ==== +# +# [--let $output_file= FILENAME] +# [--let $append= 1] +# [--let $rpl_debug= 1] +# --source include/show_all_binlogs.inc +# +# Parameters: +# +# $output_file +# By default, output is printed to the result log. If you need to +# print it to a specific file, specify the filename with this +# parameter. +# +# $append +# By default, if $output_file is specified and the file exists, +# this script truncates the file before it writes to it. If +# $append is specified, the file is not truncated and the contents +# of the binary log is appended to the end. +# +# $rpl_debug +# See rpl_init.inc + +--let $include_filename= show_all_binlogs.inc +--source include/begin_include_file.inc + + +--disable_query_log + +if ($output_file == '') +{ + --echo DO_NOT_CHECK_IN_THIS_LINE: include/show_all_binlogs.inc should only be used for debugging. Never check in a test that calls it on success. +} + +--let $number= 1 +--let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, $number) +while ($binlog_file != 'No such row') +{ + --let $statement= SHOW BINLOG EVENTS IN '$binlog_file' + --let $header= ======== $statement ======== + + if ($output_file != '') + { + --let $write_var= $header + --let $write_to_file= $output_file + --source include/write_var_to_file.inc + + --source include/write_result_to_file.inc + } + if ($output_file == '') + { + --echo $header + eval $statement; + } + --inc $number + + --let $binlog_file= query_get_value(SHOW BINARY LOGS, Log_name, $number) +} + + +--source include/end_include_file.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/show_all_relay_logs.inc b/mysql-wsrep-5.6/mysql-test/include/show_all_relay_logs.inc new file mode 100644 index 00000000..1e5cb73e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/show_all_relay_logs.inc @@ -0,0 +1,70 @@ +# ==== Purpose ==== +# +# Print the contents of all relay logs to the result log. This must +# only be used for debugging. +# +# ==== Usage ==== +# +# [--let $output_file= FILENAME] +# [--let $append= 1] +# [--let $rpl_debug= 1] +# --source include/show_all_binlogs.inc +# +# Parameters: +# +# $output_file +# By default, output is printed to the result log. If you need to +# print it to a specific file, specify the filename with this +# parameter. +# +# $append +# By default, if $output_file is specified and the file exists, +# this script truncates the file before it writes to it. If +# $append is specified, the file is not truncated and the contents +# of the binary log is appended to the end. +# +# $rpl_debug +# See rpl_init.inc + +--let $include_filename= show_all_relay_logs.inc +--source include/begin_include_file.inc + + +--disable_query_log + +if ($output_file == '') +{ + --echo DO_NOT_CHECK_IN_THIS_LINE: include/show_all_relay_logs.inc should only be used for debugging. Never check in a test that calls it on success. +} + +--let $last_relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1) +--let $relay_log_base= `SELECT SUBSTRING_INDEX('$last_relay_log_file', '.', 1)` +--let $relay_log_count= `SELECT CONCAT('1', SUBSTRING_INDEX('$last_relay_log_file', '.', -1)) - 1000000` +--let $number= 1 +while ($number <= $relay_log_count) +{ + --let $padded_number= `SELECT LPAD('$number', 6, '0')` + --let $statement= SHOW RELAYLOG EVENTS IN '$relay_log_base.$padded_number' + --let $header= ======== $statement ======== + + if ($output_file != '') + { + --let $write_to_file= $output_file + --let $write_var= $header + --let $allow_error= 1 + --source include/write_var_to_file.inc + + --source include/write_result_to_file.inc + } + if ($output_file == '') + { + --echo $header + --error 0, 1220 # 1220 = ER_ERROR_WHEN_EXECUTING_COMMAND + eval $statement; + } + + --inc $number +} + + +--source include/end_include_file.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/show_rpl_debug_info.inc b/mysql-wsrep-5.6/mysql-test/include/show_rpl_debug_info.inc index a20520ee..2399dd75 100644 --- a/mysql-wsrep-5.6/mysql-test/include/show_rpl_debug_info.inc +++ b/mysql-wsrep-5.6/mysql-test/include/show_rpl_debug_info.inc @@ -21,6 +21,8 @@ # ==== Usage ==== # # [--let $rpl_only_current_connection= 1] +# [--let $extra_debug_info= some text] +# [--let $extra_debug_eval= expression parsable by include/eval.inc] # --source include/show_rpl_debug_info.inc # # Parameters: @@ -28,7 +30,14 @@ # By default, debug info is printed from all connections, starting # with the current connection. If this variable is set, debug # info is printed only for the current connection. -# +# +# $extra_debug_info +# This text is printed verbatim to the output. Useful for helper +# scripts to supply extra diagnostic output. +# +# $extra_debug_eval +# Expression in the form expected by include/eval.inc, which will +# be evaluated and printed to the output. # # ==== Side effects ==== # @@ -56,6 +65,8 @@ if ($_rpl_server == '') } --inc $_rpl_server +--echo DO_NOT_CHECK_IN_THIS_LINE: include/show_rpl_debug_info.inc should only be used for debugging. Never check in a test that calls it on success. + --echo CURRENT_CONNECTION = '$_rpl_old_con' while ($_rpl_server) @@ -124,6 +135,12 @@ while ($_rpl_server) --echo rand_seed: '$rand_seed' _rand_state: '$_rand_state' --echo extra debug info if any: '$extra_debug_info' +if ($extra_debug_eval) +{ + --let $eval_expr= $extra_debug_eval + --source include/eval.inc + --echo extra evaluated debug info: '$eval_result' +} --connection $_rpl_old_con --enable_abort_on_error diff --git a/mysql-wsrep-5.6/mysql-test/include/shutdown_mysqld.inc b/mysql-wsrep-5.6/mysql-test/include/shutdown_mysqld.inc old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/include/start_mysqld.inc b/mysql-wsrep-5.6/mysql-test/include/start_mysqld.inc old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/include/stop_dump_threads.inc b/mysql-wsrep-5.6/mysql-test/include/stop_dump_threads.inc index 9ffc826f..afeb6cb8 100644 --- a/mysql-wsrep-5.6/mysql-test/include/stop_dump_threads.inc +++ b/mysql-wsrep-5.6/mysql-test/include/stop_dump_threads.inc @@ -15,7 +15,7 @@ --disable_query_log --disable_result_log ---let $_sdt_dump_thread_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump'` +--let $_sdt_dump_thread_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump' OR COMMAND = 'Binlog Dump GTID'` while ($_sdt_dump_thread_id != '') { @@ -23,10 +23,9 @@ while ($_sdt_dump_thread_id != '') --let $wait_condition= SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = $_sdt_dump_thread_id --source include/wait_condition.inc - --let $_sdt_dump_thread_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump'` + --let $_sdt_dump_thread_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND = 'Binlog dump' OR COMMAND = 'Binlog Dump GTID'` } - --let $show_rpl_debug_info= $_sdt_show_rpl_debug_info_old --let $include_filename= stop_dump_threads.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/subquery.inc b/mysql-wsrep-5.6/mysql-test/include/subquery.inc index 8d973f68..119414c8 100644 --- a/mysql-wsrep-5.6/mysql-test/include/subquery.inc +++ b/mysql-wsrep-5.6/mysql-test/include/subquery.inc @@ -6178,5 +6178,21 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; DROP TABLE t1, t2; +--echo # Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +--echo # + +CREATE TABLE t1 ( + f1 INTEGER, + f2 INTEGER +); + +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); + +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); + +DROP TABLE t1; + +--echo # End of test for Bug#18014565 + set @@optimizer_switch=@old_opt_switch; # New tests go here. diff --git a/mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc b/mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc index 93cbf287..15de01bc 100644 --- a/mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc +++ b/mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc @@ -1417,6 +1417,53 @@ eval $query; DROP TABLE t1,t2,t3; +--echo # +--echo # Bug#19297190 NOT IN DOESN'T RETURN EXPECTED RESULT +--echo # + +CREATE TABLE t1 (a VARCHAR(500) CHARACTER SET UTF8) ENGINE=INNODB; + +# Fill the table with 32 distinct long rows (>32kB of data) +SET @str= repeat("a",450); +SET @num=1000; +INSERT INTO t1 VALUES (CONCAT((@num:=@num+1), @str)); +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +SELECT COUNT(*) FROM t1; + +ANALYZE TABLE t1; + +let $query= +SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( + SELECT t2.a FROM t1 as t2 +); + +# If subq-mat is used, this will force MEMORY->MYISAM tmp table conversion: +set @save_heap_size= @@max_heap_table_size; +set @@max_heap_table_size= 16384; + +# Uses IN->EXISTS because field too long for subq-materialization: +eval EXPLAIN $query; +eval $query; + +# Make field just below the length limit: +# Silence truncation warnings: +--disable_warnings +ALTER TABLE t1 MODIFY a VARCHAR(332) CHARACTER SET UTF8; +--enable_warnings + +# Now subquery materialization can be used, and result is still correct: +eval EXPLAIN $query; +eval $query; + +DROP TABLE t1; +set @@max_heap_table_size= @save_heap_size; + --echo # End of 5.6 tests set @@optimizer_switch=@old_opt_switch; diff --git a/mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc b/mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc index 34aa48dd..208932cb 100644 --- a/mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc +++ b/mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc @@ -6442,6 +6442,86 @@ DROP TABLE t1, t2; --echo # End of test for bug#14064201. +--echo # +--echo # Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +--echo # && IDX < PARENT_JOIN->TABLES +--echo # + +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); + +SELECT(SELECT 1 + FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) + FROM b) IN (SELECT d FROM c)) as cc FROM b; + +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN + (SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN + (SELECT d FROM c)) as cc FROM c; +DROP TABLE b,c; + +--echo # +--echo # Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +--echo # +CREATE TABLE b ( + d INT(11) +); +CREATE TABLE c ( + d BLOB +) ; +CREATE TABLE d ( + b INT(11) +); + +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; + +DROP TABLE b,c,d; + +--echo # +--echo # Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +--echo # +CREATE TABLE t1 ( + ID int(11) NOT NULL AUTO_INCREMENT, + id2 int(11) DEFAULT NULL, + id3 int(11) DEFAULT NULL, + id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, + id5 int(11) DEFAULT NULL, + PRIMARY KEY (ID), + KEY id2 (id2), + KEY id3 (id3), + KEY id5 (id5) +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); + +CREATE TABLE t2 ( + id6 int(11) NOT NULL, + id7 int(11) NOT NULL, + PRIMARY KEY (id6,id7), + KEY id7 (id7) +) ENGINE=InnoDB; + +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); + +SELECT ID + FROM t1 p0 + WHERE p0.id3=1 + AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); + +DROP TABLE t1,t2; + set @@optimizer_switch=@old_opt_switch; # New tests go here. diff --git a/mysql-wsrep-5.6/mysql-test/include/sync_slave_sql.inc b/mysql-wsrep-5.6/mysql-test/include/sync_slave_sql.inc index 4f9fc052..834acad8 100644 --- a/mysql-wsrep-5.6/mysql-test/include/sync_slave_sql.inc +++ b/mysql-wsrep-5.6/mysql-test/include/sync_slave_sql.inc @@ -22,6 +22,11 @@ # # $use_gtids # If set, uses GTIDs instead of filename and offset for positions. +# +# $ignore_gtids_on_sync +# Forces the use of master file and position, even if $use_gtids is set. +# This might be used if the slave will not have all the GTIDs of the master +# but have to read and apply all master events to the end. --let $include_filename= sync_slave_sql.inc --source include/begin_include_file.inc @@ -34,10 +39,40 @@ if (!$_sss_slave_timeout) if ($rpl_debug) { - --echo use_gtids='$use_gtids' _saved_gtids='$_saved_gtids' _saved_file='$_saved_file' _saved_pos='$_saved_pos' timeout='$_sss_slave_timeout' + --echo use_gtids='$use_gtids' ignore_gtids_on_sync='$ignore_gtids_on_sync' _saved_gtids='$_saved_gtids' _saved_file='$_saved_file' _saved_pos='$_saved_pos' timeout='$_sss_slave_timeout' +} + +# +# Verify if the SQL thread is already updated by the master position +# regardless the use if GTIDs. If the SQL thread is already updated, +# we can reduce the slave timeout of WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS +# to a minimum because there in nothing else to sync. +# As there is a possibility of missing GTIDs on slave, this reduced +# timeout will make mtr throw an error almost promptly, without having +# to wait 300 seconds to notice a sync problem between master and slave. +# +--let $_slave_master_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1) +--let $_slave_master_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) +if ($_slave_master_file == $_saved_file) +{ + if ($_slave_master_pos == $_saved_pos) + { + if ($rpl_debug) + { + --echo debug: It seems that SQL thread is already synced (by verifying master file and position) + --echo debug: Changing slave timeout to 1 seconds + } + --let $_sss_slave_timeout= 1 + } +} + +--let $_sync_with_gtids= $use_gtids +if ($ignore_gtids_on_sync) +{ + --let $_sync_with_gtids= 0 } -if ($use_gtids) +if ($_sync_with_gtids) { if ($rpl_debug) { @@ -45,7 +80,7 @@ if ($use_gtids) } --let $_sss_result= `SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('$_saved_gtids', $_sss_slave_timeout)` } -if (!$use_gtids) +if (!$_sync_with_gtids) { if ($rpl_debug) { @@ -61,7 +96,7 @@ if ($_sss_result == '') } if ($_sss_result == -1) { - --let $error_type= Timeout after $slave_timeout seconds. + --let $error_type= Timeout after $_sss_slave_timeout seconds. } if ($_sss_result < 0) diff --git a/mysql-wsrep-5.6/mysql-test/include/sync_slave_sql_with_master.inc b/mysql-wsrep-5.6/mysql-test/include/sync_slave_sql_with_master.inc index 7204f0b2..e2c5c52d 100644 --- a/mysql-wsrep-5.6/mysql-test/include/sync_slave_sql_with_master.inc +++ b/mysql-wsrep-5.6/mysql-test/include/sync_slave_sql_with_master.inc @@ -37,6 +37,7 @@ --let $include_filename= sync_slave_sql_with_master.inc --source include/begin_include_file.inc +--source include/wait_for_ndb_committed_to_binlog.inc --source include/save_master_pos.inc --let $rpl_connection_name= slave diff --git a/mysql-wsrep-5.6/mysql-test/include/truncate_file.inc b/mysql-wsrep-5.6/mysql-test/include/truncate_file.inc index 2326d6c0..c55627b5 100644 --- a/mysql-wsrep-5.6/mysql-test/include/truncate_file.inc +++ b/mysql-wsrep-5.6/mysql-test/include/truncate_file.inc @@ -9,8 +9,8 @@ if (!$file) let TRUNCATE_FILE= $file; perl; -use Env; -Env::import('TRUNCATE_FILE'); -open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file"; +my $filename = $ENV{'TRUNCATE_FILE'}; +$filename =~ s/\/\//\//; +open FILE, '>', $filename || die "Can not open file $filename"; close FILE; EOF diff --git a/mysql-wsrep-5.6/mysql-test/include/uninstall_semisync.inc b/mysql-wsrep-5.6/mysql-test/include/uninstall_semisync.inc index 18e43486..dfe286b1 100644 --- a/mysql-wsrep-5.6/mysql-test/include/uninstall_semisync.inc +++ b/mysql-wsrep-5.6/mysql-test/include/uninstall_semisync.inc @@ -13,6 +13,11 @@ UNINSTALL PLUGIN rpl_semi_sync_slave; --connection master +# After BUG#17638477 fix, uninstallation of rpl_semi_sync_master +# is not allowed when there are semi sync slaves. Hence kill +# all dump threads before uninstalling it. +SET GLOBAL rpl_semi_sync_master_enabled = OFF; +--source include/stop_dump_threads.inc UNINSTALL PLUGIN rpl_semi_sync_master; --enable_warnings diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_for_ndb_committed_to_binlog.inc b/mysql-wsrep-5.6/mysql-test/include/wait_for_ndb_committed_to_binlog.inc new file mode 100644 index 00000000..08dcbac4 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/wait_for_ndb_committed_to_binlog.inc @@ -0,0 +1,57 @@ +# ==== 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 file waits for all committed transactions (at start +# of file) are injected into the binlog. +# +# ==== Usage ==== +# +# let $wait_timeout= 150; +# --source include/wait_for_ndb_committed_to_binlog.inc +# +# ==== Parameters ===== +# +# $wait_timeout +# Time to wait in seconds for epoch to be injected in binlog. +# On timeout test dies. +# + +if (`SELECT 1 FROM information_schema.engines WHERE engine = 'ndbcluster' AND support IN ('YES', 'DEFAULT')`) +{ + let $max_run_time= 150; + if ($wait_timeout) + { + let $max_run_time= $wait_timeout; + } + # Reset $wait_timeout so that its value won't be used on subsequent + # calls, and default will be used instead. + let $wait_timeout= 0; + + # The smallest timespan till UNIX_TIMESTAMP() gets incremented is ~0 seconds. + # We add one second to avoid the case that somebody measures timespans on a + # real clock with fractions of seconds, detects that n seconds are sufficient, + # assigns n to this routine and suffers because he sometimes gets n - 1 + # seconds in reality. + + let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time + 1`; + + source include/get_ndb_epochs.inc; + + while (`SELECT $ndb_latest_trans_epoch > $ndb_latest_handled_binlog_epoch AND UNIX_TIMESTAMP() <= $max_end_time`) + { + # Sleep a bit to avoid too heavy load. + sleep 0.1; + + source include/get_ndb_epochs.inc; + } + + if (`SELECT $ndb_latest_trans_epoch > $ndb_latest_handled_binlog_epoch`) + { + echo ERROR IN TEST: Timeout in waiting for epoch $ndb_latest_trans_epoch to be handled, last handled is $ndb_latest_handled_binlog_epoch; + die ERROR IN TEST: Timeout in waiting for epoch to be handled; + } +} diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_param.inc b/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_param.inc index 75db9a31..d181f955 100644 --- a/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_param.inc +++ b/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_param.inc @@ -12,7 +12,7 @@ # [--let $slave_timeout= NUMBER] # [--let $slave_error_param= [Slave_SQL_Errno | Slave_IO_Errno]] # [--let $rpl_debug= 1] -# --source include/slave_wait_param.inc +# --source include/wait_for_slave_param.inc # # Parameters: # diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_sql_error.inc index d2818f65..8697ca05 100644 --- a/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_sql_error.inc +++ b/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_sql_error.inc @@ -6,7 +6,7 @@ # # ==== Usage ==== # -# --let $slave_sql_errno= NUMBER +# --let $slave_sql_errno= NUMBER [, NUMBER ...] [# comment] # [--let $show_slave_sql_error= 1] # [--let $rpl_debug= 1] # [--let $slave_timeout= NUMBER] @@ -14,7 +14,13 @@ # # Parameters: # $slave_sql_errno -# The expected SQL error number. This is required. +# The expected SQL error numbers. This can be either a single +# number, or a comma-separated list of numbers. Examples: +# --let $slave_sql_errno= 1040, 1053, 2002, 2003, 2006, 2013 +# --let $slave_sql_errno= 1593 # ER_SLAVE_FATAL_ERROR +# It is allowed to add a comment at the end of the line, and it +# is strongly advised to put the symbolic name of the error in +# this comment, like the example above. # (After BUG#41956 has been fixed, this will be required to be a # symbolic name instead of a number.) # @@ -50,7 +56,15 @@ if ($slave_sql_errno == '') { --die !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_for_slave_sql_error.inc } -if (`SELECT $_wfsse_errno NOT IN ($slave_sql_errno)`) { +# Strip away comments +--let $_slave_sql_errno= `SELECT IF(LOCATE('#', '$slave_sql_errno') != 0, SUBSTR('$slave_sql_errno', 1, LOCATE('#', '$slave_sql_errno') - 1), '$slave_sql_errno')` + +if ($rpl_debug) +{ + --echo # debug: slave_sql_errno='$_slave_sql_errno'; stripped from comments='$_slave_sql_errno' wfsie_errno='$_wfsie_errno' +} + +if (`SELECT $_wfsse_errno NOT IN ($_slave_sql_errno)`) { --echo **** Slave stopped with wrong error code: $_wfsse_errno (expected $slave_sql_errno) **** source include/show_rpl_debug_info.inc; --echo **** Slave stopped with wrong error code: $_wfsse_errno (expected $slave_sql_errno) **** diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_sql_to_stop.inc index 492b3237..f81768cd 100644 --- a/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_sql_to_stop.inc +++ b/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_sql_to_stop.inc @@ -31,6 +31,7 @@ --let $slave_param= Slave_SQL_Running --let $slave_param_value= No +--let $slave_param_comparison= = --let $slave_error_param= Last_SQL_Errno --source include/wait_for_slave_param.inc --let $slave_error_param= diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_show_condition.inc b/mysql-wsrep-5.6/mysql-test/include/wait_show_condition.inc index ae1600a7..2afde7ff 100644 --- a/mysql-wsrep-5.6/mysql-test/include/wait_show_condition.inc +++ b/mysql-wsrep-5.6/mysql-test/include/wait_show_condition.inc @@ -9,7 +9,7 @@ # # USAGE # -# All rows of the result must fulfil the condition if $all_rows_fulfil is 1 +# All rows of the result must fulfil the condition if $wait_for_all is 1 # else at least one of the result must fulfil the condition. # let $wait_for_all= 1; # let $show_statement= SHOW PROCESSLIST; @@ -87,6 +87,11 @@ if ($wait_for_all != 1) # We are behind the last row of the result set. let $process_result= 0; let $do_loop= 0; + # For string fields and for "!=" comparision, it is possible that + # above if condition (i.e., SELECT '$field_value' $condition) is + # true and the current if condition is also true. So set $found=0 + # here explicitly + let $found= 0; } inc $rowno; } diff --git a/mysql-wsrep-5.6/mysql-test/include/write_result_to_file.inc b/mysql-wsrep-5.6/mysql-test/include/write_result_to_file.inc index 80d67a0c..75caf021 100644 --- a/mysql-wsrep-5.6/mysql-test/include/write_result_to_file.inc +++ b/mysql-wsrep-5.6/mysql-test/include/write_result_to_file.inc @@ -12,6 +12,8 @@ # --let $statement= <STATEMENT> # --let $output_file= {<FILE>|GENERATE} # [--let $dont_print_statement= 1] +# [--let $allow_error= 1] +# [--let $append= 1] # --source include/write_result_to_file.inc # # Parameters: @@ -27,6 +29,14 @@ # By default, the statement is echoed to the result log. If the # statement contains non-deterministic output, set this variable # to suppress it. +# +# $allow_error +# By default, this script causes the test to fail if the statement +# generates an error. If $allow_error is set, errors are ignored. +# +# $append +# By default, any existing file is overwritten. If $append is +# specified, and the file exists, it appends to the file. # Get the port and socket used by mysqld on current connection --let _WRTF_SERVER_PORT= `SELECT @@PORT` @@ -58,19 +68,37 @@ if ($output_file == GENERATE) } --let _WRTF_OUTPUT_FILE= $output_file +if ($allow_error) +{ + --let _WRTF_ALLOW_ERROR= 1 +} +if (!$allow_error) +{ + --let _WRTF_ALLOW_ERROR= 0 +} +if ($append) +{ + --let _WRTF_APPEND= 1 +} +if (!$append) +{ + --let _WRTF_APPEND= 0 +} + perl; use strict; my $stmt= $ENV{'_WRTF_STATEMENT'}; # Connecting mysql to same mysqld as current connectiona # by overriding port and socket - my $mysql = $ENV{'MYSQL'}; + my $mysql= $ENV{'MYSQL'}; my $server_port= $ENV{'_WRTF_SERVER_PORT'}; my $server_socket= $ENV{'_WRTF_SERVER_SOCKET'}; + my $redirection_type= $ENV{'_WRTF_APPEND'} ? '>>' : '>'; $mysql .= " --port=$server_port --socket=$server_socket"; my $outfile = $ENV{'_WRTF_OUTPUT_FILE'}; - open MYSQL, "| $mysql > $outfile" or die "Failed to open MYSQL pipe: '$mysql > $outfile'"; + open MYSQL, "| $mysql $redirection_type $outfile" or die "Failed to open MYSQL pipe: '$mysql > $outfile'"; print MYSQL $stmt, ';' or die "Error printing statement to MYSQL pipe: $!"; - close MYSQL or die "Error closing MYSQL pipe: $!"; + close MYSQL or $ENV{'_WRTF_ALLOW_ERROR'} or die "Error closing MYSQL pipe: $!"; EOF --let $include_filename= write_result_to_file.inc [$write_result_msg] diff --git a/mysql-wsrep-5.6/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-wsrep-5.6/mysql-test/lib/My/SafeProcess/CMakeLists.txt index ada3777b..c75e09f5 100644 --- a/mysql-wsrep-5.6/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-wsrep-5.6/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -29,7 +29,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") STRING(REPLACE " -library=stlport4" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE " -library=stlport4" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) STRING(REPLACE " -library=stlport4" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) - STRING(REGEX REPLACE " -R[^ ]+" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS}) + STRING(REGEX REPLACE " -R[^ ]+" "" CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS}") ENDIF() ENDIF() diff --git a/mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm b/mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm index ae1d465e..45867d21 100644 --- a/mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm +++ b/mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -336,7 +336,7 @@ sub collect_one_suite($) # Build a hash of disabled testcases for this suite # ---------------------------------------------------------------------- my %disabled; - my @disabled_collection= @{$opt_skip_test_list} if defined @{$opt_skip_test_list}; + my @disabled_collection= @{$opt_skip_test_list} if $opt_skip_test_list; unshift (@disabled_collection, "$testdir/disabled.def"); for my $skip (@disabled_collection) { diff --git a/mysql-wsrep-5.6/mysql-test/lib/mtr_match.pm b/mysql-wsrep-5.6/mysql-test/lib/mtr_match.pm index 6fc9832a..140885b6 100644 --- a/mysql-wsrep-5.6/mysql-test/lib/mtr_match.pm +++ b/mysql-wsrep-5.6/mysql-test/lib/mtr_match.pm @@ -1,5 +1,6 @@ # -*- cperl -*- # Copyright (C) 2004-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 diff --git a/mysql-wsrep-5.6/mysql-test/mysql-test-run.pl b/mysql-wsrep-5.6/mysql-test/mysql-test-run.pl index b293ae39..82b5d1c6 100755 --- a/mysql-wsrep-5.6/mysql-test/mysql-test-run.pl +++ b/mysql-wsrep-5.6/mysql-test/mysql-test-run.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,6 +235,7 @@ our $opt_ddd; our $opt_client_ddd; my $opt_boot_ddd; our $opt_manual_gdb; +our $opt_manual_lldb; our $opt_manual_dbx; our $opt_manual_ddd; our $opt_manual_debug; @@ -420,7 +421,6 @@ sub main { ); mtr_error("Could not create testcase server port: $!") unless $server; my $server_port = $server->sockport(); - mtr_report("Using server port $server_port"); if ($opt_resfile) { resfile_init("$opt_vardir/mtr-results.txt"); @@ -478,7 +478,7 @@ sub main { # Send Ctrl-C to any children still running kill("INT", keys(%children)); - if (!IS_WINDOWS) { + if (!IS_WINDOWS) { # Wait for children to exit foreach my $pid (keys %children) { @@ -492,7 +492,7 @@ sub main { } } - if ( not defined @$completed ) { + if ( not $completed ) { mtr_error("Test suite aborted"); } @@ -1093,6 +1093,7 @@ sub command_line_setup { 'gdb' => \$opt_gdb, 'client-gdb' => \$opt_client_gdb, 'manual-gdb' => \$opt_manual_gdb, + 'manual-lldb' => \$opt_manual_lldb, 'boot-gdb' => \$opt_boot_gdb, 'manual-debug' => \$opt_manual_debug, 'ddd' => \$opt_ddd, @@ -1549,8 +1550,9 @@ sub command_line_setup { $opt_debugger= undef; } - if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd || - $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx) + if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_lldb || + $opt_manual_ddd || $opt_manual_debug || $opt_debugger || $opt_dbx || + $opt_manual_dbx) { mtr_error("You need to use the client debug options for the", "embedded server. Ex: --client-gdb"); @@ -1576,9 +1578,9 @@ sub command_line_setup { # -------------------------------------------------------------------------- # Check debug related options # -------------------------------------------------------------------------- - if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || - $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || - $opt_dbx || $opt_client_dbx || $opt_manual_dbx || + if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || + $opt_manual_gdb || $opt_manual_lldb || $opt_manual_ddd || + $opt_manual_debug || $opt_dbx || $opt_client_dbx || $opt_manual_dbx || $opt_debugger || $opt_client_debugger ) { # Indicate that we are using debugger @@ -2473,6 +2475,11 @@ sub environment_setup { "$basedir/tests/bug25714"); $ENV{'MYSQL_BUG25714'}= native_path($exe_bug25714); + # ---------------------------------------------------- + # Get the bin dir + # ---------------------------------------------------- + $ENV{'MYSQL_BIN_PATH'}= native_path($bindir); + # ---------------------------------------------------- # mysql_fix_privilege_tables.sql # ---------------------------------------------------- @@ -2538,6 +2545,14 @@ sub environment_setup { "$path_client_bindir/perror"); $ENV{'MY_PERROR'}= native_path($exe_perror); + # ---------------------------------------------------- + # replace + # ---------------------------------------------------- + my $exe_replace= mtr_exe_exists(vs_config_dirs('extra', 'replace'), + "$basedir/extra/replace", + "$path_client_bindir/replace"); + $ENV{'REPLACE'}= native_path($exe_replace); + # Create an environment variable to make it possible # to detect that valgrind is being used from test cases $ENV{'VALGRIND_TEST'}= $opt_valgrind; @@ -5159,10 +5174,17 @@ sub mysqld_arguments ($$$) { my $found_skip_core= 0; my $found_no_console= 0; + my $found_log_error= 0; foreach my $arg ( @$extra_opts ) { # Skip --defaults-file option since it's handled above. next if $arg =~ /^--defaults-file/; + + + if ($arg eq "--log-error") + { + $found_log_error= 1; + } # Allow --skip-core-file to be set in <testname>-[master|slave].opt file if ($arg eq "--skip-core-file") @@ -5193,7 +5215,7 @@ sub mysqld_arguments ($$$) { } } $opt_skip_core = $found_skip_core; - if (IS_WINDOWS && !$found_no_console) + if (IS_WINDOWS && !$found_no_console && !$found_log_error) { # Trick the server to send output to stderr, with --console mtr_add_arg($args, "--console"); @@ -5255,6 +5277,10 @@ sub mysqld_start ($$) { { gdb_arguments(\$args, \$exe, $mysqld->name()); } + elsif ( $opt_manual_lldb ) + { + lldb_arguments(\$args, \$exe, $mysqld->name()); + } elsif ( $opt_ddd || $opt_manual_ddd ) { ddd_arguments(\$args, \$exe, $mysqld->name()); @@ -6014,6 +6040,24 @@ sub start_mysqltest ($) { return $proc; } +sub create_debug_statement { + my $args= shift; + my $input= shift; + + # Put $args into a single string + my $str= join(" ", @$$args); + my $runline= $input ? "run $str < $input" : "run $str"; + + # add quotes to escape ; in plugin_load option + my $pos1 = index($runline, "--plugin_load="); + if ( $pos1 != -1 ) { + my $pos2 = index($runline, " ",$pos1); + substr($runline,$pos1+14,0) = "\""; + substr($runline,$pos2+1,0) = "\""; + } + + return $runline; +} # # Modify the exe and args so that program is run in gdb in xterm @@ -6029,9 +6073,7 @@ sub gdb_arguments { # Remove the old gdbinit file unlink($gdb_init_file); - # Put $args into a single string - my $str= join(" ", @$$args); - my $runline= $input ? "run $str < $input" : "run $str"; + my $runline=create_debug_statement($args,$input); # write init file for mysqld or client mtr_tofile($gdb_init_file, @@ -6067,6 +6109,32 @@ sub gdb_arguments { $$exe= "xterm"; } + # +# Modify the exe and args so that program is run in lldb +# +sub lldb_arguments { + my $args= shift; + my $exe= shift; + my $type= shift; + my $input= shift; + + my $lldb_init_file= "$opt_vardir/tmp/lldbinit.$type"; + unlink($lldb_init_file); + + my $runline=create_debug_statement($args,$input); + + # write init file for mysqld or client + mtr_tofile($lldb_init_file, + "b main\n" . + $runline); + + print "\nTo start lldb for $type, type in another window:\n"; + print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n"; + + # Indicate the exe should not be started + $$exe= undef; + return; +} # # Modify the exe and args so that program is run in ddd @@ -6082,9 +6150,7 @@ sub ddd_arguments { # Remove the old gdbinit file unlink($gdb_init_file); - # Put $args into a single string - my $str= join(" ", @$$args); - my $runline= $input ? "run $str < $input" : "run $str"; + my $runline=create_debug_statement($args,$input); # write init file for mysqld or client mtr_tofile($gdb_init_file, @@ -6545,6 +6611,8 @@ Options for debugging the product test(s) manual-dbx Let user manually start mysqld in dbx, before running test(s) + manual-lldb Let user manually start mysqld in lldb, before running + test(s) strace-client Create strace output for mysqltest client, strace-server Create strace output for mysqltest server, max-save-core Limit the number of core files saved (to avoid filling diff --git a/mysql-wsrep-5.6/mysql-test/purify.supp b/mysql-wsrep-5.6/mysql-test/purify.supp index 230dae20..0bb31d00 100644 --- a/mysql-wsrep-5.6/mysql-test/purify.supp +++ b/mysql-wsrep-5.6/mysql-test/purify.supp @@ -1,4 +1,5 @@ # Copyright (C) 2005, 2007 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 Library General Public diff --git a/mysql-wsrep-5.6/mysql-test/r/alter_table.result b/mysql-wsrep-5.6/mysql-test/r/alter_table.result index 5c87afdf..fc505a08 100644 --- a/mysql-wsrep-5.6/mysql-test/r/alter_table.result +++ b/mysql-wsrep-5.6/mysql-test/r/alter_table.result @@ -850,6 +850,8 @@ id drop table t1; set @orig_sql_mode = @@sql_mode; set sql_mode="no_zero_date"; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. create table t1(f1 int); alter table t1 add column f2 datetime not null, add column f21 date not null; insert into t1 values(1,'2000-01-01','2000-01-01'); @@ -1445,24 +1447,6 @@ rename table t2 to t1; execute stmt1; deallocate prepare stmt1; drop table t2; -# -# Bug#11938817 ALTER BEHAVIOR DIFFERENT THEN DOCUMENTED -# -DROP TABLE IF EXISTS t1; -CREATE TABLE t1(a INT) engine=innodb; -INSERT INTO t1 VALUES (1), (2); -# This should not do anything -ALTER TABLE t1; -affected rows: 0 -# Check that we rebuild the table -ALTER TABLE t1 engine=innodb; -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 -# This should also rebuild the table -ALTER TABLE t1 FORCE; -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 -DROP TABLE t1; # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't # identify correct column name. # @@ -1872,8 +1856,8 @@ ALTER TABLE tm1 DEFAULT CHARACTER SET utf8; affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 ALTER TABLE ti1 FORCE; -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE tm1 FORCE; affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 diff --git a/mysql-wsrep-5.6/mysql-test/r/bug17076131.result b/mysql-wsrep-5.6/mysql-test/r/bug17076131.result new file mode 100644 index 00000000..3c8aa65b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/bug17076131.result @@ -0,0 +1,12 @@ +# +# Bug#17076131 MYSQLDUMP FAILS WHEN ERR LOG ON RUNNING SERVER IS +# DELETED ON WINDOWS +# +# Creating file aliases. +# Executing mysqldump normally. +# Removing Error_log file. +# Executing mysqldump after deleting error_log file. +# Checking diff of the 2 dumps. +# No Difference found. +# Clean Up. +# End of Test. diff --git a/mysql-wsrep-5.6/mysql-test/r/check_auto_permission.result b/mysql-wsrep-5.6/mysql-test/r/check_auto_permission.result new file mode 100644 index 00000000..ea34c445 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/check_auto_permission.result @@ -0,0 +1,3 @@ +CALL mtr.add_suppression("World-writable config file './auto.cnf' is ignored"); +CALL mtr.add_suppression("World-writable config file './auto.cnf' has been removed."); +include/assert.inc [File permissions should be equl to decimal 432(i.e octal 660).] diff --git a/mysql-wsrep-5.6/mysql-test/r/connect.result b/mysql-wsrep-5.6/mysql-test/r/connect.result index 4103119d..06cacfde 100644 --- a/mysql-wsrep-5.6/mysql-test/r/connect.result +++ b/mysql-wsrep-5.6/mysql-test/r/connect.result @@ -81,12 +81,15 @@ SET GLOBAL secure_auth = OFF; Warnings: Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead update mysql.user set password=old_password("gambling2"), plugin="mysql_old_password" where user=_binary"test"; +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead flush privileges; set password=""; set password='gambling3'; ERROR HY000: Password hash should be a 16-digit hexadecimal number set password=old_password('gambling3'); Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead show tables; Tables_in_mysql @@ -252,10 +255,12 @@ SET old_passwords=1; CREATE USER old_pwd@localhost IDENTIFIED WITH 'mysql_old_password'; SET PASSWORD FOR old_pwd@localhost= OLD_PASSWORD('aha'); Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead #Expect deprecation warning SET PASSWORD FOR old_pwd@localhost = OLD_PASSWORD('aha2'); Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead #Expect deprecation warning GRANT SELECT on test.* TO old_gpwd@localhost @@ -266,6 +271,7 @@ GRANT SELECT on test.* TO old_gpwd@localhost IDENTIFIED WITH 'mysql_old_password'; SET PASSWORD FOR old_gpwd@localhost= OLD_PASSWORD('aha4'); Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead #Expected normal flush, no warnings FLUSH PRIVILEGES; diff --git a/mysql-wsrep-5.6/mysql-test/r/count_distinct.result b/mysql-wsrep-5.6/mysql-test/r/count_distinct.result index 6874e6d8..86cff147 100644 --- a/mysql-wsrep-5.6/mysql-test/r/count_distinct.result +++ b/mysql-wsrep-5.6/mysql-test/r/count_distinct.result @@ -94,3 +94,161 @@ count(distinct i) 2 drop table t1; drop view v1; +# +# Bug#11760197: INCORRECT RESULTS WITH COUNT DISTINCT AND BIG_TABLES +# +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SET @big_tables_save= @@big_tables; +SET SESSION big_tables=0; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +COUNT(DISTINCT t1.a) +1 +SET SESSION big_tables=1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +COUNT(DISTINCT t1.a) +1 +DROP TABLE t1; +CREATE TABLE t1 (a BLOB ,PRIMARY KEY(a(10))); +INSERT INTO t1 VALUES (1),(2); +SET SESSION big_tables=0; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +COUNT(DISTINCT t1.a) +1 +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = '1'; +COUNT(DISTINCT t1.a) +1 +SET SESSION big_tables=1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +COUNT(DISTINCT t1.a) +1 +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = '1'; +COUNT(DISTINCT t1.a) +1 +DROP TABLE t1; +CREATE TABLE t1 (a CHAR PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SET SESSION big_tables=0; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +COUNT(DISTINCT t1.a) +1 +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = '1'; +COUNT(DISTINCT t1.a) +1 +SET SESSION big_tables=1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +COUNT(DISTINCT t1.a) +1 +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = '1'; +COUNT(DISTINCT t1.a) +1 +SET SESSION big_tables= @big_tables_save; +DROP TABLE t1; +# +# BUG#17607155: ASSERTION FAILED: +# ((ITEM_RESULT_FIELD*)ITEM)->RESULT_FIELD +# +CREATE TABLE t (a INT)ENGINE=INNODB; +INSERT t VALUES(1); +SELECT '' FROM t GROUP BY 1 WITH ROLLUP HAVING GROUP_CONCAT(''); + +DROP TABLE t; +# +# BUG#17957913: ASSERTION `((ITEM_RESULT_FIELD*)ITEM)->RESULT_FIELD' +# FAILS IN CREATE_TMP_FIELD +# +CREATE TABLE t1 ( i INT ); +INSERT INTO t1 VALUES (1),(2); +SELECT GROUP_CONCAT(i,'foo') AS f1 FROM t1 GROUP BY 'a' WITH ROLLUP; +f1 +1foo,2foo +1foo,2foo +DROP TABLE t1; +# +# Bug #17555462: SELECT DISTINCT OF VIEW WITH CONSTANT STRING +# RETURNS WRONG RESULT +# +CREATE TABLE t (x char(3)); +INSERT INTO t VALUES ('foo'), ('bar'); +CREATE VIEW v AS SELECT 'x' AS x FROM t; +SELECT DISTINCT x FROM v; +x +x +DROP TABLE t; +DROP VIEW v; +# +# Bug #17634335 SELECT DISTINCT...GROUP BY RETURNS WRONG +# RESULTS IN SOME CASES +# +CREATE TABLE t1 ( +a int(11) DEFAULT NULL, +b int(11) DEFAULT NULL, +c int(11) DEFAULT NULL +) ENGINE=InnoDB; +INSERT INTO t1 +VALUES (1,1,1),(1,2,1),(1,3,0), +(1,4,0),(2,1,1),(2,2,1),(2,3,0),(2,4,0); +SELECT DISTINCT a, b +FROM (SELECT * FROM t1 ORDER BY a, b) AS f +GROUP BY a,c; +a b +1 3 +1 1 +2 3 +2 1 +SELECT DISTINCT a, b, 0 +FROM (SELECT * FROM t1 ORDER BY a, b) AS f +GROUP BY a,c; +a b 0 +1 3 0 +1 1 0 +2 3 0 +2 1 0 +DROP TABLE t1; +# +# Bug #18853696 WRONG RESULT FOR COUNT DISTINCT OF RESULT +# OF JOINED DERIVED TABLE +# +CREATE TABLE t1 ( +pk INT NOT NULL, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key) +); +INSERT INTO t1 VALUES (10,'x','x'); +INSERT INTO t1 VALUES (11,'d','d'); +INSERT INTO t1 VALUES (12,'r','r'); +INSERT INTO t1 VALUES (13,'f','f'); +INSERT INTO t1 VALUES (14,'y','y'); +CREATE TABLE t2 ( +pk INT NOT NULL, +col_int_nokey INT, +col_varchar_key VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key) +); +INSERT INTO t2 VALUES (1,7,'x'); +SELECT COUNT( DISTINCT table1.col_varchar_key ) +FROM t2 AS table1 +JOIN (SELECT * FROM t1) AS table2 +ON ( table2.pk = table1.col_int_nokey ) +WHERE table1.pk = 1; +COUNT( DISTINCT table1.col_varchar_key ) +0 +SELECT COUNT( DISTINCT table1.col_varchar_key ) +FROM t2 AS table1 +JOIN t1 AS table2 +ON ( table2.pk = table1.col_int_nokey ) +WHERE table1.pk = 1; +COUNT( DISTINCT table1.col_varchar_key ) +0 +SELECT COUNT( table1.col_varchar_key ) +FROM t2 AS table1 +JOIN (SELECT * FROM t1) AS table2 +ON ( table2.pk = table1.col_int_nokey ) +WHERE table1.pk = 1; +COUNT( table1.col_varchar_key ) +0 +DROP TABLE t1,t2; +# End of test for Bug#18853696 diff --git a/mysql-wsrep-5.6/mysql-test/r/create.result b/mysql-wsrep-5.6/mysql-test/r/create.result index 6f7dd984..daa0d01f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/create.result +++ b/mysql-wsrep-5.6/mysql-test/r/create.result @@ -318,7 +318,7 @@ Level Code Message Note 1050 Table 't1' already exists show status like "Opened_tables"; Variable_name Value -Opened_tables 2 +Opened_tables 1 select * from t1; a b 1 1 @@ -1982,6 +1982,8 @@ DROP TABLE IF EXISTS t3; CREATE TABLE t1(c1 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c2 TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'); SET sql_mode = NO_ZERO_DATE; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t2(c1 TIMESTAMP, c2 TIMESTAMP DEFAULT 0); Warnings: diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_binary.result b/mysql-wsrep-5.6/mysql-test/r/ctype_binary.result index 76758efd..4c27cf78 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_binary.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_binary.result @@ -494,7 +494,12 @@ drop table t1; select old_password('a'), hex(old_password('a')); old_password('a') hex(old_password('a')) 60671c896665c3fa 36303637316338393636363563336661 +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead create table t1 as select old_password('a') as c1; +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2578,6 +2583,8 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) binary binary SET @x=old_password('a'); +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead SELECT charset(@x), collation(@x); charset(@x) collation(@x) binary binary diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_cp1251.result b/mysql-wsrep-5.6/mysql-test/r/ctype_cp1251.result index 97c3f4af..948285b4 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_cp1251.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_cp1251.result @@ -886,7 +886,12 @@ drop table t1; select old_password('a'), hex(old_password('a')); old_password('a') hex(old_password('a')) 60671c896665c3fa 36303637316338393636363563336661 +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead create table t1 as select old_password('a') as c1; +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2970,6 +2975,8 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) cp1251 cp1251_general_ci SET @x=old_password('a'); +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead SELECT charset(@x), collation(@x); charset(@x) collation(@x) cp1251 cp1251_general_ci diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_cp932.result b/mysql-wsrep-5.6/mysql-test/r/ctype_cp932.result new file mode 100644 index 00000000..4b170ee4 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_cp932.result @@ -0,0 +1,35 @@ +# +# Bug #11755818 LIKE DOESN'T MATCH WHEN CP932_BIN/SJIS_BIN COLLATIONS ARE +# USED. +# +SET @old_character_set_client= @@character_set_client; +SET @old_character_set_connection= @@character_set_connection; +SET @old_character_set_results= @@character_set_results; +SET character_set_client= 'utf8'; +SET character_set_connection= 'utf8'; +SET character_set_results= 'utf8'; +CREATE TABLE t1 (a VARCHAR(10) COLLATE cp932_bin); +INSERT INTO t1 VALUES('ï½¶ï½¶'); +SELECT * FROM t1 WHERE a LIKE '%ï½¶'; +a +ï½¶ï½¶ +SELECT * FROM t1 WHERE a LIKE '_ï½¶'; +a +ï½¶ï½¶ +SELECT * FROM t1 WHERE a LIKE '%_ï½¶'; +a +ï½¶ï½¶ +ALTER TABLE t1 MODIFY a VARCHAR(100) COLLATE sjis_bin; +SELECT * FROM t1 WHERE a LIKE '%ï½¶'; +a +ï½¶ï½¶ +SELECT * FROM t1 WHERE a LIKE '_ï½¶'; +a +ï½¶ï½¶ +SELECT * FROM t1 WHERE a LIKE '%_ï½¶'; +a +ï½¶ï½¶ +DROP TABLE t1; +SET @@character_set_client= @old_character_set_client; +SET @@character_set_connection= @old_character_set_connection; +SET @@character_set_results= @old_character_set_results; diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_latin1.result b/mysql-wsrep-5.6/mysql-test/r/ctype_latin1.result index 52c26226..99426346 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_latin1.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_latin1.result @@ -913,7 +913,12 @@ drop table t1; select old_password('a'), hex(old_password('a')); old_password('a') hex(old_password('a')) 60671c896665c3fa 36303637316338393636363563336661 +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead create table t1 as select old_password('a') as c1; +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2997,6 +3002,8 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) latin1 latin1_swedish_ci SET @x=old_password('a'); +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead SELECT charset(@x), collation(@x); charset(@x) collation(@x) latin1 latin1_swedish_ci diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_ldml.result b/mysql-wsrep-5.6/mysql-test/r/ctype_ldml.result index 25f25c4f..da2d3290 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_ldml.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_ldml.result @@ -819,7 +819,7 @@ ERROR HY000: Unknown collation: 'utf8_5624_2' SHOW WARNINGS; Level Code Message Error 1273 Unknown collation: 'utf8_5624_2' -Warning 1273 Syntax error at '[strength tertiary]' +Warning 1273 Syntax error at '[strength tertiary]' for COLLATION : utf8_5624_2 # # WL#5624, reset before primary ignorable # diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_uca.result b/mysql-wsrep-5.6/mysql-test/r/ctype_uca.result index 14a48b80..9dbe8809 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_uca.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_uca.result @@ -7120,5 +7120,19 @@ F0909080 30D2 ð F09090A8 30D2 ð¨ DROP TABLE t1; # +# Bug #16204175 : COLLATION NAME MISSING FROM LOG MESSAGES +# ABOUT LDML DEFINITION PROBLEMS +# +# Check whether the new collation is loaded after restart +SHOW COLLATION LIKE 'utf8_test'; +Collation Charset Id Default Compiled Sortlen +utf8_test utf8 248 8 +# Create a table with the unknown collation. +CREATE TABLE t1(id INT PRIMARY KEY, c CHAR(1) COLLATE utf8_test); +ERROR HY000: Unknown collation: 'utf8_test' +# Below error is caused as a result of this test. The error message +# contains collation name which is added as a part of the fix. +call mtr.add_suppression("Shift expected at '' for COLLATION : utf8_test"); +# # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_ucs.result b/mysql-wsrep-5.6/mysql-test/r/ctype_ucs.result index d43e8a25..842229b9 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_ucs.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_ucs.result @@ -1831,7 +1831,12 @@ drop table t1; select old_password('a'), hex(old_password('a')); old_password('a') hex(old_password('a')) 0705298948d1f92f 0030003700300035003200390038003900340038006400310066003900320066 +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead create table t1 as select old_password('a') as c1; +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -3915,6 +3920,8 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) ucs2 ucs2_general_ci SET @x=old_password('a'); +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead SELECT charset(@x), collation(@x); charset(@x) collation(@x) ucs2 ucs2_general_ci diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result index 03edc7be..52e84818 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result @@ -2740,7 +2740,12 @@ drop table t1; select old_password('a'), hex(old_password('a')); old_password('a') hex(old_password('a')) 60671c896665c3fa 36303637316338393636363563336661 +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead create table t1 as select old_password('a') as c1; +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -4824,6 +4829,8 @@ SELECT charset(@x), collation(@x); charset(@x) collation(@x) utf8 utf8_general_ci SET @x=old_password('a'); +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead SELECT charset(@x), collation(@x); charset(@x) collation(@x) utf8 utf8_general_ci diff --git a/mysql-wsrep-5.6/mysql-test/r/ddl_i18n_koi8r.result b/mysql-wsrep-5.6/mysql-test/r/ddl_i18n_koi8r.result index 739b79d3..d1253b8e 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ddl_i18n_koi8r.result +++ b/mysql-wsrep-5.6/mysql-test/r/ddl_i18n_koi8r.result @@ -260,7 +260,7 @@ END| SHOW CREATE PROCEDURE p1| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT ÐÁÒÁÍ1 CHAR(10), OUT ÐÁÒÁÍ2 CHAR(10)) BEGIN @@ -281,7 +281,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE p2| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +p2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -302,7 +302,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p3| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +p3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT ÐÁÒÁÍ1 CHAR(10), OUT ÐÁÒÁÍ2 CHAR(10)) BEGIN @@ -323,7 +323,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p4| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +p4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -376,7 +376,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -394,7 +394,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -412,7 +412,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -430,7 +430,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SET @a = '1'| @@ -506,7 +506,7 @@ set names koi8r| SHOW CREATE PROCEDURE p1| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT ÐÁÒÁÍ1 CHAR(10), OUT ÐÁÒÁÍ2 CHAR(10)) BEGIN @@ -527,7 +527,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE p2| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +p2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -548,7 +548,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p3| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +p3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT ÐÁÒÁÍ1 CHAR(10), OUT ÐÁÒÁÍ2 CHAR(10)) BEGIN @@ -569,7 +569,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p4| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +p4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -622,7 +622,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -640,7 +640,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -658,7 +658,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -676,7 +676,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SET @a = '1'| @@ -732,7 +732,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = koi8r */ ; /*!50003 SET collation_connection = koi8r_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT ÐÁÒÁÍ1 CHAR(10), @@ -766,7 +766,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = koi8r */ ; /*!50003 SET collation_connection = koi8r_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, @@ -808,7 +808,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = koi8r */ ; /*!50003 SET collation_connection = koi8r_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT ÐÁÒÁÍ1 CHAR(10), @@ -842,7 +842,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = koi8r */ ; /*!50003 SET collation_connection = koi8r_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, @@ -908,7 +908,7 @@ set names koi8r| SHOW CREATE PROCEDURE p1| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT ÐÁÒÁÍ1 CHAR(10), OUT ÐÁÒÁÍ2 CHAR(10)) BEGIN @@ -929,7 +929,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE p2| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +p2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -950,7 +950,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p3| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +p3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT ÐÁÒÁÍ1 CHAR(10), OUT ÐÁÒÁÍ2 CHAR(10)) BEGIN @@ -971,7 +971,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p4| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +p4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -1024,7 +1024,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1042,7 +1042,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1060,7 +1060,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1078,7 +1078,7 @@ COLLATION( ' @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SET @a = '1'| @@ -1200,7 +1200,7 @@ END| SHOW CREATE TRIGGER trg1| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +trg1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1216,7 +1216,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER trg2| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +trg2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1232,7 +1232,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg3| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +trg3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1248,7 +1248,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg4| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +trg4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1276,7 +1276,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci trg2 INSERT t1 BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1288,7 +1288,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci use mysqltest2| @@ -1305,7 +1305,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci trg4 INSERT t1 BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1317,7 +1317,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci use mysqltest1| @@ -1334,7 +1334,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1349,7 +1349,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1364,7 +1364,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1379,7 +1379,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SET @a1 = '1'| @@ -1473,7 +1473,7 @@ use mysqltest1| SHOW CREATE TRIGGER trg1| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +trg1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1489,7 +1489,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER trg2| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +trg2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1505,7 +1505,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg3| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +trg3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1521,7 +1521,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg4| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +trg4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1549,7 +1549,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci trg2 INSERT t1 BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1561,7 +1561,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci use mysqltest2| @@ -1578,7 +1578,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci trg4 INSERT t1 BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1590,7 +1590,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci use mysqltest1| @@ -1607,7 +1607,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1622,7 +1622,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1637,7 +1637,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1652,7 +1652,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SET @a1 = '1'| @@ -1750,7 +1750,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = koi8r */ ; /*!50003 SET collation_connection = koi8r_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN @@ -1779,7 +1779,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = koi8r */ ; /*!50003 SET collation_connection = koi8r_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW BEGIN @@ -1829,7 +1829,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = koi8r */ ; /*!50003 SET collation_connection = koi8r_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN @@ -1858,7 +1858,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = koi8r */ ; /*!50003 SET collation_connection = koi8r_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN @@ -1908,7 +1908,7 @@ use mysqltest1| SHOW CREATE TRIGGER trg1| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +trg1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1924,7 +1924,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER trg2| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +trg2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1940,7 +1940,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg3| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +trg3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1956,7 +1956,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg4| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +trg4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1984,7 +1984,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci trg2 INSERT t1 BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -1996,7 +1996,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci use mysqltest2| @@ -2013,7 +2013,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END BEFORE NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci trg4 INSERT t1 BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1)); @@ -2025,7 +2025,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END AFTER NULL root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci use mysqltest1| @@ -2042,7 +2042,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2057,7 +2057,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2072,7 +2072,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÔÅËÓÔ'; SET @a1 = 'ÔÅËÓÔ'; SET @a2 = 'ÔÅËÓÔ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2087,7 +2087,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÔÅËÓÔ'; SET @b1 = 'ÔÅËÓÔ'; SET @b2 = 'ÔÅËÓÔ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost koi8r koi8r_general_ci utf8_unicode_ci SET @a1 = '1'| @@ -2226,7 +2226,7 @@ END| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2239,7 +2239,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2252,7 +2252,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2265,7 +2265,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2303,7 +2303,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2316,7 +2316,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2329,7 +2329,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2342,7 +2342,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| @@ -2361,7 +2361,7 @@ set names koi8r| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2374,7 +2374,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2387,7 +2387,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2400,7 +2400,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2438,7 +2438,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2451,7 +2451,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2464,7 +2464,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2477,7 +2477,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci ---> Dump of mysqltest1 @@ -2494,7 +2494,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET character_set_results = koi8r */ ;; /*!50003 SET collation_connection = koi8r_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN @@ -2522,7 +2522,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET character_set_results = koi8r */ ;; /*!50003 SET collation_connection = koi8r_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN @@ -2561,7 +2561,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET character_set_results = koi8r */ ;; /*!50003 SET collation_connection = koi8r_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN @@ -2589,7 +2589,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET character_set_results = koi8r */ ;; /*!50003 SET collation_connection = koi8r_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN @@ -2634,7 +2634,7 @@ set names koi8r| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10); SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2647,7 +2647,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2660,7 +2660,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2673,7 +2673,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(ÐÅÒÅÍ1) AS c1, @@ -2711,7 +2711,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2724,7 +2724,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2737,7 +2737,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2750,7 +2750,7 @@ COLLATION( ' COLLATION( 'ÔÅËÓÔ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 koi8r koi8r_general_ci utf8_unicode_ci ------------------------------------------------------------------- DDL statements within stored routine. diff --git a/mysql-wsrep-5.6/mysql-test/r/ddl_i18n_utf8.result b/mysql-wsrep-5.6/mysql-test/r/ddl_i18n_utf8.result index 007a4f14..76b54366 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ddl_i18n_utf8.result +++ b/mysql-wsrep-5.6/mysql-test/r/ddl_i18n_utf8.result @@ -260,7 +260,7 @@ END| SHOW CREATE PROCEDURE p1| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT паÑам1 CHAR(10), OUT паÑам2 CHAR(10)) BEGIN @@ -281,7 +281,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE p2| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +p2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT паÑам1 CHAR(10) CHARACTER SET utf8, OUT паÑам2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -302,7 +302,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p3| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +p3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT паÑам1 CHAR(10), OUT паÑам2 CHAR(10)) BEGIN @@ -323,7 +323,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p4| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +p4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT паÑам1 CHAR(10) CHARACTER SET utf8, OUT паÑам2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -376,7 +376,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -394,7 +394,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -412,7 +412,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -430,7 +430,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SET @a = '1'| @@ -506,7 +506,7 @@ set names utf8| SHOW CREATE PROCEDURE p1| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT паÑам1 CHAR(10), OUT паÑам2 CHAR(10)) BEGIN @@ -527,7 +527,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE p2| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +p2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT паÑам1 CHAR(10) CHARACTER SET utf8, OUT паÑам2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -548,7 +548,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p3| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +p3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT паÑам1 CHAR(10), OUT паÑам2 CHAR(10)) BEGIN @@ -569,7 +569,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p4| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +p4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT паÑам1 CHAR(10) CHARACTER SET utf8, OUT паÑам2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -622,7 +622,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -640,7 +640,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -658,7 +658,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -676,7 +676,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SET @a = '1'| @@ -732,7 +732,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT паÑам1 CHAR(10), @@ -766,7 +766,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT паÑам1 CHAR(10) CHARACTER SET utf8, @@ -808,7 +808,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT паÑам1 CHAR(10), @@ -842,7 +842,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT паÑам1 CHAR(10) CHARACTER SET utf8, @@ -908,7 +908,7 @@ set names utf8| SHOW CREATE PROCEDURE p1| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( +p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT паÑам1 CHAR(10), OUT паÑам2 CHAR(10)) BEGIN @@ -929,7 +929,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE p2| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p2 CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( +p2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT паÑам1 CHAR(10) CHARACTER SET utf8, OUT паÑам2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -950,7 +950,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p3| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p3 CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( +p3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT паÑам1 CHAR(10), OUT паÑам2 CHAR(10)) BEGIN @@ -971,7 +971,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE PROCEDURE mysqltest2.p4| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p4 CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( +p4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT паÑам1 CHAR(10) CHARACTER SET utf8, OUT паÑам2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -1024,7 +1024,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1042,7 +1042,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1060,7 +1060,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'| SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1078,7 +1078,7 @@ COLLATION( 'ÑекÑÑ') AS c6, @@character_set_client AS c8; SET паÑам1 = 'a'; SET паÑам2 = 'b'; -END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SET @a = '1'| @@ -1200,7 +1200,7 @@ END| SHOW CREATE TRIGGER trg1| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +trg1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10); INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1216,7 +1216,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER trg2| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +trg2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1232,7 +1232,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg3| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +trg3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10); INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1248,7 +1248,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg4| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +trg4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1276,7 +1276,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci trg2 INSERT t1 BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1288,7 +1288,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci use mysqltest2| @@ -1305,7 +1305,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci trg4 INSERT t1 BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1317,7 +1317,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci use mysqltest1| @@ -1334,7 +1334,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1349,7 +1349,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1364,7 +1364,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1379,7 +1379,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SET @a1 = '1'| @@ -1473,7 +1473,7 @@ use mysqltest1| SHOW CREATE TRIGGER trg1| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +trg1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10); INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1489,7 +1489,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER trg2| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +trg2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1505,7 +1505,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg3| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +trg3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10); INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1521,7 +1521,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg4| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +trg4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1549,7 +1549,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci trg2 INSERT t1 BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1561,7 +1561,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci use mysqltest2| @@ -1578,7 +1578,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci trg4 INSERT t1 BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1590,7 +1590,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci use mysqltest1| @@ -1607,7 +1607,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1622,7 +1622,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1637,7 +1637,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -1652,7 +1652,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SET @a1 = '1'| @@ -1750,7 +1750,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN @@ -1779,7 +1779,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW BEGIN @@ -1829,7 +1829,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN @@ -1858,7 +1858,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN @@ -1908,7 +1908,7 @@ use mysqltest1| SHOW CREATE TRIGGER trg1| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg1 CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW +trg1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10); INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1924,7 +1924,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER trg2| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg2 CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW +trg2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1940,7 +1940,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg3| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg3 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW +trg3 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg3 BEFORE INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10); INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1956,7 +1956,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE TRIGGER mysqltest2.trg4| Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -trg4 CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW +trg4 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER mysqltest2.trg4 AFTER INSERT ON mysqltest2.t1 FOR EACH ROW BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1984,7 +1984,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci trg2 INSERT t1 BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -1996,7 +1996,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci use mysqltest2| @@ -2013,7 +2013,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END BEFORE NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci trg4 INSERT t1 BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; INSERT INTO log VALUES(COLLATION(пеÑем1)); @@ -2025,7 +2025,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END AFTER NULL root@localhost utf8 utf8_general_ci utf8_unicode_ci +END AFTER NULL NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci use mysqltest1| @@ -2042,7 +2042,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2057,7 +2057,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2072,7 +2072,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @a1 = 'ÑекÑÑ'; SET @a2 = 'ÑекÑÑ'; SET @a3 = 'ÑекÑÑ'; -END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW BEFORE NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'| TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2087,7 +2087,7 @@ INSERT INTO log VALUES(@@character_set_client); SET @b1 = 'ÑекÑÑ'; SET @b2 = 'ÑекÑÑ'; SET @b3 = 'ÑекÑÑ'; -END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf8_unicode_ci +END ROW AFTER NULL NULL OLD NEW CREATED NO_ENGINE_SUBSTITUTION root@localhost utf8 utf8_general_ci utf8_unicode_ci SET @a1 = '1'| @@ -2226,7 +2226,7 @@ END| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10); SELECT COLLATION(пеÑем1) AS c1, @@ -2239,7 +2239,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2252,7 +2252,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2265,7 +2265,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2303,7 +2303,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2316,7 +2316,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2329,7 +2329,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2342,7 +2342,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci ALTER DATABASE mysqltest1 COLLATE cp866_general_ci| @@ -2361,7 +2361,7 @@ set names utf8| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10); SELECT COLLATION(пеÑем1) AS c1, @@ -2374,7 +2374,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2387,7 +2387,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2400,7 +2400,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2438,7 +2438,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2451,7 +2451,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2464,7 +2464,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2477,7 +2477,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci ---> Dump of mysqltest1 @@ -2494,7 +2494,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET character_set_results = utf8 */ ;; /*!50003 SET collation_connection = utf8_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN @@ -2522,7 +2522,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET character_set_results = utf8 */ ;; /*!50003 SET collation_connection = utf8_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN @@ -2561,7 +2561,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET character_set_results = utf8 */ ;; /*!50003 SET collation_connection = utf8_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN @@ -2589,7 +2589,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;; /*!50003 SET character_set_results = utf8 */ ;; /*!50003 SET collation_connection = utf8_general_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN @@ -2634,7 +2634,7 @@ set names utf8| SHOW CREATE EVENT ev1| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev1 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10); SELECT COLLATION(пеÑем1) AS c1, @@ -2647,7 +2647,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT ev2| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev2 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2660,7 +2660,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2673,7 +2673,7 @@ END utf8 utf8_general_ci utf8_unicode_ci SHOW CREATE EVENT mysqltest2.ev3| Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN +ev3 NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN DECLARE пеÑем1 CHAR(10) CHARACTER SET utf8; SELECT COLLATION(пеÑем1) AS c1, @@ -2711,7 +2711,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2724,7 +2724,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2737,7 +2737,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'| EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -2750,7 +2750,7 @@ COLLATION( 'ÑекÑÑ') AS c3, COLLATION( 'ÑекÑÑ') AS c4, @@collation_connection AS c5, @@character_set_client AS c6; -END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci +END ONE TIME 2030-01-01 00:00:00 NULL NULL NO_ENGINE_SUBSTITUTION NULL NULL ENABLED NOT PRESERVE CREATED LAST_ALTERED NULL 1 utf8 utf8_general_ci utf8_unicode_ci ------------------------------------------------------------------- DDL statements within stored routine. diff --git a/mysql-wsrep-5.6/mysql-test/r/debug_sync.result b/mysql-wsrep-5.6/mysql-test/r/debug_sync.result index 25fdf523..e3905ae4 100644 --- a/mysql-wsrep-5.6/mysql-test/r/debug_sync.result +++ b/mysql-wsrep-5.6/mysql-test/r/debug_sync.result @@ -2,7 +2,7 @@ SET DEBUG_SYNC= 'RESET'; DROP TABLE IF EXISTS t1; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: '' +debug_sync ON - signals: '' SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2 HIT_LIMIT 3'; SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2'; SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 HIT_LIMIT 3'; @@ -150,34 +150,34 @@ SET @myvar= 'now SIGNAL from_myvar'; SET DEBUG_SYNC= @myvar; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 'from_myvar' +debug_sync ON - signals: 'from_myvar' SET DEBUG_SYNC= LEFT('now SIGNAL from_function_cut_here', 24); SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 'from_function' +debug_sync ON - signals: 'from_function,from_myvar' SET DEBUG_SYNC= 'now SIGNAL something'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 'something' +debug_sync ON - signals: 'from_function,from_myvar,something' SET DEBUG_SYNC= 'now WAIT_FOR nothing TIMEOUT 0'; Warnings: Warning #### debug sync point wait timed out SET DEBUG_SYNC= 'now SIGNAL nothing'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 'nothing' +debug_sync ON - signals: 'from_function,from_myvar,nothing,something' SET DEBUG_SYNC= 'now WAIT_FOR nothing TIMEOUT 0'; SET DEBUG_SYNC= 'now SIGNAL something EXECUTE 0'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 'nothing' +debug_sync ON - signals: 'from_function,from_myvar,something' SET DEBUG_SYNC= 'now WAIT_FOR anotherthing TIMEOUT 0 EXECUTE 0'; SET DEBUG_SYNC= 'now HIT_LIMIT 1'; ERROR HY000: debug sync point hit limit reached SET DEBUG_SYNC= 'RESET'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: '' +debug_sync ON - signals: '' SET DEBUG_SYNC= 'p1abcd SIGNAL s1 EXECUTE 2'; SET DEBUG_SYNC= 'p2abc SIGNAL s2 EXECUTE 2'; SET DEBUG_SYNC= 'p9abcdef SIGNAL s9 EXECUTE 2'; @@ -190,23 +190,23 @@ SET DEBUG_SYNC= 'p3abcdef SIGNAL s3 EXECUTE 2'; SET DEBUG_SYNC= 'p4a TEST'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 's4' +debug_sync ON - signals: 's4' SET DEBUG_SYNC= 'p1abcd TEST'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 's1' +debug_sync ON - signals: 's1,s4' SET DEBUG_SYNC= 'p7 TEST'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 's7' +debug_sync ON - signals: 's1,s4,s7' SET DEBUG_SYNC= 'p9abcdef TEST'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 's9' +debug_sync ON - signals: 's1,s4,s7,s9' SET DEBUG_SYNC= 'p3abcdef TEST'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 's3' +debug_sync ON - signals: 's1,s3,s4,s7,s9' SET DEBUG_SYNC= 'p1abcd CLEAR'; SET DEBUG_SYNC= 'p2abc CLEAR'; SET DEBUG_SYNC= 'p5abcde CLEAR'; @@ -219,19 +219,19 @@ SET DEBUG_SYNC= 'p7 CLEAR'; SET DEBUG_SYNC= 'p1abcd TEST'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 's3' +debug_sync ON - signals: 's1,s3,s4,s7,s9' SET DEBUG_SYNC= 'p7 TEST'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 's3' +debug_sync ON - signals: 's1,s3,s4,s7,s9' SET DEBUG_SYNC= 'p9abcdef TEST'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: 's3' +debug_sync ON - signals: 's1,s3,s4,s7,s9' SET DEBUG_SYNC= 'RESET'; SHOW VARIABLES LIKE 'DEBUG_SYNC'; Variable_name Value -debug_sync ON - current signal: '' +debug_sync ON - signals: '' CREATE USER mysqltest_1@localhost; GRANT SUPER ON *.* TO mysqltest_1@localhost; connection con1, mysqltest_1 diff --git a/mysql-wsrep-5.6/mysql-test/r/delayed.result b/mysql-wsrep-5.6/mysql-test/r/delayed.result index a45a0526..b5b6576a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/delayed.result +++ b/mysql-wsrep-5.6/mysql-test/r/delayed.result @@ -334,6 +334,8 @@ id f1 0 test1 1 ab SET SQL_MODE='ERROR_FOR_DIVISION_BY_ZERO,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. INSERT DELAYED INTO t1 VALUES(mod(1,0),"test3"); ERROR 22012: Division by 0 CREATE TABLE t2 ( @@ -341,6 +343,9 @@ CREATE TABLE t2 ( `f1` date ); SET SQL_MODE='NO_ZERO_DATE,STRICT_ALL_TABLES,NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. INSERT DELAYED INTO t2 VALUES (0,'0000-00-00'); ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1 INSERT DELAYED INTO t2 VALUES (0,'2007-00-00'); diff --git a/mysql-wsrep-5.6/mysql-test/r/derived.result b/mysql-wsrep-5.6/mysql-test/r/derived.result index 12e8a2ab..14391f41 100644 --- a/mysql-wsrep-5.6/mysql-test/r/derived.result +++ b/mysql-wsrep-5.6/mysql-test/r/derived.result @@ -1978,3 +1978,229 @@ SELECT * FROM (SELECT * FROM t1) AS a1 RIGHT JOIN t3 LEFT JOIN t2 ON d=c ON a=c; a b d c NULL NULL 0 NULL DROP TABLE t1, t2, t3; +# +# Bug #17814492 - INVALID RESULTS FROM SUBQUERY WITH IN CLAUSE +# +CREATE TABLE t1 ( +a INTEGER NOT NULL, +b VARCHAR(1000) NOT NULL, +c TEXT NOT NULL +)ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'xxx', 'abc'); +INSERT INTO t1 VALUES (2, 'yyy', 'abc'); +INSERT INTO t1 SELECT a, b, c FROM t1 WHERE b='yyy'; +INSERT INTO t1 SELECT a, b, c FROM t1 WHERE b='yyy'; +INSERT INTO t1 SELECT a, b, c FROM t1 WHERE b='yyy'; +CREATE TABLE t2 ( +a INTEGER NOT NULL +)ENGINE=InnoDB; +INSERT INTO t2 VALUES (1), (2); +SET @save_optimizer_switch= @@optimizer_switch; +SET @@SESSION.optimizer_switch="index_condition_pushdown=on"; +EXPLAIN SELECT a1.a, a1.b, a1.c FROM (SELECT a, b, c FROM t1 ) a1 +JOIN t2 ON a1.a=t2.a WHERE a1.b='xxx'; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 NULL +1 PRIMARY <derived2> ref <auto_key1> <auto_key1> 4 test.t2.a 2 Using where +2 DERIVED t1 ALL NULL NULL NULL NULL 9 NULL +SELECT a1.a, a1.b, a1.c FROM (SELECT a, b, c FROM t1 ) a1 +JOIN t2 ON a1.a=t2.a WHERE a1.b='xxx'; +a b c +1 xxx abc +SET @@SESSION.optimizer_switch= @save_optimizer_switch; +DROP TABLE t2, t1; +# End of test for Bug #17814492 +# +# Bug #18607971 : 5.5 TO 5.6 REGRESSION WITH A SUBQUERY IN THE FROM +# CLAUSE. +# +CREATE TABLE t(id INT PRIMARY KEY, +c1 INT, c2 INT, key(c2)) engine=InnoDB; +INSERT INTO t(id, c1, c2) VALUES(1, 2, 3), (2, 3, 4), (3, 3, 4), (4, 3, 4); +ANALYZE TABLE t; +Table Op Msg_type Msg_text +test.t analyze status OK +EXPLAIN SELECT * FROM +(SELECT t1.c1 +FROM t t1 INNER JOIN t t2 ON t1.c1= 3 +GROUP BY t1.c1) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where +2 DERIVED t2 index NULL c2 5 NULL 4 Using index; Using join buffer (Block Nested Loop) +EXPLAIN SELECT * FROM +(SELECT t1.id +FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.id +GROUP BY t1.id, t2.c2) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 const PRIMARY PRIMARY 4 const 1 NULL +2 DERIVED t2 const PRIMARY PRIMARY 4 const 1 NULL +EXPLAIN SELECT * FROM +(SELECT t1.c1 +FROM t t1 INNER JOIN t t2 ON t1.c1= 3 AND t2.c2= 3 +GROUP BY t1.c1) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t2 ref c2 c2 5 const 1 Using index +2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (Block Nested Loop) +EXPLAIN SELECT * FROM +(SELECT t1.c1 +FROM t t1 INNER JOIN t t2 ON t1.c1= 3 AND t2.c2= 3 +GROUP BY t1.c1, t2.c2) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t2 ref c2 c2 5 const 1 Using index +2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (Block Nested Loop) +EXPLAIN SELECT * FROM +(SELECT t1.c1 +FROM t t1 INNER JOIN t t2 ON t1.c1= 3 AND t2.c2= 3 +GROUP BY t1.c1, t1.id) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 Using join buffer (Block Nested Loop) +2 DERIVED t2 ref c2 c2 5 const 1 Using index; Using temporary; Using filesort +2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (Block Nested Loop) +EXPLAIN SELECT * FROM +(SELECT t1.id +FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.c1 +GROUP BY t2.c1, t1.id) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 const PRIMARY PRIMARY 4 const 1 NULL +2 DERIVED t2 ALL NULL NULL NULL NULL 4 Using where +EXPLAIN SELECT * FROM +(SELECT t1.id +FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.id +GROUP BY t2.c1, t1.id) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 const PRIMARY PRIMARY 4 const 1 NULL +2 DERIVED t2 const PRIMARY PRIMARY 4 const 1 NULL +EXPLAIN SELECT * FROM +(SELECT t1.id +FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.id +GROUP BY t2.c2, t1.id) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 const PRIMARY PRIMARY 4 const 1 NULL +2 DERIVED t2 const PRIMARY PRIMARY 4 const 1 NULL +EXPLAIN SELECT * FROM +(SELECT t1.id +FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.id +GROUP BY t1.id, t2.c2) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 const PRIMARY PRIMARY 4 const 1 NULL +2 DERIVED t2 const PRIMARY PRIMARY 4 const 1 NULL +EXPLAIN SELECT * FROM +(SELECT t1.id +FROM t t1 INNER JOIN t t2 INNER JOIN t t3 ON t1.id=1 AND t1.c1=t2.id AND t2.c1=t3.id +GROUP BY t1.id, t2.c2, t3.c2) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 const PRIMARY PRIMARY 4 const 1 NULL +2 DERIVED t2 const PRIMARY PRIMARY 4 const 1 NULL +2 DERIVED t3 const PRIMARY PRIMARY 4 const 1 NULL +EXPLAIN SELECT * FROM +(SELECT DISTINCT t1.id +FROM t t1 +WHERE t1.id= 1) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 const PRIMARY PRIMARY 4 const 1 Using index +EXPLAIN SELECT * FROM +(SELECT t1.id + 1 +FROM t t1 INNER JOIN t t2 ON t1.id= 1 +GROUP BY t1.id + 1) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 const PRIMARY PRIMARY 4 const 1 Using index +2 DERIVED t2 index NULL c2 5 NULL 4 Using index +EXPLAIN SELECT * FROM +(SELECT t1.c1 +FROM t t1 INNER JOIN t t2 ON t1.c1= 3 +GROUP BY 1.5) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where +2 DERIVED t2 index NULL c2 5 NULL 4 Using index; Using join buffer (Block Nested Loop) +EXPLAIN SELECT * FROM +(SELECT t1.id +FROM t t1 INNER JOIN t t2 ON mod(t1.id,1000)= 1 +GROUP BY t1.id) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 16 Using join buffer (Block Nested Loop) +2 DERIVED t1 index PRIMARY,c2 c2 5 NULL 4 Using where; Using index; Using temporary; Using filesort +2 DERIVED t2 index NULL c2 5 NULL 4 Using index; Using join buffer (Block Nested Loop) +EXPLAIN SELECT * FROM +(SELECT t1.id + 1 +FROM t t1 INNER JOIN t t2 ON t1.id + 1= 2 +GROUP BY t1.id + 1) a, t b +WHERE b.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY b range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t1 index PRIMARY,c2 c2 5 NULL 4 Using where; Using index +2 DERIVED t2 index NULL c2 5 NULL 4 Using index; Using join buffer (Block Nested Loop) +CREATE VIEW v1 AS SELECT c1 a FROM t WHERE c1 = 3; +CREATE VIEW v2 AS SELECT c2 b FROM t WHERE c2 > 3; +EXPLAIN SELECT * FROM (SELECT v1.a +FROM v1 LEFT OUTER JOIN v2 ON v1.a = v2.b +GROUP BY v1.a) p, t q +WHERE q.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY q range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t ALL NULL NULL NULL NULL 4 Using where +2 DERIVED t ref c2 c2 5 const 1 Using where; Using index +DROP VIEW v1; +CREATE VIEW v1 AS SELECT c1 a FROM t; +EXPLAIN SELECT * FROM (SELECT v1.a +FROM v1 LEFT OUTER JOIN v2 ON v1.a = v2.b AND v1.a = 10 +GROUP BY v1.a) p, t q +WHERE q.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY q range PRIMARY PRIMARY 4 NULL 4 Using where +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 Using join buffer (Block Nested Loop) +2 DERIVED t ALL NULL NULL NULL NULL 4 Using temporary; Using filesort +2 DERIVED t ref c2 c2 5 func 1 Using where; Using index +EXPLAIN SELECT * FROM (SELECT v1.a +FROM v1 LEFT OUTER JOIN v2 ON v1.a = v2.b +WHERE v1.a = 3 +GROUP BY v1.a) p, t q +WHERE q.id BETWEEN 1 AND 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 NULL +1 PRIMARY q range PRIMARY PRIMARY 4 NULL 4 Using where +2 DERIVED t ALL NULL NULL NULL NULL 4 Using where +2 DERIVED t ref c2 c2 5 const 1 Using where; Using index +DROP VIEW v1, v2; +DROP TABLE t; diff --git a/mysql-wsrep-5.6/mysql-test/r/distinct.result b/mysql-wsrep-5.6/mysql-test/r/distinct.result index bc602f0d..a69d5247 100644 --- a/mysql-wsrep-5.6/mysql-test/r/distinct.result +++ b/mysql-wsrep-5.6/mysql-test/r/distinct.result @@ -212,12 +212,12 @@ select distinct 1 from t1,t3 where t1.a=t3.a; show status like 'Handler_read%'; Variable_name Value Handler_read_first 1 -Handler_read_key 1 +Handler_read_key 4 Handler_read_last 0 -Handler_read_next 0 +Handler_read_next 208 Handler_read_prev 0 Handler_read_rnd 0 -Handler_read_rnd_next 2 +Handler_read_rnd_next 1 explain SELECT distinct t1.a from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index diff --git a/mysql-wsrep-5.6/mysql-test/r/dynamic_tracing.result b/mysql-wsrep-5.6/mysql-test/r/dynamic_tracing.result new file mode 100644 index 00000000..28d1576c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/dynamic_tracing.result @@ -0,0 +1,39 @@ +CREATE PROCEDURE create_table_and_insert_rows() +BEGIN +DECLARE count INT; +SET count = 1; +SELECT SLEEP(10); +CREATE TABLE t1 (f1 INT); +INSERT INTO t1 VALUES (7894); +WHILE count <= 5 DO +INSERT INTO t1 SELECT * FROM t1; +SET count = count + 1; +END WHILE; +SET count = 1; +WHILE count <= 10000 DO +SELECT SQL_NO_CACHE count(*) from t1; +SET count = count + 1; +END WHILE; +END +$ +CALL create_table_and_insert_rows(); +SELECT SLEEP(4); + + Dynamic tracing ...... started. + + query-parse-start : 1 + query-parse-done : 1 + select-start : 1 + select-done : 1 + net-read-start : 1 + net-read-done : 1 + handler_rdlock_start : 1 + handler_rdlock_done : 1 + + Expected probe hits : 8 + Actual probe hits : 8 + + Dynamic tracing ...... completed. + +DROP TABLE t1; +DROP PROCEDURE create_table_and_insert_rows; diff --git a/mysql-wsrep-5.6/mysql-test/r/events_bugs.result b/mysql-wsrep-5.6/mysql-test/r/events_bugs.result index 4447f96f..8aad6f8d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/events_bugs.result +++ b/mysql-wsrep-5.6/mysql-test/r/events_bugs.result @@ -728,6 +728,10 @@ DROP USER mysqltest_u1@localhost; drop procedure if exists p; set @old_mode= @@sql_mode; set @@sql_mode= cast(pow(2,32)-1 as unsigned integer); +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. create event e1 on schedule every 1 day do select 1; select @@sql_mode into @full_mode; set @@sql_mode= @old_mode; diff --git a/mysql-wsrep-5.6/mysql-test/r/file_contents.result b/mysql-wsrep-5.6/mysql-test/r/file_contents.result index 110769e1..0b0d5d59 100644 --- a/mysql-wsrep-5.6/mysql-test/r/file_contents.result +++ b/mysql-wsrep-5.6/mysql-test/r/file_contents.result @@ -1,6 +1,6 @@ Checking 'INFO_SRC' and 'INFO_BIN' -INFO_SRC: Found MySQL version number / Found BZR revision id +INFO_SRC: Found MySQL version number / Found GIT revision id INFO_BIN: Found 'Compiler ... used' line / Found 'Feature flags' line End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/func_aes.result b/mysql-wsrep-5.6/mysql-test/r/func_aes.result new file mode 100644 index 00000000..5bede7f2 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/func_aes.result @@ -0,0 +1,411 @@ +# Tests of the AES functionality +# +# WL#6781: Support multiple AES encryption modes +# +#### AES_ENCRYPT return type +# must be aes-128-ecb +SELECT @@block_encryption_mode; +@@block_encryption_mode +aes-128-ecb +# must work and return a string +SELECT TO_BASE64(AES_ENCRYPT('a', 'b')); +TO_BASE64(AES_ENCRYPT('a', 'b')) +VIE8melxXCgTE0xsFy5JTg== +# must return 16 +SELECT LENGTH(AES_ENCRYPT('a', 'b')); +LENGTH(AES_ENCRYPT('a', 'b')) +16 +# must return binary +SELECT CHARSET(AES_ENCRYPT('a', 'b')); +CHARSET(AES_ENCRYPT('a', 'b')) +binary +# must be equal +SELECT AES_ENCRYPT('a', 'b') = AES_ENCRYPT('a', 'b'); +AES_ENCRYPT('a', 'b') = AES_ENCRYPT('a', 'b') +1 +#### AES_ENCRYPT parameters +# must return NULL +SELECT AES_ENCRYPT('a', NULL); +AES_ENCRYPT('a', NULL) +NULL +SELECT AES_ENCRYPT(NULL, 'a'); +AES_ENCRYPT(NULL, 'a') +NULL +SELECT AES_ENCRYPT(NULL, NULL); +AES_ENCRYPT(NULL, NULL) +NULL +# must return value +SELECT TO_BASE64(AES_ENCRYPT('a', 0)); +TO_BASE64(AES_ENCRYPT('a', 0)) +aYJapBqdtJb5LdZYNnyvSQ== +SELECT TO_BASE64(AES_ENCRYPT('a', 12.04)); +TO_BASE64(AES_ENCRYPT('a', 12.04)) +zsb8jPtLNXiWI5Kzwf0V0A== +SELECT TO_BASE64(AES_ENCRYPT(0, 'a')); +TO_BASE64(AES_ENCRYPT(0, 'a')) +6k2i7KJUMBKiOkGToSMgxg== +SELECT TO_BASE64(AES_ENCRYPT(12.04, 'a')); +TO_BASE64(AES_ENCRYPT(12.04, 'a')) +TXCHis1z3ZT2p2daWZfwLg== +SELECT TO_BASE64(AES_ENCRYPT(0, 0)); +TO_BASE64(AES_ENCRYPT(0, 0)) +Nop3grbtyVAOy+Ycpyx7RA== +SELECT TO_BASE64(AES_ENCRYPT(12.04, 12.04)); +TO_BASE64(AES_ENCRYPT(12.04, 12.04)) +W4FA3x/RuDuacxCfEQY4pQ== +#### parameter conversion +must be equal +SELECT AES_ENCRYPT('a', 12.04) = AES_ENCRYPT('a', '12.04'); +AES_ENCRYPT('a', 12.04) = AES_ENCRYPT('a', '12.04') +1 +SELECT AES_ENCRYPT('a', 0) = AES_ENCRYPT('a', '0'); +AES_ENCRYPT('a', 0) = AES_ENCRYPT('a', '0') +1 +SELECT AES_ENCRYPT(12.04, 'a') = AES_ENCRYPT('12.04', 'a'); +AES_ENCRYPT(12.04, 'a') = AES_ENCRYPT('12.04', 'a') +1 +SELECT AES_ENCRYPT(0, 'a') = AES_ENCRYPT('0', 'a'); +AES_ENCRYPT(0, 'a') = AES_ENCRYPT('0', 'a') +1 +SELECT AES_ENCRYPT('\x0Z', 'a') = AES_ENCRYPT('\x0Z', 'a'); +AES_ENCRYPT('\x0Z', 'a') = AES_ENCRYPT('\x0Z', 'a') +1 +SELECT AES_ENCRYPT('a', '\x0Z') = AES_ENCRYPT('a', '\x0Z'); +AES_ENCRYPT('a', '\x0Z') = AES_ENCRYPT('a', '\x0Z') +1 +# must not be equal +SELECT AES_ENCRYPT('a', '\x0Y') = AES_ENCRYPT('a', '\x0Z'); +AES_ENCRYPT('a', '\x0Y') = AES_ENCRYPT('a', '\x0Z') +0 +SELECT AES_ENCRYPT('\x0Y', 'a') = AES_ENCRYPT('\x0Z', 'a'); +AES_ENCRYPT('\x0Y', 'a') = AES_ENCRYPT('\x0Z', 'a') +0 +#### algorithm +# must not be equal +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('b', 'a'); +AES_ENCRYPT('a', 'a') = AES_ENCRYPT('b', 'a') +0 +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'b'); +AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'b') +0 +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('aa', 'a'); +AES_ENCRYPT('a', 'a') = AES_ENCRYPT('aa', 'a') +0 +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'aa'); +AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'aa') +0 +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT(REPEAT('a',1000), 'a'); +AES_ENCRYPT('a', 'a') = AES_ENCRYPT(REPEAT('a',1000), 'a') +0 +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', REPEAT('a',1000)); +AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', REPEAT('a',1000)) +0 +#### persistense +CREATE TABLE t1 (a BINARY(16) PRIMARY KEY); +# must pass without a warning +INSERT INTO t1 VALUES (AES_ENCRYPT('a','a')); +# must fail +INSERT INTO t1 VALUES (AES_ENCRYPT('a','a')); +ERROR 23000: Duplicate entry '{ W]\xA1\x06u\x9D\xBD\xB1\xA3.\xE2\xD9\xA7t' for key 'PRIMARY' +# must pass +INSERT INTO t1 VALUES (AES_ENCRYPT('b','a')); +# must return 1 +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('a', 'a'); +COUNT(*) +1 +# must return 1 +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('b', 'a'); +COUNT(*) +1 +# must return 0 +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('c', 'a'); +COUNT(*) +0 +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('a', 'c'); +COUNT(*) +0 +SELECT TO_BASE64(a) FROM t1 ORDER BY a; +TO_BASE64(a) +eyBXXaEGdZ29saMu4tmndA== +nZ4GgEfF5ib3dWk0Is8MFw== +# cleanup +DROP TABLE t1; +#### IV +# must be equal +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'a', REPEAT('a', 16)); +AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'a', REPEAT('a', 16)) +1 +Warnings: +Warning 1618 <IV> option ignored +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'a', REPEAT('b', 16)); +AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'a', REPEAT('b', 16)) +1 +Warnings: +Warning 1618 <IV> option ignored +# must return a warning +SELECT TO_BASE64(AES_ENCRYPT('a', 'a', 'a')); +TO_BASE64(AES_ENCRYPT('a', 'a', 'a')) +eyBXXaEGdZ29saMu4tmndA== +Warnings: +Warning 1618 <IV> option ignored +# must pass +SELECT TO_BASE64(AES_ENCRYPT('a', 'a', NULL)); +TO_BASE64(AES_ENCRYPT('a', 'a', NULL)) +eyBXXaEGdZ29saMu4tmndA== +Warnings: +Warning 1618 <IV> option ignored +SELECT TO_BASE64(AES_ENCRYPT('a', 'a', REPEAT('a', 1024))); +TO_BASE64(AES_ENCRYPT('a', 'a', REPEAT('a', 1024))) +eyBXXaEGdZ29saMu4tmndA== +Warnings: +Warning 1618 <IV> option ignored +SELECT TO_BASE64(AES_ENCRYPT('a', 'a', RANDOM_BYTES(16))); +TO_BASE64(AES_ENCRYPT('a', 'a', RANDOM_BYTES(16))) +eyBXXaEGdZ29saMu4tmndA== +Warnings: +Warning 1618 <IV> option ignored +#### RANDOM_BYTES +# must be 1 +SELECT LENGTH(RANDOM_BYTES(1)); +LENGTH(RANDOM_BYTES(1)) +1 +# must return binary +SELECT CHARSET(RANDOM_BYTES(1)); +CHARSET(RANDOM_BYTES(1)) +binary +# must return an error +SELECT RANDOM_BYTES(1000000000000); +ERROR 22003: length value is out of range in 'random_bytes' +SELECT LENGTH(RANDOM_BYTES(0)); +ERROR 22003: length value is out of range in 'random_bytes' +#### AES_DECRYPT +# must return binary +SELECT CHARSET(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a')); +CHARSET(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a')) +binary +# must return 1 +SELECT LENGTH(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a')); +LENGTH(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a')) +1 +# must be equal +SELECT AES_DECRYPT(AES_ENCRYPT('a','a'), 'a') = 'a'; +AES_DECRYPT(AES_ENCRYPT('a','a'), 'a') = 'a' +1 +# must be equal +SELECT AES_DECRYPT(AES_ENCRYPT(_UTF8'ÐоÑо', 'a'), 'a') = _UTF8'ÐоÑо'; +AES_DECRYPT(AES_ENCRYPT(_UTF8'ÐоÑо', 'a'), 'a') = _UTF8'ÐоÑо' +1 +SELECT AES_DECRYPT(AES_ENCRYPT('ÐоÑо', 'a'), 'a') = 'ÐоÑо'; +AES_DECRYPT(AES_ENCRYPT('ÐоÑо', 'a'), 'a') = 'ÐоÑо' +1 +# must be NULL +SELECT AES_DECRYPT(NULL, 'a'); +AES_DECRYPT(NULL, 'a') +NULL +SELECT AES_DECRYPT('a', NULL); +AES_DECRYPT('a', NULL) +NULL +SELECT AES_DECRYPT(NULL, NULL); +AES_DECRYPT(NULL, NULL) +NULL +#### AES_DECRYPT IV +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', NULL); +'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', NULL) +1 +Warnings: +Warning 1618 <IV> option ignored +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', REPEAT('a',16)); +'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', REPEAT('a',16)) +1 +Warnings: +Warning 1618 <IV> option ignored +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', REPEAT('a',100)); +'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', REPEAT('a',100)) +1 +Warnings: +Warning 1618 <IV> option ignored +# must return a warning +SELECT TO_BASE64(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', 'a')); +TO_BASE64(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', 'a')) +YQ== +Warnings: +Warning 1618 <IV> option ignored +#### 128, 192 and 256 bit ECB +CREATE TABLE aes_ecb(a VARCHAR(16), b128 CHAR(16), b192 CHAR(16), b256 CHAR(16)); +INSERT INTO aes_ecb (a) VALUES ('a'), ('ÐоÑо'), (REPEAT('a', 10)); +SET SESSION block_encryption_mode='aes-128-ecb'; +UPDATE aes_ecb SET b128 = AES_ENCRYPT(a, 'a'); +SET SESSION block_encryption_mode='aes-192-ecb'; +UPDATE aes_ecb SET b192 = AES_ENCRYPT(a, 'a'); +SET SESSION block_encryption_mode='aes-256-ecb'; +UPDATE aes_ecb SET b256 = AES_ENCRYPT(a, 'a'); +# must return 0 +SELECT COUNT(*) FROM aes_ecb WHERE b128 = b192 OR B192 = b256 OR b128=b256; +COUNT(*) +0 +SET SESSION block_encryption_mode='aes-256-ecb'; +# must return 3 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b256, 'a'); +COUNT(*) +3 +# must return 0 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b256, 'b'); +COUNT(*) +0 +SET SESSION block_encryption_mode='aes-192-ecb'; +# must return 3 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b192, 'a'); +COUNT(*) +3 +# must return 0 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b192, 'b'); +COUNT(*) +0 +SET SESSION block_encryption_mode='aes-128-ecb'; +# must return 3 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b128, 'a'); +COUNT(*) +3 +# must return 0 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b128, 'b'); +COUNT(*) +0 +SET SESSION block_encryption_mode=DEFAULT; +DROP TABLE aes_ecb; +#### cbc +SET @IVA=REPEAT('a', 16); +SET @IVB=REPEAT('b', 16); +SET @KEY1=REPEAT('c', 16); +SET @KEY2=REPEAT('d', 16); +#### 128-cbc +SET SESSION block_encryption_mode="aes-128-cbc"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +block mode dependent. Must be non-0 and non-null +SELECT LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)); +LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)) +16 +block mode dependent +SELECT TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)); +TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)) +EDJBpPTlIfYc8nytlcwy0Q== +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +NULL +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 192-cbc +SET SESSION block_encryption_mode="aes-192-cbc"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +NULL +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 256-cbc +SET SESSION block_encryption_mode="aes-256-cbc"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +NULL +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +SET SESSION block_encryption_mode=DEFAULT; +#### 128, 192 and 256 bit cbc +CREATE TABLE aes_cbc(a VARCHAR(128), b128 VARCHAR(144), +b192 VARCHAR(144), b256 CHAR(144)); +INSERT INTO aes_cbc (a) VALUES (REPEAT('a', 128)); +INSERT INTO aes_cbc (a) VALUES (REPEAT(0x00313233, 32)); +SET SESSION block_encryption_mode="aes-128-cbc"; +UPDATE aes_cbc SET b128 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-192-cbc"; +UPDATE aes_cbc SET b192 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-256-cbc"; +UPDATE aes_cbc SET b256 = AES_ENCRYPT(a, @KEY1, @IVA); +# must return 0 +SELECT COUNT(*) FROM aes_cbc WHERE b128 = b192 OR B192 = b256 OR b128=b256; +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-256-cbc"; +# must return 2 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b256, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b256, 'b', @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-192-cbc"; +# must return 2 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b192, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b192, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-128-cbc"; +# must return 2 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b128, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b128, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cbc WHERE a = AES_DECRYPT(b256, @KEY2, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode=DEFAULT; +DROP TABLE aes_cbc; +# +# Bug #18259229: SERVER CRASHES WITH THE FUNCTION RANDOM_BYTES() +# +# INT_MAX - 9 (terminating 0 + rounding). Should not crash +SELECT RANDOM_BYTES(2147483647 - 9); +ERROR 22003: length value is out of range in 'random_bytes' +# +# End of 5.7 tests +# diff --git a/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb1.result b/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb1.result new file mode 100644 index 00000000..2667d46f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb1.result @@ -0,0 +1,132 @@ +# Tests of the AES CFB1 block mode +#### cfb1 +SET @IVA=REPEAT('a', 16); +SET @IVB=REPEAT('b', 16); +SET @KEY1=REPEAT('c', 16); +SET @KEY2=REPEAT('d', 16); +#### 128-cfb1 +SET SESSION block_encryption_mode="aes-128-cfb1"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +block mode dependent. Must be non-0 and non-null +SELECT LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)); +LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)) +1 +block mode dependent +SELECT TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)); +TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)) +eg== +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 192-cfb1 +SET SESSION block_encryption_mode="aes-192-cfb1"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 256-cfb1 +SET SESSION block_encryption_mode="aes-256-cfb1"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +SET SESSION block_encryption_mode=DEFAULT; +#### 128, 192 and 256 bit cfb1 +CREATE TABLE aes_cfb1(a VARCHAR(128), b128 VARCHAR(144), +b192 VARCHAR(144), b256 CHAR(144)); +INSERT INTO aes_cfb1 (a) VALUES (REPEAT('a', 128)); +INSERT INTO aes_cfb1 (a) VALUES (REPEAT(0x00313233, 32)); +SET SESSION block_encryption_mode="aes-128-cfb1"; +UPDATE aes_cfb1 SET b128 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-192-cfb1"; +UPDATE aes_cfb1 SET b192 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-256-cfb1"; +UPDATE aes_cfb1 SET b256 = AES_ENCRYPT(a, @KEY1, @IVA); +# must return 0 +SELECT COUNT(*) FROM aes_cfb1 WHERE b128 = b192 OR B192 = b256 OR b128=b256; +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-256-cfb1"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b256, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b256, 'b', @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-192-cfb1"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b192, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b192, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-128-cfb1"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b128, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b128, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb1 WHERE a = AES_DECRYPT(b256, @KEY2, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode=DEFAULT; +DROP TABLE aes_cfb1; +SET SESSION block_encryption_mode=default; +# +# End of 5.7 tests +# diff --git a/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb128.result b/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb128.result new file mode 100644 index 00000000..9098052c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb128.result @@ -0,0 +1,132 @@ +# Tests of the AES CFB128 block mode +#### cfb128 +SET @IVA=REPEAT('a', 16); +SET @IVB=REPEAT('b', 16); +SET @KEY1=REPEAT('c', 16); +SET @KEY2=REPEAT('d', 16); +#### 128-cfb128 +SET SESSION block_encryption_mode="aes-128-cfb128"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +block mode dependent. Must be non-0 and non-null +SELECT LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)); +LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)) +1 +block mode dependent +SELECT TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)); +TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)) +Pw== +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 192-cfb128 +SET SESSION block_encryption_mode="aes-192-cfb128"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 256-cfb128 +SET SESSION block_encryption_mode="aes-256-cfb128"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +SET SESSION block_encryption_mode=DEFAULT; +#### 128, 192 and 256 bit cfb128 +CREATE TABLE aes_cfb128(a VARCHAR(128), b128 VARCHAR(144), +b192 VARCHAR(144), b256 CHAR(144)); +INSERT INTO aes_cfb128 (a) VALUES (REPEAT('a', 128)); +INSERT INTO aes_cfb128 (a) VALUES (REPEAT(0x00313233, 32)); +SET SESSION block_encryption_mode="aes-128-cfb128"; +UPDATE aes_cfb128 SET b128 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-192-cfb128"; +UPDATE aes_cfb128 SET b192 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-256-cfb128"; +UPDATE aes_cfb128 SET b256 = AES_ENCRYPT(a, @KEY1, @IVA); +# must return 0 +SELECT COUNT(*) FROM aes_cfb128 WHERE b128 = b192 OR B192 = b256 OR b128=b256; +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-256-cfb128"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b256, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b256, 'b', @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-192-cfb128"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b192, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b192, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-128-cfb128"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b128, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b128, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb128 WHERE a = AES_DECRYPT(b256, @KEY2, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode=DEFAULT; +DROP TABLE aes_cfb128; +SET SESSION block_encryption_mode=default; +# +# End of 5.7 tests +# diff --git a/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb8.result b/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb8.result new file mode 100644 index 00000000..44158cb8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/func_aes_cfb8.result @@ -0,0 +1,132 @@ +# Tests of the AES CFB8 block mode +#### cfb8 +SET @IVA=REPEAT('a', 16); +SET @IVB=REPEAT('b', 16); +SET @KEY1=REPEAT('c', 16); +SET @KEY2=REPEAT('d', 16); +#### 128-cfb8 +SET SESSION block_encryption_mode="aes-128-cfb8"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +block mode dependent. Must be non-0 and non-null +SELECT LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)); +LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)) +1 +block mode dependent +SELECT TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)); +TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)) +Pw== +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 192-cfb8 +SET SESSION block_encryption_mode="aes-192-cfb8"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 256-cfb8 +SET SESSION block_encryption_mode="aes-256-cfb8"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +SET SESSION block_encryption_mode=DEFAULT; +#### 128, 192 and 256 bit cfb8 +CREATE TABLE aes_cfb8(a VARCHAR(128), b128 VARCHAR(144), +b192 VARCHAR(144), b256 CHAR(144)); +INSERT INTO aes_cfb8 (a) VALUES (REPEAT('a', 128)); +INSERT INTO aes_cfb8 (a) VALUES (REPEAT(0x00313233, 32)); +SET SESSION block_encryption_mode="aes-128-cfb8"; +UPDATE aes_cfb8 SET b128 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-192-cfb8"; +UPDATE aes_cfb8 SET b192 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-256-cfb8"; +UPDATE aes_cfb8 SET b256 = AES_ENCRYPT(a, @KEY1, @IVA); +# must return 0 +SELECT COUNT(*) FROM aes_cfb8 WHERE b128 = b192 OR B192 = b256 OR b128=b256; +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-256-cfb8"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b256, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b256, 'b', @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-192-cfb8"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b192, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b192, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-128-cfb8"; +# must return 2 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b128, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b128, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_cfb8 WHERE a = AES_DECRYPT(b256, @KEY2, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode=DEFAULT; +DROP TABLE aes_cfb8; +SET SESSION block_encryption_mode=default; +# +# End of 5.7 tests +# diff --git a/mysql-wsrep-5.6/mysql-test/r/func_aes_misc.result b/mysql-wsrep-5.6/mysql-test/r/func_aes_misc.result new file mode 100644 index 00000000..7553b97d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/func_aes_misc.result @@ -0,0 +1,255 @@ +############################################## +#### Tests for ECB Mode +############################################## +SET @IV='abcd1234efgh5678'; +SET @KEYS=REPEAT('c', 16); +SET @ENCSTR=REPEAT('d', 256); +"--------------------------------------------" +##################### Testing with mode : aes-128-ecb +SET SESSION block_encryption_mode="aes-128-ecb"; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +####Test without tables +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +####Test with InnoDB tables +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 'test.t1' +CREATE TABLE t1(f1 varchar(256)); +INSERT INTO t1 values(@ENCSTR); +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +####Test with MyISAM tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)) engine=MyISAM; +INSERT INTO t1 values(@ENCSTR); +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +"--------------------------------------------" +##################### Testing with mode : aes-192-ecb +SET SESSION block_encryption_mode="aes-192-ecb"; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-192-ecb +####Test without tables +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +####Test with InnoDB tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)); +INSERT INTO t1 values(@ENCSTR); +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +####Test with MyISAM tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)) engine=MyISAM; +INSERT INTO t1 values(@ENCSTR); +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +"--------------------------------------------" +##################### Testing with mode : aes-256-ecb +SET SESSION block_encryption_mode="aes-256-ecb"; +should return 1 +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +should return 1 +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-256-ecb +####Test without tables +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +####Test with InnoDB tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)); +INSERT INTO t1 values(@ENCSTR); +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +####Test with MyISAM tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)) engine=MyISAM; +INSERT INTO t1 values(@ENCSTR); +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR +1 +should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +Warning 1618 <IV> option ignored +DROP TABLE IF EXISTS t1; +"--------------------------------------------" +############################################## +"Tests related to RANDOM_BYTES()" +############################################## +should return 1 +select LENGTH(RANDOM_BYTES(1))=1; +LENGTH(RANDOM_BYTES(1))=1 +1 +should return 1 +select LENGTH(RANDOM_BYTES(1024))=1024; +LENGTH(RANDOM_BYTES(1024))=1024 +1 +SET @KEYS=RANDOM_BYTES(1); +SET @KEYS=RANDOM_BYTES(1024); +select RANDOM_BYTES(0); +ERROR 22003: length value is out of range in 'random_bytes' +select RANDOM_BYTES(1025); +ERROR 22003: length value is out of range in 'random_bytes' +############################################## +"Tests related to boundary values of IV" +############################################## +SET @IV='abcdefghijklmnophelloworldworldisgreat'; +SET @IV1='abcdefghijklmnopqrstuvwxyz'; +SET @KEYS='helloworld'; +SET @ENCSTR=REPEAT('K',100); +SET @@session.block_encryption_mode = 'aes-256-cbc'; +should return 1 +select AES_ENCRYPT(@ENCSTR, @KEYS, @IV)=AES_ENCRYPT(@ENCSTR, @KEYS, @IV1); +AES_ENCRYPT(@ENCSTR, @KEYS, @IV)=AES_ENCRYPT(@ENCSTR, @KEYS, @IV1) +1 +############################################## +"Few negative tests with invalid/different keys and IV" +############################################## +SET @IV='ijkl8765mnop2345'; +SET @KEYS='helloworld1234567890'; +SET @ENCSTR=REPEAT('J',255); +SET @@session.block_encryption_mode = 'aes-128-ecb'; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 'test.t1' +CREATE TABLE t1(f1 varchar(256)); +INSERT INTO t1 values(AES_ENCRYPT(@ENCSTR, @KEYS, @IV)); +Warnings: +Warning 1618 <IV> option ignored +Combination1.............. +SET @@session.block_encryption_mode = 'aes-192-ecb'; +should return NULL +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR +NULL +Warnings: +Warning 1618 <IV> option ignored +Combination2.............. +SET @@session.block_encryption_mode = 'aes-256-ecb'; +should return NULL +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR +NULL +Warnings: +Warning 1618 <IV> option ignored +Combination3.............. +SET @@session.block_encryption_mode = 'aes-128-cbc'; +should return 0 or NULL +SELECT COALESCE (AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR,0) FROM t1; +COALESCE (AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR,0) +0 +Combination4.............. +SET @@session.block_encryption_mode = 'aes-192-cbc'; +should return NULL +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR +NULL +Combination5.............. +SET @@session.block_encryption_mode = 'aes-256-cbc'; +should return NULL +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR +NULL +Combination6.............. +SET @@session.block_encryption_mode = 'aes-128-ecb'; +should return 1 +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; +AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR +1 +Warnings: +Warning 1618 <IV> option ignored +SET @@session.block_encryption_mode = DEFAULT; +DROP TABLE IF EXISTS t1; +# +# End of 5.7 tests +# diff --git a/mysql-wsrep-5.6/mysql-test/r/func_aes_ofb.result b/mysql-wsrep-5.6/mysql-test/r/func_aes_ofb.result new file mode 100644 index 00000000..06160063 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/func_aes_ofb.result @@ -0,0 +1,132 @@ +# Tests of the AES ofb block mode +#### ofb +SET @IVA=REPEAT('a', 16); +SET @IVB=REPEAT('b', 16); +SET @KEY1=REPEAT('c', 16); +SET @KEY2=REPEAT('d', 16); +#### 128-ofb +SET SESSION block_encryption_mode="aes-128-ofb"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +block mode dependent. Must be non-0 and non-null +SELECT LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)); +LENGTH(AES_ENCRYPT('a', @KEY1, @IVA)) +1 +block mode dependent +SELECT TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)); +TO_BASE64(AES_ENCRYPT('a', @KEY1, @IVA)) +Pw== +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a', @KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 192-ofb +SET SESSION block_encryption_mode="aes-192-ofb"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +#### 256-ofb +SET SESSION block_encryption_mode="aes-256-ofb"; +# must throw an error without an IV +SELECT AES_ENCRYPT('a', @KEY1); +ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt' +# must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVA) +1 +# must not be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY1, @IVB) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('a',@KEY1, @IVA), @KEY2, @IVA) +0 +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA); +'a' = AES_DECRYPT(AES_ENCRYPT('b',@KEY1, @IVA), @KEY1, @IVA) +0 +SET SESSION block_encryption_mode=DEFAULT; +#### 128, 192 and 256 bit ofb +CREATE TABLE aes_ofb(a VARCHAR(128), b128 VARCHAR(144), +b192 VARCHAR(144), b256 CHAR(144)); +INSERT INTO aes_ofb (a) VALUES (REPEAT('a', 128)); +INSERT INTO aes_ofb (a) VALUES (REPEAT(0x00313233, 32)); +SET SESSION block_encryption_mode="aes-128-ofb"; +UPDATE aes_ofb SET b128 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-192-ofb"; +UPDATE aes_ofb SET b192 = AES_ENCRYPT(a, @KEY1, @IVA); +SET SESSION block_encryption_mode="aes-256-ofb"; +UPDATE aes_ofb SET b256 = AES_ENCRYPT(a, @KEY1, @IVA); +# must return 0 +SELECT COUNT(*) FROM aes_ofb WHERE b128 = b192 OR B192 = b256 OR b128=b256; +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-256-ofb"; +# must return 2 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b256, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b256, 'b', @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-192-ofb"; +# must return 2 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b192, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b192, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b256, @KEY1, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode="aes-128-ofb"; +# must return 2 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b128, @KEY1, @IVA); +COUNT(*) +2 +# must return 0 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b128, @KEY2, @IVA); +COUNT(*) +0 +# must return 0 +SELECT COUNT(*) FROM aes_ofb WHERE a = AES_DECRYPT(b256, @KEY2, @IVB); +COUNT(*) +0 +SET SESSION block_encryption_mode=DEFAULT; +DROP TABLE aes_ofb; +SET SESSION block_encryption_mode=default; +# +# End of 5.7 tests +# diff --git a/mysql-wsrep-5.6/mysql-test/r/func_crypt.result b/mysql-wsrep-5.6/mysql-test/r/func_crypt.result index 31eb20b9..f449efc6 100644 --- a/mysql-wsrep-5.6/mysql-test/r/func_crypt.result +++ b/mysql-wsrep-5.6/mysql-test/r/func_crypt.result @@ -20,15 +20,21 @@ password('') select old_password('abc'); old_password('abc') 7cd2b5942be28759 +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead select old_password(''); old_password('') +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead select password('gabbagabbahey'); password('gabbagabbahey') *B0F99D2963660DD7E16B751EC9EE2F17B6A68FA6 select old_password('idkfa'); old_password('idkfa') 5c078dc54ca0fcca +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead select length(password('1')); length(password('1')) 41 @@ -41,6 +47,8 @@ aaqPiZY5xR5l. select old_password(NULL); old_password(NULL) NULL +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead select password(NULL); password(NULL) @@ -51,12 +59,16 @@ password('') select old_password(''); old_password('') +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead select password('idkfa'); password('idkfa') *B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA select old_password('idkfa'); old_password('idkfa') 5c078dc54ca0fcca +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead set old_passwords=1; select password('idkfa'); password('idkfa') @@ -64,6 +76,8 @@ password('idkfa') select old_password('idkfa'); old_password('idkfa') 5c078dc54ca0fcca +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead set global old_passwords=0; select password('idkfa'); password('idkfa') @@ -71,6 +85,8 @@ password('idkfa') select old_password('idkfa'); old_password('idkfa') 5c078dc54ca0fcca +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead set old_passwords=0; select password('idkfa '); password('idkfa ') @@ -84,13 +100,18 @@ password(' idkfa') select old_password('idkfa'); old_password('idkfa') 5c078dc54ca0fcca +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead select old_password(' i d k f a '); old_password(' i d k f a ') 5c078dc54ca0fcca +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead explain extended select password('idkfa '), old_password('idkfa'); 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: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead Note 1003 /* select#1 */ select password('idkfa ') AS `password('idkfa ')`,old_password('idkfa') AS `old_password('idkfa')` select encrypt('1234','_.'); encrypt('1234','_.') @@ -104,6 +125,8 @@ INSERT INTO t1 VALUES (REPEAT('a', 1024)); SELECT OLD_PASSWORD(c1), PASSWORD(c1) FROM t1; OLD_PASSWORD(c1) PASSWORD(c1) 77023ffe214c04ff *82E58A2C08AAFE72C8EB523069CD8ADB33F78F58 +Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead DROP TABLE t1; End of 5.0 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/group_min_max.result b/mysql-wsrep-5.6/mysql-test/r/group_min_max.result index 683f51c5..78ae0012 100644 --- a/mysql-wsrep-5.6/mysql-test/r/group_min_max.result +++ b/mysql-wsrep-5.6/mysql-test/r/group_min_max.result @@ -3004,7 +3004,7 @@ COUNT(DISTINCT a, b) SUM(DISTINCT a) 0 NULL EXPLAIN SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 5 NULL 9 Using index for group-by +1 SIMPLE t2 index a a 15 NULL 16 Using index SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a; SUM(DISTINCT a) MAX(b) 1 8 @@ -3032,7 +3032,7 @@ SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c; 168 EXPLAIN SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range a a 5 NULL 9 Using index for group-by +1 SIMPLE t2 index a a 15 NULL 16 Using index SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a; (SUM(DISTINCT a) + MAX(b)) 9 @@ -3060,3 +3060,81 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 5 NULL 9 Using index for group-by (scanning) drop table t1; # End of test#50539. +# +# Bug#17217128 - BAD INTERACTION BETWEEN MIN/MAX AND +# "HAVING SUM(DISTINCT)": WRONG RESULTS. +# +CREATE TABLE t (a INT, b INT, KEY(a,b)); +INSERT INTO t VALUES (1,1), (2,2), (3,3), (4,4), (1,0), (3,2), (4,5); +set optimizer_trace_max_mem_size=1048576; +set @@session.optimizer_trace='enabled=on'; +set end_markers_in_json=on; +ANALYZE TABLE t; +Table Op Msg_type Msg_text +test.t analyze status OK +SELECT a, SUM(DISTINCT a), MIN(b) FROM t GROUP BY a; +a SUM(DISTINCT a) MIN(b) +1 1 0 +2 2 2 +3 3 2 +4 4 4 +EXPLAIN SELECT a, SUM(DISTINCT a), MIN(b) FROM t GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t index a a 10 NULL 7 Using index +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK +FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +1 +SELECT a, SUM(DISTINCT a), MAX(b) FROM t GROUP BY a; +a SUM(DISTINCT a) MAX(b) +1 1 1 +2 2 2 +3 3 3 +4 4 5 +EXPLAIN SELECT a, SUM(DISTINCT a), MAX(b) FROM t GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t index a a 10 NULL 7 Using index +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK +FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +1 +SELECT a, MAX(b) FROM t GROUP BY a HAVING SUM(DISTINCT a); +a MAX(b) +1 1 +2 2 +3 3 +4 5 +EXPLAIN SELECT a, MAX(b) FROM t GROUP BY a HAVING SUM(DISTINCT a); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t index a a 10 NULL 7 Using index +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK +FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +1 +SELECT SUM(DISTINCT a), MIN(b), MAX(b) FROM t; +SUM(DISTINCT a) MIN(b) MAX(b) +10 0 5 +EXPLAIN SELECT SUM(DISTINCT a), MIN(b), MAX(b) FROM t; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t index a a 10 NULL 7 Using index +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK +FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +1 +SELECT a, SUM(DISTINCT a), MIN(b), MAX(b) FROM t GROUP BY a; +a SUM(DISTINCT a) MIN(b) MAX(b) +1 1 0 1 +2 2 2 2 +3 3 2 3 +4 4 4 5 +EXPLAIN SELECT a, SUM(DISTINCT a), MIN(b), MAX(b) FROM t GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t index a a 10 NULL 7 Using index +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK +FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +1 +SET optimizer_trace_max_mem_size=DEFAULT; +SET optimizer_trace=DEFAULT; +SET end_markers_in_json=DEFAULT; +DROP TABLE t; diff --git a/mysql-wsrep-5.6/mysql-test/r/group_min_max_innodb.result b/mysql-wsrep-5.6/mysql-test/r/group_min_max_innodb.result index 320c0ec1..a56dc011 100644 --- a/mysql-wsrep-5.6/mysql-test/r/group_min_max_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/r/group_min_max_innodb.result @@ -119,3 +119,205 @@ COUNT(DISTINCT a) 1 DROP TABLE t1; End of 5.5 tests +# +# Bug#17909656 - WRONG RESULTS FOR A SIMPLE QUERY WITH GROUP BY +# +CREATE TABLE t0 ( +i1 INTEGER NOT NULL +); +INSERT INTO t0 VALUES (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); +CREATE TABLE t1 ( +c1 CHAR(1) NOT NULL, +i1 INTEGER NOT NULL, +i2 INTEGER NOT NULL, +UNIQUE KEY k1 (c1,i2) +) ENGINE=InnoDB; +INSERT INTO t1 SELECT 'A',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'B',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'C',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'D',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'E',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'F',i1,i1 FROM t0; +CREATE TABLE t2 ( +c1 CHAR(1) NOT NULL, +i1 INTEGER NOT NULL, +i2 INTEGER NOT NULL, +UNIQUE KEY k2 (c1,i1,i2) +) ENGINE=InnoDB; +INSERT INTO t2 SELECT 'A',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'B',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'C',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'D',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'E',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'F',i1,i1 FROM t0; +ANALYZE TABLE t1; +ANALYZE TABLE t2; +set optimizer_trace_max_mem_size=1048576; +set @@session.optimizer_trace='enabled=on'; +set end_markers_in_json=on; +EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F') +GROUP BY c1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range k1 k1 5 NULL ROWS Using where; Using index +SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F') +GROUP BY c1; +c1 max(i2) +C 17 +F 30 +SELECT TRACE RLIKE 'minmax_keypart_in_disjunctive_query' +AS OK FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +1 +EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17)) +GROUP BY c1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range k1 k1 5 NULL ROWS Using where; Using index +SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17)) +GROUP BY c1; +c1 max(i2) +C 30 +F 17 +SELECT TRACE RLIKE 'minmax_keypart_in_disjunctive_query' +AS OK FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +1 +EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 ) +GROUP BY c1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range k1 k1 5 NULL ROWS Using where; Using index for group-by +SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 ) +GROUP BY c1; +c1 max(i2) +C 17 +F 17 +SELECT TRACE RLIKE 'minmax_keypart_in_disjunctive_query' +AS OK FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +0 +EXPLAIN SELECT c1, max(i2) FROM t1 +WHERE ((c1 = 'C' AND (i2 = 40 OR i2 = 30)) OR ( c1 = 'F' AND (i2 = 40 ))) +GROUP BY c1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range k1 k1 5 NULL ROWS Using where; Using index +SELECT c1, max(i2) FROM t1 +WHERE ((c1 = 'C' AND (i2 = 40 OR i2 = 30)) OR ( c1 = 'F' AND (i2 = 40 ))) +GROUP BY c1; +c1 max(i2) +C 30 +SELECT TRACE RLIKE 'minmax_keypart_in_disjunctive_query' +AS OK FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +1 +EXPLAIN SELECT c1, i1, max(i2) FROM t2 +WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ) +GROUP BY c1,i1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range k2 k2 5 NULL ROWS Using where; Using index +SELECT c1, i1, max(i2) FROM t2 +WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ) +GROUP BY c1,i1; +c1 i1 max(i2) +C 17 17 +F 17 17 +SELECT TRACE RLIKE 'minmax_keypart_in_disjunctive_query' +AS OK FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +0 +EXPLAIN SELECT c1, i1, max(i2) FROM t2 +WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )) +GROUP BY c1,i1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range k2 k2 5 NULL ROWS Using where; Using index +SELECT c1, i1, max(i2) FROM t2 +WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )) +GROUP BY c1,i1; +c1 i1 max(i2) +C 17 17 +F 17 17 +SELECT TRACE RLIKE 'minmax_keypart_in_disjunctive_query' +AS OK FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +0 +EXPLAIN SELECT c1, i1, max(i2) FROM t2 +WHERE ((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35) OR ( i2 = 17 )) +GROUP BY c1,i1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index k2 k2 9 NULL ROWS Using where; Using index +SELECT c1, i1, max(i2) FROM t2 +WHERE ((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35) OR ( i2 = 17 )) +GROUP BY c1,i1; +c1 i1 max(i2) +A 17 17 +B 17 17 +C 1 1 +C 2 2 +C 3 3 +C 4 4 +C 5 5 +C 6 6 +C 7 7 +C 8 8 +C 9 9 +C 10 10 +C 11 11 +C 12 12 +C 13 13 +C 14 14 +C 15 15 +C 16 16 +C 17 17 +C 18 18 +C 19 19 +C 20 20 +C 21 21 +C 22 22 +C 23 23 +C 24 24 +C 25 25 +C 26 26 +C 27 27 +C 28 28 +C 29 29 +C 30 30 +D 17 17 +E 17 17 +F 1 1 +F 2 2 +F 3 3 +F 4 4 +F 5 5 +F 6 6 +F 7 7 +F 8 8 +F 9 9 +F 10 10 +F 11 11 +F 12 12 +F 13 13 +F 14 14 +F 15 15 +F 16 16 +F 17 17 +F 18 18 +F 19 19 +F 20 20 +F 21 21 +F 22 22 +F 23 23 +F 24 24 +F 25 25 +F 26 26 +F 27 27 +F 28 28 +F 29 29 +F 30 30 +SELECT TRACE RLIKE 'minmax_keypart_in_disjunctive_query' +AS OK FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +OK +0 +SET optimizer_trace_max_mem_size=DEFAULT; +SET optimizer_trace=DEFAULT; +SET end_markers_in_json=DEFAULT; +DROP TABLE t0,t1,t2; diff --git a/mysql-wsrep-5.6/mysql-test/r/have_cp1251.require b/mysql-wsrep-5.6/mysql-test/r/have_cp1251.require index 465e8338..a4e66df9 100644 --- a/mysql-wsrep-5.6/mysql-test/r/have_cp1251.require +++ b/mysql-wsrep-5.6/mysql-test/r/have_cp1251.require @@ -1,2 +1,2 @@ Collation Charset Id Default Compiled Sortlen -cp1251_general_ci cp1251 51 Yes 0 +cp1251_general_ci cp1251 51 Yes Yes 1 diff --git a/mysql-wsrep-5.6/mysql-test/r/have_cp866.require b/mysql-wsrep-5.6/mysql-test/r/have_cp866.require index da2a3e2f..7efa36b9 100644 --- a/mysql-wsrep-5.6/mysql-test/r/have_cp866.require +++ b/mysql-wsrep-5.6/mysql-test/r/have_cp866.require @@ -1,2 +1,2 @@ Collation Charset Id Default Compiled Sortlen -cp866_general_ci cp866 36 Yes 0 +cp866_general_ci cp866 36 Yes Yes 1 diff --git a/mysql-wsrep-5.6/mysql-test/r/have_koi8r.require b/mysql-wsrep-5.6/mysql-test/r/have_koi8r.require index b109b9ae..2df3fdd2 100644 --- a/mysql-wsrep-5.6/mysql-test/r/have_koi8r.require +++ b/mysql-wsrep-5.6/mysql-test/r/have_koi8r.require @@ -1,2 +1,2 @@ Collation Charset Id Default Compiled Sortlen -koi8r_general_ci koi8r 7 Yes 0 +koi8r_general_ci koi8r 7 Yes Yes 1 diff --git a/mysql-wsrep-5.6/mysql-test/r/information_schema-big.result b/mysql-wsrep-5.6/mysql-test/r/information_schema-big.result index 8e86b3b0..b8b6dc6d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/information_schema-big.result +++ b/mysql-wsrep-5.6/mysql-test/r/information_schema-big.result @@ -17,7 +17,8 @@ WHERE c2.table_schema = t.table_schema AND c2.table_name = t.table_name AND c2.column_name LIKE '%SCHEMA%' ) -AND t.table_name NOT LIKE 'innodb%'; +AND t.table_name NOT LIKE 'ndb%' + AND t.table_name NOT LIKE 'innodb%'; table_name column_name CHARACTER_SETS CHARACTER_SET_NAME COLLATIONS COLLATION_NAME @@ -64,7 +65,8 @@ WHERE c2.table_schema = 'information_schema' AND c2.table_name = t.table_name AND c2.column_name LIKE '%SCHEMA%' ) -AND t.table_name NOT LIKE 'innodb%'; +AND t.table_name NOT LIKE 'ndb%' + AND t.table_name NOT LIKE 'innodb%'; table_name column_name CHARACTER_SETS CHARACTER_SET_NAME COLLATIONS COLLATION_NAME diff --git a/mysql-wsrep-5.6/mysql-test/r/information_schema.result b/mysql-wsrep-5.6/mysql-test/r/information_schema.result index 6a2cba5f..fce2f40d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/information_schema.result +++ b/mysql-wsrep-5.6/mysql-test/r/information_schema.result @@ -2080,6 +2080,21 @@ t6 e timestamp 6 drop database mysqltest; use test; # +# Test for bug #16869534 - "QUERYING SUBSET OF COLUMNS DOESN'T USE TABLE +# CACHE; OPENED_TABLES INCREASES" +# +SELECT * FROM INFORMATION_SCHEMA.TABLES; +SELECT VARIABLE_VALUE INTO @val1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE +VARIABLE_NAME LIKE 'Opened_tables'; +SELECT ENGINE FROM INFORMATION_SCHEMA.TABLES; +# The below SELECT query should give same output as above SELECT query. +SELECT VARIABLE_VALUE INTO @val2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE +VARIABLE_NAME LIKE 'Opened_tables'; +# The below select should return '1' +SELECT @val1 = @val2; +@val1 = @val2 +1 +# # End of 5.5 tests # # diff --git a/mysql-wsrep-5.6/mysql-test/r/innodb_mysql_lock.result b/mysql-wsrep-5.6/mysql-test/r/innodb_mysql_lock.result index e51e7552..59b0079b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/innodb_mysql_lock.result +++ b/mysql-wsrep-5.6/mysql-test/r/innodb_mysql_lock.result @@ -199,7 +199,10 @@ ERROR 23000: Duplicate entry '1' for key 'b' # Also check that copy algorithm is used ALTER IGNORE TABLE t1 ADD UNIQUE INDEX (b); affected rows: 3 -info: Records: 3 Duplicates: 2 Warnings: 0 +info: Records: 3 Duplicates: 2 Warnings: 1 +Warnings: +Warning 1681 'IGNORE' is deprecated and will be removed in a future release. SHOW WARNINGS; Level Code Message +Warning 1681 'IGNORE' is deprecated and will be removed in a future release. DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/innodb_mysql_sync.result b/mysql-wsrep-5.6/mysql-test/r/innodb_mysql_sync.result index ec2ae4ce..e4a17d55 100644 --- a/mysql-wsrep-5.6/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-wsrep-5.6/mysql-test/r/innodb_mysql_sync.result @@ -359,3 +359,184 @@ Note 1831 Duplicate index 'i4' defined on the table 'test.t1'. This is deprecate SET DEBUG_SYNC= 'RESET'; DROP TABLE t1; SET DEBUG_SYNC= 'RESET'; +# +#BUG#13975225:ONLINE OPTIMIZE TABLE FOR INNODB TABLES +# +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +#Setting up INNODB table. +CREATE TABLE t1(fld1 INT, fld2 INT, fld3 INT) ENGINE= INNODB; +INSERT INTO t1 VALUES (155, 45, 55); +#Concurrent INSERT, UPDATE, SELECT and DELETE is supported +#during OPTIMIZE TABLE operation for INNODB tables. +connection default; +#OPTIMIZE TABLE operation. +OPTIMIZE TABLE t1; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +# With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (10, 11, 12); +UPDATE t1 SET fld1= 20 WHERE fld1= 155; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +fld1 fld2 fld3 +10 11 12 +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +#Concurrent INSERT, UPDATE, SELECT and DELETE is supported +#during OPTIMIZE TABLE operation for Partitioned table. +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +#Setup PARTITIONED table. +CREATE TABLE t1(fld1 INT) ENGINE= INNODB PARTITION BY HASH(fld1) PARTITIONS 4; +INSERT INTO t1 VALUES(10); +#OPTIMIZE TABLE operation. +OPTIMIZE TABLE t1; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +# With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +fld1 +30 +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +#ALTER TABLE FORCE and ALTER TABLE ENGINE uses online rebuild +#of the table. +CREATE TABLE t1(fld1 INT, fld2 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(10, 20); +ALTER TABLE t1 FORCE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ENGINE=INNODB; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +#ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE uses +#table copy when the old_alter_table enabled. +SET SESSION old_alter_table= TRUE; +affected rows: 0 +ALTER TABLE t1 FORCE; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ENGINE= INNODB; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded'; +affected rows: 0 +#OPTIMIZE TABLE operation using table copy. +OPTIMIZE TABLE t1; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR upgraded'; +affected rows: 0 +INSERT INTO t1 VALUES(10, 20); +affected rows: 1 +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +affected rows: 2 +SET DEBUG_SYNC= 'RESET'; +affected rows: 0 +SET SESSION old_alter_table= FALSE; +affected rows: 0 +#ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy +#when ALGORITHM COPY is used. +ALTER TABLE t1 FORCE, ALGORITHM= COPY; +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ENGINE= INNODB, ALGORITHM= COPY; +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +DROP TABLE t1; +#OPTIMIZE TABLE on a table with FULLTEXT index uses +#ALTER TABLE FORCE using COPY algorithm here. This +#test case ensures the COPY table debug sync point is hit. +SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded'; +#Setup a table with FULLTEXT index. +connection default; +CREATE TABLE t1(fld1 CHAR(10), FULLTEXT(fld1)) ENGINE= INNODB; +INSERT INTO t1 VALUES("String1"); +#OPTIMIZE TABLE operation. +OPTIMIZE TABLE t1; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR upgraded'; +INSERT INTO t1 VALUES("String2"); +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; +#Test which demonstrates that ALTER TABLE, OPTIMIZE PARTITION +#takes OPTIMIZE TABLE code path, hence does an online rebuild +#of the table with the patch. +connection default; +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +#Setup PARTITIONED table. +CREATE TABLE t1(fld1 INT) ENGINE= INNODB PARTITION BY HASH(fld1) PARTITIONS 4; +INSERT INTO t1 VALUES(10); +#OPTIMIZE ALL PARTITIONS operation. +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +# With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +fld1 +30 +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection default; +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 +SET DEBUG_SYNC= 'RESET'; +#OPTIMIZE PER PARTITION operation. +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +ALTER TABLE t1 OPTIMIZE PARTITION p0; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +# With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +fld1 +30 +30 +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection default; +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 +SET DEBUG_SYNC= 'RESET'; +# Test case for Bug#11938817 (ALTER BEHAVIOR DIFFERENT THEN DOCUMENTED). +# This should not do anything +ALTER TABLE t1; +affected rows: 0 +SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuild'; +# Check that we rebuild the table +ALTER TABLE t1 engine=innodb; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR rebuild'; +connection default; +SET DEBUG_SYNC= 'RESET'; +SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuild'; +# Check that we rebuild the table +ALTER TABLE t1 FORCE; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR rebuild'; +connection default; +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/innodb_recovery_with_upper_case_names.result b/mysql-wsrep-5.6/mysql-test/r/innodb_recovery_with_upper_case_names.result new file mode 100644 index 00000000..29434562 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/innodb_recovery_with_upper_case_names.result @@ -0,0 +1,48 @@ +Bug #18412598 UNCLEAN SYSTEM SHUTDOWN RECOVERY FAILS +FOR SCHEMA WITH CAPITAL LETTERS +create database MYDB; +USE MYDB; +CREATE TABLE mytable (id int primary key) ENGINE=innodb; +CREATE TABLE FOO (id int,constraint FOREIGN KEY (id) REFERENCES mytable(id) ON DELETE CASCADE) ENGINE=innodb; +CREATE TABLE mytable_ref (id int,constraint FOREIGN KEY (id) REFERENCES FOO(id) ON DELETE CASCADE) ENGINE=innodb; +INSERT INTO mytable VALUES (10),(20),(30),(40); +INSERT INTO FOO VALUES (20),(10); +INSERT INTO mytable_ref VALUES (20),(10); +SHOW VARIABLES LIKE 'innodb_fast_shutdown'; +Variable_name Value +innodb_fast_shutdown 2 +START TRANSACTION; +INSERT INTO mytable VALUES (50); +INSERT INTO FOO VALUES (50); +INSERT INTO mytable_ref VALUES (50); +# Restart the server. This will go into crash recovery mode +USE MYDB; +SELECT * FROM mytable; +id +10 +20 +30 +40 +SELECT * FROM FOO; +id +10 +20 +SELECT * FROM mytable_ref; +id +10 +20 +DELETE FROM mytable WHERE id =10; +SELECT * FROM FOO; +id +20 +SELECT * FROM mytable_ref; +id +20 +CREATE TABLE MYtable (id int) ENGINE=innodb; +ERROR 42S01: Table 'mytable' already exists +CREATE TABLE Foo (id int) ENGINE=innodb; +ERROR 42S01: Table 'foo' already exists +DROP TABLE mytable_ref,FOO; +DROP TABLE mytable; +use test; +DROP DATABASE MYDB; diff --git a/mysql-wsrep-5.6/mysql-test/r/insert.result b/mysql-wsrep-5.6/mysql-test/r/insert.result index 8bc5839d..6f7169e9 100644 --- a/mysql-wsrep-5.6/mysql-test/r/insert.result +++ b/mysql-wsrep-5.6/mysql-test/r/insert.result @@ -664,6 +664,8 @@ End of 5.0 tests. drop table if exists t1; create table t1 (data varchar(4) not null); set sql_mode='error_for_division_by_zero'; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. # # Demonstrate that the number of warnings matches # the information in mysql_info(). diff --git a/mysql-wsrep-5.6/mysql-test/r/loaddata.result b/mysql-wsrep-5.6/mysql-test/r/loaddata.result index 328d26ee..8ccc1a3d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/loaddata.result +++ b/mysql-wsrep-5.6/mysql-test/r/loaddata.result @@ -520,3 +520,15 @@ LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug11735141.txt' INTO TABLE t1; ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1; End of 5.1 tests +# +# Bug#11759519 INFINITE HANG WITH 100% CPU USAGE WITH LOAD DATA LOCAL AND IMPORT ERRORS +# +SET @old_mode= @@sql_mode; +CREATE TABLE t1 (fld1 INT); +SET sql_mode='strict_all_tables'; +# Without fix, load data hangs forever. +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/mysql' REPLACE INTO TABLE t1 +FIELDS TERMINATED BY 't' LINES TERMINATED BY ''; +Got one of the listed errors +SET @@sql_mode= @old_mode; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/lock_sync.result b/mysql-wsrep-5.6/mysql-test/r/lock_sync.result index 219cc083..52d2d979 100644 --- a/mysql-wsrep-5.6/mysql-test/r/lock_sync.result +++ b/mysql-wsrep-5.6/mysql-test/r/lock_sync.result @@ -752,6 +752,9 @@ SET DEBUG_SYNC="RESET"; DROP TABLE IF EXISTS t1; CREATE TABLE t1(a INT) engine=InnoDB; INSERT INTO t1 VALUES (1), (2); +# Note: This test now provides coverage for the scenario where +# opening of table during analyze phase of OPTIMIZE TABLE +# fails (instead of original coverage for open_ltable() code). # Connection con1 SET SESSION lock_wait_timeout= 1; SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze'; @@ -761,7 +764,7 @@ OPTIMIZE TABLE t1; SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate'; SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock'; # Sending: -INSERT INTO t1 VALUES (3); +LOCK TABLES t1 WRITE; # Connection default SET DEBUG_SYNC= 'now WAIT_FOR thrlock'; SET DEBUG_SYNC= 'now SIGNAL opti_analyze'; @@ -775,7 +778,7 @@ Warnings: Error 1205 Lock wait timeout exceeded; try restarting transaction SET DEBUG_SYNC= 'now SIGNAL release_thrlock'; # Connection con2 -# Reaping: INSERT INTO t1 VALUES (3) +# Reaping: LOCK TABLES t1 WRITE # Connection default DROP TABLE t1; SET DEBUG_SYNC= 'RESET'; @@ -814,3 +817,90 @@ Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function SET DEBUG_SYNC= 'RESET'; DROP VIEW v1; DROP TABLE t1; +# +#Bug#18110156: RECREATE+ANALYZE OPTIMIZE TABLE T AND ONLINE +# ALTER TABLE T MAY DEADLOCK +CREATE TABLE t1 (fld1 INT) ENGINE=InnoDB; +connection con1; +SET DEBUG_SYNC= 'before_lock_tables_takes_lock SIGNAL before_thr_lock WAIT_FOR do_thr_lock EXECUTE 3'; +SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze'; +OPTIMIZE TABLE t1; +connection con2; +# Skip thr_lock acquisition during the initial phase of OPTIMIZE TABLE +SET DEBUG_SYNC= 'now WAIT_FOR before_thr_lock'; +SET DEBUG_SYNC= 'now SIGNAL do_thr_lock'; +# Skip thr_lock acquisition during the recreate phase of OPTIMIZE TABLE +SET DEBUG_SYNC= 'now WAIT_FOR before_thr_lock'; +SET DEBUG_SYNC= 'now SIGNAL do_thr_lock'; +SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate'; +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL lock_downgraded +WAIT_FOR finish_alter'; +ALTER TABLE t1 ADD INDEX index1(fld1), ALGORITHM=INPLACE, LOCK=NONE; +#Without the patch, the test case hangs. +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR lock_downgraded'; +SET DEBUG_SYNC= 'now SIGNAL opti_analyze'; +SET DEBUG_SYNC= 'now WAIT_FOR before_thr_lock'; +SET DEBUG_SYNC= 'now SIGNAL finish_alter'; +SET DEBUG_SYNC= 'now SIGNAL do_thr_lock'; +#Reap: OPTIMIZE TABLE t1 +connection con1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +#Reap: ALTER TABLE t1 +connection con2; +#Clean up. +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +# +# Bug#19070633 - POSSIBLE ACCESS TO FREED MEMORY IN IS_FREE_LOCK() AND IS_USED_LOCK(). +# +# Verifying issue for IS_FREE_LOCK() function. +SELECT GET_LOCK("lock_19070633", 600); +GET_LOCK("lock_19070633", 600) +1 +connect con1, localhost, root,,; +# Waiting after getting user level lock info and releasing mutex. +SET DEBUG_SYNC= 'after_getting_user_level_lock_info SIGNAL parked WAIT_FOR go'; +# Sending: SELECT IS_FREE_LOCK("lock_19070633"); +SELECT IS_FREE_LOCK("lock_19070633"); +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR parked'; +SELECT RELEASE_LOCK("lock_19070633"); +RELEASE_LOCK("lock_19070633") +1 +# Signaling connection con1 after releasing the lock. +# Without fix, accessing user level lock info in con1 would result in +# crash or valgrind issue invalid read is reported. +SET DEBUG_SYNC= 'now SIGNAL go'; +connection con1; +# Reaping: SELECT IS_FREE_LOCK("lock_19070633"); +IS_FREE_LOCK("lock_19070633") +0 +connection default; +# Verifying issue for IS_USED_LOCK() function. +SELECT GET_LOCK("lock_19070633", 600); +GET_LOCK("lock_19070633", 600) +1 +connection con1; +# Waiting after getting user level lock info and releasing mutex. +SET DEBUG_SYNC= 'after_getting_user_level_lock_info SIGNAL parked WAIT_FOR go'; +# Sending: SELECT IS_USED_LOCK("lock_19070633"); +SELECT IS_USED_LOCK("lock_19070633"); +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR parked'; +SELECT RELEASE_LOCK("lock_19070633"); +RELEASE_LOCK("lock_19070633") +1 +# Signaling connection con1 after releasing the lock. +# Without fix, accessing user level lock info in con1 would result in +# crash or valgrind issue invalid read is reported. +SET DEBUG_SYNC= 'now SIGNAL go'; +connection con1; +# Reaping: SELECT IS_USED_LOCK("lock_19070633"); +IS_USED_LOCK("lock_19070633") +# +connection default; +SET DEBUG_SYNC= 'RESET'; +disconnect con1; diff --git a/mysql-wsrep-5.6/mysql-test/r/log_errchk.result b/mysql-wsrep-5.6/mysql-test/r/log_errchk.result new file mode 100644 index 00000000..be5e14cf --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/log_errchk.result @@ -0,0 +1,10 @@ +call mtr.add_suppression("Could not open"); +# Case 1: Setting fife file to general_log_file and slow_query_log_file +# system variable. +SET GLOBAL general_log_file="MYSQLTEST_VARDIR/tmp/general_log.fifo";; +ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR/tmp/general_log.fifo' +SET GLOBAL slow_query_log_file="MYSQLTEST_VARDIR/tmp/slow_log.fifo";; +ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'MYSQLTEST_VARDIR/tmp/slow_log.fifo' +# Case 2: Starting server with fifo file as general log file +# and slow query log file. +Setting fifo file as general log file and slow query log failed. diff --git a/mysql-wsrep-5.6/mysql-test/r/lowercase_table4.result b/mysql-wsrep-5.6/mysql-test/r/lowercase_table4.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/r/myisam.result b/mysql-wsrep-5.6/mysql-test/r/myisam.result index 33c2265b..56814e2b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/myisam.result +++ b/mysql-wsrep-5.6/mysql-test/r/myisam.result @@ -2537,3 +2537,82 @@ f1 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'lhsi' DROP TABLE t1; +# +# Bug 17156940 THE UPDATE AND SELECT BEHAVE DIFFERENTLY +# UNDER THE SAME CONDITIONS. +# +CREATE TABLE t1 ( +col1 VARCHAR(255) DEFAULT NULL, +col1_id INT(11) DEFAULT NULL, +KEY col1 (col1), +KEY col1_id (col1_id) +) ENGINE=MyISAM; +INSERT INTO t1 (col1, col1_id) VALUES +('5cm', 10000), ('people', 10000), ('king', 10000), ('queen', 10000), +('minister', 10000), ('servent', 13000); +INSERT INTO t1 (col1, col1_id) +SELECT col1, col1_id FROM t1 WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_id) +SELECT col1, col1_id FROM t1 WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_id) +SELECT col1, col1_id FROM t1 WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_id) VALUES +('5cm ', 10000), ('5cm ', 10000); +SELECT col1, hex(col1), col1_id, count(*) from t1 +WHERE col1= '5cm' GROUP BY hex(col1), col1_id; +col1 hex(col1) col1_id count(*) +5cm 35636D 10000 1 +5cm 35636D20 10000 2 +UPDATE t1 SET col1_id= 1414 WHERE col1= '5cm'; +SELECT count(*) FROM t1 WHERE col1= '5cm'; +count(*) +3 +SELECT count(*) FROM t1 WHERE col1_id= 1414; +count(*) +3 +DELETE FROM t1 WHERE col1= '5cm'; +SELECT count(*) FROM t1 WHERE col1= '5cm'; +count(*) +0 +DROP TABLE t1; +# Test for multi column key. +CREATE TABLE t1 ( +col1 VARCHAR(255) DEFAULT NULL, +col1_dummy VARCHAR(25) DEFAULT NULL, +col1_id INT(11) DEFAULT NULL, +col1_id_dummy INT(10) DEFAULT NULL, +KEY col1 (col1, col1_dummy), +KEY col1_id (col1, col1_id_dummy) +) ENGINE=MyISAM; +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) VALUES +('5cm', '5cm' , 10000, 100), ('people', 'people', 10000, 100), +('king', 'king' , 10000, 100), ('queen', 'queen', 10000, 100), +('minister', 'minister', 10000, 100), ('servent', 'servent', 13000, 100); +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) +SELECT col1, col1_dummy, col1_id, col1_id_dummy FROM t1 +WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) +SELECT col1, col1_dummy, col1_id, col1_id_dummy FROM t1 +WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) +SELECT col1, col1_dummy, col1_id, col1_id_dummy FROM t1 +WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) VALUES +('5cm ', '5cm ', 10000, 100), ('5cm ', '5cm ', 10000, 100); +SELECT col1, hex(col1), col1_id, count(*) from t1 WHERE col1= '5cm' + GROUP BY hex(col1), col1_id; +col1 hex(col1) col1_id count(*) +5cm 35636D 10000 1 +5cm 35636D20 10000 2 +UPDATE t1 SET col1_id= 1414 WHERE col1= '5cm' AND col1_dummy= '5cm'; +SELECT count(*) FROM t1 WHERE col1= '5cm'; +count(*) +3 +SELECT count(*) FROM t1 WHERE col1_id= 1414; +count(*) +3 +DELETE FROM t1 WHERE col1= '5cm' AND col1_dummy= '5cm'; +SELECT count(*) FROM t1 WHERE col1= '5cm'; +count(*) +0 +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result b/mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result index 2869a91b..a84fa308 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result @@ -100,7 +100,7 @@ user = test_user4 ############################################## # Tests for mysql_config_editor's help command ############################################## -Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective diff --git a/mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result b/mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result index d8b72d7b..627f359a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result @@ -117,6 +117,8 @@ 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 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. Warning: Using a password on the command line interface can be insecure. Warning: Using a password on the command line interface can be insecure. mysql.columns_priv OK @@ -363,6 +365,7 @@ mtr.test_suppressions OK CREATE USER 'bug13586336'@'localhost' IDENTIFIED WITH 'mysql_old_password'; SET PASSWORD FOR 'bug13586336'@'localhost' = OLD_PASSWORD('a'); Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead Run mysql_upgrade with all privileges on a user Warning: Using a password on the command line interface can be insecure. @@ -402,5 +405,102 @@ Warning: Using a password on the command line interface can be insecure. mtr.global_suppressions OK mtr.test_suppressions OK DROP USER 'bug13586336'@'localhost'; +# +# Bug #20023823 BACKPORT THE FIX FOR MYSQL_INSTALL_DB/MYSQL_UPGRADE +# ON NON-EMPTY PLUGIN COLUMN +# +# Creating user with empty plugin and empty password +# plugin should be changed to mysql_native_password after the update +CREATE USER B20023823_empty@localhost; +GRANT ALL PRIVILEGES on *.* TO B20023823_empty@localhost; +update mysql.user set plugin='' WHERE user='B20023823_empty' + and host='localhost'; +flush privileges; +# Creating user with default plugin, i.e. mysql_native_password +# this plugin should not be changed during the upgrade +CREATE USER B20023823_def@localhost IDENTIFIED BY 'test'; +# Creating user with 41 bytes hash pass (default) and setting its plugin +# to empty string. Plugin should be set to mysql_native_password +# after the upgrade is finished +CREATE USER B20023823_41hash@localhost IDENTIFIED WITH mysql_native_password; +set session old_passwords=0; +set password for B20023823_41hash@localhost = password('test'); +update mysql.user set plugin='' WHERE user='B20023823_41hash' + and host='localhost'; +flush privileges; +# Creating user with 16 bytes hash pass and setting its plugin +# to empty string. Plugin should be set to mysql_old_password +# after the upgrade is finished +CREATE USER B20023823_16hash@localhost identified with mysql_old_password; +set session old_passwords=1; +set password for B20023823_16hash@localhost = password('test'); +Warnings: +Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead +update mysql.user set plugin='' WHERE user='B20023823_16hash' + and host='localhost'; +flush privileges; +SELECT user, plugin from mysql.user; +user plugin +root mysql_native_password +root mysql_native_password +root mysql_native_password +root mysql_native_password +B20023823_empty +B20023823_def mysql_native_password +B20023823_41hash +B20023823_16hash +# repair the user's plugin +Warning: Using a password on the command line interface can be insecure. +Warning: Using a password on the command line interface can be insecure. +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.general_log OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.innodb_index_stats OK +mysql.innodb_table_stats OK +mysql.ndb_binlog_index OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.servers OK +mysql.slave_master_info OK +mysql.slave_relay_log_info OK +mysql.slave_worker_info OK +mysql.slow_log OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +Warning: Using a password on the command line interface can be insecure. +Warning 1642 Pre-4.1 password hash found. It is deprecated and will be removed in a future release. Please upgrade it to a new format. +Warning: Using a password on the command line interface can be insecure. +Warning: Using a password on the command line interface can be insecure. +mtr.global_suppressions OK +mtr.test_suppressions OK +# expect non-empty +SELECT user, plugin from mysql.user; +user plugin +root mysql_native_password +root mysql_native_password +root mysql_native_password +root mysql_native_password +B20023823_empty mysql_native_password +B20023823_def mysql_native_password +B20023823_41hash mysql_native_password +B20023823_16hash mysql_old_password +# cleanup +DROP USER B20023823_empty@localhost; +DROP USER B20023823_def@localhost; +DROP USER B20023823_41hash@localhost; +DROP USER B20023823_16hash@localhost; End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqlbinlog_debug.result b/mysql-wsrep-5.6/mysql-test/r/mysqlbinlog_debug.result new file mode 100644 index 00000000..0e27778c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/mysqlbinlog_debug.result @@ -0,0 +1,7 @@ +# +# Bug#18742916 : MYSQLBINLOG --RAW DOES NOT CHECK FOR ERRORS +# +ERROR: Could not write into log file 'MYSQLTEST_VARDIR/tmp/master-bin.000001' +ERROR: Could not write into log file 'MYSQLTEST_VARDIR/tmp/master-bin.000001' + +End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqlbinlog_mixed_or_statment.result b/mysql-wsrep-5.6/mysql-test/r/mysqlbinlog_mixed_or_statment.result new file mode 100644 index 00000000..4a08c4d3 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/mysqlbinlog_mixed_or_statment.result @@ -0,0 +1,26 @@ +# +# Bug#18913551 - LOCK TABLES USES INCORRECT LOCK FOR IMPLICITLY USED +# TABLES. +# +SET @org_concurrent_insert= @@global.concurrent_insert; +SET @@global.concurrent_insert=1; +CREATE TABLE t1(a INT) ENGINE=MyISAM; +CREATE FUNCTION f1() RETURNS INT RETURN (SELECT MIN(a) FROM t1); +CREATE VIEW v1 AS (SELECT 1 FROM dual WHERE f1() = 1); +LOCK TABLE v1 READ; +connect con1, localhost, root; +SET lock_wait_timeout=1; +# With fix, con1 does not get lock on table "t1" so following insert +# operation fails after waiting for "lock_wait_timeout" duration. +INSERT INTO t1 VALUES (1); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +UNLOCK TABLES; +# V1 should be empty here. +SELECT * FROM v1; +1 +disconnect con1; +SET @@global.concurrent_insert= @org_concurrent_insert; +DROP TABLE t1; +DROP VIEW v1; +DROP FUNCTION f1; diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqlcheck.result b/mysql-wsrep-5.6/mysql-test/r/mysqlcheck.result index f210aed3..5bc31ae8 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqlcheck.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqlcheck.result @@ -314,10 +314,7 @@ CHECK TABLE bug47205 FOR UPGRADE; Table Op Msg_type Msg_text test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! # ALTER TABLE ... FORCE should rebuild the table -# and therefore output "affected rows: 1" ALTER TABLE bug47205 FORCE; -affected rows: 1 -info: Records: 1 Duplicates: 0 Warnings: 0 # Table should now be ok CHECK TABLE bug47205 FOR UPGRADE; Table Op Msg_type Msg_text diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result b/mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result index aa4b3ebf..18b21ffd 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result @@ -56,6 +56,10 @@ The following options may be given as the first argument: --binlog-do-db=name Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned. + --binlog-error-action=name + When statements cannot be written to the binary log due + to a fatal error, the server can either ignore the error + and let the master continue, or abort. --binlog-format=name What form of binary logging the master will use: either ROW for row-based binary logging, STATEMENT for @@ -68,6 +72,19 @@ The following options may be given as the first argument: binlog-format is MIXED, the format switches to row-based 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. --binlog-ignore-db=name Tells the master that updates to the given database should not be logged to the binary log. @@ -103,6 +120,14 @@ The following options may be given as the first argument: non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance + --binlogging-impossible-mode=name + On a fatal error when statements cannot be binlogged the + behaviour can be ignore the error and let the master + continue or abort the server. This variable is deprecated + and will be removed in a future release. Please use + binlog_error_action instead. + --block-encryption-mode=name + mode for AES_ENCRYPT/AES_DECRYPT --bootstrap Used by mysql installation scripts. --bulk-insert-buffer-size=# Size of tree cache used in bulk insert optimisation. Note @@ -809,6 +834,8 @@ The following options may be given as the first argument: --show-slave-auth-info Show user and password in SHOW SLAVE HOSTS on this master. + --simplified-binlog-gtid-recovery + Alias for @@binlog_gtid_simple_recovery. Deprecated --skip-grant-tables Start without grant tables. This gives all users FULL ACCESS to all tables. --skip-host-cache Don't cache host names. @@ -948,8 +975,8 @@ The following options may be given as the first argument: one-thread-per-connection, no-threads, loaded-dynamically --thread-stack=# The stack size for each thread --time-format=name The TIME format (ignored) - --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are - currently supported) + --timed-mutexes Specify whether to time mutexes. Deprecated, has no + effect. --tmp-table-size=# If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM table @@ -997,13 +1024,17 @@ bind-address * binlog-cache-size 32768 binlog-checksum CRC32 binlog-direct-non-transactional-updates FALSE +binlog-error-action IGNORE_ERROR binlog-format STATEMENT +binlog-gtid-simple-recovery FALSE binlog-max-flush-queue-time 0 binlog-order-commits TRUE binlog-row-event-max-size 8192 binlog-row-image FULL binlog-rows-query-log-events FALSE binlog-stmt-cache-size 32768 +binlogging-impossible-mode IGNORE_ERROR +block-encryption-mode aes-128-ecb bulk-insert-buffer-size 8388608 character-set-client-handshake TRUE character-set-filesystem binary @@ -1219,6 +1250,7 @@ secure-file-priv (No default value) server-id 0 server-id-bits 32 show-slave-auth-info FALSE +simplified-binlog-gtid-recovery FALSE skip-grant-tables TRUE skip-name-resolve FALSE skip-networking FALSE diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result b/mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result index cdc8f509..7e5e2596 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result @@ -56,6 +56,10 @@ The following options may be given as the first argument: --binlog-do-db=name Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned. + --binlog-error-action=name + When statements cannot be written to the binary log due + to a fatal error, the server can either ignore the error + and let the master continue, or abort. --binlog-format=name What form of binary logging the master will use: either ROW for row-based binary logging, STATEMENT for @@ -68,6 +72,19 @@ The following options may be given as the first argument: binlog-format is MIXED, the format switches to row-based 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. --binlog-ignore-db=name Tells the master that updates to the given database should not be logged to the binary log. @@ -103,6 +120,14 @@ The following options may be given as the first argument: non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance + --binlogging-impossible-mode=name + On a fatal error when statements cannot be binlogged the + behaviour can be ignore the error and let the master + continue or abort the server. This variable is deprecated + and will be removed in a future release. Please use + binlog_error_action instead. + --block-encryption-mode=name + mode for AES_ENCRYPT/AES_DECRYPT --bootstrap Used by mysql installation scripts. --bulk-insert-buffer-size=# Size of tree cache used in bulk insert optimisation. Note @@ -812,6 +837,8 @@ The following options may be given as the first argument: --show-slave-auth-info Show user and password in SHOW SLAVE HOSTS on this master. + --simplified-binlog-gtid-recovery + Alias for @@binlog_gtid_simple_recovery. Deprecated --skip-grant-tables Start without grant tables. This gives all users FULL ACCESS to all tables. --skip-host-cache Don't cache host names. @@ -956,8 +983,8 @@ The following options may be given as the first argument: one-thread-per-connection, no-threads, loaded-dynamically --thread-stack=# The stack size for each thread --time-format=name The TIME format (ignored) - --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are - currently supported) + --timed-mutexes Specify whether to time mutexes. Deprecated, has no + effect. --tmp-table-size=# If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM table @@ -1005,13 +1032,17 @@ bind-address * binlog-cache-size 32768 binlog-checksum CRC32 binlog-direct-non-transactional-updates FALSE +binlog-error-action IGNORE_ERROR binlog-format STATEMENT +binlog-gtid-simple-recovery FALSE binlog-max-flush-queue-time 0 binlog-order-commits TRUE binlog-row-event-max-size 8192 binlog-row-image FULL binlog-rows-query-log-events FALSE binlog-stmt-cache-size 32768 +binlogging-impossible-mode IGNORE_ERROR +block-encryption-mode aes-128-ecb bulk-insert-buffer-size 8388608 character-set-client-handshake TRUE character-set-filesystem binary @@ -1229,6 +1260,7 @@ server-id-bits 32 shared-memory FALSE shared-memory-base-name MYSQL show-slave-auth-info FALSE +simplified-binlog-gtid-recovery FALSE skip-grant-tables TRUE skip-name-resolve FALSE skip-networking FALSE diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqldump.result b/mysql-wsrep-5.6/mysql-test/r/mysqldump.result index 784a3f15..c1299119 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqldump.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqldump.result @@ -1987,11 +1987,9 @@ DROP TABLE IF EXISTS `v2`; /*!50001 DROP VIEW IF EXISTS `v2`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v2` ( - `a` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v2` AS SELECT + 1 AS `a`*/; SET character_set_client = @saved_cs_client; -/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -2081,11 +2079,9 @@ DROP TABLE IF EXISTS `v1`; /*!50001 DROP VIEW IF EXISTS `v1`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v1` ( - `a` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v1` AS SELECT + 1 AS `a`*/; SET character_set_client = @saved_cs_client; -/*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -2155,11 +2151,9 @@ DROP TABLE IF EXISTS `v2`; /*!50001 DROP VIEW IF EXISTS `v2`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v2` ( - `a` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v2` AS SELECT + 1 AS `a`*/; SET character_set_client = @saved_cs_client; -/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -2269,31 +2263,27 @@ DROP TABLE IF EXISTS `v1`; /*!50001 DROP VIEW IF EXISTS `v1`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v1` ( - `a` tinyint NOT NULL, - `b` tinyint NOT NULL, - `c` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v1` AS SELECT + 1 AS `a`, + 1 AS `b`, + 1 AS `c`*/; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; /*!50001 DROP VIEW IF EXISTS `v2`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v2` ( - `a` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v2` AS SELECT + 1 AS `a`*/; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v3`; /*!50001 DROP VIEW IF EXISTS `v3`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v3` ( - `a` tinyint NOT NULL, - `b` tinyint NOT NULL, - `c` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v3` AS SELECT + 1 AS `a`, + 1 AS `b`, + 1 AS `c`*/; SET character_set_client = @saved_cs_client; -/*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -2307,7 +2297,6 @@ SET character_set_client = @saved_cs_client; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -2321,7 +2310,6 @@ SET character_set_client = @saved_cs_client; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP TABLE IF EXISTS `v3`*/; /*!50001 DROP VIEW IF EXISTS `v3`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -3026,35 +3014,31 @@ DROP TABLE IF EXISTS `v0`; /*!50001 DROP VIEW IF EXISTS `v0`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v0` ( - `a` tinyint NOT NULL, - `b` tinyint NOT NULL, - `c` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v0` AS SELECT + 1 AS `a`, + 1 AS `b`, + 1 AS `c`*/; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v1`; /*!50001 DROP VIEW IF EXISTS `v1`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v1` ( - `a` tinyint NOT NULL, - `b` tinyint NOT NULL, - `c` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v1` AS SELECT + 1 AS `a`, + 1 AS `b`, + 1 AS `c`*/; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; /*!50001 DROP VIEW IF EXISTS `v2`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v2` ( - `a` tinyint NOT NULL, - `b` tinyint NOT NULL, - `c` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v2` AS SELECT + 1 AS `a`, + 1 AS `b`, + 1 AS `c`*/; SET character_set_client = @saved_cs_client; USE `test`; -/*!50001 DROP TABLE IF EXISTS `v0`*/; /*!50001 DROP VIEW IF EXISTS `v0`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -3068,7 +3052,6 @@ USE `test`; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -3082,7 +3065,6 @@ USE `test`; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -3320,7 +3302,7 @@ insert into t values(5, 51); create view v1 as select qty, price, qty*price as value from t; create view v2 as select qty from v1; mysqldump { -/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; /*!50001 SET @saved_col_connection = @@collation_connection */; @@ -3335,7 +3317,7 @@ mysqldump { /*!50001 SET collation_connection = @saved_col_connection */; } mysqldump { -/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; /*!50001 SET @saved_col_connection = @@collation_connection */; @@ -3428,13 +3410,11 @@ DROP TABLE IF EXISTS `v1`; /*!50001 DROP VIEW IF EXISTS `v1`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v1` ( - `id` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v1` AS SELECT + 1 AS `id`*/; SET character_set_client = @saved_cs_client; USE `mysqldump_test_db`; -/*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -3488,15 +3468,14 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHAR USE `mysqldump_views`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `nasishnasifu` ( - `id` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `nasishnasifu` AS SELECT + 1 AS `id`*/; SET character_set_client = @saved_cs_client; USE `mysqldump_tables`; USE `mysqldump_views`; -/*!50001 DROP TABLE IF EXISTS `nasishnasifu`*/; +/*!50001 DROP VIEW IF EXISTS `nasishnasifu`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; /*!50001 SET @saved_col_connection = @@collation_connection */; @@ -3881,11 +3860,9 @@ DROP TABLE IF EXISTS `v2`; /*!50001 DROP VIEW IF EXISTS `v2`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v2` ( - `c` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v2` AS SELECT + 1 AS `c`*/; SET character_set_client = @saved_cs_client; -/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -4298,13 +4275,11 @@ DROP TABLE IF EXISTS `v1`; /*!50001 DROP VIEW IF EXISTS `v1`*/; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -/*!50001 CREATE TABLE `v1` ( - `id` tinyint NOT NULL -) ENGINE=MyISAM */; +/*!50001 CREATE VIEW `v1` AS SELECT + 1 AS `id`*/; SET character_set_client = @saved_cs_client; USE `mysqldump_test_db`; -/*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; @@ -5409,3 +5384,23 @@ SET @@global.general_log= @old_general_log_state; # # End of 5.1 tests # +# +#BUG#17477959 - VIEW COLUMNS EXCEED TABLE LIMITS +# +CREATE VIEW v1 AS SELECT 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit1, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit2, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit3, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit4, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit5, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit6, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit7, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit8, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit9, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit10, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit11, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit12, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit13, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit14, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit15, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit16, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit17, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit18, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit19, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit20, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit21, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit22, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit23, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit24, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit25, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit26, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit27, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit28, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit29, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit30, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit31, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit32, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit33, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit34, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit35, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit36, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit37, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit38, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit39, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit40, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit41, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit42, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit43, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit44, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit45, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit46, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit47, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit48, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit49, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit50, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit51, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit52, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit53, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit54, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit55, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit56, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit57, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit58, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit59, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit60, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit61, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit62, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit63, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit64, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit65, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit66, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit67, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit68, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit69, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit70, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit71, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit72, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit73, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit74, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit75, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit76, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit77, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit78, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit79, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit80, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit81, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit82, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit83, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit84, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit85, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit86, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit87, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit88, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit89, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit90, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit91, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit92, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit93, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit94, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit95, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit96, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit97, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit98, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit99, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit100, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit101, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit102, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit103, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit104, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit105, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit106, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit107, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit108, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit109, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit110, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit111, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit112, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit113, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit114, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit115, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit116, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit117, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit118, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit119, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit120, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit121, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit122, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit123, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit124, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit125, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit126, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit127, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit128, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit129, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit130, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit131, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit132, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit133, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit134, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit135, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit136, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit137, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit138, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit139, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit140, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit141, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit142, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit143, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit144, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit145, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit146, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit147, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit148, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit149, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit150, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit151, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit152, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit153, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit154, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit155, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit156, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit157, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit158, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit159, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit160, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit161, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit162, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit163, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit164, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit165, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit166, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit167, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit168, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit169, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit170, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit171, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit172, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit173, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit174, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit175, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit176, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit177, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit178, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit179, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit180, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit181, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit182, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit183, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit184, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit185, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit186, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit187, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit188, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit189, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit190, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit191, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit192, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit193, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit194, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit195, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit196, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit197, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit198, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit199, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit200, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit201, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit202, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit203, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit204, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit205, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit206, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit207, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit208, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit209, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit210, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit211, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit212, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit213, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit214, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit215, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit216, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit217, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit218, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit219, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit220, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit221, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit222, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit223, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit224, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit225, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit226, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit227, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit228, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit229, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit230, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit231, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit232, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit233, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit234, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit235, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit236, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit237, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit238, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit239, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit240, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit241, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit242, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit243, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit244, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit245, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit246, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit247, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit248, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit249, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit250, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit251, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit252, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit253, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit254, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit255, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit256, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit257, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit258, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit259, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit260, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit261, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit262, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit263, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit264, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit265, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit266, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit267, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit268, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit269, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit270, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit271, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit272, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit273, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit274, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit275, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit276, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit277, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit278, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit279, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit280, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit281, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit282, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit283, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit284, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit285, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit286, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit287, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit288, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit289, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit290, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit291, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit292, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit293, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit294, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit295, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit296, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit297, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit298, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit299, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit300, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit301, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit302, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit303, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit304, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit305, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit306, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit307, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit308, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit309, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit310, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit311, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit312, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit313, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit314, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit315, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit316, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit317, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit318, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit319, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit320, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit321, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit322, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit323, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit324, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit325, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit326, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit327, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit328, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit329, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit330, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit331, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit332, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit333, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit334, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit335, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit336, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit337, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit338, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit339, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit340, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit341, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit342, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit343, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit344, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit345, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit346, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit347, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit348, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit349, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit350, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit351, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit352, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit353, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit354, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit355, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit356, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit357, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit358, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit359, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit360, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit361, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit362, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit363, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit364, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit365, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit366, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit367, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit368, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit369, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit370, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit371, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit372, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit373, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit374, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit375, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit376, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit377, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit378, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit379, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit380, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit381, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit382, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit383, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit384, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit385, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit386, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit387, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit388, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit389, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit390, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit391, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit392, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit393, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit394, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit395, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit396, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit397, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit398, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit399, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit400, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit401, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit402, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit403, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit404, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit405, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit406, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit407, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit408, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit409, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit410, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit411, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit412, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit413, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit414, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit415, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit416, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit417, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit418, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit419, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit420, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit421, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit422, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit423, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit424, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit425, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit426, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit427, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit428, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit429, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit430, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit431, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit432, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit433, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit434, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit435, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit436, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit437, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit438, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit439, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit440, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit441, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit442, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit443, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit444, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit445, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit446, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit447, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit448, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit449, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit450, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit451, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit452, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit453, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit454, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit455, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit456, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit457, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit458, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit459, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit460, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit461, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit462, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit463, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit464, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit465, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit466, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit467, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit468, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit469, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit470, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit471, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit472, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit473, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit474, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit475, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit476, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit477, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit478, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit479, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit480, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit481, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit482, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit483, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit484, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit485, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit486, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit487, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit488, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit489, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit490, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit491, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit492, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit493, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit494, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit495, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit496, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit497, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit498, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit499, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit500, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit501, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit502, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit503, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit504, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit505, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit506, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit507, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit508, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit509, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit510, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit511, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit512, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit513, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit514, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit515, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit516, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit517, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit518, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit519, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit520, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit521, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit522, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit523, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit524, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit525, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit526, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit527, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit528, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit529, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit530, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit531, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit532, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit533, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit534, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit535, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit536, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit537, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit538, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit539, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit540, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit541, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit542, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit543, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit544, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit545, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit546, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit547, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit548, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit549, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit550, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit551, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit552, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit553, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit554, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit555, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit556, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit557, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit558, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit559, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit560, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit561, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit562, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit563, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit564, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit565, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit566, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit567, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit568, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit569, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit570, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit571, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit572, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit573, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit574, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit575, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit576, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit577, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit578, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit579, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit580, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit581, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit582, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit583, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit584, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit585, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit586, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit587, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit588, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit589, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit590, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit591, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit592, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit593, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit594, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit595, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit596, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit597, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit598, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit599, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit600, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit601, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit602, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit603, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit604, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit605, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit606, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit607, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit608, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit609, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit610, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit611, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit612, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit613, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit614, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit615, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit616, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit617, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit618, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit619, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit620, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit621, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit622, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit623, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit624, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit625, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit626, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit627, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit628, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit629, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit630, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit631, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit632, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit633, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit634, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit635, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit636, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit637, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit638, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit639, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit640, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit641, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit642, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit643, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit644, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit645, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit646, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit647, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit648, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit649, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit650, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit651, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit652, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit653, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit654, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit655, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit656, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit657, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit658, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit659, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit660, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit661, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit662, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit663, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit664, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit665, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit666, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit667, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit668, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit669, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit670, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit671, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit672, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit673, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit674, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit675, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit676, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit677, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit678, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit679, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit680, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit681, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit682, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit683, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit684, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit685, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit686, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit687, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit688, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit689, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit690, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit691, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit692, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit693, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit694, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit695, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit696, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit697, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit698, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit699, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit700, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit701, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit702, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit703, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit704, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit705, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit706, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit707, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit708, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit709, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit710, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit711, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit712, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit713, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit714, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit715, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit716, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit717, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit718, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit719, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit720, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit721, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit722, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit723, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit724, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit725, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit726, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit727, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit728, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit729, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit730, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit731, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit732, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit733, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit734, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit735, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit736, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit737, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit738, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit739, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit740, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit741, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit742, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit743, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit744, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit745, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit746, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit747, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit748, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit749, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit750, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit751, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit752, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit753, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit754, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit755, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit756, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit757, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit758, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit759, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit760, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit761, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit762, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit763, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit764, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit765, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit766, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit767, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit768, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit769, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit770, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit771, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit772, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit773, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit774, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit775, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit776, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit777, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit778, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit779, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit780, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit781, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit782, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit783, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit784, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit785, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit786, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit787, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit788, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit789, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit790, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit791, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit792, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit793, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit794, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit795, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit796, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit797, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit798, 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit; +DROP VIEW v1; +# +# End of 5.6 tests +# +# +# Bug #11752369 : MYSQLDUMP SHOULD CONVERT GEOMETRY COLUMNS TO HEX WITH +# --HEX-BLOB OPTION +CREATE DATABASE dump_gis; +USE dump_gis; +CREATE TABLE t1 (a GEOMETRY); +INSERT INTO t1 VALUES(GeomFromText('LineString(1 1, 2 1, 2 2, 1 2, 1 1)')); +SELECT HEX(a) FROM t1; +HEX(a) +00000000010200000005000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F +INSERT INTO `t1` (`a`) VALUES (0x00000000010200000005000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F); +DROP DATABASE dump_gis; diff --git a/mysql-wsrep-5.6/mysql-test/r/named_pipe.result b/mysql-wsrep-5.6/mysql-test/r/named_pipe.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/r/openssl_1.result b/mysql-wsrep-5.6/mysql-test/r/openssl_1.result index 2a3eeaca..a60c536c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/openssl_1.result +++ b/mysql-wsrep-5.6/mysql-test/r/openssl_1.result @@ -3,8 +3,8 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET); @@ -196,7 +196,7 @@ Ssl_cipher DHE-RSA-AES256-SHA Variable_name Value Ssl_cipher EDH-RSA-DES-CBC3-SHA Variable_name Value -Ssl_cipher EDH-RSA-DES-CBC-SHA +Ssl_cipher AES256-SHA Variable_name Value Ssl_cipher RC4-SHA select 'is still running; no cipher request crashed the server' as result from dual; diff --git a/mysql-wsrep-5.6/mysql-test/r/outfile_loaddata.result b/mysql-wsrep-5.6/mysql-test/r/outfile_loaddata.result index 36a72fd8..ca3a42c0 100644 --- a/mysql-wsrep-5.6/mysql-test/r/outfile_loaddata.result +++ b/mysql-wsrep-5.6/mysql-test/r/outfile_loaddata.result @@ -143,15 +143,16 @@ TRUNCATE t2; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'Ñ'; Warnings: Warning 1638 Non-ASCII separator arguments are not fully supported -Warning 1265 Data truncated for column 'a' at row 1 -Warning 1261 Row 1 doesn't contain data for all columns -Warning 1261 Row 1 doesn't contain data for all columns -Warning 1265 Data truncated for column 'a' at row 2 -Warning 1261 Row 2 doesn't contain data for all columns -Warning 1261 Row 2 doesn't contain data for all columns SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; a b c -1 NULL NULL +1 ABC-ÐÐÐ DEF-ÃÃà +2 NULL NULL +SELECT * FROM t1; +a b c +1 ABC-ÐÐÐ DEF-ÃÃà +2 NULL NULL +SELECT * FROM t2; +a b c 1 ABC-ÐÐÐ DEF-ÃÃà 2 NULL NULL SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES STARTING BY 'Ñ'; @@ -181,7 +182,14 @@ Warning 1638 Non-ASCII separator arguments are not fully supported SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; a b c 1 ABC-ÐÐÐ DEF-ÃÃà -1 ABC-ÐÐÐ DEF-ÃÃÃÃÅ 2 +2 NULL NULL +SELECT * FROM t1; +a b c +1 ABC-ÐÐÐ DEF-ÃÃà +2 NULL NULL +SELECT * FROM t2; +a b c +1 ABC-ÐÐÐ DEF-ÃÃà 2 NULL NULL # Default (binary) charset: SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FROM t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/parser.result b/mysql-wsrep-5.6/mysql-test/r/parser.result index 266122b6..dc35a146 100644 --- a/mysql-wsrep-5.6/mysql-test/r/parser.result +++ b/mysql-wsrep-5.6/mysql-test/r/parser.result @@ -669,3 +669,28 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp # START TRANSACTION ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,' at line 1 +# +# Bug#17075846 : unquoted file names for variable values are +# accepted but parsed incorrectly +# +SET default_storage_engine=a.myisam; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = .a.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = a.b.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = `a`.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = `a`.`MyISAM`; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +set default_storage_engine = "a.MYISAM"; +ERROR 42000: Unknown storage engine 'a.MYISAM' +set default_storage_engine = 'a.MYISAM'; +ERROR 42000: Unknown storage engine 'a.MYISAM' +set default_storage_engine = `a.MYISAM`; +ERROR 42000: Unknown storage engine 'a.MYISAM' +CREATE TABLE t1 (s VARCHAR(100)); +CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW +SET default_storage_engine = NEW.INNODB; +ERROR 42S22: Unknown column 'INNODB' in 'NEW' +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/partition.result b/mysql-wsrep-5.6/mysql-test/r/partition.result index 9992ff86..46ffb0da 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition.result @@ -2185,6 +2185,8 @@ count(*) drop table t1, t2; SET @orig_sql_mode = @@SQL_MODE; SET SQL_MODE='STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO'; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 INT) PARTITION BY LIST(1 DIV c1) ( PARTITION p0 VALUES IN (NULL), diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_archive.result b/mysql-wsrep-5.6/mysql-test/r/partition_archive.result index 186a7930..cbe74c3b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_archive.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_archive.result @@ -126,3 +126,29 @@ select count(*) from t1; count(*) 100 drop table t1; +# +#BUG 18618561: FAILED ALTER TABLE ENGINE CHANGE WITH PARTITIONS +# CORRUPTS FRM +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= MYISAM PARTITION BY HASH(fld1) +PARTITIONS 5; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `fld1` int(11) NOT NULL, + PRIMARY KEY (`fld1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (fld1) +PARTITIONS 5 */ +ALTER TABLE t1 ENGINE= ARCHIVE; +ERROR HY000: Got error -1 from storage engine +#After the patch, the ENGINE is correctly displayed as MyISAM +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `fld1` int(11) NOT NULL, + PRIMARY KEY (`fld1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (fld1) +PARTITIONS 5 */ +#Cleanup. +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_index_innodb.result b/mysql-wsrep-5.6/mysql-test/r/partition_index_innodb.result new file mode 100644 index 00000000..fae6f629 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/partition_index_innodb.result @@ -0,0 +1,116 @@ +# +# Bug#18167648: WRONG RESULTS WITH PARTITIONING, INDEX_MERGE AND NO PK +# +CREATE TABLE t1 +(a smallint, +b smallint, +c smallint, +KEY a (a), +KEY b (b) +) ENGINE=InnoDB +PARTITION BY HASH(c) PARTITIONS 3; +# c will simulate DB_ROW_ID + force to chosen partition. +# c is unique so we can identify rows in the test. +# Fillers to make the optimizer choose index_merge_intersect/union: +INSERT INTO t1 VALUES (1,1,1), (1,1,1+3), (1,1,1+6), (1,1,1+9); +# row N..N+3 +INSERT INTO t1 VALUES (1,2,1+12), (2,2,2+15), (2,2,2+18), (1,2,3+21); +# More index matching rows for index_merge_intersect: N+4, N+5 +INSERT INTO t1 VALUES (2,2,1+24); +INSERT INTO t1 VALUES (2,1,1+27); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SET @old_opt_switch = @@session.optimizer_switch; +SET SESSION optimizer_switch="index_merge=on"; +SET SESSION optimizer_switch="index_merge_intersection=on"; +SET SESSION optimizer_switch="index_merge_sort_union=off"; +SET SESSION optimizer_switch="index_merge_union=off"; +EXPLAIN SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2 AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b a,b 3,3 NULL 1 Using intersect(a,b); Using where +SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2 AND c > 0 AND c < 100; +a b c +2 2 17 +2 2 20 +2 2 25 +EXPLAIN PARTITIONS SELECT a,b,c FROM t1 WHERE a = 2 AND b = 2 AND c IN (13,25,28); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 index_merge a,b a,b 3,3 NULL 1 Using intersect(a,b); Using where +SELECT a,b,c FROM t1 WHERE a = 2 AND b = 2 AND c IN (13,25,28); +a b c +2 2 25 +SET SESSION optimizer_switch="index_merge_intersection=off"; +SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2 AND c > 0 AND c < 100; +a b c +2 2 25 +2 2 17 +2 2 20 +EXPLAIN SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2 AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b a 3 const 2 Using where +# Adding more fillers to get index_merge_union +INSERT INTO t1 VALUES (1,1,1+30), (1,1,1+33), (1,1,1+36), (1,1,1+39), +(1,1,1+42), (1,1,1+45), (1,1,1+48), (1,1,1+51), (1,1,1+54), (1,1,1+57), +(1,1,1+60), (1,1,1+63), (1,1,1+66), (1,1,1+69), (1,1,1+72), (1,1,1+75), +(1,1,1+78); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SET SESSION optimizer_switch="index_merge_union=on"; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b b,a 3,3 NULL 4 Using union(b,a); Using where +SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +a b c +1 2 13 +2 2 17 +2 2 20 +1 2 24 +2 2 25 +2 1 28 +SET SESSION optimizer_switch="index_merge_union=off"; +SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +a b c +1 2 24 +1 2 13 +2 2 25 +2 1 28 +2 2 17 +2 2 20 +EXPLAIN SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a,b NULL NULL NULL 27 Using where +Insert a few more rows to trigger sort_union +INSERT INTO t1 VALUES (1,1,1+81), (1,1,1+84), (1,1,1+87), (1,1,1+90), +(1,1,1+93); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SET SESSION optimizer_switch="index_merge_sort_union=on"; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b b,a 3,3 NULL 4 Using sort_union(b,a); Using where +# Not affected, added for completeness... +SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +a b c +1 2 13 +2 2 17 +2 2 20 +1 2 24 +2 2 25 +2 1 28 +SET SESSION optimizer_switch="index_merge_sort_union=off"; +SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +a b c +1 2 24 +1 2 13 +2 2 25 +2 1 28 +2 2 17 +2 2 20 +EXPLAIN SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a,b NULL NULL NULL 32 Using where +SET @@session.optimizer_switch = @old_opt_switch; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_index_myisam.result b/mysql-wsrep-5.6/mysql-test/r/partition_index_myisam.result new file mode 100644 index 00000000..775d3ef1 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/partition_index_myisam.result @@ -0,0 +1,86 @@ +# +# Bug#18167648: WRONG RESULTS WITH PARTITIONING, INDEX_MERGE AND NO PK +# +CREATE TABLE t1 ( +a smallint, +b smallint, +c smallint, +KEY a (a), +KEY b (b) +) ENGINE = MyISAM +PARTITION BY HASH (c) PARTITIONS 3; +CREATE TABLE t2 (a tinyint) ENGINE = MyISAM; +INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13), +(14),(15),(16); +SET SESSION optimizer_switch="index_merge=on"; +SET SESSION optimizer_switch="index_merge_intersection=on"; +SET SESSION optimizer_switch="index_merge_union=off"; +SET SESSION optimizer_switch="index_merge_sort_union=off"; +INSERT INTO t1 VALUES (1,1,0), (1,1,0), (2,1,0), (2,2,1), (1,1,1), (2,2,4); +# Add some rows to make the index_merge_intersect possible +INSERT INTO t1 SELECT 1,1,0 FROM t2 A, t2 B; +INSERT INTO t1 SELECT 1,1,1 FROM t2 A, t2 B; +INSERT INTO t1 SELECT 1,1,2 FROM t2 A, t2 B LIMIT 68; +SELECT COUNT(*) FROM t1; +COUNT(*) +586 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b b,a 3,3 NULL 1 Using intersect(b,a); Using where +# Before fix: +# (p0 - partition 0, R3 - 3rd record in that partition = offset) +# Make 'a' read p0-R3, p1-R1, p1-R3 +# Make 'b' read p1-R1, p1-R3 +# 'b' will skip p1-R1 since R3 is bigger than R1. +SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2; +a b c +2 2 1 +2 2 4 +SET @old_opt_switch = @@session.optimizer_switch; +SET SESSION optimizer_switch="index_merge_intersection=off"; +# Without index_merge_intersection +SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2; +a b c +2 2 1 +2 2 4 +EXPLAIN SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a,b b 3 const 2 Using where +SET SESSION optimizer_switch="index_merge_union=on"; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b b,a 3,3 NULL 5 Using union(b,a); Using where +SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +a b c +2 2 1 +2 2 4 +SET SESSION optimizer_switch="index_merge_union=off"; +SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +a b c +2 2 1 +2 2 4 +EXPLAIN SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a,b NULL NULL NULL 586 Using where +SET SESSION optimizer_switch="index_merge_sort_union=on"; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b b,a 3,3 NULL 10 Using sort_union(b,a); Using where +# Not affected, added for completeness... +SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +a b c +2 2 1 +2 2 4 +SET SESSION optimizer_switch="index_merge_sort_union=off"; +SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +a b c +2 2 1 +2 2 4 +EXPLAIN SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a,b NULL NULL NULL 586 Using where +SET @@session.optimizer_switch = @old_opt_switch; +DROP TABLE t1, t2; diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_innodb.result b/mysql-wsrep-5.6/mysql-test/r/partition_innodb.result index fba4d054..02fe9a47 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_innodb.result @@ -549,6 +549,8 @@ CREATE TABLE t1 (a INT, b TIMESTAMP DEFAULT '0000-00-00 00:00:00') ENGINE=INNODB PARTITION BY LINEAR HASH (a) PARTITIONS 1; SET @old_mode = @@sql_mode; SET SESSION sql_mode = 'NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize note Table does not support optimize, doing recreate + analyze instead @@ -585,3 +587,174 @@ a b 1 2 0 1 DROP TABLE t1; +# +# Bug#16943907: FLUSH TABLES FOR EXPORT: ASSERTION IN HA_PARTITION::EXTRA +# +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; +FLUSH TABLES t1 FOR EXPORT; +# List of files after EXPORT (should include a .cfg file for each part). +t1#P#p0.cfg +t1#P#p0.ibd +t1#P#p1.cfg +t1#P#p1.ibd +t1.frm +t1.par +UNLOCK TABLES; +# List of files after UNLOCK (no .cfg files). +t1#P#p0.ibd +t1#P#p1.ibd +t1.frm +t1.par +ALTER TABLE t1 DISCARD TABLESPACE; +ERROR HY000: Table storage engine for 't1' doesn't have this option +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Table storage engine for 't1' doesn't have this option +DROP TABLE t1; +USE test; +# +# Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT +# Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE +# +CREATE TABLE t1 +(a INT, +b INT, +PRIMARY KEY (a)) +ENGINE = InnoDB +PARTITION BY HASH (a) PARTITIONS 3; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +# con1 +ALTER TABLE t1 ADD INDEX idx1 (b); +# con default +SELECT b FROM t1 WHERE b = 0; +ERROR HY000: Table definition has changed, please retry transaction +SELECT b FROM t1 WHERE b = 0; +ERROR HY000: Table definition has changed, please retry transaction +DROP TABLE t1; +# Same test without partitioning +CREATE TABLE t1 +(a INT, +b INT, +PRIMARY KEY (a)) +ENGINE = InnoDB; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +# con1 +ALTER TABLE t1 ADD INDEX idx1 (b); +# con default +SELECT b FROM t1 WHERE b = 0; +ERROR HY000: Table definition has changed, please retry transaction +SELECT b FROM t1 WHERE b = 0; +ERROR HY000: Table definition has changed, please retry transaction +DROP TABLE t1; +Bug 17896265 PARTITIONED TABLE HAS MISPLACED ROWS, AFTER INPLACE ALTER +CREATE TABLE t1 ( +f1 INT(11) NOT NULL, +f2 INT(11) NOT NULL +) +ENGINE=InnoDB +PARTITION BY KEY (f1,f2) PARTITIONS 2; +INSERT INTO t1 VALUES (9585,5); +ALTER TABLE t1 CHANGE f1 f1 INT AFTER f2, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. +CREATE TABLE t2 ( +f1 INT(11) NOT NULL, +f2 INT(11) NOT NULL, +f3 INT(11) NOT NULL, +f4 INT(11) NOT NULL +) +ENGINE=InnoDB +PARTITION BY KEY (f2,f3) PARTITIONS 2; +INSERT INTO t2 VALUES (10,9585,5,20); +ALTER TABLE t2 CHANGE f3 f3 INT AFTER f4, ALGORITHM=INPLACE; +CHECK TABLE t2; +Table Op Msg_type Msg_text +test.t2 check status OK +ALTER TABLE t2 CHANGE f3 f3 INT AFTER f1, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. +ALTER TABLE t2 CHANGE f4 f4 INT AFTER f3, ALGORITHM=INPLACE; +CHECK TABLE t2; +Table Op Msg_type Msg_text +test.t2 check status OK +ALTER TABLE t2 CHANGE f1 f1 INT AFTER f4, ALGORITHM=INPLACE; +CHECK TABLE t2; +Table Op Msg_type Msg_text +test.t2 check status OK +ALTER TABLE t2 CHANGE f1 f1 INT AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t2; +Table Op Msg_type Msg_text +test.t2 check status OK +ALTER TABLE t2 CHANGE f2 f2 INT AFTER f4, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. +CREATE TABLE t3 (f1 INT,f2 INT) ENGINE=INNODB +PARTITION BY RANGE(f1) ( +PARTITION p0 VALUES LESS THAN (100), +PARTITION p1 VALUES LESS THAN (200), +PARTITION p2 VALUES LESS THAN (600), +PARTITION p3 VALUES LESS THAN MAXVALUE +); +insert into t3 values (90,120); +insert into t3 values (120,300); +ALTER TABLE t3 CHANGE f1 f1 int AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t3; +Table Op Msg_type Msg_text +test.t3 check status OK +CREATE TABLE t4 ( +f1 INT(11) NOT NULL, +f2 INT(11) NOT NULL +) +ENGINE=InnoDB +PARTITION BY HASH (MOD(f1,f2)) PARTITIONS 2; +INSERT INTO t4 VALUES (9585,5); +ALTER TABLE t4 CHANGE f1 f1 INT AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t4; +Table Op Msg_type Msg_text +test.t4 check status OK +CREATE TABLE t5 ( +f1 INT, +f2 INT +) +ENGINE=InnoDB +PARTITION BY RANGE COLUMNS(f1,f2) ( +PARTITION p0 VALUES LESS THAN (10000,12), +PARTITION p1 VALUES LESS THAN (MAXVALUE, MAXVALUE) +); +INSERT INTO t5 VALUES (1,20000); +ALTER TABLE t5 CHANGE f1 f1 INT AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t5; +Table Op Msg_type Msg_text +test.t5 check status OK +CREATE TABLE t6 ( +a INT, +b INT +) +ENGINE=InnoDB +PARTITION BY RANGE COLUMNS(a,b) +SUBPARTITION BY KEY(a,b) +SUBPARTITIONS 2 ( +PARTITION p0 VALUES LESS THAN (10000,12), +PARTITION p1 VALUES LESS THAN (MAXVALUE, MAXVALUE) +); +INSERT INTO t6 VALUES (9585,5); +ALTER TABLE t6 CHANGE a a INT AFTER b, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. +CREATE TABLE t7 ( +f1 INT(11) NOT NULL, +f2 INT(11) NOT NULL, +f3 INT(11) NOT NULL, +f4 INT(11) NOT NULL, +f5 INT(11) NOT NULL +) +ENGINE=InnoDB +PARTITION BY KEY (f1,f5) PARTITIONS 2; +INSERT INTO t7 VALUES (9585,10,20,10,5); +ALTER TABLE t7 CHANGE f5 f5 INT AFTER f3, ALGORITHM=INPLACE; +CHECK TABLE t7; +Table Op Msg_type Msg_text +test.t7 check status OK +ALTER TABLE t7 CHANGE f5 f5 INT AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t7; +Table Op Msg_type Msg_text +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; diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_pruning.result b/mysql-wsrep-5.6/mysql-test/r/partition_pruning.result index 49f7ad12..63bb6439 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_pruning.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_pruning.result @@ -3534,3 +3534,117 @@ explain partitions select * from t1 where a between 10 and 10+33; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 100 Using where drop table t0, t1; +# +# Bug#71095: Wrong results with PARTITION BY LIST COLUMNS() +# +CREATE TABLE t1 +(c1 int, +c2 int, +c3 int, +c4 int, +PRIMARY KEY (c1,c2)) +PARTITION BY LIST COLUMNS (c2) +(PARTITION p1 VALUES IN (1,2), +PARTITION p2 VALUES IN (3,4)); +INSERT INTO t1 VALUES (1, 1, 1, 1), (2, 3, 1, 1); +INSERT INTO t1 VALUES (1, 2, 1, 1), (2, 4, 1, 1); +SELECT * FROM t1 WHERE c1 = 1 AND c2 < 1; +c1 c2 c3 c4 +SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 1; +c1 c2 c3 c4 +1 1 1 1 +SELECT * FROM t1 WHERE c1 = 1 AND c2 = 1; +c1 c2 c3 c4 +1 1 1 1 +SELECT * FROM t1 WHERE c1 = 1 AND c2 >= 1; +c1 c2 c3 c4 +1 1 1 1 +1 2 1 1 +SELECT * FROM t1 WHERE c1 = 1 AND c2 > 1; +c1 c2 c3 c4 +1 2 1 1 +SELECT * FROM t1 WHERE c1 = 1 AND c2 < 3; +c1 c2 c3 c4 +1 1 1 1 +1 2 1 1 +SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 3; +c1 c2 c3 c4 +1 1 1 1 +1 2 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 3; +c1 c2 c3 c4 +2 3 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 = 3; +c1 c2 c3 c4 +2 3 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 3; +c1 c2 c3 c4 +2 3 1 1 +2 4 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 > 3; +c1 c2 c3 c4 +2 4 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 < 4; +c1 c2 c3 c4 +2 3 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 4; +c1 c2 c3 c4 +2 3 1 1 +2 4 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 = 4; +c1 c2 c3 c4 +2 4 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 4; +c1 c2 c3 c4 +2 4 1 1 +SELECT * FROM t1 WHERE c1 = 2 AND c2 > 4; +c1 c2 c3 c4 +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 < 1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 range PRIMARY PRIMARY 8 NULL 1 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 = 1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 const PRIMARY PRIMARY 8 const,const 1 NULL +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 >= 1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 > 1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 < 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 range PRIMARY PRIMARY 8 NULL 1 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 = 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2 const PRIMARY PRIMARY 8 const,const 1 NULL +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2 range PRIMARY PRIMARY 8 NULL 1 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 > 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2 range PRIMARY PRIMARY 8 NULL 1 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 < 4; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 4; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 = 4; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2 const PRIMARY PRIMARY 8 const,const 1 NULL +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 4; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2 range PRIMARY PRIMARY 8 NULL 1 Using where +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 > 4; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin.result b/mysql-wsrep-5.6/mysql-test/r/plugin.result index 4e65fddb..a3d74375 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin.result @@ -162,3 +162,73 @@ SELECT @@SESSION.example_double_thdvar; @@SESSION.example_double_thdvar 1000.500000 UNINSTALL PLUGIN example; +# +# BUG#18008907 - DEADLOCK BETWEEN MYSQL_CHANGE_USER(), SHOW VARIABLES AND INSTALL PLUGIN +# +CREATE PROCEDURE p_install() +BEGIN +INSTALL PLUGIN no_such_plugin SONAME 'no_such_object'; +END +| +CREATE PROCEDURE p_show_vars() +BEGIN +SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES; +END| +connect con1, localhost, root,,; +# Case 18008907_1: Deadlock situation cause by +# con1: has LOCK_system_variables_hash and waits on LOCK_plugin AND +# default: has LOCK_plugin and waits on LOCK_system_variables_hash. +# +SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL install_plugin WAIT_FOR cont_show_vars'; +call p_show_vars();; +connection default; +SET DEBUG_SYNC='now WAIT_FOR install_plugin'; +SET DEBUG_SYNC='acquired_LOCK_plugin SIGNAL cont_show_vars'; +call p_install();; +connection con1; +COUNT(*) +# +SET DEBUG_SYNC='RESET'; +connection default; +ERROR HY000: Can't open shared library +SET DEBUG_SYNC='RESET'; +# Case 18008907_2: Deadlock situation caused by +# default: has LOCK_system_variables_hash and waits on LOCK_global_system_variables, +# con1: has LOCK_plugin and waits on LOCK_system_variables_hash AND +# con2: has LOCK_global_system_variables and waits on LOCK_plugin. +SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL install_plugin WAIT_FOR nothing TIMEOUT 10'; +call p_show_vars();; +connection con1; +SET DEBUG_SYNC='now WAIT_FOR install_plugin'; +SET DEBUG_SYNC='acquired_LOCK_plugin SIGNAL create_connection WAIT_FOR nothing TIMEOUT 10'; +call p_install();; +connect con2, localhost, root,,; +SET DEBUG_SYNC='now WAIT_FOR create_connection'; +connection con1; +ERROR HY000: Can't open shared library +connection default; +COUNT(*) +# +Warnings: +# 1639 debug sync point wait timed out +disconnect con2; +# Case 18008907_3: Testing Concurrent "Show Variables" and "Plugin Uninstall" operations. +INSTALL PLUGIN example SONAME 'ha_example.so'; +connection con1; +SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL uninstall_plugin WAIT_FOR go'; +call p_show_vars();; +connect con2, localhost, root,,; +SET DEBUG_SYNC='now WAIT_FOR uninstall_plugin'; +UNINSTALL PLUGIN example;; +connection default; +SET DEBUG_SYNC='now SIGNAL go'; +connection con1; +COUNT(*) +# +connection con2; +connection default; +DROP PROCEDURE p_show_vars; +DROP PROCEDURE p_install; +SET DEBUG_SYNC='RESET'; +disconnect con1; +disconnect con2; diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth.result index 27b305e5..cf3eb43a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth.result @@ -549,3 +549,25 @@ bug12818542@localhost bug12818542_dest@localhost DROP USER bug12818542@localhost; DROP USER bug12818542_dest@localhost; End of 5.5 tests +# +# Bug #18057562: PROXY USERS LOCKED OUT WHEN UNDERLYING PROXIED USER +# PASSWORD IS EXPIRED +# +# Restart server with disconnect_on_expired_password OFF; +CREATE USER 'empl_external'@'localhost' IDENTIFIED WITH test_plugin_server AS 'employee'; +CREATE USER 'employee'@'localhost' IDENTIFIED BY 'passkey'; +GRANT PROXY ON 'employee'@'localhost' TO 'empl_external'@'localhost'; +# Expiring the proxied user's password +ALTER USER employee@localhost PASSWORD EXPIRE; +# Connecting with the proxied user and executing a query after the +# proxied user's password is expired +Warning: Using a password on the command line interface can be insecure. +ERROR 1820 (HY000) at line 1: You must SET PASSWORD before executing this statement +# Connecting with the proxy user and executing a query after the proxied +# user's password is expired. Here we are not supposed to get error. +Warning: Using a password on the command line interface can be insecure. +current_user() +employee@localhost +user() +empl_external@localhost +DROP USER 'empl_external'@'localhost', 'employee'@'localhost'; diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa_3.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa_3.result index 8e7b9050..14e45fef 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa_3.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa_3.result @@ -8,6 +8,6 @@ current_user() user() @@local.proxy_user @@local.external_user qa_test_11_dest@% qa_test_11_user@localhost 'qa_test_11_user'@'%' 'qa_test_11_user'@'%' exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 Warning: Using a password on the command line interface can be insecure. -ERROR 1045 (28000): Access denied for user 'qa_test_2_user'@'localhost' (using password: NO) +ERROR 1045 (28000): Access denied for user 'qa_test_2_user'@'localhost' (using password: YES) DROP USER qa_test_11_user, qa_test_11_dest; DROP DATABASE test_user_db; diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result index 34d32ed5..3ba4c1c3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result @@ -4,10 +4,10 @@ SET SESSION old_passwords= 2; SET PASSWORD FOR 'kristofer'=PASSWORD('secret'); SELECT user, plugin FROM mysql.user; user plugin -root -root -root -root +root mysql_native_password +root mysql_native_password +root mysql_native_password +root mysql_native_password kristofer sha256_password SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -79,10 +79,10 @@ SET SESSION old_passwords= 2; SET PASSWORD FOR 'kristofer'=PASSWORD('secret'); SELECT user, plugin FROM mysql.user; user plugin -root -root -root -root +root mysql_native_password +root mysql_native_password +root mysql_native_password +root mysql_native_password kristofer sha256_password SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result index 924fad9d..38c537d2 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result @@ -1,10 +1,10 @@ CREATE USER 'kristofer' IDENTIFIED BY 'secret'; SELECT user, plugin FROM mysql.user; user plugin -root -root -root -root +root mysql_native_password +root mysql_native_password +root mysql_native_password +root mysql_native_password kristofer sha256_password user() current_user() kristofer@localhost kristofer@% diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result index 495ca3ea..6f1aa20b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result @@ -3,10 +3,10 @@ SET old_passwords=2; SET PASSWORD FOR 'kristofer'=PASSWORD('secret'); SELECT user, plugin FROM mysql.user; user plugin -root -root -root -root +root mysql_native_password +root mysql_native_password +root mysql_native_password +root mysql_native_password kristofer sha256_password SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result index 4762e807..76ec29a1 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result @@ -3,10 +3,10 @@ SET old_passwords=2; SET PASSWORD FOR 'kristofer'=PASSWORD('secret'); SELECT user, plugin FROM mysql.user; user plugin -root -root -root -root +root mysql_native_password +root mysql_native_password +root mysql_native_password +root mysql_native_password kristofer sha256_password SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() diff --git a/mysql-wsrep-5.6/mysql-test/r/query_cache.result b/mysql-wsrep-5.6/mysql-test/r/query_cache.result index 0f7067a8..495e87a2 100644 --- a/mysql-wsrep-5.6/mysql-test/r/query_cache.result +++ b/mysql-wsrep-5.6/mysql-test/r/query_cache.result @@ -1810,3 +1810,59 @@ COUNT(*) DROP TABLE t1; SET GLOBAL query_cache_size= @qc; # +#BUG 18710853: QUERY CACHE NOT INVALIDATED ON CASCADE DELETE IF DB NAME HAS +# SPECIAL SYMBOLS +SET @query_cache_size.saved = @@query_cache_size; +SET GLOBAL query_cache_size = 1024*1024; +CREATE DATABASE `db-db`; +CREATE TABLE `db-db`.`t$1` (fld1 INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `db-db`.`t$2` (fld1 INT PRIMARY KEY, fld2 INT, +CONSTRAINT t2_fk FOREIGN KEY (fld2) REFERENCES `db-db`.`t$1` (fld1) ON +DELETE CASCADE) ENGINE=InnoDB; +CREATE TABLE `db-db`.`t$3` (fld1 INT PRIMARY KEY, fld2 INT, +CONSTRAINT t3_fk FOREIGN KEY (fld2) REFERENCES `db-db`.`t$1` (fld1) ON +UPDATE CASCADE) ENGINE=InnoDB; +INSERT INTO `db-db`.`t$1` VALUES (100); +INSERT INTO `db-db`.`t$1` VALUES (300); +INSERT INTO `db-db`.`t$2` VALUES (1, 100); +INSERT INTO `db-db`.`t$3` VALUES (2, 300); +SELECT * FROM `db-db`.`t$2`; +fld1 fld2 +1 100 +SELECT * FROM `db-db`.`t$3`; +fld1 fld2 +2 300 +DELETE FROM `db-db`.`t$1` WHERE fld1= 100; +UPDATE `db-db`.`t$1` SET fld1= 200 WHERE fld1= 300; +#After fix the number of the records returned with the +#query cache and without the query cache are the same. +SELECT * FROM `db-db`.`t$2`; +fld1 fld2 +SELECT SQL_NO_CACHE * FROM `db-db`.`t$2`; +fld1 fld2 +SELECT * FROM `db-db`.`t$3`; +fld1 fld2 +2 200 +SELECT SQL_NO_CACHE * FROM `db-db`.`t$3`; +fld1 fld2 +2 200 +#Test case added for code coverage, invalidation +#triggered at the SQL layer. +CREATE TABLE `db-db`.`t$4` (fld1 INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO `db-db`.`t$4` VALUES (100); +SELECT * FROM `db-db`.`t$4`; +fld1 +100 +INSERT INTO `db-db`.`t$4` VALUES (200); +SELECT * FROM `db-db`.`t$4`; +fld1 +100 +200 +SELECT SQL_NO_CACHE * FROM `db-db`.`t$4`; +fld1 +100 +200 +#cleanup +DROP DATABASE `db-db`; +SET GLOBAL query_cache_size = @query_cache_size.saved; +# diff --git a/mysql-wsrep-5.6/mysql-test/r/shm.result b/mysql-wsrep-5.6/mysql-test/r/shm.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/r/show_processlist.result b/mysql-wsrep-5.6/mysql-test/r/show_processlist.result new file mode 100644 index 00000000..5e0a8fa8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/show_processlist.result @@ -0,0 +1,47 @@ +Bug#17283409 4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS, SHOW PROCESSLIST, +SHOW BINLOGS +connect connection1,localhost,root,,test,$MASTER_MYPORT,; +connection default; +SET DEBUG_SYNC='before_copying_threads SIGNAL parked1 WAIT_FOR go'; +SHOW PROCESSLIST; +connection connection1; +"Wait_for parked1" +SET DEBUG_SYNC='now WAIT_FOR parked1'; +connect connection2,localhost,root,,test,$MASTER_MYPORT,; +connect connection3,localhost,root,,test,$MASTER_MYPORT,; +SET DEBUG_SYNC='now SIGNAL go'; +connection default; +Id User Host db Command Time State Info +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +SET DEBUG_SYNC='after_copying_threads SIGNAL parked1 WAIT_FOR go'; +SHOW PROCESSLIST; +connection connection1; +"Wait_for parked1" +SET DEBUG_SYNC='now WAIT_FOR parked1'; +connect connection4,localhost,root,,test,$MASTER_MYPORT,; +connect connection5,localhost,root,,test,$MASTER_MYPORT,; +SET DEBUG_SYNC='now SIGNAL go'; +connection default; +Id User Host db Command Time State Info +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +SHOW PROCESSLIST; +Id User Host db Command Time State Info +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +<Id> root <Host> test <Command> <Time> <State> <Info> +"Cleanup" +SET DEBUG_SYNC='RESET'; +disconnect connection1; +disconnect connection2; +disconnect connection3; +disconnect connection4; +disconnect connection5; diff --git a/mysql-wsrep-5.6/mysql-test/r/sp.result b/mysql-wsrep-5.6/mysql-test/r/sp.result index 76c9207b..1659947d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/sp.result +++ b/mysql-wsrep-5.6/mysql-test/r/sp.result @@ -2916,10 +2916,16 @@ call bug6129()| @@sql_mode ERROR_FOR_DIVISION_BY_ZERO set @@sql_mode= "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"| +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. call bug6129()| @@sql_mode ERROR_FOR_DIVISION_BY_ZERO set @@sql_mode= "NO_ZERO_IN_DATE"| +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. call bug6129()| @@sql_mode ERROR_FOR_DIVISION_BY_ZERO @@ -6872,6 +6878,10 @@ DROP FUNCTION f1; drop procedure if exists p; set @old_mode= @@sql_mode; set @@sql_mode= cast(pow(2,32)-1 as unsigned integer); +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. select @@sql_mode into @full_mode; create procedure p() begin end; call p(); diff --git a/mysql-wsrep-5.6/mysql-test/r/sp_validation.result b/mysql-wsrep-5.6/mysql-test/r/sp_validation.result index f4774096..9e00650f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/sp_validation.result +++ b/mysql-wsrep-5.6/mysql-test/r/sp_validation.result @@ -1373,7 +1373,6 @@ CALL p2(); 2 UPDATE t2 SET a = 30; -ERROR 42S22: Unknown column 'a' in 'NEW' DROP PROCEDURE p1; DROP PROCEDURE p2; diff --git a/mysql-wsrep-5.6/mysql-test/r/ssl.result b/mysql-wsrep-5.6/mysql-test/r/ssl.result index abcf5720..f3bb31b7 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ssl.result +++ b/mysql-wsrep-5.6/mysql-test/r/ssl.result @@ -3,10 +3,10 @@ Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_server_not_before'; Variable_name Value -Ssl_server_not_before Jan 29 11:56:49 2010 GMT +Ssl_server_not_before Dec 5 04:48:40 2014 GMT SHOW STATUS LIKE 'Ssl_server_not_after'; Variable_name Value -Ssl_server_not_after Jan 28 11:56:49 2015 GMT +Ssl_server_not_after Dec 1 04:48:40 2029 GMT drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, diff --git a/mysql-wsrep-5.6/mysql-test/r/strict.result b/mysql-wsrep-5.6/mysql-test/r/strict.result index 52e17648..a45d16db 100644 --- a/mysql-wsrep-5.6/mysql-test/r/strict.result +++ b/mysql-wsrep-5.6/mysql-test/r/strict.result @@ -28,6 +28,8 @@ ERROR 22007: Incorrect date value: '59' for column 'col1' at row 1 set @@sql_mode='STRICT_ALL_TABLES'; INSERT INTO t1 VALUES('2004-01-03'),('2004-0-31'); set @@sql_mode='STRICT_ALL_TABLES,NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. INSERT INTO t1 VALUES('2004-0-30'); ERROR 22007: Incorrect date value: '2004-0-30' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-01-04'),('2004-0-31'),('2004-01-05'); @@ -37,6 +39,8 @@ INSERT IGNORE INTO t1 VALUES('2004-0-29'); Warnings: Warning 1264 Out of range value for column 'col1' at row 1 set @@sql_mode='STRICT_ALL_TABLES,NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. INSERT INTO t1 VALUES('0000-00-00'); ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1 INSERT IGNORE INTO t1 VALUES('0000-00-00'); @@ -188,8 +192,12 @@ INSERT INTO t1 VALUES('2004-02-30 15:30:04'); ERROR 22007: Incorrect datetime value: '2004-02-30 15:30:04' for column 'col1' at row 1 INSERT INTO t1 VALUES('0000-00-00 00:00:00'); set @@sql_mode='STRICT_ALL_TABLES,NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. INSERT INTO t1 VALUES('0000-00-00 00:00:00'); set @@sql_mode='STRICT_ALL_TABLES,NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. INSERT INTO t1 VALUES('0000-00-00 00:00:00'); ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'col1' at row 1 set @@sql_mode='ansi,traditional'; @@ -351,6 +359,8 @@ ERROR 22003: Out of range value for column 'col2' at row 3 UPDATE t1 SET col1=col1 / 0 WHERE col1 > 0; ERROR 22012: Division by 0 set @@sql_mode='ERROR_FOR_DIVISION_BY_ZERO'; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. INSERT INTO t1 values (1/0,1/0); Warnings: Warning 1365 Division by 0 @@ -1144,6 +1154,8 @@ ERROR 22007: Incorrect datetime value: '0000-00-00' insert into t1 (col1) values (cast('0000-00-00' as date)); ERROR 22007: Incorrect datetime value: '0000-00-00' set sql_mode='no_zero_date'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. insert into t1 values (0,0,0); Warnings: Warning 1264 Out of range value for column 'col1' at row 1 @@ -1174,6 +1186,7 @@ alter table t1 modify col1 datetime; ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col1' at row 1 alter ignore table t1 modify col1 datetime; Warnings: +Warning 1681 'IGNORE' is deprecated and will be removed in a future release. Warning 1264 Out of range value for column 'col1' at row 1 Warning 1264 Out of range value for column 'col1' at row 2 insert into t1 select * from t1; @@ -1496,6 +1509,8 @@ ERROR HY000: Column 'f1' has duplicated value 'a' in SET create table t1 (f1 enum('a','a')); ERROR HY000: Column 'f1' has duplicated value 'a' in ENUM set @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. create table t1(a datetime not null); select count(*) from t1 where a is null; count(*) @@ -1512,6 +1527,8 @@ End of 5.0 tests # STR_TO_DATE with NO_ZERO_DATE did not return NULL (with warning) # in get_date(). Only did in val_str() and val_int(). SET sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. SELECT STR_TO_DATE('2001','%Y'), CONCAT(STR_TO_DATE('2001','%Y')), diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_all.result b/mysql-wsrep-5.6/mysql-test/r/subquery_all.result index 053eec81..1916b8ff 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_all.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_all.result @@ -7483,5 +7483,18 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_all_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_all_bka.result index 3646bff7..99e3475e 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_all_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_all_bka.result @@ -7484,6 +7484,19 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_all_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_all_bka_nixbnl.result index a93f0d73..6e333e1f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_all_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_all_bka_nixbnl.result @@ -7484,6 +7484,19 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_mat.result b/mysql-wsrep-5.6/mysql-test/r/subquery_mat.result index f3c606de..d2fe3159 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_mat.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_mat.result @@ -1863,6 +1863,59 @@ ORDER BY innr.c4) AND o.c4=7 XOR o.pk=3 ORDER BY o.pk; x DROP TABLE t1,t2,t3; +# +# Bug#19297190 NOT IN DOESN'T RETURN EXPECTED RESULT +# +CREATE TABLE t1 (a VARCHAR(500) CHARACTER SET UTF8) ENGINE=INNODB; +SET @str= repeat("a",450); +SET @num=1000; +INSERT INTO t1 VALUES (CONCAT((@num:=@num+1), @str)); +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +SELECT COUNT(*) FROM t1; +COUNT(*) +32 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +set @save_heap_size= @@max_heap_table_size; +set @@max_heap_table_size= 16384; +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 32 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 32 Using where +SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +COUNT(*) +0 +ALTER TABLE t1 MODIFY a VARCHAR(332) CHARACTER SET UTF8; +EXPLAIN SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where +2 SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL +SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +COUNT(*) +0 +DROP TABLE t1; +set @@max_heap_table_size= @save_heap_size; # End of 5.6 tests set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result b/mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result index 59a016dd..fff4b4d5 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result @@ -1876,6 +1876,59 @@ ORDER BY innr.c4) AND o.c4=7 XOR o.pk=3 ORDER BY o.pk; x DROP TABLE t1,t2,t3; +# +# Bug#19297190 NOT IN DOESN'T RETURN EXPECTED RESULT +# +CREATE TABLE t1 (a VARCHAR(500) CHARACTER SET UTF8) ENGINE=INNODB; +SET @str= repeat("a",450); +SET @num=1000; +INSERT INTO t1 VALUES (CONCAT((@num:=@num+1), @str)); +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +SELECT COUNT(*) FROM t1; +COUNT(*) +32 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +set @save_heap_size= @@max_heap_table_size; +set @@max_heap_table_size= 16384; +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 32 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 32 Using where +SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +COUNT(*) +0 +ALTER TABLE t1 MODIFY a VARCHAR(332) CHARACTER SET UTF8; +EXPLAIN SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where +2 SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL +SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +COUNT(*) +0 +DROP TABLE t1; +set @@max_heap_table_size= @save_heap_size; # End of 5.6 tests set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result b/mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result index dcd45d34..9f70f1a7 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result @@ -1862,6 +1862,59 @@ ORDER BY innr.c4) AND o.c4=7 XOR o.pk=3 ORDER BY o.pk; x DROP TABLE t1,t2,t3; +# +# Bug#19297190 NOT IN DOESN'T RETURN EXPECTED RESULT +# +CREATE TABLE t1 (a VARCHAR(500) CHARACTER SET UTF8) ENGINE=INNODB; +SET @str= repeat("a",450); +SET @num=1000; +INSERT INTO t1 VALUES (CONCAT((@num:=@num+1), @str)); +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +INSERT INTO t1 SELECT CONCAT((@num:=@num+1), @str) FROM t1; +SELECT COUNT(*) FROM t1; +COUNT(*) +32 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +set @save_heap_size= @@max_heap_table_size; +set @@max_heap_table_size= 16384; +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 32 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 32 Using where +SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +COUNT(*) +0 +ALTER TABLE t1 MODIFY a VARCHAR(332) CHARACTER SET UTF8; +EXPLAIN SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where +SELECT COUNT(*) +FROM t1 +WHERE t1.a NOT IN ( +SELECT t2.a FROM t1 as t2 +); +COUNT(*) +0 +DROP TABLE t1; +set @@max_heap_table_size= @save_heap_size; # End of 5.6 tests set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj.result b/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj.result index 8758757b..cfbaf012 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj.result @@ -7483,5 +7483,18 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj_bka.result index c8b3d3db..75bae58b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj_bka.result @@ -7484,6 +7484,19 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result index d1b3b5ed..5dc81ff6 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result @@ -7484,6 +7484,19 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_none.result b/mysql-wsrep-5.6/mysql-test/r/subquery_none.result index 2059f4ba..1af952a8 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_none.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_none.result @@ -7482,5 +7482,18 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_none_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_none_bka.result index a8227867..fd71371c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_none_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_none_bka.result @@ -7483,6 +7483,19 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_none_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_none_bka_nixbnl.result index dd1e5a3c..87610417 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_none_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_none_bka_nixbnl.result @@ -7483,6 +7483,19 @@ SELECT 1 FROM t2 WHERE c > ANY (SELECT a FROM t1 WHERE b >= 3) IS TRUE; 1 1 DROP TABLE t1, t2; +# Bug #18014565 - WRONG RESULT COMPUTATION USING ALL() AND GROUP BY +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER +); +INSERT INTO t1 VALUES (1,3),(1,6),(2,3),(2,6); +SELECT f1, SUM(f2) AS sum FROM t1 GROUP BY f1 HAVING sum > ALL (SELECT 1); +f1 sum +1 9 +2 9 +DROP TABLE t1; +# End of test for Bug#18014565 set @@optimizer_switch=@old_opt_switch; set optimizer_switch=default; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result index d3f9cdb8..098f71eb 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result @@ -10503,6 +10503,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result index 9a771648..55d7d63d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result @@ -10509,6 +10509,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result index 044d8ed6..52f4ae6d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result @@ -10518,6 +10518,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result index b1cb3d89..f05ca11b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result @@ -10510,6 +10510,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result index e5ca6fc2..c9c4e7ad 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result @@ -10385,6 +10385,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result index c35ff08e..7ce8131c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result @@ -10390,6 +10390,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result index aaff5b48..b355b9bf 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result @@ -10390,6 +10390,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result index 342ae2c4..b30cc400 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result @@ -10391,6 +10391,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result index 123a42ea..190cae50 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result @@ -10368,6 +10368,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result index d18cd4e2..76682cd3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result @@ -10369,6 +10369,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result index de2ecc6c..c0ac2b51 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result @@ -10375,6 +10375,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result index 57143ba2..0f5d9ac2 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result @@ -10370,6 +10370,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result index 31fc4667..2529cca2 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result @@ -10386,6 +10386,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result index 5afcaf81..c0f3fd55 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result @@ -10391,6 +10391,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result index 0ddc7c50..dbb80885 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result @@ -10391,6 +10391,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result index b7463d97..8207454f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result @@ -10392,6 +10392,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result index c34d424e..acd322bd 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result @@ -10606,6 +10606,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result index b867b5b2..7864846e 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result @@ -10607,6 +10607,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result index 9fa8b250..d7705d49 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result @@ -10591,6 +10591,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result index e260051a..48dda601 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result @@ -10608,6 +10608,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result index 9fe36211..6d169a9c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result @@ -10372,6 +10372,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result index 4f721a9f..cf5d6bf6 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result @@ -10381,6 +10381,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result index f4b0bde2..65efb8c1 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result @@ -10382,6 +10382,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result index a125c766..8455f48f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result @@ -10377,6 +10377,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result index 08a35e26..c55f7179 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result @@ -10383,6 +10383,85 @@ col_datetime_key 2002-08-25 20:35:06 DROP TABLE t1, t2; # End of test for bug#14064201. +# +# Bug#18223655:ASSERTION FAILED: (INT)IDX >= 0 +# && IDX < PARENT_JOIN->TABLES +# +CREATE TABLE b (d INT); +CREATE TABLE c (a INT, b INT,c INT,d BLOB NOT NULL); +SELECT(SELECT 1 +FROM b WHERE(SELECT 1 IN (SELECT 1 FROM b WHERE 1 NOT BETWEEN d AND 1) +FROM b) IN (SELECT d FROM c)) as cc FROM b; +cc +INSERT INTO b VALUE(1); +INSERT INTO c VALUES(1,2,3,'1'),(2,3,4,'1'),(3,4,5,'C'); +SELECT(SELECT d FROM b WHERE(SELECT d IN +(SELECT d FROM b WHERE 1 NOT BETWEEN d AND 1) FROM b) IN +(SELECT d FROM c)) as cc FROM c; +cc +1 +1 +1 +DROP TABLE b,c; +# +# Bug#18447874:WRONG RESULT COMING FROM SEMI-JOIN +# +CREATE TABLE b ( +d INT(11) +); +CREATE TABLE c ( +d BLOB +) ; +CREATE TABLE d ( +b INT(11) +); +INSERT INTO b VALUES(1),(2),(4); +INSERT INTO c VALUES(1),(2),(3); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +INSERT INTO d VALUES(2); +SELECT 1 FROM b WHERE (SELECT 1 FROM d ) IN (SELECT d FROM c) ; +1 +1 +1 +1 +DROP TABLE b,c,d; +# +# Bug#17292723:INCORRECT RESULT FOR (SELECT...) IN (SELECT...) STATEMENT +# +CREATE TABLE t1 ( +ID int(11) NOT NULL AUTO_INCREMENT, +id2 int(11) DEFAULT NULL, +id3 int(11) DEFAULT NULL, +id4 varchar(150) COLLATE utf8_spanish_ci NOT NULL, +id5 int(11) DEFAULT NULL, +PRIMARY KEY (ID), +KEY id2 (id2), +KEY id3 (id3), +KEY id5 (id5) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(123,1,1,'1',NULL), +(124,1,1,'2',NULL), +(125,1,1,'4',NULL), +(126,1,1,'3',NULL), +(127,1,1,'6',NULL), +(128,1,1,'8',NULL); +CREATE TABLE t2 ( +id6 int(11) NOT NULL, +id7 int(11) NOT NULL, +PRIMARY KEY (id6,id7), +KEY id7 (id7) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (126,123),(130,123),(135,123); +SELECT ID +FROM t1 p0 +WHERE p0.id3=1 +AND ( (SELECT p1.id FROM t1 p1 WHERE p1.id=123) IN (SELECT p3.id FROM t2 +p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); +ID +126 +DROP TABLE t1,t2; set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/system_mysql_db.result b/mysql-wsrep-5.6/mysql-test/r/system_mysql_db.result index f2fcbf3f..2302e451 100644 --- a/mysql-wsrep-5.6/mysql-test/r/system_mysql_db.result +++ b/mysql-wsrep-5.6/mysql-test/r/system_mysql_db.result @@ -99,7 +99,7 @@ user CREATE TABLE `user` ( `max_updates` int(11) unsigned NOT NULL DEFAULT '0', `max_connections` int(11) unsigned NOT NULL DEFAULT '0', `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', - `plugin` char(64) COLLATE utf8_bin DEFAULT '', + `plugin` char(64) COLLATE utf8_bin DEFAULT 'mysql_native_password', `authentication_string` text COLLATE utf8_bin, `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', PRIMARY KEY (`Host`,`User`) diff --git a/mysql-wsrep-5.6/mysql-test/r/temp_pool.result b/mysql-wsrep-5.6/mysql-test/r/temp_pool.result new file mode 100644 index 00000000..f9cf7f40 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/temp_pool.result @@ -0,0 +1,19 @@ +# +# BUG#11747548:DETECT ORPHAN TEMP-POOL FILES, AND HANDLE GRACEFULLY. +# +#Set up. +CREATE TABLE pid_table(pid_no INT); +CREATE TABLE t1 (a BLOB); +INSERT INTO t1 VALUES (1), (2); +#Create MYD and MYI files for intrinsic temp table. +LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table; +#Reports an error since the temp file already exists. +SELECT a FROM t1 ORDER BY rand(1); +ERROR HY000: Can't create or write to file +#With patch, the query executes successfully. +SELECT a FROM t1 ORDER BY rand(1); +a +1 +2 +#cleanup +DROP TABLE t1, pid_table; diff --git a/mysql-wsrep-5.6/mysql-test/r/temporal_literal.result b/mysql-wsrep-5.6/mysql-test/r/temporal_literal.result index beb89000..5db34b1a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/temporal_literal.result +++ b/mysql-wsrep-5.6/mysql-test/r/temporal_literal.result @@ -67,6 +67,8 @@ Note 1003 /* select#1 */ select DATE'2010-01-01' AS `DATE'2010-01-01'` # Testing DATE literals in non-default sql_mode # SET sql_mode=no_zero_in_date; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. SELECT DATE'2001-00-00'; ERROR HY000: Incorrect DATE value: '2001-00-00' SELECT DATE'2001-01-00'; @@ -75,6 +77,8 @@ SELECT DATE'0000-00-00'; DATE'0000-00-00' 0000-00-00 SET sql_mode=no_zero_date; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. SELECT DATE'0000-00-00'; ERROR HY000: Incorrect DATE value: '0000-00-00' SET sql_mode=default; @@ -353,3 +357,43 @@ SELECT DATE'2001-01-01' FROM t1 GROUP BY DATE'2001-01-01'; DATE'2001-01-01' 2001-01-01 DROP TABLE t1; +# +# BUG #16812821: INCONSISTANT RESULTS WHEN ODBC DATE FORMAT IS USED +# +CREATE TABLE t1(c1 INT, c2 DATE, c3 TIME, c4 TIMESTAMP); +CREATE TABLE t2(c11 INT, C12 INT); +INSERT INTO t1 VALUES (1, '2014-01-02', '01:01:01', '2014-01-02 01:01:01'), +(2, '2014-01-04', '01:01:01', '2014-01-02 01:01:01'); +INSERT INTO t2 VALUES (3, 4), (5, 6); +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 +WHERE c2 BETWEEN {d'2014-01-01'} AND {d'2014-01-05'}; +c1 c2 c3 c4 c11 C12 +1 2014-01-02 01:01:01 2014-01-02 01:01:01 NULL NULL +2 2014-01-04 01:01:01 2014-01-02 01:01:01 NULL NULL +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 +WHERE c3 BETWEEN {t'01:01:01'} AND {t'01:01:05'}; +c1 c2 c3 c4 c11 C12 +1 2014-01-02 01:01:01 2014-01-02 01:01:01 NULL NULL +2 2014-01-04 01:01:01 2014-01-02 01:01:01 NULL NULL +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 +WHERE c4 BETWEEN {ts'2014-01-01 01:01:01'} AND {ts'2014-01-05 01:01:01'}; +c1 c2 c3 c4 c11 C12 +1 2014-01-02 01:01:01 2014-01-02 01:01:01 NULL NULL +2 2014-01-04 01:01:01 2014-01-02 01:01:01 NULL NULL +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 +WHERE c2 BETWEEN DATE'2014-01-01' AND DATE'2014-01-05'; +c1 c2 c3 c4 c11 C12 +1 2014-01-02 01:01:01 2014-01-02 01:01:01 NULL NULL +2 2014-01-04 01:01:01 2014-01-02 01:01:01 NULL NULL +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 +WHERE c3 BETWEEN TIME'01:01:01' AND TIME'01:01:05'; +c1 c2 c3 c4 c11 C12 +1 2014-01-02 01:01:01 2014-01-02 01:01:01 NULL NULL +2 2014-01-04 01:01:01 2014-01-02 01:01:01 NULL NULL +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 +WHERE c4 BETWEEN TIMESTAMP'2014-01-01 01:01:01' + AND TIMESTAMP'2014-01-05 01:01:01'; +c1 c2 c3 c4 c11 C12 +1 2014-01-02 01:01:01 2014-01-02 01:01:01 NULL NULL +2 2014-01-04 01:01:01 2014-01-02 01:01:01 NULL NULL +DROP TABLE t1, t2; diff --git a/mysql-wsrep-5.6/mysql-test/r/trigger.result b/mysql-wsrep-5.6/mysql-test/r/trigger.result index a38d453c..9f3ddad9 100644 --- a/mysql-wsrep-5.6/mysql-test/r/trigger.result +++ b/mysql-wsrep-5.6/mysql-test/r/trigger.result @@ -2257,4 +2257,21 @@ INSERT INTO t1 VALUES (1, 'example.com'), INSERT INTO t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); DROP TRIGGER t2_ai; DROP TABLE t1, t2, t3; +# +# Bug#18596756 - FAILED PREPARING OF TRIGGER ON TRUNCATED TABLES CAUSE +# ERROR 1054. +# +CREATE TABLE t1(id INT); +CREATE TABLE t2(id INT); +CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW +SET NEW.id= (SELECT * FROM t2); +INSERT INTO t2 VALUES(0); +INSERT INTO t1 VALUES(0); +TRUNCATE TABLE t2; +INSERT INTO t2 VALUES(0); +INSERT INTO t1 VALUES(0); +DROP TABLE t2; +INSERT INTO t1 VALUES(0); +ERROR 42S02: Table 'test.t2' doesn't exist +DROP TABLE t1; End of 6.0 tests. diff --git a/mysql-wsrep-5.6/mysql-test/r/type_date.result b/mysql-wsrep-5.6/mysql-test/r/type_date.result index 91ced2c3..cfccf88a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/type_date.result +++ b/mysql-wsrep-5.6/mysql-test/r/type_date.result @@ -512,15 +512,21 @@ DROP TABLE IF EXISTS t1, t2, t3; SET @org_mode=@@sql_mode; #Table creation in strict mode with NO_ZERO_IN_DATE/NO_ZERO_DATE SET @@sql_mode='NO_ZERO_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 DATE DEFAULT 0); ERROR 42000: Invalid default value for 'c1' CREATE TABLE t1 (c1 DATE DEFAULT '0000-00-00'); ERROR 42000: Invalid default value for 'c1' SET @@sql_mode='NO_ZERO_IN_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 DATE DEFAULT '2012-02-00'); ERROR 42000: Invalid default value for 'c1' #Table creation in non-strict mode but with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 DATE DEFAULT 0); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -528,6 +534,8 @@ CREATE TABLE t2 (c1 DATE DEFAULT '0000-00-00'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 SET @@sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t3 (c1 DATE DEFAULT '2012-02-00'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -541,15 +549,21 @@ DROP TABLE t1, t2, t3; CREATE TABLE t1 (c1 INT); #Alter table in strict mode with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 DATE DEFAULT 0; ERROR 42000: Invalid default value for 'c2' ALTER TABLE t1 ADD c2 DATE DEFAULT '0000-00-00'; ERROR 42000: Invalid default value for 'c2' SET @@sql_mode='NO_ZERO_IN_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 DATE DEFAULT '2012-02-00'; ERROR 42000: Invalid default value for 'c2' #Alter table in non-strict mode but with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 DATE DEFAULT 0; Warnings: Warning 1264 Out of range value for column 'c2' at row 1 @@ -558,6 +572,8 @@ Warnings: Warning 1264 Out of range value for column 'c2' at row 1 Warning 1264 Out of range value for column 'c3' at row 1 SET @@sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c4 DATE DEFAULT '2012-02-00'; Warnings: Warning 1264 Out of range value for column 'c4' at row 1 diff --git a/mysql-wsrep-5.6/mysql-test/r/type_datetime.result b/mysql-wsrep-5.6/mysql-test/r/type_datetime.result index f9b48705..7bf28579 100644 --- a/mysql-wsrep-5.6/mysql-test/r/type_datetime.result +++ b/mysql-wsrep-5.6/mysql-test/r/type_datetime.result @@ -768,15 +768,21 @@ DROP TABLE if EXISTS t1, t2, t3; SET @org_mode=@@sql_mode; #Table creation in strict mode SET @@sql_mode='NO_ZERO_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 DATETIME DEFAULT 0); ERROR 42000: Invalid default value for 'c1' CREATE TABLE t1 (c1 DATETIME DEFAULT '0000-00-00 00:00:00'); ERROR 42000: Invalid default value for 'c1' SET @@sql_mode='NO_ZERO_IN_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 DATETIME DEFAULT '2012-02-00 12:12:12'); ERROR 42000: Invalid default value for 'c1' #Table creation in non-strict mode but with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 DATETIME DEFAULT 0); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -784,6 +790,8 @@ CREATE TABLE t2 (c1 DATETIME DEFAULT '0000-00-00 00:00:00'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 SET @@sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t3 (c1 DATETIME DEFAULT '2012-02-00 12:12:12'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -797,15 +805,21 @@ DROP TABLE t1, t2, t3; CREATE TABLE t1 (c1 int); #Alter table in strict mode with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 DATETIME DEFAULT 0; ERROR 42000: Invalid default value for 'c2' ALTER TABLE t1 ADD c2 DATETIME DEFAULT '0000-00-00'; ERROR 42000: Invalid default value for 'c2' SET @@sql_mode='NO_ZERO_IN_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 DATETIME DEFAULT '2012-02-00'; ERROR 42000: Invalid default value for 'c2' #Alter table in non-strict mode but with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 DATETIME DEFAULT 0; Warnings: Warning 1264 Out of range value for column 'c2' at row 1 @@ -814,6 +828,8 @@ Warnings: Warning 1264 Out of range value for column 'c2' at row 1 Warning 1264 Out of range value for column 'c3' at row 1 SET @@sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c4 DATETIME DEFAULT '2012-02-00'; Warnings: Warning 1264 Out of range value for column 'c4' at row 1 diff --git a/mysql-wsrep-5.6/mysql-test/r/type_temporal_fractional.result b/mysql-wsrep-5.6/mysql-test/r/type_temporal_fractional.result index df772118..2edf2284 100644 --- a/mysql-wsrep-5.6/mysql-test/r/type_temporal_fractional.result +++ b/mysql-wsrep-5.6/mysql-test/r/type_temporal_fractional.result @@ -7337,6 +7337,8 @@ DROP TABLE t1; # Testing values with zeros in dates # SET sql_mode=no_zero_in_date; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (a DATETIME, b DATETIME(6)); INSERT INTO t1 VALUES ('1999-00-00 00:00:00', '1999-00-00 00:00:00'); Warnings: @@ -17269,4 +17271,259 @@ SECOND(-4.99999999991e0) SELECT SECOND(TRUNCATE('5',180)); SECOND(TRUNCATE('5',180)) 5 +# +# Bug#17080703 INCONSISTENT DATETIME CONVERSIONS WITH FRACTIONAL SECONDS +# +# Test for TIMESTAMP datatype. +SELECT TIMESTAMP '20130710010203'; +TIMESTAMP '20130710010203' +2013-07-10 01:02:03 +SELECT TIMESTAMP '201307100102031'; +ERROR HY000: Incorrect DATETIME value: '201307100102031' +SELECT TIMESTAMP '2013071001020312'; +ERROR HY000: Incorrect DATETIME value: '2013071001020312' +SELECT TIMESTAMP '20130710010203123'; +ERROR HY000: Incorrect DATETIME value: '20130710010203123' +SELECT TIMESTAMP '201307100102031234'; +ERROR HY000: Incorrect DATETIME value: '201307100102031234' +SELECT TIMESTAMP '2013071001020312345'; +ERROR HY000: Incorrect DATETIME value: '2013071001020312345' +SELECT TIMESTAMP '20130710010203123456'; +ERROR HY000: Incorrect DATETIME value: '20130710010203123456' +# Test non decimal point as delimiter for fractional seconds. +SELECT TIMESTAMP '2013:07:10 01:02:03:04'; +ERROR HY000: Incorrect DATETIME value: '2013:07:10 01:02:03:04' +# Test for invalid seconds >= 60 properly separated by decimal point with fractions. +SELECT TIMESTAMP '2013:07:10 01.02.131'; +ERROR HY000: Incorrect DATETIME value: '2013:07:10 01.02.131' +SELECT TIMESTAMP '2013:07:10 01.02.131.2'; +ERROR HY000: Incorrect DATETIME value: '2013:07:10 01.02.131.2' +SELECT TIMESTAMP '2013:07:10 01.02.0312.3'; +ERROR HY000: Incorrect DATETIME value: '2013:07:10 01.02.0312.3' +SELECT TIMESTAMP '2013.07.10 01.02.131.23456'; +ERROR HY000: Incorrect DATETIME value: '2013.07.10 01.02.131.23456' +SELECT TIMESTAMP '201307100102031.'; +ERROR HY000: Incorrect DATETIME value: '201307100102031.' +SELECT TIMESTAMP '2012071001021.1'; +ERROR HY000: Incorrect DATETIME value: '2012071001021.1' +# Test for valid seconds properly separated by decimal point with fractions. +SELECT TIMESTAMP '2013:07:10 01.02.0.31'; +TIMESTAMP '2013:07:10 01.02.0.31' +2013-07-10 01:02:00.31 +SELECT TIMESTAMP '20130710010203.'; +TIMESTAMP '20130710010203.' +2013-07-10 01:02:03 +# Test for valid seconds properly separated by decimal point with fractions. +SELECT TIMESTAMP '20130710010203.1'; +TIMESTAMP '20130710010203.1' +2013-07-10 01:02:03.1 +SELECT TIMESTAMP '20130710010203.12'; +TIMESTAMP '20130710010203.12' +2013-07-10 01:02:03.12 +SELECT TIMESTAMP '20130710010203.123'; +TIMESTAMP '20130710010203.123' +2013-07-10 01:02:03.123 +SELECT TIMESTAMP '20130710010203.1234'; +TIMESTAMP '20130710010203.1234' +2013-07-10 01:02:03.1234 +SELECT TIMESTAMP '20130710010203.12345'; +TIMESTAMP '20130710010203.12345' +2013-07-10 01:02:03.12345 +SELECT TIMESTAMP '20130710010203.123456'; +TIMESTAMP '20130710010203.123456' +2013-07-10 01:02:03.123456 +SELECT TIMESTAMP '20130710010203.1234567'; +TIMESTAMP '20130710010203.1234567' +2013-07-10 01:02:03.123457 +# Test for valid time literals in insert operation. +CREATE TABLE t(key1 INT UNIQUE, col TIMESTAMP(6)); +INSERT INTO t VALUES (1, '20130710010203.1'), (2, '20130710010203.12'), (3, '20130710010203.123'), (4, '20130710010203.1234'), +(5,'20130710010203.12345'), (6, '20130710010203.123456'), (7, '201207100102'); +SELECT * FROM t ORDER BY key1; +key1 col +1 2013-07-10 01:02:03.100000 +2 2013-07-10 01:02:03.120000 +3 2013-07-10 01:02:03.123000 +4 2013-07-10 01:02:03.123400 +5 2013-07-10 01:02:03.123450 +6 2013-07-10 01:02:03.123456 +7 2020-12-07 10:01:02.000000 +DELETE FROM t; +# Test for invalid time literals in insert operation. +INSERT INTO t VALUES (1, '201307100102031'), (2, '2013071001020312'), (3, '20130710010203123'), (4, '201307100102031234'), +(5, '2013071001020312345'), (6, '20130710010203123456'), (7, '2013:07:10 01.02.031'), (8, '2013:07:10 01.02.031.2'), +(9, '2013:07:10 01.02.0312.3'), (10, '2012071001021.1'), (11, '2012071001021'); +Warnings: +Warning 1265 Data truncated for column 'col' at row 1 +Warning 1265 Data truncated for column 'col' at row 2 +Warning 1265 Data truncated for column 'col' at row 3 +Warning 1265 Data truncated for column 'col' at row 4 +Warning 1265 Data truncated for column 'col' at row 5 +Warning 1265 Data truncated for column 'col' at row 6 +Warning 1265 Data truncated for column 'col' at row 9 +Warning 1265 Data truncated for column 'col' at row 10 +Warning 1265 Data truncated for column 'col' at row 11 +SELECT * FROM t ORDER BY key1; +key1 col +1 2013-07-10 01:02:03.000000 +2 2013-07-10 01:02:03.000000 +3 2013-07-10 01:02:03.000000 +4 2013-07-10 01:02:03.000000 +5 2013-07-10 01:02:03.000000 +6 2013-07-10 01:02:03.000000 +7 2013-07-10 01:02:31.000000 +8 2013-07-10 01:02:31.200000 +9 0000-00-00 00:00:00.000000 +10 2020-12-07 10:01:02.000000 +11 2020-12-07 10:01:02.000000 +DROP TABLE t; +# Test for DATETIME datatype. +# Test for valid time literals in insert operation. +CREATE TABLE t(key1 INT UNIQUE, col DATETIME(6)); +INSERT INTO t VALUES (1, '20130710010203.1'), (2, '20130710010203.12'), (3, '20130710010203.123'), (4, '20130710010203.1234'), +(5, '20130710010203.12345'), (6, '20130710010203.123456'), (7, '201207100102'); +SELECT * FROM t ORDER BY key1; +key1 col +1 2013-07-10 01:02:03.100000 +2 2013-07-10 01:02:03.120000 +3 2013-07-10 01:02:03.123000 +4 2013-07-10 01:02:03.123400 +5 2013-07-10 01:02:03.123450 +6 2013-07-10 01:02:03.123456 +7 2020-12-07 10:01:02.000000 +DELETE FROM t; +# Test for invalid time literals in insert operation. +INSERT INTO t VALUES (1, '201307100102031'), (2, '2013071001020312'), (3, '20130710010203123'), (4, '201307100102031234'), +(5, '2013071001020312345'), (6, '20130710010203123456'), (7, '2013:07:10 01.02.031'), (8, '2013:07:10 01.02.031.2'), +(9, '2013:07:10 01.02.0312.3'), (10, '2012071001021.1'), (11, '2012071001021'); +Warnings: +Warning 1265 Data truncated for column 'col' at row 1 +Warning 1265 Data truncated for column 'col' at row 2 +Warning 1265 Data truncated for column 'col' at row 3 +Warning 1265 Data truncated for column 'col' at row 4 +Warning 1265 Data truncated for column 'col' at row 5 +Warning 1265 Data truncated for column 'col' at row 6 +Warning 1265 Data truncated for column 'col' at row 9 +Warning 1265 Data truncated for column 'col' at row 10 +Warning 1265 Data truncated for column 'col' at row 11 +SELECT * FROM t ORDER BY key1; +key1 col +1 2013-07-10 01:02:03.000000 +2 2013-07-10 01:02:03.000000 +3 2013-07-10 01:02:03.000000 +4 2013-07-10 01:02:03.000000 +5 2013-07-10 01:02:03.000000 +6 2013-07-10 01:02:03.000000 +7 2013-07-10 01:02:31.000000 +8 2013-07-10 01:02:31.200000 +9 0000-00-00 00:00:00.000000 +10 2020-12-07 10:01:02.000000 +11 2020-12-07 10:01:02.000000 +DROP TABLE t; +# Test for TIME datatype. +SELECT TIME '010203'; +TIME '010203' +01:02:03 +SELECT TIME '1010203'; +TIME '1010203' +101:02:03 +SELECT TIME '01010203'; +TIME '01010203' +101:02:03 +SELECT TIME '10102031'; +ERROR HY000: Incorrect TIME value: '10102031' +SELECT TIME '101020312'; +ERROR HY000: Incorrect TIME value: '101020312' +SELECT TIME '1010203123'; +ERROR HY000: Incorrect TIME value: '1010203123' +SELECT TIME '10102031234'; +ERROR HY000: Incorrect TIME value: '10102031234' +SELECT TIME '101020312345'; +ERROR HY000: Incorrect TIME value: '101020312345' +SELECT TIME '1010203123456'; +ERROR HY000: Incorrect TIME value: '1010203123456' +# Test non decimal point as delimiter for fractional seconds. +SELECT TIME '01:02:03:04'; +ERROR HY000: Incorrect TIME value: '01:02:03:04' +# Test for invalid seconds >= 60 properly separated by decimal point with fractions. +SELECT TIME '01:02:131'; +ERROR HY000: Incorrect TIME value: '01:02:131' +SELECT TIME '01:02:131.2'; +ERROR HY000: Incorrect TIME value: '01:02:131.2' +SELECT TIME '01:02:0312.3'; +ERROR HY000: Incorrect TIME value: '01:02:0312.3' +SELECT TIME '01:02:131.23456'; +ERROR HY000: Incorrect TIME value: '01:02:131.23456' +SELECT TIME '11102031.'; +ERROR HY000: Incorrect TIME value: '11102031.' +# Test for valid seconds properly separated by decimal point with fractions. +SELECT TIME '01:02:0.31'; +TIME '01:02:0.31' +01:02:00.31 +SELECT TIME '010203.'; +TIME '010203.' +01:02:03 +# Test for valid seconds properly separated by decimal point with fractions. +SELECT TIME '110203.1'; +TIME '110203.1' +11:02:03.1 +SELECT TIME '010203.12'; +TIME '010203.12' +01:02:03.12 +SELECT TIME '010203.123'; +TIME '010203.123' +01:02:03.123 +SELECT TIME '010203.1234'; +TIME '010203.1234' +01:02:03.1234 +SELECT TIME '010203.12345'; +TIME '010203.12345' +01:02:03.12345 +SELECT TIME '010203.123456'; +TIME '010203.123456' +01:02:03.123456 +SELECT TIME '010203.1234567'; +TIME '010203.1234567' +01:02:03.123457 +SELECT TIME '01021.1'; +TIME '01021.1' +00:10:21.1 +# Test for valid time literals in insert operation. +CREATE TABLE t(key1 INT UNIQUE, col TIME(6)); +INSERT INTO t VALUES (1, '010203.1'), (2, '010203.12'), (3, '010203.123'), (4, '010203.1234'), +(5, '010203.12345'), (6, '010203.123456'), (7, '0203.123456'), (8, '03.123456'), (9, '0.123456'); +SELECT * FROM t ORDER BY key1; +key1 col +1 01:02:03.100000 +2 01:02:03.120000 +3 01:02:03.123000 +4 01:02:03.123400 +5 01:02:03.123450 +6 01:02:03.123456 +7 00:02:03.123456 +8 00:00:03.123456 +9 00:00:00.123456 +DELETE FROM t; +# Test for invalid time literals in insert operation. +INSERT INTO t VALUES (1, '0102031'), (2, '01020312'), (3, '010203123'), (4, '0102031234'), +(5, '01020312345'), (6, '010203123456'), (7, '01:02:031'), (8, '01:02:031.2'), +(9, '01:02:0312.3'); +Warnings: +Warning 1264 Out of range value for column 'col' at row 3 +Warning 1264 Out of range value for column 'col' at row 4 +Warning 1264 Out of range value for column 'col' at row 5 +Note 1265 Data truncated for column 'col' at row 6 +Warning 1264 Out of range value for column 'col' at row 9 +SELECT * FROM t ORDER BY key1; +key1 col +1 10:20:31.000000 +2 102:03:12.000000 +3 838:59:59.000000 +4 838:59:59.000000 +5 838:59:59.000000 +6 12:34:56.000000 +7 01:02:31.000000 +8 01:02:31.200000 +9 00:00:00.000000 +DROP TABLE t; # End of 5.6 tests diff --git a/mysql-wsrep-5.6/mysql-test/r/type_timestamp.result b/mysql-wsrep-5.6/mysql-test/r/type_timestamp.result index ea887c74..04708418 100644 --- a/mysql-wsrep-5.6/mysql-test/r/type_timestamp.result +++ b/mysql-wsrep-5.6/mysql-test/r/type_timestamp.result @@ -653,15 +653,21 @@ DROP TABLE IF EXISTS t1, t2, t3; SET @org_mode=@@sql_mode; #Table creation in strict mode SET @@sql_mode='NO_ZERO_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 TIMESTAMP DEFAULT 0); ERROR 42000: Invalid default value for 'c1' CREATE TABLE t1 (c1 TIMESTAMP DEFAULT '0000-00-00 00:00:00'); ERROR 42000: Invalid default value for 'c1' SET @@sql_mode='NO_ZERO_IN_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 TIMESTAMP DEFAULT '2012-02-00 12:12:12'); ERROR 42000: Invalid default value for 'c1' #Table creation in non-strict mode but with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 TIMESTAMP DEFAULT 0); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -669,6 +675,8 @@ CREATE TABLE t2 (c1 TIMESTAMP DEFAULT '0000-00-00 00:00:00'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 SET @@sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t3 (c1 TIMESTAMP DEFAULT '2012-02-00 12:12:12'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -684,15 +692,21 @@ DROP TABLE t1, t2, t3; CREATE TABLE t1 (c1 INT); #Alter table in strict mode with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 TIMESTAMP DEFAULT 0; ERROR 42000: Invalid default value for 'c2' ALTER TABLE t1 ADD c2 TIMESTAMP DEFAULT '0000-00-00'; ERROR 42000: Invalid default value for 'c2' SET @@sql_mode='NO_ZERO_IN_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 TIMESTAMP DEFAULT '2012-02-00'; ERROR 42000: Invalid default value for 'c2' #Alter table in non-strict mode but with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 TIMESTAMP DEFAULT 0; Warnings: Warning 1264 Out of range value for column 'c2' at row 1 @@ -701,6 +715,8 @@ Warnings: Warning 1264 Out of range value for column 'c2' at row 1 Warning 1264 Out of range value for column 'c3' at row 1 SET @@sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c4 TIMESTAMP DEFAULT '2012-02-00'; Warnings: Warning 1264 Out of range value for column 'c4' at row 1 diff --git a/mysql-wsrep-5.6/mysql-test/r/type_timestamp_explicit.result b/mysql-wsrep-5.6/mysql-test/r/type_timestamp_explicit.result index 117ccf3f..0b7acee4 100644 --- a/mysql-wsrep-5.6/mysql-test/r/type_timestamp_explicit.result +++ b/mysql-wsrep-5.6/mysql-test/r/type_timestamp_explicit.result @@ -645,15 +645,21 @@ DROP TABLE IF EXISTS t1, t2, t3; SET @org_mode=@@sql_mode; #Table creation in strict mode SET @@sql_mode='NO_ZERO_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 TIMESTAMP DEFAULT 0); ERROR 42000: Invalid default value for 'c1' CREATE TABLE t1 (c1 TIMESTAMP DEFAULT '0000-00-00 00:00:00'); ERROR 42000: Invalid default value for 'c1' SET @@sql_mode='NO_ZERO_IN_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 TIMESTAMP DEFAULT '2012-02-00 12:12:12'); ERROR 42000: Invalid default value for 'c1' #Table creation in non-strict mode but with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. CREATE TABLE t1 (c1 TIMESTAMP DEFAULT 0); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -661,6 +667,8 @@ CREATE TABLE t2 (c1 TIMESTAMP DEFAULT '0000-00-00 00:00:00'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 SET @@sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. CREATE TABLE t3 (c1 TIMESTAMP DEFAULT '2012-02-00 12:12:12'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 @@ -676,15 +684,21 @@ DROP TABLE t1, t2, t3; CREATE TABLE t1 (c1 INT); #Alter table in strict mode with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 TIMESTAMP DEFAULT 0; ERROR 42000: Invalid default value for 'c2' ALTER TABLE t1 ADD c2 TIMESTAMP DEFAULT '0000-00-00'; ERROR 42000: Invalid default value for 'c2' SET @@sql_mode='NO_ZERO_IN_DATE,STRICT_ALL_TABLES'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 TIMESTAMP DEFAULT '2012-02-00'; ERROR 42000: Invalid default value for 'c2' #Alter table in non-strict mode but with NO_ZERO_DATE/NO_ZERO_IN_DATE SET @@sql_mode='NO_ZERO_DATE'; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c2 TIMESTAMP DEFAULT 0; Warnings: Warning 1264 Out of range value for column 'c2' at row 1 @@ -693,6 +707,8 @@ Warnings: Warning 1264 Out of range value for column 'c2' at row 1 Warning 1264 Out of range value for column 'c3' at row 1 SET @@sql_mode='NO_ZERO_IN_DATE'; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. ALTER TABLE t1 ADD c4 TIMESTAMP DEFAULT '2012-02-00'; Warnings: Warning 1264 Out of range value for column 'c4' at row 1 diff --git a/mysql-wsrep-5.6/mysql-test/r/union.result b/mysql-wsrep-5.6/mysql-test/r/union.result index 4fe56404..3f077952 100644 --- a/mysql-wsrep-5.6/mysql-test/r/union.result +++ b/mysql-wsrep-5.6/mysql-test/r/union.result @@ -1826,3 +1826,37 @@ dev SELECT(SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev; dev 1 +# +# Bug #17059925 : UNIONS COMPUTES ROWS_EXAMINED INCORRECTLY +# +SET @old_slow_query_log= @@global.slow_query_log; +SET @old_log_output= @@global.log_output; +SET @old_long_query_time= @@long_query_time; +SET GLOBAL log_output= "TABLE"; +SET GLOBAL slow_query_log= ON; +SET SESSION long_query_time= 0; +CREATE TABLE t17059925 (a INT); +CREATE TABLE t2 (b INT); +CREATE TABLE t3 (c INT); +INSERT INTO t17059925 VALUES (1), (2), (3); +INSERT INTO t2 VALUES (4), (5), (6); +INSERT INTO t3 VALUES (7), (8), (9); +TRUNCATE table mysql.slow_log; +SELECT * FROM t17059925 UNION SELECT * FROM t2 UNION SELECT * FROM t3; +a +1 +2 +3 +4 +5 +6 +7 +8 +9 +SELECT sql_text, rows_examined FROM mysql.slow_log WHERE sql_text LIKE '%SELECT%t17059925%'; +sql_text rows_examined +SELECT * FROM t17059925 UNION SELECT * FROM t2 UNION SELECT * FROM t3 18 +DROP TABLE t17059925, t2, t3; +SET @@long_query_time= @old_long_query_time; +SET @@global.log_output= @old_log_output; +SET @@global.slow_query_log= @old_slow_query_log; diff --git a/mysql-wsrep-5.6/mysql-test/r/user_var.result b/mysql-wsrep-5.6/mysql-test/r/user_var.result index 0df436a7..a64e1e80 100644 --- a/mysql-wsrep-5.6/mysql-test/r/user_var.result +++ b/mysql-wsrep-5.6/mysql-test/r/user_var.result @@ -126,14 +126,14 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i; set @a=0; select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; @a @a:="hello" @a @a:=3 @a @a:="hello again" -0 hello 0 3 3 hello again -0 hello 0 3 3 hello again -0 hello 0 3 3 hello again +0 hello 0 3 0 hello again +0 hello 0 3 0 hello again +0 hello 0 3 0 hello again select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; @a @a:="hello" @a @a:=3 @a @a:="hello again" -hello again hello hello 3 3 hello again -hello again hello hello 3 3 hello again -hello again hello hello 3 3 hello again +hello again hello hello again 3 hello again hello again +hello again hello hello again 3 hello again hello again +hello again hello hello again 3 hello again hello again drop table t1; set @a=_latin2'test'; select charset(@a),collation(@a),coercibility(@a); diff --git a/mysql-wsrep-5.6/mysql-test/r/variables.result b/mysql-wsrep-5.6/mysql-test/r/variables.result index 60fd1dc6..9b435e81 100644 --- a/mysql-wsrep-5.6/mysql-test/r/variables.result +++ b/mysql-wsrep-5.6/mysql-test/r/variables.result @@ -196,6 +196,8 @@ select @@concurrent_insert; @@concurrent_insert AUTO set global timed_mutexes=ON; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. show variables like 'timed_mutexes'; Variable_name Value timed_mutexes ON @@ -203,6 +205,8 @@ select * from information_schema.session_variables where variable_name like 'tim VARIABLE_NAME VARIABLE_VALUE TIMED_MUTEXES ON set global timed_mutexes=0; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. show variables like 'timed_mutexes'; Variable_name Value timed_mutexes OFF diff --git a/mysql-wsrep-5.6/mysql-test/r/view.result b/mysql-wsrep-5.6/mysql-test/r/view.result index bc0b24bd..dc6fb575 100644 --- a/mysql-wsrep-5.6/mysql-test/r/view.result +++ b/mysql-wsrep-5.6/mysql-test/r/view.result @@ -4211,3 +4211,40 @@ OR ((pk BETWEEN 9 AND 13) AND pk = 90) pk DROP VIEW v_t1; DROP TABLE t1; +# +# BUG#14117018 - MYSQL SERVER CREATES INVALID VIEW DEFINITION +# BUG#18405221 - SHOW CREATE VIEW OUTPUT INCORRECT +# +CREATE VIEW v1 AS (SELECT '' FROM DUAL); +CREATE VIEW v2 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL +(SELECT '' FROM DUAL); +CREATE VIEW v3 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL +(SELECT '' FROM DUAL) UNION ALL +(SELECT '' FROM DUAL); +CREATE VIEW v4 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL +(SELECT '' AS col2 FROM DUAL) UNION ALL +(SELECT '' FROM DUAL); +# Name for the column in select1 is set properly with or +# without this fix. +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select '' AS `Name_exp_1`) latin1 latin1_swedish_ci +# Name for the column in select2 is set with this fix. +# Without this fix, name would not have set for the +# columns in select2. +SHOW CREATE VIEW v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `Name_exp_2`) latin1 latin1_swedish_ci +# Name for the field item in select2 & select3 is set with this fix. +# Without this fix, name would not have set for the +# columns in select2 & select3. +SHOW CREATE VIEW v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `Name_exp_2`) union all (select '' AS `Name_exp_3`) latin1 latin1_swedish_ci +# Name for the field item in select3 is set with this fix. +# Without this fix, name would not have set for the +# columns in select3. +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; diff --git a/mysql-wsrep-5.6/mysql-test/r/windows.result b/mysql-wsrep-5.6/mysql-test/r/windows.result index d0cdd858..05e4600f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/windows.result +++ b/mysql-wsrep-5.6/mysql-test/r/windows.result @@ -60,3 +60,8 @@ SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'socket'; VARIABLE_NAME SOCKET +# +# Bug#16581605: REPLACE.EXE UTILITY IS BROKEN IN 5.5 +# +xyz +def diff --git a/mysql-wsrep-5.6/mysql-test/std_data/bug17532932.MYD b/mysql-wsrep-5.6/mysql-test/std_data/bug17532932.MYD new file mode 100644 index 00000000..e69de29b diff --git a/mysql-wsrep-5.6/mysql-test/std_data/bug17532932.MYI b/mysql-wsrep-5.6/mysql-test/std_data/bug17532932.MYI new file mode 100644 index 0000000000000000000000000000000000000000..11f69839f6131320ec750503f7ee80f901fac0d4 GIT binary patch literal 1024 zcmezOkDZZ$fzg0r149ZBg8>JG`VXNn$^TFQkzv79fKw!n37b@K?E6{B;^=&2IS89* vI|YF1k+BGn57x}a3^x_(T{s`a0EP(&K<(jxIGdShYazNv$<YuP>>&UELl6>D literal 0 HcmV?d00001 diff --git a/mysql-wsrep-5.6/mysql-test/std_data/bug17532932.frm b/mysql-wsrep-5.6/mysql-test/std_data/bug17532932.frm new file mode 100644 index 0000000000000000000000000000000000000000..90c08307f0fb6dcb670c91857c8d44e7dba8f426 GIT binary patch literal 8602 zcmeI&y$%6E6o%n<&#v_wkq{b%R>c+AC>0WkM(L+=2|Cx|e%zKZLuM%z3X*TOID5WL zW+qR&=a$s#DRdH;`r@B*S&bT0LhtKyh0n(;3}Y~vz$iAV5|DrdBp?9^NI(J-kbndv zAOQ*dtbpOlyS?6Gl(Rf7*7N1FZ^c+u0uqpb1SB8<2}nQ!5|DrdBp`vm5x6Apzx@B^ z+F!e9LP`-vA3Q^xaxhl(vBwz&S!%uU=)*;Z?flGy?a8qNnRUBirx^pNhH;7z<gh*a W?OQ&`t<j(jn-Da8;C62B4vsrlR~Nqk literal 0 HcmV?d00001 diff --git a/mysql-wsrep-5.6/mysql-test/std_data/cacert.pem b/mysql-wsrep-5.6/mysql-test/std_data/cacert.pem index e4434138..a0ba6744 100644 --- a/mysql-wsrep-5.6/mysql-test/std_data/cacert.pem +++ b/mysql-wsrep-5.6/mysql-test/std_data/cacert.pem @@ -1,17 +1,79 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 16263805969935345171 (0xe1b4a55c3ddfa613) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Validity + Not Before: Dec 5 04:48:11 2014 GMT + Not After : Dec 1 04:48:11 2030 GMT + Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:b4:95:bd:24:92:73:06:22:01:13:28:0e:09:a3: + 94:05:96:54:9d:dc:8f:83:39:f3:64:7a:31:70:f6: + d9:c4:14:19:75:87:a6:b1:ea:52:ed:40:54:5a:f6: + 9c:13:8e:d8:76:8f:5a:65:a5:20:19:19:bd:51:9d: + ba:35:ce:9a:a9:58:0a:fc:11:6e:1d:cb:a8:f1:92: + 79:ee:aa:fc:e3:32:5e:aa:0d:0b:23:34:95:e9:d3: + 8e:3f:72:93:90:bc:2c:b0:04:75:4f:a4:4a:a0:32: + db:ac:89:ac:34:9b:d0:07:e3:81:e9:ca:5b:26:f0: + f5:de:fe:d5:5e:a0:54:26:dd:ec:58:07:6e:b9:e5: + 97:f6:20:6d:d8:4a:c0:50:cc:81:e6:d2:3f:c7:47: + 70:8b:15:89:65:71:2e:47:c3:42:76:b5:ee:16:0e: + 26:97:6a:a3:1c:ad:90:53:50:b0:b1:6d:1d:b0:b8: + 6d:df:3c:ee:bd:3b:87:e8:db:4d:3a:72:78:dd:db: + 40:3d:c9:20:46:b8:4e:33:bb:76:b7:4f:b2:79:da: + 03:cc:f9:75:c0:1d:4c:51:0a:b9:9b:25:34:50:11: + 97:df:82:46:02:a9:bc:98:51:3e:c3:df:57:ad:b7: + 28:be:de:65:ce:2b:f3:2c:22:f5:af:31:28:1c:ef: + 10:09 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + 94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 + X509v3 Authority Key Identifier: + keyid:94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha256WithRSAEncryption + 32:97:4c:af:bf:ca:e0:10:66:b7:cc:8b:0d:05:d1:d2:ca:b8: + 0c:c2:78:57:1f:f6:55:9c:74:fc:bd:31:58:05:18:bc:6d:b5: + 79:9a:22:8c:1f:da:33:ea:ef:db:e3:cb:46:bc:36:91:8b:d8: + 36:8d:06:40:c2:e9:fe:79:1b:4a:c5:70:74:6d:9d:92:2c:90: + be:3c:a7:88:03:e4:b7:ef:f4:b0:00:34:ec:8f:d1:c3:23:2b: + ef:bc:ff:ab:a2:0e:bc:ba:11:a5:8e:44:80:fa:d6:f4:26:66: + 84:64:2c:e3:23:62:0c:e2:ba:01:ab:5f:24:d6:9d:7e:9c:7b: + f4:5d:0e:ba:64:35:6e:a5:fa:98:0c:57:f3:72:e8:3e:2e:ce: + b3:f9:e3:fa:ee:aa:79:f9:06:01:19:b2:b3:28:ff:f4:d6:bb: + 17:bb:a6:a0:e0:45:23:f3:61:40:31:5c:a3:ee:88:1c:00:31: + 54:96:f9:71:37:b5:7f:66:6a:af:04:94:09:39:99:b3:88:86: + 9e:bb:d6:36:24:24:f4:37:2c:a6:6c:0b:35:2e:bb:40:af:a7: + 64:8a:7f:f2:74:e3:94:0c:32:bd:31:3d:d9:79:68:0f:1e:4b: + 17:c0:4e:df:85:3c:f0:84:df:58:f1:d2:4d:2f:ad:ff:1b:d7: + c8:9b:fe:dc -----BEGIN CERTIFICATE----- -MIICrTCCAhagAwIBAgIJAMI7xZKjhrDbMA0GCSqGSIb3DQEBBAUAMEQxCzAJBgNV -BAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxhMREwDwYD -VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkxMTQ3MTBaFw0xNTAxMjgxMTQ3MTBaMEQx -CzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxh -MREwDwYDVQQKEwhNeVNRTCBBQjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA -wQYsOEfrN4ESP3FjsI8cghE+tZVuyK2gck61lwieVxjgFMtBd65mI5a1y9pmlOI1 -yM4SB2Ppqcuw7/e1CdV1y7lvHrGNt5yqEHbN4QX1gvsN8TQauP/2WILturk4R4Hq -rKg0ZySu7f1Xhl0ed9a48LpaEHD17IcxWEGMMJwAxF0CAwEAAaOBpjCBozAMBgNV -HRMEBTADAQH/MB0GA1UdDgQWBBSvktYQ0ahLnyxyVKqty+WpBbBrDTB0BgNVHSME -bTBrgBSvktYQ0ahLnyxyVKqty+WpBbBrDaFIpEYwRDELMAkGA1UEBhMCU0UxEDAO -BgNVBAgTB1VwcHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FM -IEFCggkAwjvFkqOGsNswDQYJKoZIhvcNAQEEBQADgYEAdKN1PjwMHAKG2Ww1145g -JQGBnKxSFOUaoSvkBi/4ntTM+ysnViWh7WvxyWjR9zU9arfr7aqsDeQxm0XDOqzj -AQ/cQIla2/Li8tXyfc06bisH/IHRaSc2zWqioTKbEwMdVOdrvq4a8V8ic3xYyIWn -7F4WeS07J8LKardSvM0+hOA= +MIIDmTCCAoGgAwIBAgIJAOG0pVw936YTMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV +BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP +MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN +MTQxMjA1MDQ0ODExWhcNMzAxMjAxMDQ0ODExWjBjMQswCQYDVQQGEwJTRTESMBAG +A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y +YWNsZTEOMAwGA1UECwwFTXlTUUwxCzAJBgNVBAMMAkNBMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAtJW9JJJzBiIBEygOCaOUBZZUndyPgznzZHoxcPbZ +xBQZdYemsepS7UBUWvacE47Ydo9aZaUgGRm9UZ26Nc6aqVgK/BFuHcuo8ZJ57qr8 +4zJeqg0LIzSV6dOOP3KTkLwssAR1T6RKoDLbrImsNJvQB+OB6cpbJvD13v7VXqBU +Jt3sWAduueWX9iBt2ErAUMyB5tI/x0dwixWJZXEuR8NCdrXuFg4ml2qjHK2QU1Cw +sW0dsLht3zzuvTuH6NtNOnJ43dtAPckgRrhOM7t2t0+yedoDzPl1wB1MUQq5myU0 +UBGX34JGAqm8mFE+w99Xrbcovt5lzivzLCL1rzEoHO8QCQIDAQABo1AwTjAdBgNV +HQ4EFgQUlGWho4fPv8F0u9iEl7Zr7rKQc7IwHwYDVR0jBBgwFoAUlGWho4fPv8F0 +u9iEl7Zr7rKQc7IwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAMpdM +r7/K4BBmt8yLDQXR0sq4DMJ4Vx/2VZx0/L0xWAUYvG21eZoijB/aM+rv2+PLRrw2 +kYvYNo0GQMLp/nkbSsVwdG2dkiyQvjyniAPkt+/0sAA07I/RwyMr77z/q6IOvLoR +pY5EgPrW9CZmhGQs4yNiDOK6AatfJNadfpx79F0OumQ1bqX6mAxX83LoPi7Os/nj ++u6qefkGARmysyj/9Na7F7umoOBFI/NhQDFco+6IHAAxVJb5cTe1f2ZqrwSUCTmZ +s4iGnrvWNiQk9DcspmwLNS67QK+nZIp/8nTjlAwyvTE92XloDx5LF8BO34U88ITf +WPHSTS+t/xvXyJv+3A== -----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/checkDBI_DBD-mysql.pl b/mysql-wsrep-5.6/mysql-test/std_data/checkDBI_DBD-mysql.pl old mode 100644 new mode 100755 diff --git a/mysql-wsrep-5.6/mysql-test/std_data/client-cert.pem b/mysql-wsrep-5.6/mysql-test/std_data/client-cert.pem index ee7f2ab2..f60a0884 100644 --- a/mysql-wsrep-5.6/mysql-test/std_data/client-cert.pem +++ b/mysql-wsrep-5.6/mysql-test/std_data/client-cert.pem @@ -1,46 +1,82 @@ Certificate: Data: - Version: 1 (0x0) - Serial Number: 1048577 (0x100001) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB + Version: 3 (0x2) + Serial Number: 16263805969935345173 (0xe1b4a55c3ddfa615) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA Validity - Not Before: Jan 29 11:50:22 2010 GMT - Not After : Jan 28 11:50:22 2015 GMT - Subject: C=SE, ST=Uppsala, O=MySQL AB + Not Before: Dec 5 04:49:23 2014 GMT + Not After : Dec 1 04:49:23 2029 GMT + Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=Client Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) + Public-Key: (2048 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 + 00:c8:d1:a1:fe:a4:8c:f3:1b:17:71:1b:74:35:11: + e0:0e:6c:40:0a:fb:c0:f7:f0:eb:bb:c9:1d:a1:c7: + d7:b0:8a:f6:f1:cf:fa:6b:d0:79:64:eb:bb:69:a5: + 0d:80:06:df:52:14:d2:85:32:cf:bf:ce:2a:47:28: + 5b:cd:0b:28:ab:bb:07:33:d5:8b:d3:b4:72:c4:a6: + b5:cc:37:b9:03:a8:78:56:25:58:1f:17:30:7c:d1: + 0a:bb:ec:3c:a3:03:90:97:99:92:49:ae:b3:57:96: + 5c:1a:e9:e8:02:23:ae:c8:c9:05:50:63:e5:77:a1: + 9a:73:06:74:0e:46:50:28:d8:c9:4f:c4:1c:37:b8: + 52:18:0b:af:19:2b:d4:e5:66:74:a4:f3:f0:da:09: + 30:f7:bc:0c:c9:9b:ce:57:06:04:27:e5:a1:2f:2b: + a0:ba:b7:99:69:9d:46:fc:21:b6:45:81:9d:b2:3d: + 2f:76:15:78:b5:33:62:ac:1e:6b:66:dd:27:61:0a: + 47:02:20:2b:57:bb:32:20:dd:06:4c:76:a4:9b:72: + 42:4c:9c:2c:76:72:12:1f:4b:df:1e:11:1f:a9:06: + 54:dc:88:12:b0:49:d5:40:83:ef:7e:48:43:86:7a: + 37:a6:c1:d7:9b:fe:08:34:98:e0:54:3c:30:4f:79: + 15:29 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 + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 26:0C:90:BC:97:12:9E:43:BB:5E:FE:EB:A9:66:B3:C3:EE:B2:18:CB + X509v3 Authority Key Identifier: + keyid:94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 + + Signature Algorithm: sha256WithRSAEncryption + 3e:3c:1f:6c:5b:83:d1:71:15:f5:45:52:fc:7f:67:bc:af:c5: + 92:f5:74:78:13:43:3c:fe:b5:61:bf:00:47:43:45:a0:b9:dd: + a1:10:0c:29:69:2a:6f:7d:67:3d:1e:09:b5:15:74:bf:73:11: + e6:e9:09:b6:6b:b5:cc:1e:06:fd:bd:3a:11:d3:44:bd:ca:7a: + a1:f1:09:43:fc:bf:83:89:3a:b1:18:40:f3:cf:6d:12:ef:6e: + 0c:b7:a4:99:03:8a:4f:0c:3c:2c:23:78:35:2a:99:ea:de:9c: + 1b:e8:8d:19:fb:44:80:13:89:81:c5:05:4b:a7:66:6b:c0:31: + 41:f0:6c:60:aa:ec:d3:4c:ff:c1:3b:d5:bb:0d:42:7d:37:5e: + 80:e7:9c:7e:60:90:0f:a4:4e:70:20:9c:b1:e4:1b:70:65:b0: + ef:bb:41:16:ed:ad:46:ce:34:d3:02:3d:dd:e2:50:fa:3c:5d: + f0:e2:71:f8:9a:ef:a3:32:25:c5:8e:64:f4:46:e1:f4:c0:69: + d2:34:56:8d:d9:c2:6e:b6:55:3b:6a:4d:b6:d2:84:ab:85:7b: + cb:fd:b4:73:40:ba:5d:49:e2:0d:39:77:17:01:49:bb:72:8b: + 3a:c9:b1:e2:cd:13:d2:9c:ce:7d:6c:a8:f0:32:c9:a4:af:56: + 6f:8a:e6:88 -----BEGIN CERTIFICATE----- -MIIB5zCCAVACAxAAATANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G -A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg -QUIwHhcNMTAwMTI5MTE1MDIyWhcNMTUwMTI4MTE1MDIyWjAyMQswCQYDVQQGEwJT -RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIwgZ8wDQYJKoZI -hvcNAQEBBQADgY0AMIGJAoGBAMyaN0kTZtzP4wsToSPteNtOvRH2jA12+aMyVpr4 -oSFqVU5NP+ZnnSaZss2kmtIrWVzXitNgaPgYvcW+FeEqPKPUYcv1EZQXgYH3h4z2 -atLu2OZ39mJmTS4WjQiBSsnGSzHluceKhJZIp0eMDSaQVk7mpW6Ms/Kf/D14m0lu -hoN3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAXh+jU18kExz4KDKwf2lp8w7ANIcQ -A33aFYu9GbgaVjHnhUmByX9FIHQ+icDgJoRRzAQWzmmZAeEmmbPj9b3sX6CE5Dja -dXh7iZzSzWCVILqO43zm33Y6fIl3ApSGETrEYX1vcYMhihf7F+LuAmthwbRSY9fY -RrLFnG84kYo1Mgs= +MIIDyDCCArCgAwIBAgIJAOG0pVw936YVMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV +BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP +MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN +MTQxMjA1MDQ0OTIzWhcNMjkxMjAxMDQ0OTIzWjBnMQswCQYDVQQGEwJTRTESMBAG +A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y +YWNsZTEOMAwGA1UECwwFTXlTUUwxDzANBgNVBAMMBkNsaWVudDCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMjRof6kjPMbF3EbdDUR4A5sQAr7wPfw67vJ +HaHH17CK9vHP+mvQeWTru2mlDYAG31IU0oUyz7/OKkcoW80LKKu7BzPVi9O0csSm +tcw3uQOoeFYlWB8XMHzRCrvsPKMDkJeZkkmus1eWXBrp6AIjrsjJBVBj5XehmnMG +dA5GUCjYyU/EHDe4UhgLrxkr1OVmdKTz8NoJMPe8DMmbzlcGBCfloS8roLq3mWmd +RvwhtkWBnbI9L3YVeLUzYqwea2bdJ2EKRwIgK1e7MiDdBkx2pJtyQkycLHZyEh9L +3x4RH6kGVNyIErBJ1UCD735IQ4Z6N6bB15v+CDSY4FQ8ME95FSkCAwEAAaN7MHkw +CQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2Vy +dGlmaWNhdGUwHQYDVR0OBBYEFCYMkLyXEp5Du17+66lms8PushjLMB8GA1UdIwQY +MBaAFJRloaOHz7/BdLvYhJe2a+6ykHOyMA0GCSqGSIb3DQEBCwUAA4IBAQA+PB9s +W4PRcRX1RVL8f2e8r8WS9XR4E0M8/rVhvwBHQ0Wgud2hEAwpaSpvfWc9Hgm1FXS/ +cxHm6Qm2a7XMHgb9vToR00S9ynqh8QlD/L+DiTqxGEDzz20S724Mt6SZA4pPDDws +I3g1Kpnq3pwb6I0Z+0SAE4mBxQVLp2ZrwDFB8GxgquzTTP/BO9W7DUJ9N16A55x+ +YJAPpE5wIJyx5BtwZbDvu0EW7a1GzjTTAj3d4lD6PF3w4nH4mu+jMiXFjmT0RuH0 +wGnSNFaN2cJutlU7ak220oSrhXvL/bRzQLpdSeINOXcXAUm7cos6ybHizRPSnM59 +bKjwMsmkr1ZviuaI -----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/client-key.pem b/mysql-wsrep-5.6/mysql-test/std_data/client-key.pem index 205b5f31..e0aae4f2 100644 --- a/mysql-wsrep-5.6/mysql-test/std_data/client-key.pem +++ b/mysql-wsrep-5.6/mysql-test/std_data/client-key.pem @@ -1,15 +1,27 @@ -----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 +MIIEowIBAAKCAQEAyNGh/qSM8xsXcRt0NRHgDmxACvvA9/Dru8kdocfXsIr28c/6 +a9B5ZOu7aaUNgAbfUhTShTLPv84qRyhbzQsoq7sHM9WL07RyxKa1zDe5A6h4ViVY +HxcwfNEKu+w8owOQl5mSSa6zV5ZcGunoAiOuyMkFUGPld6GacwZ0DkZQKNjJT8Qc +N7hSGAuvGSvU5WZ0pPPw2gkw97wMyZvOVwYEJ+WhLyugureZaZ1G/CG2RYGdsj0v +dhV4tTNirB5rZt0nYQpHAiArV7syIN0GTHakm3JCTJwsdnISH0vfHhEfqQZU3IgS +sEnVQIPvfkhDhno3psHXm/4INJjgVDwwT3kVKQIDAQABAoIBAFrliE2abbIcMSAh +LRhYXvIoTVSrX0za39i/z4nKyvY98EjDurXSRyBHEy1eaB3q/mpIwoFH3oES8FAF +FIha5K3Wmgv8PK42nzwjuWYWUsg1GULk5F4uQOQ+On2VEF0439m+yVhQmxyqEkac +WUeenx6C3sTkcpkTrLUj1qQfb2kM6JmeGsXfJNFLP/U36x8Q6kp2089DxBFgVcFu +W3ge24W08umDBKuZWIF5B9GX8JFzmbAwPT2KATppGeroX0+bo4KAts4F1dBKmbrm +3815kqYnz+VqyWbw6AHUA7aw2TY6QIT1oHrm+EdfnOQZaf8d/2CHWlIZPmxB46Lz +6zQTVgECgYEA/L9awju31alISm0WYOPZBBndIHsOve4iKcMmy85GTKSvV+cAvgAZ +uQwabZi4ZYHYaa4LPF0hbTb5IdV6krQzGYXpAjlwaarW0Zx4VoQIErWyji79OnFD +QpbzIPGQiUAc0D7Gk7kJpwNmpgjyYcSkjEibF4cFEhDpTVlccbgxboUCgYEAy2c0 +tIfKiu1hwo/8UdcO4LQ6LWJdbIDdNU45HCk/IhIe4FrB0pXnk1yIBBn0ezY7Mgzy +USYlfPTjFmnQOFF/6bHyGmeB4YTYamlTDuHlUUdH76brCZ3ywUlqpToiAPJFjx36 +nTNjo8JLF7eyjMOy4uN6eJzzS7OP9GwsHllux1UCgYBeFLCo+me8va2uHpsk58th +TmtUatoa8uh+mSj41kiuwOKQGunYz9rDWfEAeMey6TlwZRvDlXsa10q3QGrG7xLS +XllUvaLNgo1CKzdUJQOIS2AysuUJ+x0pTV0lFyZRIK9ZCPUMCeXA6HAuP8hRgkwp +9+DbSiQmDGt7olbZ8dFcrQKBgQCOFzzUWH//aTD/z8H+EfQMuRpjFfIZmDPvxwNS +TuYRkQMMy5nW2G17ngpOgyss34eewTiNw84waoow4B5bGWP4Bx0PoPs0Za8hNw6U +uO2PR/JS0hIjF7m7mOPtJJ0YeCZrgg/OvVV/0nzOxr7uYs+WfD7T/yBe48NOhjqT +wPoIOQKBgGRLd3G8b0AbPTv4NVwzIl3xKHCKYd1EcBbfyPWjAZ8+BagEPK8mJfOt +MXkMrSKOq6ShEfzRsdJna7eI0te3zNXXFu/G3IHQZUdC0RtksW5T9tXvASRN3wnX ++aaoIM1q/KUgfH0TF/1pQPHFSUfFrGyLDiCDUu1sJ2ijULr5rZES -----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/server-cert.pem b/mysql-wsrep-5.6/mysql-test/std_data/server-cert.pem index 5922fe7d..f6acc62f 100644 --- a/mysql-wsrep-5.6/mysql-test/std_data/server-cert.pem +++ b/mysql-wsrep-5.6/mysql-test/std_data/server-cert.pem @@ -1,41 +1,82 @@ Certificate: Data: - Version: 1 (0x0) - Serial Number: 1048578 (0x100002) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB + Version: 3 (0x2) + Serial Number: 16263805969935345172 (0xe1b4a55c3ddfa614) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA Validity - Not Before: Jan 29 11:56:49 2010 GMT - Not After : Jan 28 11:56:49 2015 GMT - Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=localhost + Not Before: Dec 5 04:48:40 2014 GMT + Not After : Dec 1 04:48:40 2029 GMT + Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=localhost Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (512 bit) + Public-Key: (2048 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 + 00:e9:20:e7:05:51:07:3a:48:b9:e2:62:a2:24:45: + 1f:f1:54:34:22:5c:62:86:9b:01:e8:c2:45:90:00: + 8d:4e:e4:a2:ea:e9:d7:b5:95:25:ce:18:ac:1a:4f: + b3:e6:30:46:af:20:13:40:84:df:21:dc:df:09:e5: + a0:7f:81:12:6e:1e:84:58:5c:a1:11:db:aa:b6:04: + e0:fc:1e:0c:11:2e:f3:30:62:1a:f9:ee:df:fe:a3: + d3:d6:83:6e:ad:e8:8d:98:89:b1:69:63:b8:72:f4: + 5a:e6:22:5e:73:64:95:ef:56:92:92:0b:e1:93:a5: + d7:4c:41:47:e7:31:ed:09:68:b3:c5:6e:c1:1b:01: + 39:bb:f1:8f:bf:ba:f4:02:e2:e5:e5:9e:b7:d6:9a: + b2:94:76:9b:48:d8:27:18:0e:9f:30:98:f5:9a:3e: + 23:e6:3b:4a:48:ee:a5:26:e8:80:94:37:e4:4a:ba: + ff:9f:42:b9:32:dd:7a:9d:63:11:a8:25:99:b1:1f: + 86:e5:7c:b1:31:e3:12:11:0c:eb:f6:1d:02:4b:1d: + 34:cb:74:1d:7f:2f:40:c0:81:e2:04:d4:8e:ea:96: + f8:22:35:8e:ab:b6:99:33:36:ef:b5:83:11:88:6d: + 06:0f:76:4d:bf:db:a8:df:6c:3c:91:e2:ba:73:a0: + 73:45 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 + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + E4:31:D8:D5:06:EA:C6:B3:A2:F6:01:39:8F:58:08:36:2C:7B:3F:DB + X509v3 Authority Key Identifier: + keyid:94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 + + Signature Algorithm: sha256WithRSAEncryption + 46:ef:cd:bf:c1:ef:36:a9:cb:99:b5:be:e2:a7:ba:69:0d:f5: + 9b:63:39:78:32:35:01:a8:b9:f1:70:0e:b5:d1:8f:94:2e:7a: + cb:65:d4:d0:b4:ad:52:b8:51:5f:64:2e:a8:08:a5:71:fe:c2: + 35:8a:0d:28:26:e5:be:ca:d7:f4:79:54:e1:27:8f:87:92:d3: + 04:72:1b:cc:c4:7f:8b:26:09:92:2d:c8:6f:27:da:97:31:80: + 0f:83:84:9c:e0:a4:88:c9:e3:8f:35:e7:de:bd:31:e2:fa:52: + 83:de:ee:5c:60:6e:8f:a5:8d:5e:53:41:18:42:f3:03:0b:05: + 0b:59:09:42:2e:1b:0b:29:b3:fe:11:3b:d5:ad:3f:4d:24:e8: + c0:da:4c:0d:93:94:ec:cd:18:0f:66:cd:03:d3:ee:a0:b2:7f: + 64:d7:39:66:19:72:9f:64:43:38:b4:b6:b3:ea:6f:39:e7:09: + 98:90:9f:6c:f5:e8:b3:2e:09:8d:7b:76:65:30:f4:c4:9b:8e: + 10:4e:9b:8c:93:63:44:9d:2b:8a:f3:f0:cf:f8:7b:65:95:38: + fb:b4:92:e8:6c:11:03:a2:a2:2f:ea:e0:22:b7:cd:cf:0d:a5: + 91:23:14:47:0c:34:8f:f1:11:cc:e8:1e:37:53:ec:a1:01:81: + 20:c0:2c:f5 -----BEGIN CERTIFICATE----- -MIIBtzCCASACAxAAAjANBgkqhkiG9w0BAQQFADBEMQswCQYDVQQGEwJTRTEQMA4G -A1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwg -QUIwHhcNMTAwMTI5MTE1NjQ5WhcNMTUwMTI4MTE1NjQ5WjBGMQswCQYDVQQGEwJT -RTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNVBAMT -CWxvY2FsaG9zdDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDN5IdRnXIRoNH685KL -Exzr9+KaL3Ko1mVI0WmvG8BME+VgYFFB6aumvBO7DF4yfNlsns0FJIR424CRLtiI -K8LtAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAc86cbjlGtBS+2j/zG7qQvCND14Iq -cE6m2VplXLffcd91d8WApK/60lni/cmc8JiVjmmpjHzYb0jS4zbgzf8/0aXmq3UJ -xFAQxJbdvzveMkbaykrx1lKKMy+r9S5wP9ScvgDIA/k5it9bcDxA7wO+fD0dMjLz -UYHigzBuPTib+zw= +MIIDyzCCArOgAwIBAgIJAOG0pVw936YUMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV +BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP +MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN +MTQxMjA1MDQ0ODQwWhcNMjkxMjAxMDQ0ODQwWjBqMQswCQYDVQQGEwJTRTESMBAG +A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y +YWNsZTEOMAwGA1UECwwFTXlTUUwxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAOkg5wVRBzpIueJioiRFH/FUNCJcYoab +AejCRZAAjU7kourp17WVJc4YrBpPs+YwRq8gE0CE3yHc3wnloH+BEm4ehFhcoRHb +qrYE4PweDBEu8zBiGvnu3/6j09aDbq3ojZiJsWljuHL0WuYiXnNkle9WkpIL4ZOl +10xBR+cx7Qlos8VuwRsBObvxj7+69ALi5eWet9aaspR2m0jYJxgOnzCY9Zo+I+Y7 +SkjupSbogJQ35Eq6/59CuTLdep1jEaglmbEfhuV8sTHjEhEM6/YdAksdNMt0HX8v +QMCB4gTUjuqW+CI1jqu2mTM277WDEYhtBg92Tb/bqN9sPJHiunOgc0UCAwEAAaN7 +MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQg +Q2VydGlmaWNhdGUwHQYDVR0OBBYEFOQx2NUG6sazovYBOY9YCDYsez/bMB8GA1Ud +IwQYMBaAFJRloaOHz7/BdLvYhJe2a+6ykHOyMA0GCSqGSIb3DQEBCwUAA4IBAQBG +782/we82qcuZtb7ip7ppDfWbYzl4MjUBqLnxcA610Y+ULnrLZdTQtK1SuFFfZC6o +CKVx/sI1ig0oJuW+ytf0eVThJ4+HktMEchvMxH+LJgmSLchvJ9qXMYAPg4Sc4KSI +yeOPNefevTHi+lKD3u5cYG6PpY1eU0EYQvMDCwULWQlCLhsLKbP+ETvVrT9NJOjA +2kwNk5TszRgPZs0D0+6gsn9k1zlmGXKfZEM4tLaz6m855wmYkJ9s9eizLgmNe3Zl +MPTEm44QTpuMk2NEnSuK8/DP+HtllTj7tJLobBEDoqIv6uAit83PDaWRIxRHDDSP +8RHM6B43U+yhAYEgwCz1 -----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/server-key.pem b/mysql-wsrep-5.6/mysql-test/std_data/server-key.pem index 1083495c..89aead41 100644 --- a/mysql-wsrep-5.6/mysql-test/std_data/server-key.pem +++ b/mysql-wsrep-5.6/mysql-test/std_data/server-key.pem @@ -1,9 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAM3kh1GdchGg0frzkosTHOv34povcqjWZUjRaa8bwEwT5WBgUUHp -q6a8E7sMXjJ82WyezQUkhHjbgJEu2Igrwu0CAwEAAQJBAJuwhFbF3NzRpBbEmnqJ -4GPa1UJMQMLFJF+04tqj/HxJcAIVhOJhGmmtYNw1yjz/ZsPnfJCMz4eFOtdjvGtf -peECIQDmFFg2WLvYo+2m9w9V7z4ZIkg7ixYkI/ObUUctfZkPOQIhAOUWnrvjFrAX -bIvYT/YR50+3ZDLEc51XxNgJnWqWYl1VAiEAnTOFWgyivFC1DgF8PvDp8u5TgCt2 -A1d1GMgd490O+TECIC/WMl0/hTxOF9930vKqOGf//o9PUGkZq8QE9fcM4gtlAiAE -iOcFpnLjtWj57jrhuw214ucnB5rklkQQe+AtcARNkg== +MIIEpQIBAAKCAQEA6SDnBVEHOki54mKiJEUf8VQ0IlxihpsB6MJFkACNTuSi6unX +tZUlzhisGk+z5jBGryATQITfIdzfCeWgf4ESbh6EWFyhEduqtgTg/B4MES7zMGIa ++e7f/qPT1oNureiNmImxaWO4cvRa5iJec2SV71aSkgvhk6XXTEFH5zHtCWizxW7B +GwE5u/GPv7r0AuLl5Z631pqylHabSNgnGA6fMJj1mj4j5jtKSO6lJuiAlDfkSrr/ +n0K5Mt16nWMRqCWZsR+G5XyxMeMSEQzr9h0CSx00y3Qdfy9AwIHiBNSO6pb4IjWO +q7aZMzbvtYMRiG0GD3ZNv9uo32w8keK6c6BzRQIDAQABAoIBAQDUbdzVJV6Wp4pq +VUI2Fp7iwr22ycQlr71voQbODxK0XvZtZKPgnIWUZTr9xr7A9CCUl3+zfN/t9Vtv +o0Q6qxxmJ3ylH9LNeQL3VT7FvYN1bPjAj8TRFfAaEqKHh8AkzBGqe12kEPAUH8Fs +jsjOEUvmiVaJqjXk2mty2tFwRDggJwCrN5bXkhkzwhDcMfH2Wgc4c4XkyUrciJQU +ua4d0L354B3UmRYtrzwPr6WHLXCGPGhyWvXYpDjjdUGMVf2YcBSQdABF+mhCEb2b +NP4dYUqKHjKn6p4B1/qfJtf0c9Lz229nz0WTzanmpXaNxQVce0sTbktp5A3itT+m +NlQfDNoBAoGBAPvqSK7NqCrvFYEo+Cvl6fOhq9li2zAeaYO7D+AKiWSJzG9KK/Ts +F+28nnWkBEdzAnmgWZ7UZlUwHqF6DNIGn+RLHDJ2MVRrZug2irCR8g2mxcHk2dss +DcmUtsatjCbjLqVCcyuuQylP2GWK60JmRbdKEOfpHLntzGStpOhn5FPBAoGBAOzo +okk2FWZlymJTkN2HYTqvUCYINDciTDm/ms7YGC6YKdDJ8PUVq6qJ2GO/M+zGPQtV +A+qFWqx1kk3K5uLPnZLCPLORXPIm0X1ZGreG+rHsrJTnP6uh9OxrTyLNkvt6xcm7 +yA51QOWTuRbYhPwy05IqT3Z88HkHByMKr4xafPCFAoGADff1w8ufkZHkTV8qM7Tx +/hJu5wT2RnrJOwa6YJ/08mA5t8oTGeelhAc7eiZ4HkYgUwIzNf1tFzgt2qJb56F6 +aDxJ+fpXzeiOsj2j/xp4o40l1hSMh/yvXwgiAm5JITbjtUI0BK4LB1VoGGlVlj75 +iqpOua1RbHXlKYf/Zuur24ECgYEAqXDFSWmGKsOY2XR9QwQltUxYHat2dQxxykfR +GCmUOhcYqT0VuqSyL/oBK25AXBN465b1gxG3xWsdpcf+FLB7OdD0i1XnTUYYRPeq +1SKUQRdOY/11G3Ntcn5ZjkHL41NvDRbiQfz42noqQj2/94T+rybVyKAZeeZd42Es +J0082OUCgYEAnguGJxhfSryD3a2kAQ/6s+L303rgXkRt+/luoopdm7vu2AcnaP7L +aK4dCDusp/DZyGn8/ebDCGNIaVEMJVHAPLFbhJA9E9HCjfC33RdklCO/aGDtXsiq +kzg3mqPHTCPCpmpr5YAtuLONczP1qgB04/vqb2S5eANC+5k6mEifu2U= -----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/server8k-cert.pem b/mysql-wsrep-5.6/mysql-test/std_data/server8k-cert.pem index e71ba572..dfae47b0 100644 --- a/mysql-wsrep-5.6/mysql-test/std_data/server8k-cert.pem +++ b/mysql-wsrep-5.6/mysql-test/std_data/server8k-cert.pem @@ -1,51 +1,207 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 10754692786786449447 (0x9540581bd8dcb827) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA + Validity + Not Before: Dec 5 04:50:48 2014 GMT + Not After : Dec 1 04:50:48 2029 GMT + Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=Server + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (8192 bit) + Modulus: + 00:d8:8f:9d:66:66:9c:12:ca:0a:ad:9e:9f:05:66: + 6c:6c:8a:db:19:9f:a2:d0:fa:38:dc:de:c5:a6:94: + 60:0d:4b:72:c9:85:e2:ff:27:c8:d4:ce:b1:29:66: + 31:e7:2b:4e:08:b3:a2:71:cf:1e:36:7c:8e:4d:08: + 6e:fd:7a:ea:c1:0d:5c:97:09:66:fa:ed:0b:36:64: + 8f:cc:39:35:a9:43:6c:a9:17:48:0f:2e:0a:4b:d3: + 94:bb:b0:5b:43:f1:4e:f7:e5:30:e1:ae:a2:a8:5d: + 3c:db:39:df:d6:4b:70:a6:c9:68:c3:f3:9d:19:d7: + 2f:2a:38:31:11:ab:f1:60:66:c3:38:4f:d9:6f:b5: + 49:df:ce:14:b5:fa:c8:95:04:50:69:90:9d:26:c2: + e9:07:69:7b:a2:d8:91:e7:cd:de:c4:ed:9c:e4:c8: + 8c:e3:a0:cd:dd:2b:37:21:8f:ee:54:38:91:2b:2b: + 01:86:90:f0:2e:9a:06:8a:e1:f2:a2:3f:d1:d4:21: + 9f:b0:81:eb:d0:e9:d3:e9:a9:28:6e:c2:06:4b:94: + 6e:96:70:f5:31:33:dd:97:2f:cc:5d:80:c5:74:ce: + c0:3d:b2:6a:81:b7:ce:65:4f:6a:49:3e:c9:5d:00: + 3c:06:4a:57:c9:a7:f9:bb:46:50:df:64:dc:13:1f: + 22:ad:21:0b:aa:4b:5d:94:60:9f:20:ff:28:aa:56: + 5f:f6:cd:23:34:fe:44:a2:d6:80:bd:a9:67:00:d6: + a1:82:82:9f:c9:e8:0c:97:26:1e:a9:b1:e2:ee:01: + ef:9d:c6:82:fc:72:33:02:40:35:cc:ae:51:23:f4: + f8:92:29:d3:2f:5c:1f:03:c6:81:7d:fb:4f:e9:de: + ed:68:3c:a1:be:7c:fa:11:96:2b:5a:10:c5:c5:cb: + 2e:7a:54:4c:7b:12:b8:07:01:d9:b5:38:0f:a6:43: + 70:28:81:8d:d7:95:ad:d6:e8:88:b4:19:62:05:7b: + 75:c0:2d:24:72:1c:4d:04:a3:f7:1d:6b:8b:fa:16: + a3:5a:6c:51:ba:5c:62:fa:3e:82:7f:4e:10:db:d0: + 52:d4:81:df:0e:5b:33:7e:20:77:1d:51:ca:4e:13: + ee:cd:72:36:28:b4:31:88:3d:61:0f:1a:80:19:f6: + 7d:71:5d:21:1f:dd:0b:d9:73:88:a9:72:4b:8d:a3: + d6:f1:4f:5d:01:6e:9e:c2:28:97:80:de:5b:2d:ac: + a3:c9:24:db:e9:0f:2b:36:ee:a7:f2:94:c1:41:7a: + 70:9f:fd:d0:31:a9:de:55:38:65:89:20:f4:02:f1: + 83:73:40:77:db:35:d2:66:ff:26:5f:f4:d2:e6:f9: + ba:fc:6a:66:b1:02:24:04:a3:32:4b:21:85:83:b4: + 6a:97:3c:25:7f:65:cc:a6:dd:cc:ac:e5:22:09:58: + dc:a1:0d:7d:b4:ac:98:98:81:1d:a7:83:d4:3a:e4: + 39:a7:04:6a:b6:b7:5d:a8:fe:0e:47:08:1d:95:61: + eb:a8:97:53:91:1e:ca:1f:3f:19:5a:01:73:da:33: + 32:d7:33:ca:39:1e:00:37:6b:f8:18:47:30:3a:2e: + 99:39:d0:d0:49:6d:87:c1:98:59:d0:21:ca:12:6d: + 89:33:0f:f2:52:6e:d6:c5:78:dd:15:b6:11:d6:5e: + 72:e8:c7:12:00:c3:8d:57:34:e5:d8:6d:a2:e8:47: + 79:83:8c:49:17:3b:75:24:0d:de:e1:3b:dd:bc:b7: + df:89:a6:31:e6:49:37:80:f8:8f:86:e3:42:f4:2e: + dc:de:58:45:c4:41:a9:2d:a6:5d:f0:7d:81:3d:54: + f4:8a:a3:5f:18:7c:02:c9:7f:1c:f5:9f:dd:0a:29: + 49:40:92:24:b3:b7:65:37:91:9a:a8:00:c4:4e:7f: + 7e:f7:97:de:24:2a:d7:3b:f2:a2:63:ec:38:b7:1f: + 9e:b5:72:99:bd:b1:c0:41:6a:57:97:e2:fb:11:32: + ba:a3:5d:82:48:c5:0a:cc:2c:f5:21:7a:f1:99:56: + 1b:54:9d:c7:64:50:62:80:94:50:5a:40:32:61:f3: + 2c:f8:09:dc:f0:6d:2b:60:29:c2:86:70:5a:57:12: + 7d:09:73:ca:41:6d:22:61:18:1a:48:cb:80:95:be: + 08:e8:15:99:de:36:3a:bf:09:67:35:e8:53:d9:40: + 1b:27:e5:14:32:09:73:e0:f6:a9:19:ee:81:90:dc: + b7:9d:b6:91:51:33:1e:1f:22:e0:bd:df:a8:d1:33: + a7:ab:9b:9c:27:7a:3c:ef:aa:9e:4d:f8:a8:97:63: + 24:20:c8:36:ab:05:8a:c0:80:9b:64:0c:1f:ec:4f: + de:ec:f0:9c:9c:54:db:02:ab:12:aa:ab:58:a3:49: + 25:bf:6a:0a:04:7f:2f:1d:41:11:23:4e:e2:83:51: + e3:f5:12:95:22:72:13:f4:be:6f:e2:00:29:4f:fe: + 9b:ae:b9:e2:7d:72:d3:1b:e8:12:3b:6d:b6:d2:62: + a4:91:31:46:e7:16:7f:9d:8d:74:5e:97:51:d1:cb: + 82:57:bb:bd:46:e4:9c:c5:bd:08:8b:68:20:f8:5e: + d6:aa:ed:6e:4d:ba:a4:29:fd:ac:5c:2f:25:14:d3: + 19:63:0c:01:75:6c:87:a5:0b:29:09:7f:13:7f:00: + d4:63:72:e2:a0:39:88:80:68:2c:3f:49:b1:9b:94: + 77:63:08:05:55 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 3E:96:BB:23:C2:FD:41:11:7F:EB:63:9B:39:5F:58:2D:92:A0:F0:9F + X509v3 Authority Key Identifier: + keyid:60:57:8F:09:CF:83:86:4B:35:32:BF:73:EB:81:4C:DB:36:27:12:8F + + Signature Algorithm: sha256WithRSAEncryption + 19:b8:4d:94:a3:41:1b:78:e8:fa:da:7c:c3:0c:f5:42:6a:2e: + 04:8c:f4:6e:90:e0:d1:55:28:7c:97:85:18:12:c4:ff:d3:ba: + 74:f1:7f:af:b0:ab:4d:64:f4:45:58:6e:b1:2e:06:cc:a7:5b: + cd:25:8f:60:68:14:e1:f9:56:21:40:43:e4:c4:ee:91:72:01: + 7d:86:41:2f:ac:6d:be:c6:1a:2a:ae:dd:13:ca:51:01:37:33: + 7e:b9:1a:9a:28:16:8c:bc:d1:e7:d4:46:55:87:1f:05:93:4c: + b5:75:ff:ed:ca:29:b2:5d:15:05:4c:02:a9:53:3c:d9:11:01: + 04:db:82:ad:01:ad:4e:d4:7d:9e:6a:00:5e:cc:88:83:42:98: + 6e:4b:cd:7c:55:c6:4c:98:39:db:d1:e3:aa:f3:27:83:6a:3c: + 01:ad:c5:ee:ef:01:aa:b7:4d:f7:a1:86:34:9d:61:20:7c:a0: + c0:75:26:24:6f:a3:68:0e:03:4d:cf:f3:bf:d9:40:4f:1a:04: + 4d:9c:5e:62:49:37:5b:78:ee:c5:11:78:ee:e5:87:f7:f4:f1: + 6d:0d:bd:a2:fb:a2:6c:27:91:d4:84:43:03:f5:9b:11:50:ab: + 45:ca:7c:3d:fe:5c:6b:e1:03:20:c8:c9:ac:66:ff:74:6e:0d: + 87:47:75:77:41:ca:5e:e9:77:5f:2b:09:bb:a5:7d:fc:cf:ed: + 75:dd:b0:ee:b8:da:3e:59:d0:e2:7f:38:16:fe:04:c9:99:d1: + 06:84:11:b1:07:8a:4d:59:d6:70:c3:9b:f7:f8:b9:ae:99:86: + b6:31:a4:13:de:7e:23:27:33:96:d1:9b:15:65:98:04:e5:f8: + 73:3c:f3:72:ef:a1:28:06:1d:7e:88:52:c1:f7:eb:2a:e1:f7: + 57:e5:ed:08:e9:ee:f8:95:3d:ec:4c:98:93:e7:e1:ea:a5:02: + 37:c1:66:18:ba:01:78:05:6d:c4:6b:2c:61:ee:bf:a9:e1:4d: + bf:95:31:f5:28:2a:f8:c9:ce:72:a5:c7:a3:38:2c:f6:69:34: + eb:cb:e9:b3:4f:78:de:87:61:8a:34:bd:5a:64:27:f0:42:1a: + 22:e9:2b:ac:97:f1:ed:7a:50:3b:3e:18:ae:b7:d9:20:9b:d6: + 12:3b:18:b1:47:71:39:0a:31:54:9f:fe:f2:90:d7:b8:27:6b: + 49:e5:82:cd:82:99:95:b1:ab:aa:1f:7a:e4:4e:6e:46:91:a7: + 16:b8:09:a3:5b:ec:6f:57:ca:b4:4f:69:e7:f5:f3:b9:03:93: + 08:90:9d:8d:57:82:77:bc:69:f8:e4:46:d9:4d:d1:25:ea:b8: + 60:b0:e2:cd:0c:ff:c2:63:65:20:f4:2c:34:36:34:a3:cf:67: + 6a:01:3e:51:5f:4a:49:26:9d:30:3f:03:05:70:22:b1:e3:46: + d1:ff:23:23:45:08:4b:0e:77:db:91:d9:a2:5c:15:48:49:ee: + 08:48:90:c3:25:44:b7:7b:9f:82:96:7e:8e:91:91:e5:a0:4d: + af:04:b8:72:df:07:a0:4b:02:79:0e:38:05:47:61:c3:9e:b4: + bf:01:00:10:c3:12:44:64:12:7a:bc:e1:c8:41:e5:cb:0d:7c: + 52:32:7f:71:c1:3f:6e:d3:81:d3:12:ec:85:4c:16:72:d2:79: + f8:bf:c0:fe:31:14:47:53:20:87:73:bb:34:8f:60:4a:9e:91: + 35:6e:20:96:da:bd:4b:7e:bd:c7:c4:f9:25:54:40:2c:9d:b0: + 8b:b5:fb:1e:74:59:a5:f7:b9:b7:23:56:3b:eb:2e:0a:eb:f5: + 10:9b:88:5b:49:8e:0f:05:61:7b:e5:a9:a0:24:f2:16:3f:cb: + 5b:06:d6:a5:bb:94:3a:46:2e:43:c5:02:67:b1:7d:5d:b6:c0: + f9:93:2a:d6:18:95:89:73:ff:3b:a1:f3:a6:bd:5b:6a:f0:e0: + 11:e8:95:09:83:5d:69:c3:91:e8:88:ea:b2:7c:32:73:a8:b0: + a4:24:d8:e5:6f:c7:97:8b:3e:c7:1e:69:6a:2a:b7:db:d1:26: + 7b:94:83:27:6d:d2:82:58:dd:a7:c2:74:0d:43:13:e2:c5:96: + 9f:3c:00:40:1a:10:b1:da:62:23:2e:b7:5c:33:61:56:3b:8b: + b4:b9:01:64:71:67:82:7c:18:2c:e8:d9:cf:e7:da:4b:16:7a: + 91:67:af:82:0e:ac:7a:c9:cc:47:9b:84:b9:49:e8:3d:33:a4: + 66:3f:c3:c1:20:ba:d1:0e:1e:11:80:82:78:90:25:a4:bc:80: + a2:25:8a:5c:de:3c:59:52:2f:b3:50:bb:0b:5a:f1:96:8d:d2: + eb:b9:f1:e9:72:a8:ae:f2:15:fd:5a:9c:a3:e8:ca:26:e9:67: + 80:13:38:1f:38:9f:85:8a:82:3c:4f:d3:04:ff:3a:13:f7:b5: + 13:f7:e3:50:1d:d6:e1:e6:1e:d0:b4:c8:5e:21:d7:22:cc:01: + de:db:d1:c4:a2:5c:0b:dc:dc:2f:08:e4:2e:12:c5:4a:bc:a1: + b3:92:32:1e:05:5c:7e:ca:43:6e:2e:06:3f:27:fd:1b:75:f0: + 01:42:8d:ff:aa:f8:f1:47:5b:56:67:74:66:1b:aa:b5:75:41: + 69:ba:91:66:ce:c3:3a:00:7a:93:59:1c:0c:49:c2:d2:d8:8d: + 7a:57:a4:7d:ba:61:26:1e:e9:aa:ab:e6:cb:2c:16:0a -----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 +MIIJyDCCBbCgAwIBAgIJAJVAWBvY3LgnMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV +BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP +MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN +MTQxMjA1MDQ1MDQ4WhcNMjkxMjAxMDQ1MDQ4WjBnMQswCQYDVQQGEwJTRTESMBAG +A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y +YWNsZTEOMAwGA1UECwwFTXlTUUwxDzANBgNVBAMMBlNlcnZlcjCCBCIwDQYJKoZI +hvcNAQEBBQADggQPADCCBAoCggQBANiPnWZmnBLKCq2enwVmbGyK2xmfotD6ONze +xaaUYA1LcsmF4v8nyNTOsSlmMecrTgizonHPHjZ8jk0Ibv166sENXJcJZvrtCzZk +j8w5NalDbKkXSA8uCkvTlLuwW0PxTvflMOGuoqhdPNs539ZLcKbJaMPznRnXLyo4 +MRGr8WBmwzhP2W+1Sd/OFLX6yJUEUGmQnSbC6Qdpe6LYkefN3sTtnOTIjOOgzd0r +NyGP7lQ4kSsrAYaQ8C6aBorh8qI/0dQhn7CB69Dp0+mpKG7CBkuUbpZw9TEz3Zcv +zF2AxXTOwD2yaoG3zmVPakk+yV0APAZKV8mn+btGUN9k3BMfIq0hC6pLXZRgnyD/ +KKpWX/bNIzT+RKLWgL2pZwDWoYKCn8noDJcmHqmx4u4B753GgvxyMwJANcyuUSP0 ++JIp0y9cHwPGgX37T+ne7Wg8ob58+hGWK1oQxcXLLnpUTHsSuAcB2bU4D6ZDcCiB +jdeVrdboiLQZYgV7dcAtJHIcTQSj9x1ri/oWo1psUbpcYvo+gn9OENvQUtSB3w5b +M34gdx1Ryk4T7s1yNii0MYg9YQ8agBn2fXFdIR/dC9lziKlyS42j1vFPXQFunsIo +l4DeWy2so8kk2+kPKzbup/KUwUF6cJ/90DGp3lU4ZYkg9ALxg3NAd9s10mb/Jl/0 +0ub5uvxqZrECJASjMkshhYO0apc8JX9lzKbdzKzlIglY3KENfbSsmJiBHaeD1Drk +OacEara3Xaj+DkcIHZVh66iXU5Eeyh8/GVoBc9ozMtczyjkeADdr+BhHMDoumTnQ +0Elth8GYWdAhyhJtiTMP8lJu1sV43RW2EdZecujHEgDDjVc05dhtouhHeYOMSRc7 +dSQN3uE73by334mmMeZJN4D4j4bjQvQu3N5YRcRBqS2mXfB9gT1U9IqjXxh8Asl/ +HPWf3QopSUCSJLO3ZTeRmqgAxE5/fveX3iQq1zvyomPsOLcfnrVymb2xwEFqV5fi ++xEyuqNdgkjFCsws9SF68ZlWG1Sdx2RQYoCUUFpAMmHzLPgJ3PBtK2ApwoZwWlcS +fQlzykFtImEYGkjLgJW+COgVmd42Or8JZzXoU9lAGyflFDIJc+D2qRnugZDct522 +kVEzHh8i4L3fqNEzp6ubnCd6PO+qnk34qJdjJCDINqsFisCAm2QMH+xP3uzwnJxU +2wKrEqqrWKNJJb9qCgR/Lx1BESNO4oNR4/USlSJyE/S+b+IAKU/+m6654n1y0xvo +EjttttJipJExRucWf52NdF6XUdHLgle7vUbknMW9CItoIPhe1qrtbk26pCn9rFwv +JRTTGWMMAXVsh6ULKQl/E38A1GNy4qA5iIBoLD9JsZuUd2MIBVUCAwEAAaN7MHkw +CQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2Vy +dGlmaWNhdGUwHQYDVR0OBBYEFD6WuyPC/UERf+tjmzlfWC2SoPCfMB8GA1UdIwQY +MBaAFGBXjwnPg4ZLNTK/c+uBTNs2JxKPMA0GCSqGSIb3DQEBCwUAA4IEAQAZuE2U +o0EbeOj62nzDDPVCai4EjPRukODRVSh8l4UYEsT/07p08X+vsKtNZPRFWG6xLgbM +p1vNJY9gaBTh+VYhQEPkxO6RcgF9hkEvrG2+xhoqrt0TylEBNzN+uRqaKBaMvNHn +1EZVhx8Fk0y1df/tyimyXRUFTAKpUzzZEQEE24KtAa1O1H2eagBezIiDQphuS818 +VcZMmDnb0eOq8yeDajwBrcXu7wGqt033oYY0nWEgfKDAdSYkb6NoDgNNz/O/2UBP +GgRNnF5iSTdbeO7FEXju5Yf39PFtDb2i+6JsJ5HUhEMD9ZsRUKtFynw9/lxr4QMg +yMmsZv90bg2HR3V3Qcpe6XdfKwm7pX38z+113bDuuNo+WdDifzgW/gTJmdEGhBGx +B4pNWdZww5v3+LmumYa2MaQT3n4jJzOW0ZsVZZgE5fhzPPNy76EoBh1+iFLB9+sq +4fdX5e0I6e74lT3sTJiT5+HqpQI3wWYYugF4BW3Eayxh7r+p4U2/lTH1KCr4yc5y +pcejOCz2aTTry+mzT3jeh2GKNL1aZCfwQhoi6Susl/HtelA7Phiut9kgm9YSOxix +R3E5CjFUn/7ykNe4J2tJ5YLNgpmVsauqH3rkTm5GkacWuAmjW+xvV8q0T2nn9fO5 +A5MIkJ2NV4J3vGn45EbZTdEl6rhgsOLNDP/CY2Ug9Cw0NjSjz2dqAT5RX0pJJp0w +PwMFcCKx40bR/yMjRQhLDnfbkdmiXBVISe4ISJDDJUS3e5+Cln6OkZHloE2vBLhy +3wegSwJ5DjgFR2HDnrS/AQAQwxJEZBJ6vOHIQeXLDXxSMn9xwT9u04HTEuyFTBZy +0nn4v8D+MRRHUyCHc7s0j2BKnpE1biCW2r1Lfr3HxPklVEAsnbCLtfsedFml97m3 +I1Y76y4K6/UQm4hbSY4PBWF75amgJPIWP8tbBtalu5Q6Ri5DxQJnsX1dtsD5kyrW +GJWJc/87ofOmvVtq8OAR6JUJg11pw5HoiOqyfDJzqLCkJNjlb8eXiz7HHmlqKrfb +0SZ7lIMnbdKCWN2nwnQNQxPixZafPABAGhCx2mIjLrdcM2FWO4u0uQFkcWeCfBgs +6NnP59pLFnqRZ6+CDqx6ycxHm4S5Seg9M6RmP8PBILrRDh4RgIJ4kCWkvICiJYpc +3jxZUi+zULsLWvGWjdLrufHpcqiu8hX9Wpyj6Mom6WeAEzgfOJ+FioI8T9ME/zoT +97UT9+NQHdbh5h7QtMheIdcizAHe29HEolwL3NwvCOQuEsVKvKGzkjIeBVx+ykNu +LgY/J/0bdfABQo3/qvjxR1tWZ3RmG6q1dUFpupFmzsM6AHqTWRwMScLS2I16V6R9 +umEmHumqq+bLLBYK -----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/server8k-key.pem b/mysql-wsrep-5.6/mysql-test/std_data/server8k-key.pem index 99e74177..9b3f7ed2 100644 --- a/mysql-wsrep-5.6/mysql-test/std_data/server8k-key.pem +++ b/mysql-wsrep-5.6/mysql-test/std_data/server8k-key.pem @@ -1,99 +1,99 @@ -----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 +MIISKQIBAAKCBAEA2I+dZmacEsoKrZ6fBWZsbIrbGZ+i0Po43N7FppRgDUtyyYXi +/yfI1M6xKWYx5ytOCLOicc8eNnyOTQhu/XrqwQ1clwlm+u0LNmSPzDk1qUNsqRdI +Dy4KS9OUu7BbQ/FO9+Uw4a6iqF082znf1ktwpslow/OdGdcvKjgxEavxYGbDOE/Z +b7VJ384UtfrIlQRQaZCdJsLpB2l7otiR583exO2c5MiM46DN3Ss3IY/uVDiRKysB +hpDwLpoGiuHyoj/R1CGfsIHr0OnT6akobsIGS5RulnD1MTPdly/MXYDFdM7APbJq +gbfOZU9qST7JXQA8BkpXyaf5u0ZQ32TcEx8irSELqktdlGCfIP8oqlZf9s0jNP5E +otaAvalnANahgoKfyegMlyYeqbHi7gHvncaC/HIzAkA1zK5RI/T4kinTL1wfA8aB +fftP6d7taDyhvnz6EZYrWhDFxcsuelRMexK4BwHZtTgPpkNwKIGN15Wt1uiItBli +BXt1wC0kchxNBKP3HWuL+hajWmxRulxi+j6Cf04Q29BS1IHfDlszfiB3HVHKThPu +zXI2KLQxiD1hDxqAGfZ9cV0hH90L2XOIqXJLjaPW8U9dAW6ewiiXgN5bLayjySTb +6Q8rNu6n8pTBQXpwn/3QManeVThliSD0AvGDc0B32zXSZv8mX/TS5vm6/GpmsQIk +BKMySyGFg7Rqlzwlf2XMpt3MrOUiCVjcoQ19tKyYmIEdp4PUOuQ5pwRqtrddqP4O +RwgdlWHrqJdTkR7KHz8ZWgFz2jMy1zPKOR4AN2v4GEcwOi6ZOdDQSW2HwZhZ0CHK +Em2JMw/yUm7WxXjdFbYR1l5y6McSAMONVzTl2G2i6Ed5g4xJFzt1JA3e4TvdvLff +iaYx5kk3gPiPhuNC9C7c3lhFxEGpLaZd8H2BPVT0iqNfGHwCyX8c9Z/dCilJQJIk +s7dlN5GaqADETn9+95feJCrXO/KiY+w4tx+etXKZvbHAQWpXl+L7ETK6o12CSMUK +zCz1IXrxmVYbVJ3HZFBigJRQWkAyYfMs+Anc8G0rYCnChnBaVxJ9CXPKQW0iYRga +SMuAlb4I6BWZ3jY6vwlnNehT2UAbJ+UUMglz4PapGe6BkNy3nbaRUTMeHyLgvd+o +0TOnq5ucJ3o876qeTfiol2MkIMg2qwWKwICbZAwf7E/e7PCcnFTbAqsSqqtYo0kl +v2oKBH8vHUERI07ig1Hj9RKVInIT9L5v4gApT/6brrnifXLTG+gSO2220mKkkTFG +5xZ/nY10XpdR0cuCV7u9RuScxb0Ii2gg+F7Wqu1uTbqkKf2sXC8lFNMZYwwBdWyH +pQspCX8TfwDUY3LioDmIgGgsP0mxm5R3YwgFVQIDAQABAoIEAAYjvDClBBO8SqU1 +dAixKK3DGgcV8YW/MlGAt1XLqxV1aCGyfAcD17vAyGEGFrAZGDNC9H4Jgy/ERDyG +2q6xB2rFuDRH/fVrNwApxbHihVTxJml80Xwsr/oKW5MeotfARZ7djo83ZkEjs4/7 +ig8HQIBaAXBcvb13zkyCH1IC7+rtvucfzGhQWXHQ4+Fs5Lbk0mrLwMjSicy9/tVV +En3h5kjq+6G41dW2P1/f08ZN0FHu8J6qr3ZjMYwAreLOGRTkfkxnT6GvbUIU/v8G +3rCVK5yE7sWxGiJ09/lLT53vAqoXGnglUMOwtFdG8xp0fzz1vr3m6ao76uaWTcCn +mV2palBCOZRwYozMWHaVBVAe9sWGd1MPSl7befbmkJcDfry2e1U8EO9QE1p4QpjA +0UxFznzdt/h+XYgaAQ7l6Q4rxWL4V6DBxfYOY+ubeFuWLHe8D1LkUQJSq2i6I+0v +6qMqmrEIKmXq2va5vrpHQgA0rCMFoKqKda72GxaBsSDTEJPrGhxpaiSC88qie4av +C9dQYl69ldjFhTOlIu/DQih3PylDolqoUgLdFA//W9Ai/VdyRuN1i4TlQQUoPSfD +EMLNDLtNQ9C/kUFzI2kZwYHTy/31gQc41ks7NNxv068a7IewsvS2O2rNCBKecLJ8 +jq5urm1cDInYcsicvzfFNx15QwXY6QqJ7qIIsvx2yBdhmEgMBX+eImyic9o30kMr +aYd0bKilOlV/Vi0nYq9ArT3Iwd2RsQHad2ujOTMZyxfHVFIyEgShpQM5XXTN9w8g +QwVI/0ydYdLWktJdjexvJmtJBFeUiCTz5JqCCGz/7mUfJW9XnljVLEd4J53f1PtY +fIgEGkiG1ekUejbPA+Zm1eq2oeOsTkBqqEI3e5hL+R8PL7GKWgaJEY1Io6kcbboX +RPwZeRZo6EjIJPQET3ER5x3Fey0kupercmpKaJ2aN1aZuq2TNUNRFC6n6lPknclJ +VwZsjKoazHdj6usiVNLxC5aI8MJRCuaLDgq+eLz2Au4A7a4MTtXiRG5CxtcYEOwe ++xp4Sov7+aLtn5ECdBvtQigl0E1Qew/xvQIjULSjRNnyPthX/m5FdVfD0Ni3IcT+ +nPnmDK2NYAY5PLGA7ykEMcqlAnjpRWwvsVMiC6zHCVPLhi6dYTyuK7MAvHqfEphJ +OMzF5C9SmsMmZXp5/8lCF6/dIH5vjWphxo7M1Y+5S0cL/3qPqIetVWNJBgGgMec6 +SmNg6tpmeFdTbLDpixOWclGLIb5XUPsEGBy6mrM8rPnGHfCq2hWJTlUBPXGakZAd +gQOURFJSWHa34B2PHaeJSIRWHJBy4aa2mQI8OkBsTLWh/i51gKQlWjeKNiHphsH3 +rGQMYoECggIBAOz+cYvL2uyJIZXQzzUgZAlCSbaQ/DEEiyji7L1hFGLSwy5wEO0S +rC1oCkRbo2/Ios3QDK49JYCk+QvWzIqyFnasQnTj9XCktFSBcKYRPGJnvutkf1X/ +ysO0hHbACIClfUN+mwbDfgVHHswbjSwgHPOuNxljg1TAcRnxQG8lqj3njku0RwUU +fFfTTDmMJawhAAxd7dUxgcb0zI7ge6430/TuTnc8J96Gg7ZsRoGMrFAYTVbtvkj/ +mryLK2aMz2P/cxejMOcSVMQVd5tOBLhsRhETtkjgMar1pT9z8I0E/4iEs6gqcIqr +ll+L6lghBdL+1SwW7MEFekypllMwypzlRD5uws838akoY4Ko03jm0YbA9Zf1Zn2S +gT/q+uhvhZ7IWy9OuMeBIVGhv4EltC7SWuAfHWf7SUyKcEA2yfktPlDSqeywvts6 +CxKCz9xL8P8XSsKz8jMkC7FS5Zs0rn8G3d2sPFjEY9uWABPw8jcMq/w0regwmwt8 +gkGbKnKWKmUMgGBWoQM2gjTAB0Ss1MsOJ1m260d5Wd8pNLzXjcCrHqNh6xQx8DoN +nOTCPRQu9cke/wjzW23ez9Ks9fRa4s9zJMtzc+tq2JH7WHmnehuyPYUPa6ALAcsB +5B5QMXKbTSv/hTGydeYfSBiP1yCG3DyN0miuPS1VREfzaJr6V2Fv/3DFAoICAQDp +7a1eFQ0F8SdD/9I9x9GPMvbhEi2Yz0BHjLOsOEN98EG8c7aA+pYW5AZBj/6m1nFZ +EpvGQkmPHb24v4vxK09kcACMpJC9vkFvrt0GLn4OkiGNouqe2ip6CN7VNJkpMpTs +x3aQ0x6CIEALVukHuDpV6i4TpB9O7bdmrO7hf/2GgsSM8zDGpo6a0Xk/POUVf7l8 +ZY2ZPf/LJVpLEW1YQLljZRJDI62nwgA+dtWnkX92DVT0LuKkisozlyY3+E0sWULE +tizfJdGOqzfnilZBcG5/dDrvaW/OVVQLUjRk6Hhkoudff+mJfNrdJD0t4X9lZxvf +NShlos28HJPkrOeThNhy4za6neTpn7AK6M9YYTelPBI4WyhVZkpvy4ZYnCORRs81 ++byb0l4C3oDxaKu2McTtMFVQ5z2reLNnvPip92zQcPHbmuO+NhP29Gk2sjPp24N5 +DM4c1KYPTz5k3S85V+m1DLyI+uTmh4lqL8Rdn556pKZncJfOFUp+7isauHJMrd5i +ICBtaL+M/hTZlSxFLcxykblo3gqmumIOKzegYSNZ7v8JB/r7VeZ3bQXxGThfB9dw +Tpmef8XKK+ye0Nm//P33C36s5BjukRLUg5xMOHNza74L1zR2ToJgw6nrBJjRNDSt +7EONSp7l8tQotry7C2fVezfUBMcSTHo11qOL7fdrUQKCAgEA5fttWMo04wGYc/g0 +fEu4iDupqN89vJu6J60/K/A/hj8dZb0ez9ElANNL01ZSXjIHu05AX/26nQJ7JAAI +cjesEPHNc/2buvo6fR83oBBt1tjyrx/RajVWIWDWgx6Lobv2uT7tVjzz2E9SFaRO +9Rkcv2S614p4chBmMVSqwLF+aaCBt/l0Sfu9RsUn3VihXk6P63BjUlY+qEH7GFPD +8ib/K1rvDkp0Lj+/JZIhQaqvtPJAazE/TTuuf3VWYqgWweWtXKzi0fo6BCcI8M9f +SVDZFc1ZQZM+37aN6+uo7lCBYYvVhEXa/NbSkFoIygkRy9W8LJL6ob2dFzQjSwu4 +M1VRSnzV051oiE1HdA49WcA0aF5sdlCQax93Cf4QCuvecV3hDyGHsyMeoEckvkFG +f4Fm6sOHF9cFJJ/bmpUQnxxGsswcVjKWo8vJ3ubOq+uOLR3/UL6rNPGv3x6g7mLL +Sz3wpCN2VHYQqZEA9lkF1GIZrB+6++3fJ+BlzyCyqowLDBB7rAGlMqb86A/Jfd1y +irJrgWY/IBclHaixIujTCLuGeeqV4/0qMEvxixTrjOCdZ9UKjTcL7K0iZEGwVLa2 +D7afaEfboAMJs3CERVo+5w2rIar7OE42KTjmlHwh4CPRWfcW3ElgnDaTEjLUAx6c +Lq86FpevioSKRIBzbKGvlkDHVDkCggIAbNL9C/+PB2ygb6nbDJKgkpWK9DmYrLX9 +mUuDamLiQvw6GIlcJbRtjkiWAHoUZVjtchqODTVZMxMK5590YsVbMcZI+ySzkRGp +L2ORvwZx7iVdJp7btvqXOB5YS6ckeV3mmiBQsB8G2lJWeO/9iHHT8ZP3y3tWdUlx +QHrCxnTcZG8BMPERh9iEDtHULe8OQ2ofyBcWQGvvS3oc/z8kNyIlHHAwhrtaVeiS +ZHyz+Dhfq3OYSeBl31YRqt5uESuZ+z+rKAf35/eX/V75quVYKyk6vmA76pSKRtq7 +NmkPpsHfADIooOzIoAVNbAMn0uhMc8f712LLYDzUqOZChudI8/+hEhFRrI83ptd6 +9hhIHT1cvamscDs4EEJ97nQoE6DPiw3954Y+j97VjVAlfCjNePy+N/l8Nx7cOaD1 +FRV8ONW58V4ZpafwutQ9hW0+ZQuRywErsGyclhz3A7hBtnqPNYYIWwmJy8+sHPKA +or2GBGf1OejO4OAoPt74wQPbWZrk0XcxNUTs0Pkh411wJaiX57benY3dS0PAgL/E +TgMc5adK4tOkIXds8u+LP5OgaADrkIn9V2m5XVrjkKHOejN+mSoAm6TlUVjroFAt +CmAPngXE77T3vFppNYBgdtOPgJ2q2egHecGny1sjgKXuvOIF+p3buBySZDe0xHZ/ +g/xOKRKTP4ECggIBAJkMUEiE8iiHdfbB46mGob8sFTFIJitpGLzTXL0BmFBJauI7 +lcz+qKcAd2htF45c3M/IEyFEID4Qywze4qgimFi7pA5Ns9v1gDOZw2lui3vm58o8 +BgStk+MQBYK6/JloxU9FE6UfdZRh0mXf/BY+dAvIbs3ehpgxq7VxULjv7/P+5sOZ +ObMGlE0widtniFv+Nx/L1xX6BSYnpjA4BZjLZzxhvBqQEPotSf0dj/7NGfRuj/r9 +HX5tpekG9vi3WBpWdiCBC+4MRbpXhIb9nhWJch4gjgOFQ15ySzUeBkbAdKhNWNLv +RcF1GyaM2zEHE9XpbAoYBXyik5dsEQM1JVYJP09yXQ4VAB3qwHdWI9z/yrUu48qh +JR+6PqBwVFpy9l7XJlbjPDo2mwiN4v35ngjhxyrYcJAvNe20gilAbTDCrDfFYAV6 +FS4oSDiRASVUcl+zeTcdNKrjVAtBE/qxkx3u9gJ/qowP6dvG+i42Bb4Cndv9sLEn +EX/23kIIt+SIJizrwGpjHpVeWrCkFBB+1IdvbTl1C3DHRXf78XGUeS90EoL4XupP +6fv45eHDMCccUoTj3r/eqFTxXrHl4LJ7Dj+H+kX6AJhr2eL78RiJIud0xOifPIOy +/g2eOU1OXnlz7Y0X7Vw74ECqKGtB1Pg7kh7KbCGDHscC+fD8zhc/Pa3mxRh0 -----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/system_tap.stp b/mysql-wsrep-5.6/mysql-test/std_data/system_tap.stp new file mode 100644 index 00000000..3744c680 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/system_tap.stp @@ -0,0 +1,168 @@ +# This systamtap 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. +# +# For the dynamic tracing of MySQL code using systemtap on Linux, the dtrace +# probes defined in the code are converted to systemtap marks by the dtrace +# tool. This dtrace tool is not used for dynamic tracing like real dtrace tool +# supplied with Sun OS, Mac, FreeBSD and Oracle Linux. +# + +global query_parse_start +global query_parse_done +global select_start +global select_done +global net_read_start +global net_read_done +global handler_rdlock_start +global handler_rdlock_done + +global tot_probe_hits +global exp_probe_hits + +probe 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") +} + +probe process(@1).mark("query__parse__start") +{ + if (query_parse_start == 0) + { + query_parse_start++ + tot_probe_hits++ + } + + if (tot_probe_hits >= exp_probe_hits) + { + print_summary_and_exit() + } +} + +probe process(@1).mark("query__parse__done") +{ + if (query_parse_done == 0) + { + query_parse_done++ + tot_probe_hits++ + } + + if (tot_probe_hits >= exp_probe_hits) + { + print_summary_and_exit() + } +} + +probe process(@1).mark("select__start") +{ + if (select_start == 0) + { + select_start++ + tot_probe_hits++ + } + + if (tot_probe_hits >= exp_probe_hits) + { + print_summary_and_exit() + } +} + +probe process(@1).mark("select__done") +{ + if (select_done == 0) + { + select_done++ + tot_probe_hits++ + } + + if (tot_probe_hits >= exp_probe_hits) + { + print_summary_and_exit() + } +} + +probe process(@1).mark("net__read__start") +{ + if (net_read_start == 0) + { + net_read_start++ + tot_probe_hits++ + } + + if (tot_probe_hits >= exp_probe_hits) + { + print_summary_and_exit() + } +} + +probe process(@1).mark("net__read__done") +{ + if (net_read_done == 0) + { + net_read_done++ + tot_probe_hits++ + } + + if (tot_probe_hits >= exp_probe_hits) + { + print_summary_and_exit() + } +} + +probe process(@1).mark("handler__rdlock__start") +{ + if (handler_rdlock_start == 0) + { + handler_rdlock_start++ + tot_probe_hits++ + } + + if (tot_probe_hits >= exp_probe_hits) + { + print_summary_and_exit() + } +} + +probe process(@1).mark("handler__rdlock__done") +{ + if (handler_rdlock_done == 0) + { + handler_rdlock_done++ + tot_probe_hits++ + } + + if (tot_probe_hits >= exp_probe_hits) + { + print_summary_and_exit() + } +} + +function print_summary_and_exit() +{ + 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\n") + exit() +} diff --git a/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/access_credential_control.result b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/access_credential_control.result index 320fac79..04cf0afa 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/access_credential_control.result +++ b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/access_credential_control.result @@ -436,9 +436,9 @@ Drop user 'Tanjotuser1'@'localhost'; Drop user 'Tanjotuser2'@'localhost'; Drop user 'Tanjotuser3'@'localhost'; Now trying opening a new session for the above dropped user -ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: NO) -ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: NO) -ERROR 28000: Access denied for user 'Tanjotuser3'@'localhost' (using password: NO) +ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: YES) +ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: YES) +ERROR 28000: Access denied for user 'Tanjotuser3'@'localhost' (using password: YES) Accessing the open sessions for the above dropped user select user(), current_user(); user() current_user() @@ -518,9 +518,9 @@ Tanjotuser2@localhost Tanjotuser2@localhost select user(), current_user(); user() current_user() Tanjotuser3@localhost Tanjotuser3@localhost -ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: NO) -ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: NO) -ERROR 28000: Access denied for user 'Tanjotuser3'@'localhost' (using password: NO) +ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: YES) +ERROR 28000: Access denied for user 'Tanjotuser2'@'localhost' (using password: YES) +ERROR 28000: Access denied for user 'Tanjotuser3'@'localhost' (using password: YES) select user(), current_user(); user() current_user() user1@localhost user1@localhost diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result new file mode 100644 index 00000000..9d961378 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result @@ -0,0 +1,62 @@ +call mtr.add_suppression("MYSQL_BIN_LOG::add_log_to_index failed to copy index file to crash safe index file."); +call mtr.add_suppression("Disk is full writing *"); +call mtr.add_suppression("Retry in 60 secs. *"); +call mtr.add_suppression("Error writing file*"); +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 *"); +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 +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 +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 +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 +Test case5 +flush logs; +ERROR HY000: File 'master-bin.index' not found (Errcode: 13 - Permission denied) +CREATE TABLE t1 ( f int ); +SHOW TABLES; +Tables_in_test +t1 +DROP TABLE t1; +Test case6 +SET SESSION debug="+d,fault_injection_updating_index"; +flush logs; +ERROR HY000: Can't open file: 'master-bin.000007' (errno: 1 - Operation not permitted) +CREATE TABLE t2 (f int ); +SHOW TABLES; +Tables_in_test +t2 +DROP TABLE t2; +SET SESSION debug="-d,fault_injection_updating_index"; +Test case7 +SET SESSION debug="+d,simulate_disk_full_on_open_binlog"; +flush logs; +ERROR HY000: Error writing file 'master-bin.index_crash_safe' (Errcode: 28 - No space left on device) +SET SESSION debug="-d,simulate_disk_full_on_open_binlog"; +Test case8 +SET SESSION debug="+d,fault_injection_init_name"; +flush logs; +ERROR HY000: Can't open file: 'master-bin.000009' (errno: 1 - Operation not permitted) +CREATE TABLE t2 (f int ); +SHOW TABLES; +Tables_in_test +t2 +DROP TABLE t2; +SET SESSION debug="-d,fault_injection_init_name"; +SET SESSION debug=""; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_start_stop.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_start_stop.result index 29281f00..c079de9c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_start_stop.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_start_stop.result @@ -198,6 +198,7 @@ INSERT INTO t1 VALUES(2) SET TIMESTAMP=1956560400/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -229,6 +230,7 @@ INSERT INTO t1 VALUES(2) SET TIMESTAMP=1956560400/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -313,6 +315,7 @@ INSERT INTO t1 VALUES(1) SET TIMESTAMP=1925024400/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -344,6 +347,7 @@ INSERT INTO t1 VALUES(1) SET TIMESTAMP=1925024400/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -399,22 +403,11 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -484,22 +477,11 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -559,22 +541,11 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -645,28 +616,18 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; SET TIMESTAMP=2019718800/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -709,28 +670,18 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; SET TIMESTAMP=2019718800/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -783,22 +734,11 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -869,28 +809,18 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; SET TIMESTAMP=2019718800/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -943,28 +873,18 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; SET TIMESTAMP=2019718800/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1155,6 +1075,7 @@ INSERT INTO t1 VALUES(2) SET TIMESTAMP=1956560400/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1185,6 +1106,7 @@ INSERT INTO t1 VALUES(2) SET TIMESTAMP=1956560400/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1269,6 +1191,7 @@ INSERT INTO t1 VALUES(1) SET TIMESTAMP=1925024400/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1300,6 +1223,7 @@ INSERT INTO t1 VALUES(1) SET TIMESTAMP=1925024400/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1355,22 +1279,11 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1440,22 +1353,11 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1514,22 +1416,11 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1600,28 +1491,18 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; SET TIMESTAMP=2019718800/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1663,28 +1544,18 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; SET TIMESTAMP=2019718800/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1737,22 +1608,11 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1823,28 +1683,18 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; SET TIMESTAMP=2019718800/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1897,28 +1747,18 @@ SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; -DELIMITER ; -DELIMITER /*!*/; # UUID:#-# SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; SET TIMESTAMP=2019718800/*!*/; COMMIT /*!*/; +SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog *//*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_simple_recovery.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_simple_recovery.result new file mode 100644 index 00000000..ee653a27 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_simple_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 binlog-gtid-simple-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: --binlog-gtid-simple-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 binlog-gtid-simple-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: --binlog-gtid-simple-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates] +# +# Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 +# and GLOBAL.GTID_PURGED is empty after server restarts again. +# +include/assert.inc [committed gtid MASTER_UUID:1] +include/assert.inc [GLOBAL.GTID_PURGED is empty] +# Move binary logs back. +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_utils.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_utils.result new file mode 100644 index 00000000..ca966735 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_utils.result @@ -0,0 +1,137 @@ +include/gtid_utils.inc +SELECT GTID_IS_EQUAL('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:3:2:1', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'); +GTID_IS_EQUAL('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:3:2:1', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1') +1 +SELECT GTID_IS_EQUAL('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:3:2:1', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1:3,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'); +GTID_IS_EQUAL('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:3:2:1', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1:3,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1') +0 +SELECT GTID_IS_DISJOINT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:2,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3'); +GTID_IS_DISJOINT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:2,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3') +1 +SELECT GTID_IS_DISJOINT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:2,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3'); +GTID_IS_DISJOINT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:2,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3') +0 +SELECT GTID_IS_DISJOINT_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1'); +GTID_IS_DISJOINT_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1') +1 +SELECT GTID_IS_DISJOINT_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1'); +GTID_IS_DISJOINT_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1') +0 +SELECT GTID_IS_DISJOINT_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1'); +GTID_IS_DISJOINT_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1') +0 +SELECT GTID_INTERSECTION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:5-7'); +GTID_INTERSECTION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:5-7') + +SELECT GTID_INTERSECTION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:5-7', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3-5'); +GTID_INTERSECTION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:5-7', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3-5') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3:5 +SELECT GTID_INTERSECTION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:2:3'); +GTID_INTERSECTION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:2:3') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3 +SELECT GTID_INTERSECTION('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3'); +GTID_INTERSECTION('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3') + +SELECT GTID_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3'); +GTID_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3 +SELECT GTID_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3'); +GTID_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3 +SELECT GTID_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2:4'); +GTID_UNION('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2:4') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-4 +SELECT GTID_SYMMETRIC_DIFFERENCE('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3-5'); +GTID_SYMMETRIC_DIFFERENCE('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:3-5') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-2:4-5 +SELECT GTID_SYMMETRIC_DIFFERENCE('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:4-5'); +GTID_SYMMETRIC_DIFFERENCE('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:4-5') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-5 +SELECT GTID_SYMMETRIC_DIFFERENCE('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3'); +GTID_SYMMETRIC_DIFFERENCE('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3, +bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3 +SELECT GTID_SUBTRACT_UUID('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3,cccccccc-cccc-cccc-cccc-cccccccccccc:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'); +GTID_SUBTRACT_UUID('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3,cccccccc-cccc-cccc-cccc-cccccccccccc:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3, +cccccccc-cccc-cccc-cccc-cccccccccccc:1-3 +SELECT GTID_SUBTRACT_UUID('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,cccccccc-cccc-cccc-cccc-cccccccccccc:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'); +GTID_SUBTRACT_UUID('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,cccccccc-cccc-cccc-cccc-cccccccccccc:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb') +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3, +cccccccc-cccc-cccc-cccc-cccccccccccc:1-3 +SELECT GTID_SUBTRACT_UUID('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'); +GTID_SUBTRACT_UUID('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb') + +SELECT GTID_SUBTRACT_UUID(CONCAT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-', 1 << 63 - 1), 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_SUBTRACT_UUID(CONCAT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-', 1 << 63 - 1), 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') + +SELECT GTID_INTERSECTION_WITH_UUID('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3,cccccccc-cccc-cccc-cccc-cccccccccccc:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'); +GTID_INTERSECTION_WITH_UUID('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3,cccccccc-cccc-cccc-cccc-cccccccccccc:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb') +bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3 +SELECT GTID_INTERSECTION_WITH_UUID('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,cccccccc-cccc-cccc-cccc-cccccccccccc:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'); +GTID_INTERSECTION_WITH_UUID('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,cccccccc-cccc-cccc-cccc-cccccccccccc:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb') + +SELECT GTID_INTERSECTION_WITH_UUID('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'); +GTID_INTERSECTION_WITH_UUID('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb') +bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3 +SELECT GTID_COUNT(''); +GTID_COUNT('') +0 +SELECT GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'); +GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1') +1 +SELECT GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3'); +GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3') +3 +SELECT GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:4-5'); +GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:4-5') +5 +SELECT GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:5-5'); +GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:5-5') +4 +SELECT GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:5-4'); +GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:5-4') +3 +SELECT GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:5-4,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1:3,'); +GTID_COUNT('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3:5-4,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1:3,') +5 +SELECT GTID_NEXT_GENERATED('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_NEXT_GENERATED('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') +1 +SELECT GTID_NEXT_GENERATED('', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_NEXT_GENERATED('', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') +1 +SELECT GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') +2 +SELECT GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') +1 +SELECT GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') +4 +SELECT GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:5:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:5:1-3', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') +4 +SELECT GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,11111111-1111-1111-1111-111111111111:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3,11111111-1111-1111-1111-111111111111:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') +4 +SELECT GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2-3,11111111-1111-1111-1111-111111111111:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); +GTID_NEXT_GENERATED('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2-3,11111111-1111-1111-1111-111111111111:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') +1 +SELECT GTID_NEXT_GENERATED_SET('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 0); +GTID_NEXT_GENERATED_SET('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 0) + +SELECT GTID_NEXT_GENERATED_SET('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 4); +GTID_NEXT_GENERATED_SET('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 4) +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-4 +SELECT GTID_NEXT_GENERATED_SET('', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 4); +GTID_NEXT_GENERATED_SET('', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 4) +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-4 +SELECT GTID_NEXT_GENERATED_SET('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2:4:6:8:10-11', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 10); +GTID_NEXT_GENERATED_SET('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2:4:6:8:10-11', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 10) +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3:5:7:9:12-16 +SELECT GTID_NEXT_GENERATED_SET('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3:5:7:9-11', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 10); +GTID_NEXT_GENERATED_SET('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1:3:5:7:9-11', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 10) +aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:2:4:6:8:12-17 +include/gtid_utils_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_concat.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_concat.result new file mode 100644 index 00000000..9187f564 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_concat.result @@ -0,0 +1,20 @@ +include/rpl_init.inc [topology=none] +include/rpl_default_connections.inc +CREATE TABLE t1(i INT); +INSERT INTO t1 values (1); +include/rpl_restart_server.inc [server_number=1 parameters: --gtid-mode=off] +CREATE TABLE t2(i INT); +INSERT INTO t2 values (2); +include/rpl_restart_server.inc [server_number=1 parameters: --gtid-mode=on] +CREATE TABLE t3(i INT); +INSERT INTO t3 values (3); +FLUSH LOGS; +DROP TABLE t1,t2,t3; +RESET MASTER; +SELECT * FROM t1; +i +1 +SELECT * FROM t2; +i +2 +DROP TABLE t1,t2; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_stop.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_stop.result index 6658ff6d..8f8415b0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_stop.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_stop.result @@ -368,20 +368,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -442,20 +431,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -510,20 +488,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -587,20 +554,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -646,20 +602,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -714,20 +659,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -791,20 +725,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -859,20 +782,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1238,20 +1150,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1312,20 +1213,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1379,20 +1269,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1456,20 +1335,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1514,20 +1382,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1582,20 +1439,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1659,20 +1505,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; @@ -1727,20 +1562,9 @@ INSERT INTO t1 VALUES(3) SET TIMESTAMP=1988182800/*!*/; COMMIT /*!*/; -DELIMITER ; -DELIMITER /*!*/; SET TIMESTAMP=2019718800/*!*/; -SET @@session.pseudo_thread_id=999999999/*!*/; -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/*!*/; BEGIN /*!*/; -use `test`/*!*/; SET TIMESTAMP=2019718800/*!*/; INSERT INTO t1 VALUES(4) /*!*/; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_stop_slave_server_id.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_stop_slave_server_id.result new file mode 100644 index 00000000..90ff6233 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_start_stop_slave_server_id.result @@ -0,0 +1,153 @@ +CREATE TABLE t1 (a INT); +RESET MASTER; +SET TIMESTAMP= UNIX_TIMESTAMP("2031-01-01 12:00:00"); +INSERT INTO t1 VALUES(1); +SET TIMESTAMP= UNIX_TIMESTAMP("2032-01-01 12:00:00"); +INSERT INTO t1 VALUES(2); +SET TIMESTAMP= UNIX_TIMESTAMP("2033-01-01 12:00:00"); +INSERT INTO t1 VALUES(3); +FLUSH LOGS; +SET TIMESTAMP= UNIX_TIMESTAMP("2034-01-01 12:00:00"); +INSERT INTO t1 VALUES(4); +SET TIMESTAMP= UNIX_TIMESTAMP("2035-01-01 12:00:00"); +INSERT INTO t1 VALUES(5); +FLUSH LOGS; + +==== Remote with to-last-log stop-never connection-server-id=0 ==== + +---- to-last-log stop-never connection-server-id ---- +/*!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 /*!*/; +ROLLBACK/*!*/; +SET TIMESTAMP=1925024400/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +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/*!*/; +BEGIN +/*!*/; +use `test`/*!*/; +SET TIMESTAMP=1925024400/*!*/; +INSERT INTO t1 VALUES(1) +/*!*/; +SET TIMESTAMP=1925024400/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1956560400/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1956560400/*!*/; +INSERT INTO t1 VALUES(2) +/*!*/; +SET TIMESTAMP=1956560400/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1988182800/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1988182800/*!*/; +INSERT INTO t1 VALUES(3) +/*!*/; +SET TIMESTAMP=1988182800/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=2019718800/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=2019718800/*!*/; +INSERT INTO t1 VALUES(4) +/*!*/; +SET TIMESTAMP=2019718800/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=2051254800/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=2051254800/*!*/; +INSERT INTO t1 VALUES(5) +/*!*/; +SET TIMESTAMP=2051254800/*!*/; +COMMIT +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; + +==== Remote with connection-server-id= (value other than 0) ==== + +---- to-last-log connection-server-id ---- +/*!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 /*!*/; +ROLLBACK/*!*/; +SET TIMESTAMP=1925024400/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +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/*!*/; +BEGIN +/*!*/; +use `test`/*!*/; +SET TIMESTAMP=1925024400/*!*/; +INSERT INTO t1 VALUES(1) +/*!*/; +SET TIMESTAMP=1925024400/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1956560400/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1956560400/*!*/; +INSERT INTO t1 VALUES(2) +/*!*/; +SET TIMESTAMP=1956560400/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1988182800/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1988182800/*!*/; +INSERT INTO t1 VALUES(3) +/*!*/; +SET TIMESTAMP=1988182800/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=2019718800/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=2019718800/*!*/; +INSERT INTO t1 VALUES(4) +/*!*/; +SET TIMESTAMP=2019718800/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=2051254800/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=2051254800/*!*/; +INSERT INTO t1 VALUES(5) +/*!*/; +SET TIMESTAMP=2051254800/*!*/; +COMMIT +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; + +==== clean up ==== +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result index de60d51a..50e2fd16 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result @@ -29,8 +29,7 @@ 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` /* 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 TABLE IF EXISTS `t` /* generated by server */ diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 063e2a12..d3b8f544 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -295,7 +295,8 @@ master-bin.000001 # Table_map # # table_id: # (test.t0) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb -master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti` +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ti` +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1` do release_lock("lock1"); drop table t0,t2; set autocommit=0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result index c787fe50..3e4b8005 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result @@ -36,8 +36,7 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE 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` /* 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 `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 TABLE IF EXISTS `t` /* generated by server */ diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index 6d90b3da..4d298e15 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -295,7 +295,8 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",null) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb -master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti` +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ti` +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1` do release_lock("lock1"); drop table t0,t2; set autocommit=0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result index 48b6dfa6..0819d4e7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result @@ -1,6 +1,5 @@ set @save_binlog_format= @@global.binlog_format; set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates; -set @save_sql_log_bin= @@global.sql_log_bin; create table t1 (a int) engine= myisam; create table t2 (a int) engine= innodb; SELECT @@session.binlog_format; @@ -129,7 +128,7 @@ commit; begin; insert into t2 values (5); # Test that the global variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are +# 'binlog_direct_non_transactional_updates' are # writable inside a transaction. # Current session values are ROW, FALSE, TRUE respectively. SELECT @@global.binlog_format; @@ -137,20 +136,15 @@ SELECT @@global.binlog_format; ROW set @@global.binlog_format= statement; set @@global.binlog_direct_non_transactional_updates= TRUE; -set @@global.sql_log_bin= FALSE; SELECT @@global.binlog_format; @@global.binlog_format STATEMENT SELECT @@global.binlog_direct_non_transactional_updates; @@global.binlog_direct_non_transactional_updates 1 -SELECT @@global.sql_log_bin; -@@global.sql_log_bin -0 commit; set @@global.binlog_format= @save_binlog_format; set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct; -set @@global.sql_log_bin= @save_sql_log_bin; create table t3(a int, b int) engine= innodb; create table t4(a int) engine= innodb; create table t5(a int) engine= innodb; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_truncate_kill.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_truncate_kill.result new file mode 100644 index 00000000..eeee3998 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_truncate_kill.result @@ -0,0 +1,37 @@ +RESET MASTER; +connection default; +CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB; +INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10); +SET DEBUG_SYNC = "open_and_process_table signal truncate_before_lock wait_for forever"; +TRUNCATE t1; +connect con1,localhost,root,,; +SET DEBUG_SYNC = "now wait_for truncate_before_lock"; +SELECT ((@id := id) - id) FROM information_schema.processlist WHERE processlist.info LIKE '%TRUNCATE t1%' AND state LIKE '%open_and_process_table%'; +((@id := id) - id) +0 +KILL QUERY @id; +connection default; +ERROR 70100: Query execution was interrupted +connection con1; +include/show_binlog_events.inc +connection con1; +connection con1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10) +master-bin.000001 # Xid # # COMMIT /* XID */ +connection con1; +connection con1; +disconnect con1; +connection default; +SELECT * FROM t1; +id a b +1 1 2 +2 2 4 +3 3 6 +4 4 8 +5 5 10 +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_unsafe.result index ac13356a..6adb389d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -2636,6 +2636,15 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc INSERT INTO t1 VALUES (RAND()); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +INSERT INTO t1 VALUES (RANDOM_BYTES(16)); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +INSERT INTO t1 VALUES (AES_ENCRYPT('a', 'a')); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +INSERT INTO t1 VALUES (AES_DECRYPT('a', 'a')); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. DELETE FROM t1; SET TIMESTAMP=1000000; INSERT INTO t1 VALUES diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_xa_handling.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_xa_handling.result new file mode 100644 index 00000000..473901fa --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_xa_handling.result @@ -0,0 +1,10 @@ +CREATE TABLE t1(f1 int); +XA START'',''; +INSERT INTO t1 VALUES(10); +BINLOG ' +SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8='; +XA END''; +XA PREPARE''; +XA COMMIT''; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test new file mode 100644 index 00000000..548c5e2a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test @@ -0,0 +1,139 @@ +############################################################################### +# Bug#11758766:MYSQLD CONTINUES OPERATION WITHOUT LOGGING WHEN BINLOGS +# CANNOT BE WRITTEN +# +# Problem: +# ======== +# If an error occurs that prevents mysqld writing to the binary logs (disk +# full, readonly filesystem, etc) then the logs are disabled and operations +# continue. This can lead to out of sync slaves and improper backups. +# +# Test: +# ===== +# A new option "binlog_error_action" has been introduced whose values +# are "IGNORE" or "ABORT". When binlogging becomes impossible if user sets +# the variable to "ABORT" server will stop if user sets it to "IGNORE" binlog +# will be turned off and server will continue. 4 different test cases are +# added to check both the behaviours. +############################################################################### +--source include/have_log_bin.inc +--source include/not_embedded.inc +--source include/have_binlog_format_statement.inc +# Don't test this under valgrind, memory leaks will occur +--source include/not_valgrind.inc +--source include/have_debug.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + +call mtr.add_suppression("MYSQL_BIN_LOG::add_log_to_index failed to copy index file to crash safe index file."); +call mtr.add_suppression("Disk is full writing *"); +call mtr.add_suppression("Retry in 60 secs. *"); +call mtr.add_suppression("Error writing file*"); +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 *"); + +let $old=`select @@debug`; + +RESET MASTER; + +--echo Test case1 +# Make binlog index readonly and check the behaviour with ABORT +let $MYSQLD_DATADIR= `select @@datadir`; +let $INDEX=$MYSQLD_DATADIR/master-bin.index; +--chmod 0444 $INDEX + +SET GLOBAL binlog_error_action= ABORT_SERVER; +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--error ER_BINLOG_LOGGING_IMPOSSIBLE +flush logs; +--chmod 0666 $INDEX +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo Test case2 +# Make MYSQL_BIN_LOG::open_binlog fail with debug simulation and test +# the behaviour in case of ABORT +SET SESSION debug="+d,fault_injection_updating_index"; +SET GLOBAL binlog_error_action= ABORT_SERVER; +--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 + +--echo Test case3 +# Simulate diskfull during opening of binlog and check for diskfull error +# behaviour where binlogging impossible error is to abort the server. +SET SESSION debug="+d,simulate_disk_full_on_open_binlog"; +SET GLOBAL binlog_error_action= ABORT_SERVER; +--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 + +--echo Test case4 +SET SESSION debug="+d,fault_injection_init_name"; +SET GLOBAL binlog_error_action= ABORT_SERVER; +--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 + +--echo Test case5 +# Make binlog index readonly and check the behaviour with IGNORE +--chmod 0444 $INDEX +--replace_regex /\.[\\\/]master/master/ /errno: 13 - .*\)/errno: 13 - Permission denied)/ +--error 29 +flush logs; +CREATE TABLE t1 ( f int ); +SHOW TABLES; +DROP TABLE t1; +--chmod 0666 $INDEX +--source include/restart_mysqld.inc + +--echo Test case6 +# Make MYSQL_BIN_LOG::open_binlog fail with debug simulation and test +# the behaviour in case of IGNORE +SET SESSION debug="+d,fault_injection_updating_index"; +--replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/ +--error ER_CANT_OPEN_FILE +flush logs; +CREATE TABLE t2 (f int ); +SHOW TABLES; +DROP TABLE t2; +SET SESSION debug="-d,fault_injection_updating_index"; +--source include/restart_mysqld.inc + +--echo Test case7 +# Simulate diskfull during opening of binlog and check for diskfull error +# behaviour where binlogging impossible error is to continue the server +# after the error. +SET SESSION debug="+d,simulate_disk_full_on_open_binlog"; +--replace_regex /\.[\\\/]master/master/ /Errcode: 28 - .*\)/Errcode: 28 - No space left on device)/ +# error EE_WRITE with error code number 3 is expected. +--error 3 +flush logs; +SET SESSION debug="-d,simulate_disk_full_on_open_binlog"; +--source include/restart_mysqld.inc + +--echo Test case8 +SET SESSION debug="+d,fault_injection_init_name"; +--replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/ +--error ER_CANT_OPEN_FILE +flush logs; +CREATE TABLE t2 (f int ); +SHOW TABLES; +DROP TABLE t2; +SET SESSION debug="-d,fault_injection_init_name"; +--source include/restart_mysqld.inc + +# Cleanup +eval SET SESSION debug="$old"; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_grant.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_grant.test index f0367b3a..0c9d9a45 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_grant.test +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_grant.test @@ -15,7 +15,7 @@ show grants for mysqltest_1@localhost; connect (plain,localhost,mysqltest_1,,test); connect (root,localhost,root,,test); -# Testing setting both session and global SQL_LOG_BIN variable both as +# Testing setting session SQL_LOG_BIN variable both as # root and as plain user. --echo **** Variable SQL_LOG_BIN **** diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_simple_recovery.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_simple_recovery.test new file mode 100644 index 00000000..87eef863 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_simple_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 binlog-gtid-simple-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 binlog-gtid-simple-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 binlog-gtid-simple-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 binlog-gtid-simple-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= --binlog-gtid-simple-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 binlog-gtid-simple-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= --binlog-gtid-simple-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates +--source include/rpl_restart_server.inc + +--echo # +--echo # Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 +--echo # and GLOBAL.GTID_PURGED is empty after server restarts again. +--echo # +--let $assert_text= committed gtid MASTER_UUID:1 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1" +--source include/assert.inc +--let $assert_text= GLOBAL.GTID_PURGED is empty +--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "" +--source include/assert.inc + +--echo # Move binary logs back. +--move_file $MYSQLD_DATADIR/$binlog_file2.bkp $MYSQLD_DATADIR/$binlog_file2 +--move_file $MYSQLD_DATADIR/$binlog_file3.bkp $MYSQLD_DATADIR/$binlog_file3 +--move_file $MYSQLD_DATADIR/$binlog_file4.bkp $MYSQLD_DATADIR/$binlog_file4 + +--source include/rpl_end.inc + diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_utils.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_utils.test new file mode 100644 index 00000000..e660f507 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_utils.test @@ -0,0 +1,71 @@ +# ==== Purpose ==== +# +# Check all the GTID functions defined in the auxiliary test script +# include/gtid_utils.inc. +# +# ==== Implementation ==== +# +# For each function in gtid_utils.inc, test a few values, try to +# include boundary conditions etc. + +--source include/have_gtid.inc +# Only need to test under one binlog format +--source include/have_binlog_format_row.inc +--source include/gtid_utils.inc + +eval SELECT GTID_IS_EQUAL('$uuida:1,$uuidb:3:2:1', '$uuidb:1-3,$uuida:1'); +eval SELECT GTID_IS_EQUAL('$uuida:1,$uuidb:3:2:1', '$uuidb:1:3,$uuida:1'); + +eval SELECT GTID_IS_DISJOINT('$uuida:2', '$uuidb:2,$uuida:1:3'); +eval SELECT GTID_IS_DISJOINT('$uuida:2', '$uuidb:2,$uuida:1-3'); + +eval SELECT GTID_IS_DISJOINT_UNION('$uuida:2,$uuidb:1', '$uuida:1:3', '$uuida:1-3,$uuidb:1'); +eval SELECT GTID_IS_DISJOINT_UNION('$uuida:2,$uuidb:1', '$uuida:1-3', '$uuida:1-3,$uuidb:1'); +eval SELECT GTID_IS_DISJOINT_UNION('$uuida:2,$uuidb:1', '$uuida:1', '$uuida:1-3,$uuidb:1'); + +eval SELECT GTID_INTERSECTION('$uuida:1-3', '$uuida:5-7'); +eval SELECT GTID_INTERSECTION('$uuida:1-3:5-7', '$uuida:3-5'); +eval SELECT GTID_INTERSECTION('$uuida:1-3', '$uuida:1:2:3'); +eval SELECT GTID_INTERSECTION('$uuidb:1-3', '$uuida:1-3'); + +eval SELECT GTID_UNION('$uuida:1:3', '$uuida:1:3'); +eval SELECT GTID_UNION('$uuida:1-3', '$uuida:1:3'); +eval SELECT GTID_UNION('$uuida:1:3', '$uuida:2:4'); + +eval SELECT GTID_SYMMETRIC_DIFFERENCE('$uuida:1-3', '$uuida:3-5'); +eval SELECT GTID_SYMMETRIC_DIFFERENCE('$uuida:1-3', '$uuida:4-5'); +eval SELECT GTID_SYMMETRIC_DIFFERENCE('$uuida:1-3', '$uuidb:1-3'); + +eval SELECT GTID_SUBTRACT_UUID('$uuida:1-3,$uuidb:1-3,$uuidc:1-3', '$uuidb'); +eval SELECT GTID_SUBTRACT_UUID('$uuida:1-3,$uuidc:1-3', '$uuidb'); +eval SELECT GTID_SUBTRACT_UUID('$uuidb:1-3', '$uuidb'); +eval SELECT GTID_SUBTRACT_UUID(CONCAT('$uuida:1-', 1 << 63 - 1), '$uuida'); + +eval SELECT GTID_INTERSECTION_WITH_UUID('$uuida:1-3,$uuidb:1-3,$uuidc:1-3', '$uuidb'); +eval SELECT GTID_INTERSECTION_WITH_UUID('$uuida:1-3,$uuidc:1-3', '$uuidb'); +eval SELECT GTID_INTERSECTION_WITH_UUID('$uuidb:1-3', '$uuidb'); + +eval SELECT GTID_COUNT(''); +eval SELECT GTID_COUNT('$uuida:1'); +eval SELECT GTID_COUNT('$uuida:1-3'); +eval SELECT GTID_COUNT('$uuida:1-3:4-5'); +eval SELECT GTID_COUNT('$uuida:1-3:5-5'); +eval SELECT GTID_COUNT('$uuida:1-3:5-4'); +eval SELECT GTID_COUNT('$uuida:1-3:5-4,$uuidb:1:3,'); + +eval SELECT GTID_NEXT_GENERATED('$uuidb:1', '$uuida'); +eval SELECT GTID_NEXT_GENERATED('', '$uuida'); +eval SELECT GTID_NEXT_GENERATED('$uuida:1', '$uuida'); +eval SELECT GTID_NEXT_GENERATED('$uuida:2', '$uuida'); +eval SELECT GTID_NEXT_GENERATED('$uuida:1-3', '$uuida'); +eval SELECT GTID_NEXT_GENERATED('$uuida:5:1-3', '$uuida'); +eval SELECT GTID_NEXT_GENERATED('$uuida:1-3,$uuid1:1', '$uuida'); +eval SELECT GTID_NEXT_GENERATED('$uuida:2-3,$uuid1:1', '$uuida'); + +eval SELECT GTID_NEXT_GENERATED_SET('$uuida:1', '$uuida', 0); +eval SELECT GTID_NEXT_GENERATED_SET('$uuidb:1', '$uuida', 4); +eval SELECT GTID_NEXT_GENERATED_SET('', '$uuida', 4); +eval SELECT GTID_NEXT_GENERATED_SET('$uuida:2:4:6:8:10-11', '$uuida', 10); +eval SELECT GTID_NEXT_GENERATED_SET('$uuida:1:3:5:7:9-11', '$uuida', 10); + +--source include/gtid_utils_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_killed.test index 97c7469e..ce668552 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_killed.test +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_killed.test @@ -387,6 +387,14 @@ drop function bug27563; # common cleanup # +connection con1; +disconnect con1; +--source include/wait_until_disconnected.inc +connection con2; +disconnect con2; +--source include/wait_until_disconnected.inc +connection default; + drop table t1,t2,t3; --echo end of the tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_concat.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_concat.test new file mode 100644 index 00000000..ea078ca2 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_concat.test @@ -0,0 +1,103 @@ +################################################################# +# Bug#18258933 CONCATENATION OF MYSQLBINLOG OUTPUT DOES NOT +# WORK WITH GTID + +# Problem: When mysqlbinlog processes and concatenates +# multiple binary log files into one output file, this +# output file is not in useful state. When it is later +# used for point-in-time recovery, it is producing +# ER_GTID_NEXT_TYPE_UNDEFINED_GROUP "ERROR 1837: When +# @@SESSION.GTID_NEXT is set to a GTID, you must explicitly +# set it to a different value after a COMMIT or ROLLBACK. +# Please check GTID_NEXT variable manual page for detailed +# explanation. Current @@SESSION.GTID_NEXT is 'xyz'" + +# Solution: When mysqlbinlog processes second binary log's +# start_log_event, it can output +# "SET GTID_NEXT=AUTOMATIC" if required i.e., if +# previous binary log is leaving the GTID_NEXT state +# in 'undefined' state. + +# Steps to verify the case: +# 1) On a Gtid enabled server, generate some dummy statements +# in binary log ( to generate GTID_NEXT events in binary log 1) +# 2) Restart server with gtid-mode OFF +# 3) On a Gtid disabled sever, generate some dummy statements +# in binary log ( to generate anonymous events in binary log 2) +# 4) Restart server again with gtid-mode ON. +# 5) On a Gtid enabled server, generate some dummy statements +# in binary log ( to generate GTID_NEXT events in binary log 3) +# 6) Concat all three binary logs 1,2 and 3 and apply the generated +# sql against mysql command line tool and it should not cause +# any error (i.e., no ER_GTID_NEXT_TYPE_UNDEFINED_GROUP error) +################################################################# +--source include/have_binlog_format_statement.inc +--source include/have_gtid.inc + +# Use this so that we can use rpl_restart_server.inc later. +--let $rpl_server_count= 1 +--let $rpl_topology= none +--source include/rpl_init.inc +--source include/rpl_default_connections.inc + + +#Initial setup +--let $datadir= `SELECT @@datadir` +--let $binlog_file1= query_get_value(SHOW MASTER STATUS, File, 1) + +# Step 1 : Dummy statements to generate gtid transactions (gtid-mode is ON) +# in binlog_file1 +CREATE TABLE t1(i INT); +INSERT INTO t1 values (1); + +# Step 2: Restart server with gtid-mode off (binlog will be rotated) +--let $rpl_server_number= 1 +--let $rpl_server_parameters= --gtid-mode=off +--source include/rpl_restart_server.inc +--let $binlog_file2= query_get_value(SHOW MASTER STATUS, File, 1) + +# Step 3: Dummy statements to generate anonymous transactions +# (gtid-mode is OFF) +CREATE TABLE t2(i INT); +INSERT INTO t2 values (2); + +# Step 4: Restart server with gtid-mode ON (binlog will be rotated) +--let $rpl_server_number= 1 +--let $rpl_server_parameters= --gtid-mode=on +--source include/rpl_restart_server.inc +--let $binlog_file3= query_get_value(SHOW MASTER STATUS, File, 1) + +# Step 5 : Dummy statements to generate gtid transactions (gtid-mode is ON) +# in binlog_file3 +CREATE TABLE t3(i INT); +INSERT INTO t3 values (3); + +# Clean up command (let DROP TABLE be in binary log 4, when we apply +# all three binary logs, we can select the data and verify that the +# data is there. +FLUSH LOGS; +DROP TABLE t1,t2,t3; + +# Step 6: Combine binlog_file1, binlog_file2, binlog_file3 and generate +# a .sql file. +--exec $MYSQL_BINLOG --force-if-open $datadir/$binlog_file1 $datadir/$binlog_file2 $datadir/$binlog_file3 > $MYSQLTEST_VARDIR/tmp/concat_three_files.sql + +# Execute reset master, so that when we are applying gtid transactions, +# they should not skipped. +RESET MASTER; + +# Step 7: Apply the generated .sql through mysql command line tool +# and it should not cause any issues +--exec $MYSQL --user=root --host=127.0.0.1 --port=$MASTER_MYPORT < $MYSQLTEST_VARDIR/tmp/concat_three_files.sql + +# Step 8: Verify the data in t1 and t2 +# [NOTE] there will not be table t3 created because CREATE TABLE t2, INSERT INTO t2 +# (originally anonymous transactions) now occupies gtid numbers 3 and 4, +# hence CREATE TABLE t3, INSERT INTO t3(which has originally gtid numbers 3 +# and 4) will be skipped when we are reapplying them. +SELECT * FROM t1; +SELECT * FROM t2; + +# Clean up +DROP TABLE t1,t2; +--remove_file $MYSQLTEST_VARDIR/tmp/concat_three_files.sql diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_start_stop_slave_server_id.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_start_stop_slave_server_id.test new file mode 100644 index 00000000..78e7350c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_start_stop_slave_server_id.test @@ -0,0 +1,54 @@ +# ==== Purpose ==== +# +# When mysqlbinlog connects to a running server it uses the client command +# COM_BINLOG_DUMP, and this command has a flag called BINLOG_DUMP_NON_BLOCK +# which instructs the server to stop sending when it reaches the end of the +# binary log. +# +# +# There are two ways provided by the server to set the non-blocking behavior. +# 1) Setting the connection-server-id=0. (this is the default value of +# connection-server-id) +# 2) Setting BINLOG_DUMP_NON_BLOCK flag +# --To test this, we set connection-server-id to some value other then zero +# and not calling stop-never option in mysqlbinlog +# +# ==== Bug and Worklog references ==== +# +# BUG##18000079 - binlog_dump_non_block disappeared in mysql 5.6 +# - Created the test to verify the bugfix. +# +# ==== Implementation ==== + +--source include/not_gtid_enabled.inc +# connection-server-id is a debug option. That's why we need include/have_debug.inc +--source include/mysqlbinlog_have_debug.inc + +# As it is enough to test with one binlog format. +--source include/have_binlog_format_statement.inc + +CREATE TABLE t1 (a INT); +RESET MASTER; + +--source extra/binlog_tests/binlog_mysqlbinlog_fill.inc + +# Verify Non blocking behaviour with connection-server-id=0 +--echo +--echo ==== Remote with to-last-log stop-never connection-server-id=0 ==== +--let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1 +--let $options= --to-last-log --stop-never --connection-server-id=0 +--source extra/binlog_tests/mysqlbinlog_start_stop_2.inc + +# Verify Non blocking behaviour for BINLOG_DUMP_NON_BLOCK by setting +# connection-server-id=1 and not setting --stop-never +--echo +--echo ==== Remote with connection-server-id= (value other than 0) ==== +--let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1 +--let $options= --to-last-log --connection-server-id=1 +--source extra/binlog_tests/mysqlbinlog_start_stop_2.inc + +--echo +--echo ==== clean up ==== +DROP TABLE t1; + + diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery-master.opt b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery-master.opt new file mode 100644 index 00000000..cef79bc8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery-master.opt @@ -0,0 +1 @@ +--force-restart diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test index 06c5e78b..a93cd44f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test @@ -10,7 +10,6 @@ source include/have_binlog_format_row.inc; set @save_binlog_format= @@global.binlog_format; set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates; -set @save_sql_log_bin= @@global.sql_log_bin; create table t1 (a int) engine= myisam; create table t2 (a int) engine= innodb; @@ -117,21 +116,18 @@ commit; begin; insert into t2 values (5); --echo # Test that the global variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are +--echo # 'binlog_direct_non_transactional_updates' are --echo # writable inside a transaction. --echo # Current session values are ROW, FALSE, TRUE respectively. SELECT @@global.binlog_format; set @@global.binlog_format= statement; set @@global.binlog_direct_non_transactional_updates= TRUE; - set @@global.sql_log_bin= FALSE; SELECT @@global.binlog_format; SELECT @@global.binlog_direct_non_transactional_updates; - SELECT @@global.sql_log_bin; commit; set @@global.binlog_format= @save_binlog_format; set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct; -set @@global.sql_log_bin= @save_sql_log_bin; create table t3(a int, b int) engine= innodb; create table t4(a int) engine= innodb; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_truncate_kill.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_truncate_kill.test new file mode 100644 index 00000000..ffbccfa5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_truncate_kill.test @@ -0,0 +1,56 @@ +############################################################################### +# Bug#17942050:KILL OF TRUNCATE TABLE WILL LEAD TO BINARY LOG WRITTEN WHILE +# ROWS REMAINS +# +# Problem: +# ======== +# When truncate table fails while using transactional based engines even +# though the operation errors out we still continue and log it to binlog. +# Because of this master has data but the truncate will be written to binary +# log which will cause inconsistency. +# +# Test: +# ===== +# Make master to wait in "open_table" call during the execution of truncate +# table command and kill the truncate table from other connection. This causes +# open table to return an error saying truncate failed during open table. This +# statement should not be binlogged. +############################################################################### +--source include/have_debug_sync.inc +--source include/have_binlog_format_statement.inc +RESET MASTER; +--enable_connect_log +--connection default +CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB; +INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10); +SET DEBUG_SYNC = "open_and_process_table signal truncate_before_lock wait_for forever"; +--send TRUNCATE t1 + +connect(con1,localhost,root,,); +SET DEBUG_SYNC = "now wait_for truncate_before_lock"; +# Wait for one connection to reach open_and_process_table. +--let $show_statement= SHOW PROCESSLIST +--let $field= State +--let $condition= 'debug sync point: open_and_process_table'; +--source include/wait_show_condition.inc + +SELECT ((@id := id) - id) FROM information_schema.processlist WHERE processlist.info LIKE '%TRUNCATE t1%' AND state LIKE '%open_and_process_table%'; +# Test killing from mysql server +KILL QUERY @id; + +connection default; +--ERROR ER_QUERY_INTERRUPTED +--reap + +connection con1; +--source include/show_binlog_events.inc + +disconnect con1; +--source include/wait_until_disconnected.inc +connection default; + +SELECT * FROM t1; + +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +--disable_connect_log diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_unsafe.test index c142a883..5ea21a95 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -692,6 +692,9 @@ INSERT INTO t1 VALUES (UUID()); #marked unsafe before BUG#47995 INSERT INTO t1 VALUES (UUID_SHORT()); #marked unsafe before BUG#47995 INSERT INTO t1 VALUES (VERSION()); #marked unsafe in BUG#47995 INSERT INTO t1 VALUES (RAND()); #marked unsafe in BUG#49222 +INSERT INTO t1 VALUES (RANDOM_BYTES(16)); #marked unsafe in BUG#18221667 +INSERT INTO t1 VALUES (AES_ENCRYPT('a', 'a')); #marked unsafe in BUG#18221667 +INSERT INTO t1 VALUES (AES_DECRYPT('a', 'a')); #marked unsafe in BUG#18221667 DELETE FROM t1; # Since we replicate the TIMESTAMP variable, functions affected by the diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_xa_handling.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_xa_handling.test new file mode 100644 index 00000000..1c724601 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_xa_handling.test @@ -0,0 +1,22 @@ +############################################################################### +# Bug#19928622: ASSERTION `! IS_SET()' FAILED. | ABORT IN +# DIAGNOSTICS_AREA::SET_OK_STATUS +# +# Test: +# ===== +# Begin an XA transaction and execte a DML statement so that XA state becomes +# XA_ACTIVE. Execute the BINLOG command it should not cause any assert. +# Execution should be successful. +############################################################################### +--source include/have_log_bin.inc + +CREATE TABLE t1(f1 int); +XA START'',''; +INSERT INTO t1 VALUES(10); +BINLOG ' +SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8='; +XA END''; +XA PREPARE''; +XA COMMIT''; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_mysql.result index f70d1646..5953fb33 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -249,7 +249,7 @@ def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) uns def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned select,insert,update,references def mysql user Password 3 NO char 41 41 NULL NULL NULL latin1 latin1_bin char(41) select,insert,update,references def mysql user password_expired 43 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references -def mysql user plugin 41 YES char 64 192 NULL NULL NULL utf8 utf8_bin char(64) select,insert,update,references +def mysql user plugin 41 mysql_native_password YES char 64 192 NULL NULL NULL utf8 utf8_bin char(64) select,insert,update,references def mysql user Process_priv 12 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user References_priv 15 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references diff --git a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 9e6916f5..18e3e187 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -249,7 +249,7 @@ def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) uns def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned def mysql user Password 3 NO char 41 41 NULL NULL NULL latin1 latin1_bin char(41) def mysql user password_expired 43 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') -def mysql user plugin 41 YES char 64 192 NULL NULL NULL utf8 utf8_bin char(64) +def mysql user plugin 41 mysql_native_password YES char 64 192 NULL NULL NULL utf8 utf8_bin char(64) def mysql user Process_priv 12 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user References_priv 15 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') diff --git a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/storedproc.result index d485c971..3442def0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/r/storedproc.result @@ -21772,6 +21772,8 @@ DROP PROCEDURE IF EXISTS sp4; set @@sql_mode = 'ansi, error_for_division_by_zero'; ERROR 42000: Variable 'sql_mode' can't be set to the value of ' error_for_division_by_zero' set @@sql_mode = 'ansi,error_for_division_by_zero'; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. SHOW VARIABLES LIKE 'sql_mode'; Variable_name Value sql_mode REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,ERROR_FOR_DIVISION_BY_ZERO diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/include/checksum_not_strict.inc b/mysql-wsrep-5.6/mysql-test/suite/innodb/include/checksum_not_strict.inc new file mode 100644 index 00000000..a1503b70 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/include/checksum_not_strict.inc @@ -0,0 +1,5 @@ +if (`SELECT @@GLOBAL.innodb_checksum_algorithm like 'strict_%'`) +{ + --skip This test cannot be run when innodb_checksum_algorithm is in strict mode +} + diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/add_foreign_key.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/add_foreign_key.result new file mode 100644 index 00000000..75177478 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/add_foreign_key.result @@ -0,0 +1,31 @@ +# +# Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE ADD +# FOREIGN KEY +# +CREATE TABLE `parent` (`parent_id` INT, PRIMARY KEY (`parent_id`)); +CREATE TABLE `child1` (`id` INT ,`child1_fk1` INT, `child1_fk2` INT, +PRIMARY KEY (`id`)); +CREATE TABLE `child2` (`id` INT, `child2_fk1` INT, `child2_fk2` INT, +PRIMARY KEY (`id`)); +CREATE TABLE `child3` (`id` INT , `child3_fk1` INT, PRIMARY KEY (`id`)); +ALTER TABLE `child1` ADD FOREIGN KEY (`child1_fk1`) REFERENCES `parent` +(`parent_id`); +ALTER TABLE `child1` ADD FOREIGN KEY (`child1_fk1`) REFERENCES +`parent` (`parent_id`); +ALTER TABLE `child1` ADD FOREIGN KEY (`child1_fk2`) REFERENCES `parent` +(`parent_id`); +ALTER TABLE `child2` ADD FOREIGN KEY (`child2_fk1`) REFERENCES `parent` +(`parent_id`); +ALTER TABLE `child2` ADD FOREIGN KEY (`child2_fk2`) REFERENCES `parent` +(`parent_id`); +ALTER TABLE `child3` ADD FOREIGN KEY (`child3_fk1`) REFERENCES `parent` +(`parent_id`); +ALTER TABLE `child1` ADD FOREIGN KEY (`child1_fk2`) REFERENCES +`parent` (`parent_id`); +ALTER TABLE `child2` ADD FOREIGN KEY (`child2_fk1`) REFERENCES +`parent` (`parent_id`); +ALTER TABLE `child2` ADD FOREIGN KEY (`child2_fk2`) REFERENCES +`parent` (`parent_id`); +ALTER TABLE `child3` ADD FOREIGN KEY (`child3_fk1`) REFERENCES +`parent` (`parent_id`); +drop table child3, child2, child1, parent; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/blob-update-debug.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/blob-update-debug.result new file mode 100644 index 00000000..3eb9d1dc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/blob-update-debug.result @@ -0,0 +1,15 @@ +# +# Bug#18185930 UPD_NODE_INSERT_BLOB CAUSES BTR_EXTERN_OWNER_FLAG +# ASSERTION +# +create table t1 (f1 int primary key, f2 blob) engine = innodb; +insert into t1 values (1, repeat('*', 50000)); +select f1, substring(f2, 1, 40) from t1; +f1 substring(f2, 1, 40) +1 **************************************** +set debug = 'd,row_ins_index_entry_timeout'; +update t1 set f1 = 3; +select f1, substring(f2, 1, 40) from t1; +f1 substring(f2, 1, 40) +3 **************************************** +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/blob_redo.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/blob_redo.result new file mode 100644 index 00000000..b1a09ce5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/blob_redo.result @@ -0,0 +1,42 @@ +# +# Bug #19498877 LIMITATION ON BLOB SIZE IS TOO STRICT, BLOB CAN +# BE 10% OF TOTAL REDO LOG SIZE +# +call mtr.add_suppression("InnoDB: Resizing redo log from"); +call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files."); +call mtr.add_suppression("InnoDB: New log files created, LSN="); +SET GLOBAL max_allowed_packet = 100*1024*1024; +# Connection big_packets: +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); +start transaction; +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 6*1024*1024)); +# Connection default: +# Quick shutdown and restart server +# Connection default: +SELECT a, b FROM t1; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +SET GLOBAL max_allowed_packet = 100*1024*1024; +# Connection big_packets: +start transaction; +UPDATE t1 SET b = REPEAT('a', 6*1024*1024) WHERE a = 1; +# Connection default: +# Quick shutdown and restart server +# Connection default: +SELECT a, b FROM t1; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/checksum.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/checksum.result new file mode 100644 index 00000000..7df20cd0 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/checksum.result @@ -0,0 +1,12 @@ +# +# Bug#19500258 ZERO CAN BE A VALID INNODB CHECKSUM, +# BUT VALIDATION WILL FAIL LATER +# +SET GLOBAL innodb_checksum_algorithm = 'CRC32'; +CREATE TABLE t1 (a INT PRIMARY KEY, b VARBINARY(512)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, X'666F72636520637263333220a0be0639'); +SELECT count(*) FROM t1; +count(*) +1 +SET GLOBAL innodb_checksum_algorithm = 'innodb';; +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/create-index.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/create-index.result new file mode 100644 index 00000000..ad358a86 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/create-index.result @@ -0,0 +1,9 @@ +# +# Bug #18010711 UNIQUE PREFIX INDEX ON BINARY COLUMN: FAILING +# ASSERTION: FLEN == LEN +# +create table t1 (f1 binary(5)) engine=innodb; +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; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/foreign_key.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/foreign_key.result new file mode 100644 index 00000000..5d498ecb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/foreign_key.result @@ -0,0 +1,126 @@ +# +# Bug #19027905 ASSERT RET.SECOND DICT_CREATE_FOREIGN_CONSTRAINTS_LOW +# DICT_CREATE_FOREIGN_CONSTR +# +create table t1 (f1 int primary key) engine=InnoDB; +create table t2 (f1 int primary key, +constraint c1 foreign key (f1) references t1(f1), +constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB; +ERROR HY000: Cannot add foreign key constraint +create table t2 (f1 int primary key, +constraint c1 foreign key (f1) references t1(f1)) engine=innodb; +alter table t2 add constraint c1 foreign key (f1) references t1(f1); +ERROR 23000: Can't write; duplicate key in table '#sql-temporary' +set foreign_key_checks = 0; +alter table t2 add constraint c1 foreign key (f1) references t1(f1); +ERROR HY000: Duplicate foreign key constraint name 'test/c1' +drop table t2, t1; +# +# Bug #20031243 CREATE TABLE FAILS TO CHECK IF FOREIGN KEY COLUMN +# NULL/NOT NULL MISMATCH +# +set foreign_key_checks = 1; +show variables like 'foreign_key_checks'; +Variable_name Value +foreign_key_checks ON +CREATE TABLE t1 +(a INT NOT NULL, +b INT NOT NULL, +INDEX idx(a)) ENGINE=InnoDB; +CREATE TABLE t2 +(a INT KEY, +b INT, +INDEX ind(b), +FOREIGN KEY (b) REFERENCES t1(a) ON DELETE CASCADE ON UPDATE CASCADE) +ENGINE=InnoDB; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` int(11) NOT NULL, + KEY `idx` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL, + `b` int(11) DEFAULT NULL, + PRIMARY KEY (`a`), + KEY `ind` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1, 80); +INSERT INTO t1 VALUES (2, 81); +INSERT INTO t1 VALUES (3, 82); +INSERT INTO t1 VALUES (4, 83); +INSERT INTO t1 VALUES (5, 84); +INSERT INTO t2 VALUES (51, 1); +INSERT INTO t2 VALUES (52, 2); +INSERT INTO t2 VALUES (53, 3); +INSERT INTO t2 VALUES (54, 4); +INSERT INTO t2 VALUES (55, 5); +SELECT a, b FROM t1 ORDER BY a; +a b +1 80 +2 81 +3 82 +4 83 +5 84 +SELECT a, b FROM t2 ORDER BY a; +a b +51 1 +52 2 +53 3 +54 4 +55 5 +INSERT INTO t2 VALUES (56, 6); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE) +ALTER TABLE t1 CHANGE a id INT; +SELECT id, b FROM t1 ORDER BY id; +id b +1 80 +2 81 +3 82 +4 83 +5 84 +SELECT a, b FROM t2 ORDER BY a; +a b +51 1 +52 2 +53 3 +54 4 +55 5 +# Operations on child table +INSERT INTO t2 VALUES (56, 6); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) +UPDATE t2 SET b = 99 WHERE a = 51; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) +DELETE FROM t2 WHERE a = 53; +SELECT id, b FROM t1 ORDER BY id; +id b +1 80 +2 81 +3 82 +4 83 +5 84 +SELECT a, b FROM t2 ORDER BY a; +a b +51 1 +52 2 +54 4 +55 5 +# Operations on parent table +DELETE FROM t1 WHERE id = 1; +UPDATE t1 SET id = 50 WHERE id = 5; +SELECT id, b FROM t1 ORDER BY id; +id b +2 81 +3 82 +4 83 +50 84 +SELECT a, b FROM t2 ORDER BY a; +a b +52 2 +54 4 +55 50 +DROP TABLE t2, t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/index_tree_operation.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/index_tree_operation.result new file mode 100644 index 00000000..29660962 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/index_tree_operation.result @@ -0,0 +1,55 @@ +# +# Bug#15923864 (Bug#67718): +# INNODB DRASTICALLY UNDER-FILLS PAGES IN CERTAIN CONDITIONS +# +SET GLOBAL innodb_file_per_table=ON; +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b VARCHAR(4096)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (0, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (1000, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (1001, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (1002, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (1, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (2, REPEAT('a', 4096)); +SELECT page_number, number_records +FROM information_schema.innodb_sys_tablespaces s1, +information_schema.innodb_buffer_page s2 +WHERE s1.space = s2.space AND name = 'test/t1' +AND page_type = "INDEX" ORDER BY page_number; +page_number number_records +3 2 +4 3 +5 3 +INSERT INTO t1 VALUES (999, REPEAT('a', 4096)); +SELECT page_number, number_records +FROM information_schema.innodb_sys_tablespaces s1, +information_schema.innodb_buffer_page s2 +WHERE s1.space = s2.space AND name = 'test/t1' +AND page_type = "INDEX" ORDER BY page_number; +page_number number_records +3 3 +4 3 +5 3 +6 1 +INSERT INTO t1 VALUES (998, REPEAT('a', 4096)); +SELECT page_number, number_records +FROM information_schema.innodb_sys_tablespaces s1, +information_schema.innodb_buffer_page s2 +WHERE s1.space = s2.space AND name = 'test/t1' +AND page_type = "INDEX" ORDER BY page_number; +page_number number_records +3 3 +4 3 +5 3 +6 2 +INSERT INTO t1 VALUES (997, REPEAT('a', 4096)); +SELECT page_number, number_records +FROM information_schema.innodb_sys_tablespaces s1, +information_schema.innodb_buffer_page s2 +WHERE s1.space = s2.space AND name = 'test/t1' +AND page_type = "INDEX" ORDER BY page_number; +page_number number_records +3 3 +4 3 +5 3 +6 3 +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter-tempfile.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter-tempfile.result new file mode 100644 index 00000000..12ec408a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter-tempfile.result @@ -0,0 +1,38 @@ +# +# Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS +# +# Temporary tablename will be unique. This makes sure that future +# in-place ALTERs of the same table will not be blocked due to +# temporary tablename. +# Crash the server in ha_innobase::commit_inplace_alter_table() +CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; +SET debug='d,innodb_alter_commit_crash_before_commit'; +# Write file to make mysql-test-run.pl expect crash +# Execute the statement that causes the crash +ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); +ERROR HY000: Lost connection to MySQL server during query +# Startup the server after the crash +# Read and remember the temporary table name +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Consecutive Alter table does not create same temporary file name +ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); +# Shutdown the server to allow manual recovery +# Manual recovery begin. The dictionary was not updated +# and the files were not renamed. The rebuilt table +# was left behind on purpose, to faciliate data recovery. +# Manual recovery end +# Startup the server after manual recovery +# Drop the orphaned rebuilt table. +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL, + PRIMARY KEY (`f2`,`f1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter.result index f1876f62..d6616915 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-alter.result @@ -679,3 +679,99 @@ WHERE st.NAME='test/t'; pos NAME 0 t DROP TABLE t; +# +# Bug #19465984 INNODB DATA DICTIONARY IS NOT UPDATED WHILE +# RENAMING THE COLUMN +# +CREATE TABLE t1(c1 INT NOT NULL, PRIMARY KEY(c1))ENGINE=INNODB; +CREATE TABLE t2(c2 INT NOT NULL, FOREIGN KEY(c2) REFERENCES t1(c1))ENGINE=INNODB; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `c2` int(11) NOT NULL, + KEY `c2` (`c2`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c2`) REFERENCES `t1` (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t1 CHANGE COLUMN c1 C1 INT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `C1` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `c2` int(11) NOT NULL, + KEY `c2` (`c2`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c2`) REFERENCES `t1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t1 CHANGE COLUMN C1 c5 INT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c5` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`c5`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `c2` int(11) NOT NULL, + KEY `c2` (`c2`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c2`) REFERENCES `t1` (`c5`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2, t1; +# +# BUG 20029625 - HANDLE_FATAL_SIGNAL (SIG=11) IN +# DICT_MEM_TABLE_COL_RENAME_LOW +# +CREATE TABLE parent(a INT, b INT, KEY(a, b)) ENGINE = InnoDB; +CREATE TABLE t1(a1 INT, a2 INT) ENGINE = InnoDB; +set foreign_key_checks=0; +ALTER TABLE t1 ADD CONSTRAINT fk_a FOREIGN KEY(a1, a2) REFERENCES parent(a, b) ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE t1 CHANGE a2 a3 INT,ADD CONSTRAINT fk_1 FOREIGN KEY(a1, a3) REFERENCES parent(a, b) ON DELETE SET NULL ON UPDATE CASCADE; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a1` int(11) DEFAULT NULL, + `a3` int(11) DEFAULT NULL, + KEY `fk_1` (`a1`,`a3`), + CONSTRAINT `fk_1` FOREIGN KEY (`a1`, `a3`) REFERENCES `parent` (`a`, `b`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `fk_a` FOREIGN KEY (`a1`, `a3`) REFERENCES `parent` (`a`, `b`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +ALTER TABLE t1 CHANGE a3 a4 INT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a1` int(11) DEFAULT NULL, + `a4` int(11) DEFAULT NULL, + KEY `fk_1` (`a1`,`a4`), + CONSTRAINT `fk_1` FOREIGN KEY (`a1`, `a4`) REFERENCES `parent` (`a`, `b`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `fk_a` FOREIGN KEY (`a1`, `a4`) REFERENCES `parent` (`a`, `b`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +ALTER TABLE parent CHANGE b c INT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a1` int(11) DEFAULT NULL, + `a4` int(11) DEFAULT NULL, + KEY `fk_1` (`a1`,`a4`), + CONSTRAINT `fk_1` FOREIGN KEY (`a1`, `a4`) REFERENCES `parent` (`a`, `c`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `fk_a` FOREIGN KEY (`a1`, `a4`) REFERENCES `parent` (`a`, `c`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, parent; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-autoinc.result index a1a4abaf..0e0f49b9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -1357,3 +1357,30 @@ t1 CREATE TABLE `t1` ( INSERT INTO t1 VALUES (); ERROR HY000: Failed to read auto-increment value from storage engine DROP TABLE t1; +# +# Bug #14049391 INNODB MISCALCULATES AUTO-INCREMENT +# AFTER CHANGING AUTO_INCREMENT_INCREMEMENT +# +CREATE TABLE t ( i INT AUTO_INCREMENT, KEY(i) ) ENGINE=InnoDB; +SET auto_increment_increment = 300; +INSERT INTO t VALUES (NULL), (NULL); +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `i` int(11) NOT NULL AUTO_INCREMENT, + KEY `i` (`i`) +) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=latin1 +SET auto_increment_increment = 50; +INSERT INTO t VALUES (NULL); +SELECT * FROM t; +i +1 +301 +351 +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `i` int(11) NOT NULL AUTO_INCREMENT, + KEY `i` (`i`) +) ENGINE=InnoDB AUTO_INCREMENT=401 DEFAULT CHARSET=latin1 +DROP TABLE t; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-double-write.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-double-write.result new file mode 100644 index 00000000..39249c18 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-double-write.result @@ -0,0 +1,254 @@ +# +# Bug #17335427 INNODB CAN NOT USE THE DOUBLEWRITE BUFFER PROPERLY +# Bug #18144349 INNODB CANNOT USE THE DOUBLEWRITE BUFFER FOR THE FIRST +# PAGE OF SYSTEM TABLESPACE +# +SET GLOBAL innodb_fast_shutdown = 0; +show variables like 'innodb_doublewrite'; +Variable_name Value +innodb_doublewrite ON +show variables like 'innodb_fil_make_page_dirty_debug'; +Variable_name Value +innodb_fil_make_page_dirty_debug 0 +show variables like 'innodb_saved_page_number_debug'; +Variable_name Value +innodb_saved_page_number_debug 0 +create table t1 (f1 int primary key, f2 blob) engine=innodb; +start transaction; +insert into t1 values(1, repeat('#',12)); +insert into t1 values(2, repeat('+',12)); +insert into t1 values(3, repeat('/',12)); +insert into t1 values(4, repeat('-',12)); +insert into t1 values(5, repeat('.',12)); +commit work; +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if first page of user +# tablespace is full of zeroes. +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +# Wait for purge to complete +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +# Make the first page dirty for table t1 +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +set debug='+d,crash_commit_before'; +insert into t1 values (6, repeat('%', 12)); +ERROR HY000: Lost connection to MySQL server during query +# Make the first page (page_no=0) of the user tablespace +# full of zeroes. +# Server must be started successfully, and table t1 must be fine... +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if first page of user +# tablespace is corrupted. +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +# Make the first page dirty for table t1 +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +set debug='+d,crash_commit_before'; +insert into t1 values (6, repeat('%', 12)); +ERROR HY000: Lost connection to MySQL server during query +# Corrupt the first page (page_no=0) of the user tablespace. +# Server must be started successfully, and table t1 must be fine... +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if 2nd page of user +# tablespace is full of zeroes. +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +# Make the 2nd page dirty for table t1 +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +set debug='+d,crash_commit_before'; +insert into t1 values (6, repeat('%', 400)); +ERROR HY000: Lost connection to MySQL server during query +# Make the 2nd page (page_no=1) of the tablespace all zeroes. +# Server must be started successfully, and table t1 must be fine... +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if 2nd page of user +# tablespace is corrupted. +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +# Make the 2nd page dirty for table t1 +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = @space_id; +# Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; +set debug='+d,crash_commit_before'; +insert into t1 values (6, repeat('%', 400)); +ERROR HY000: Lost connection to MySQL server during query +# Corrupt the 2nd page (page_no=1) of the user tablespace. +# Server must be started successfully, and table t1 must be fine... +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if first page of +# system tablespace is full of zeroes. +# Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; +# Make the first page dirty for system tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 0; +# Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; +set debug='+d,crash_commit_before'; +insert into t1 values (6, repeat('%', 400)); +ERROR HY000: Lost connection to MySQL server during query +# Make the first page (page_no=0) of the system tablespace +# all zeroes. +# Server must be started successfully, and table t1 must be fine... +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if first page of +# system tablespace is corrupted. +# Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; +# Make the first page dirty for system tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 0; +# Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; +set debug='+d,crash_commit_before'; +insert into t1 values (6, repeat('%', 400)); +ERROR HY000: Lost connection to MySQL server during query +# Corrupt the first page (page_no=0) of the system tablespace. +# Server must be started successfully, and table t1 must be fine... +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if 2nd page of +# system tablespace is full of zeroes. +# Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; +# Make the second page dirty for system tablespace +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = 0; +# Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; +set debug='+d,crash_commit_before'; +insert into t1 values (6, repeat('%', 400)); +ERROR HY000: Lost connection to MySQL server during query +# Make the 2nd page (page_no=1) of the system tablespace +# all zeroes. +# Server must be started successfully, and table t1 must be fine... +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +# Test Begin: Test if recovery works if 2nd page of +# system tablespace is corrupted. +# Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; +# Make the second page dirty for system tablespace +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = 0; +# Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; +set debug='+d,crash_commit_before'; +insert into t1 values (6, repeat('%', 400)); +ERROR HY000: Lost connection to MySQL server during query +# Make the 2nd page (page_no=1) of the system tablespace +# all zeroes. +# Server must be started successfully, and table t1 must be fine... +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select f1, f2 from t1; +f1 f2 +1 ############ +2 ++++++++++++ +3 //////////// +4 ------------ +5 ............ +# Test End +# --------------------------------------------------------------- +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-lock.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-lock.result index 439a8d65..7bd62f79 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-lock.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-lock.result @@ -106,3 +106,16 @@ a b 3 1 COMMIT; DROP TABLE t1; +Bug#19803418 ASSERTION: TABLE->QUIESCE == QUIESCE_NONE +IN ROW0QUIESCE.CC LINE 683 +CREATE TABLE t1(C TEXT CHARACTER SET UJIS) ENGINE=INNODB; +LOCK TABLES t1 WRITE,t1 AS t0 READ,t1 AS t2 READ; +FLUSH TABLE t1; +LOCK TABLES t1 READ,t1 AS t0 WRITE,t1 AS t2 READ; +FLUSH TABLE t1; +LOCK TABLES t1 READ,t1 AS t0 READ,t1 AS t2 READ; +FLUSH TABLE t1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +UNLOCK TABLES; +FLUSH TABLE t1; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-update-insert.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-update-insert.result new file mode 100644 index 00000000..cd0fed10 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-update-insert.result @@ -0,0 +1,43 @@ +# +# Bug#14668683 ASSERT REC_GET_DELETED_FLAG(REC, PAGE_IS_COMP(PAGE)) +# +create table t1(f1 char(1) primary key, f2 int not null, f3 blob) +engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` char(1) NOT NULL, + `f2` int(11) NOT NULL, + `f3` blob, + PRIMARY KEY (`f1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +insert into t1 values ('a', 0, repeat('b',8102)); +select f1 from t1; +f1 +a +update t1 set f1='A'; +select f1 from t1; +f1 +A +drop table t1; +# +# Another test case +# +create table t1 (f1 char(1), f2 longblob, f3 blob, primary key(f1)) +charset=utf8 engine=innodb; +replace into t1 set f1=0xa3; +Warnings: +Warning 1366 Incorrect string value: '\xA3' for column 'f1' at row 1 +select f1 from t1; +f1 + +update t1 set f1=0x6a; +update t1 set f3=repeat(0xb1,8103); +update t1 set f1=0x4a; +update t1 set f1=0x82; +Warnings: +Warning 1366 Incorrect string value: '\x82' for column 'f1' at row 1 +select f1 from t1; +f1 + +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-alter.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-alter.result index f2f2e20a..59d0921e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-alter.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-alter.result @@ -687,6 +687,12 @@ ALGORITHM=INPLACE, LOCK=SHARED; Warnings: Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -755,11 +761,23 @@ ALTER TABLE t1n ADD FULLTEXT INDEX(ct); Warnings: Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -793,11 +811,23 @@ ALTER TABLE t1n CHANGE FTS_DOC_ID c11 INT, ALGORITHM=INPLACE; ERROR 42S22: Unknown column 'FTS_DOC_ID' in 't1n' ALTER TABLE t1n CHANGE c1 FTS_DOC_ïD INT, ALGORITHM=INPLACE; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -825,11 +855,23 @@ t1p.ibd tt.ibd ALTER TABLE t1n CHANGE FTS_DOC_ÃD c1 INT, ALGORITHM=INPLACE; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -858,11 +900,23 @@ tt.ibd ALTER TABLE t1n CHANGE c1 c2 INT, CHANGE c2 ct INT, CHANGE ct c1 TEXT, ALGORITHM=INPLACE; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -900,11 +954,23 @@ t1n CREATE TABLE `t1n` ( ALTER TABLE t1n CHANGE c2 c1 INT, CHANGE ct c2 INT, CHANGE c1 ct TEXT, ALGORITHM=COPY; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -945,11 +1011,23 @@ ALTER TABLE t1n ADD INDEX(c2), CHANGE c2 c4 INT, ALGORITHM=COPY; ERROR 42000: Key column 'c2' doesn't exist in table ALTER TABLE t1n ADD INDEX(c4), CHANGE c2 c4 INT, ALGORITHM=INPLACE; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -987,11 +1065,23 @@ t1n CREATE TABLE `t1n` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ALTER TABLE t1n DROP INDEX c4; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -1021,11 +1111,23 @@ ALTER TABLE t1n CHANGE c4 c1 INT, ADD INDEX(c1), ALGORITHM=INPLACE; ERROR 42S21: Duplicate column name 'c1' ALTER TABLE t1n CHANGE c4 c11 INT, ADD INDEX(c11), ALGORITHM=INPLACE; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -1064,6 +1166,12 @@ t1n CREATE TABLE `t1n` ( DROP TABLE t1n; ALTER TABLE t1o MODIFY c1 BIGINT UNSIGNED NOT NULL; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -1091,11 +1199,23 @@ ALTER TABLE t1o ADD FULLTEXT INDEX(ct), CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -1140,6 +1260,12 @@ t1o CREATE TABLE `t1o` ( ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL, DROP INDEX ct, LOCK=NONE; ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -1194,6 +1320,12 @@ INNER JOIN sys_foreign sf ON i.ID = sf.ID; ID FOR_COL_NAME REF_COL_NAME POS ALTER TABLE t1o ADD UNIQUE INDEX FTS_DOC_ID_INDEX(foo_id); ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd @@ -1214,11 +1346,23 @@ tt.ibd ALTER TABLE t1o CHANGE foo_id FTS_DOC_ID BIGINT UNSIGNED NOT NULL, ADD FULLTEXT INDEX(ct); ### files in MYSQL_DATA_DIR/test +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd FTS_AUX_DELETED.ibd FTS_AUX_DELETED_CACHE.ibd +FTS_AUX_INDEX_1.ibd +FTS_AUX_INDEX_2.ibd +FTS_AUX_INDEX_3.ibd +FTS_AUX_INDEX_4.ibd +FTS_AUX_INDEX_5.ibd +FTS_AUX_INDEX_6.ibd FTS_AUX_BEING_DELETED.ibd FTS_AUX_BEING_DELETED_CACHE.ibd FTS_AUX_CONFIG.ibd diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-debug.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-debug.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-linux.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-linux.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-windows.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb-wl5980-windows.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb.result index 494dcbe6..0b891be0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb.result @@ -1684,7 +1684,7 @@ variable_value - @innodb_rows_deleted_orig 71 SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted'; variable_value - @innodb_rows_inserted_orig -1006 +963 SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated'; variable_value - @innodb_rows_updated_orig 866 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result new file mode 100644 index 00000000..9f6b7ca6 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result @@ -0,0 +1,23 @@ +call mtr.add_suppression("InnoDB: The total blob data length"); +SET GLOBAL max_allowed_packet = 100*1024*1024; +# Connection big_packets: +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); +start transaction; +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); +ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size. +# Connection default: +# Quick shutdown and restart server +# Connection default: +SELECT a FROM t1; +a +1 +2 +3 +4 +5 +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug14169459.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug14169459.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug34300.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug34300.result index ae9fee81..09fc0b44 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug34300.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug34300.result @@ -1,4 +1,3 @@ +ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size. f4 f8 -xxx zzz f4 f8 -xxx zzz diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug57904.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug57904.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug60196.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_bug60196.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_corrupt_bit.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_corrupt_bit.result index aee6051a..10fc88a2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_corrupt_bit.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_corrupt_bit.result @@ -78,4 +78,5 @@ z 31 32 drop table corrupt_bit_test_Ä; +DROP DATABASE pad; SET GLOBAL innodb_change_buffering_debug = 0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_ctype_ldml.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_ctype_ldml.result index 6b0d8f09..ab4f5658 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_ctype_ldml.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_ctype_ldml.result @@ -805,7 +805,7 @@ ERROR HY000: Unknown collation: 'utf8_5624_2' SHOW WARNINGS; Level Code Message Error 1273 Unknown collation: 'utf8_5624_2' -Warning 1273 Syntax error at '[strength tertiary]' +Warning 1273 Syntax error at '[strength tertiary]' for COLLATION : utf8_5624_2 # # WL#5624, reset before primary ignorable # diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_stats_external_pages.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_stats_external_pages.result new file mode 100644 index 00000000..0718efdc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_stats_external_pages.result @@ -0,0 +1,19 @@ +CREATE TABLE bug18384390 ( +id INT AUTO_INCREMENT PRIMARY KEY, +txt VARCHAR(10000) +) ENGINE=INNODB STATS_AUTO_RECALC=0; +INSERT INTO bug18384390 (txt) VALUES (REPEAT('0', 10000)); +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; +ANALYZE TABLE bug18384390; +Table Op Msg_type Msg_text +test.bug18384390 analyze status OK +DROP TABLE bug18384390; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/insert_debug.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/insert_debug.result new file mode 100644 index 00000000..0d176afa --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/insert_debug.result @@ -0,0 +1,11 @@ +# +# Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 +# CAUSES INFINITE PAGE SPLIT +# +SET GLOBAL innodb_change_buffering_debug=1; +SET GLOBAL innodb_limit_optimistic_insert_debug=1; +CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB +PARTITION BY HASH (c1) PARTITIONS 15; +DROP TABLE t1; +SET GLOBAL innodb_change_buffering_debug=0; +SET GLOBAL innodb_limit_optimistic_insert_debug=0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/monitor.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/monitor.result new file mode 100644 index 00000000..68ab1bf1 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/monitor.result @@ -0,0 +1,549 @@ +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/monitor_debug.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/monitor_debug.result new file mode 100644 index 00000000..797f2319 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/monitor_debug.result @@ -0,0 +1,20 @@ +# +# BUG#20080942 - ADAPTIVE_HASH_SEARCHES_BTREE NOT UPDATED +# +SET GLOBAL innodb_fast_shutdown=0; +SET GLOBAL innodb_stats_persistent = OFF; +SET GLOBAL innodb_stats_auto_recalc = OFF; +SET GLOBAL innodb_purge_stop_now = ON; +CREATE TABLE t1(a INT PRIMARY KEY, b BLOB) STATS_PERSISTENT=0; +INSERT INTO t1 VALUES(1, 'abc'); +INSERT INTO t1 VALUES(2, 'def'); +INSERT INTO t1 VALUES(3, 'ghi'); +SELECT * FROM t1; +a b +1 abc +2 def +3 ghi +DROP TABLE t1; +SET GLOBAL innodb_stats_persistent = default; +SET GLOBAL innodb_stats_auto_recalc = default; +SET GLOBAL innodb_purge_run_now = ON; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/sp_temp_table.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/sp_temp_table.result new file mode 100644 index 00000000..49a2a4aa --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/sp_temp_table.result @@ -0,0 +1,253 @@ +# +# Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE +# CALLED FROM A FUNCTION +# +call mtr.add_suppression("MySQL is trying to drop table"); +CREATE PROCEDURE cachedata( +IN obj_id BIGINT UNSIGNED, +IN start DATETIME, +IN end DATETIME +) +cachedata:BEGIN +DECLARE cache_count BIGINT; +SET @timestamp := NOW(); +CREATE TEMPORARY TABLE IF NOT EXISTS cachedata ( +timestamp DATETIME, +object_id BIGINT UNSIGNED NOT NULL, +start DATETIME, +end DATETIME, +seqno BIGINT AUTO_INCREMENT, +value FLOAT, +PRIMARY KEY (seqno), +INDEX (timestamp), +INDEX (object_id, start, end) +) ENGINE=INNODB; +DELETE FROM cachedata WHERE +timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND); +SELECT count(*) INTO cache_count FROM cachedata WHERE +object_id = obj_id +AND start = start +AND end = end; +IF cache_count > 0 THEN LEAVE cachedata; +END IF; +INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 2345), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 2345), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 2345); +END$$ +CREATE FUNCTION get_cache( +obj_id BIGINT UNSIGNED, +start DATETIME, +end DATETIME +) +RETURNS FLOAT +READS SQL DATA +BEGIN +DECLARE result FLOAT; +CALL cachedata(obj_id, start, end); +SELECT SUM(value) INTO result FROM cachedata WHERE +object_id = obj_id +AND start = start +AND end = end; +RETURN result; +END$$ +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +DROP FUNCTION get_cache; +DROP PROCEDURE cachedata; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/strict_mode.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/strict_mode.result new file mode 100644 index 00000000..d6e9df31 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/strict_mode.result @@ -0,0 +1,242 @@ +# +# Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN +# INNODB_STRICT_MODE = 1 +# +set innodb_strict_mode = 0; +create table t1 (id int auto_increment primary key, +v varchar(32), +col1 text, +col2 text, +col3 text, +col4 text, +col5 text, +col6 text, +col7 text, +col8 text, +col9 text, +col10 text, +col11 text, +col12 text, +col13 text, +col14 text, +col15 text, +col16 text, +col17 text, +col18 text, +col19 text, +col20 text, +col21 text, +col22 text, +col23 text, +col24 text, +col25 text, +col26 text, +col27 text, +col28 text, +col29 text, +col30 text, +col31 text, +col32 text, +col33 text, +col34 text, +col35 text, +col36 text, +col37 text, +col38 text, +col39 text, +col40 text, +col41 text, +col42 text, +col43 text, +col44 text, +col45 text , +col46 text, +col47 text, +col48 text, +col49 text, +col50 text, +col51 text, +col52 text, +col53 text, +col54 text, +col55 text, +col56 text, +col57 text, +col58 text, +col59 text, +col60 text, +col61 text, +col62 text, +col63 text, +col64 text, +col65 text, +col66 text, +col67 text, +col68 text , +col69 text, +col70 text, +col71 text, +col72 text, +col73 text, +col74 text, +col75 text, +col76 text, +col77 text, +col78 text, +col79 text, +col80 text, +col81 text, +col82 text, +col83 text, +col84 text, +col85 text, +col86 text, +col87 text, +col88 text, +col89 text, +col90 text, +col91 text, +col92 text, +col93 text, +col94 text, +col95 text, +col96 text, +col97 text, +col98 text, +col99 text, +col100 text, +col101 text, +col102 text, +col103 text, +col104 text, +col105 text, +col106 text, +col107 text, +col108 text, +col109 text, +col110 text, +col111 text, +col112 text, +col113 text, +col114 text, +col115 text, +col116 text, +col117 text, +col118 text, +col119 text, +col120 text, +col121 text, +col122 text, +col123 text, +col124 text, +col125 text, +col126 text , +col127 text, +col128 text, +col129 text, +col130 text, +col131 text, +col132 text, +col133 text, +col134 text, +col135 text, +col136 text, +col137 text, +col138 text, +col139 text, +col140 text, +col141 text, +col142 text, +col143 text, +col144 text, +col145 text, +col146 text, +col147 text , +col148 text, +col149 text, +col150 text, +col151 text, +col152 text, +col153 text, +col154 text, +col155 text, +col156 text, +col157 text, +col158 text, +col159 text, +col160 text, +col161 text, +col162 text, +col163 text, +col164 text, +col165 text, +col166 text, +col167 text, +col168 text, +col169 text, +col170 text, +col171 text, +col172 text , +col173 text, +col174 text, +col175 text, +col176 text, +col177 text, +col178 text, +col179 text, +col180 text, +col181 text, +col182 text, +col183 text, +col184 text, +col185 text, +col186 text, +col187 text, +col188 text, +col189 text, +col190 text, +col191 text, +col192 text, +col193 text, +col194 text, +col195 text, +col196 text, +col197 text, +col198 text, +col199 text, +col200 text, +col201 text, +col202 text, +col203 text, +col204 text, +col205 text, +col206 text, +col207 text, +col208 text, +col209 text, +col210 text, +col211 text, +col212 text, +col213 text, +col214 text, +col215 text, +col216 text, +col217 text, +col218 text, +col219 text, +col220 text, +col221 text, +col222 text, +col223 text, +col224 text, +col225 text, +col226 text, +col227 text, +col228 text +) ENGINE=InnoDB; +Warnings: +Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. +set innodb_strict_mode = 1; +alter table t1 engine=InnoDB; +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is NNNN. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/add_foreign_key.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/add_foreign_key.test new file mode 100644 index 00000000..d0febfd6 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/add_foreign_key.test @@ -0,0 +1,38 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE ADD +--echo # FOREIGN KEY +--echo # + +CREATE TABLE `parent` (`parent_id` INT, PRIMARY KEY (`parent_id`)); +CREATE TABLE `child1` (`id` INT ,`child1_fk1` INT, `child1_fk2` INT, +PRIMARY KEY (`id`)); +CREATE TABLE `child2` (`id` INT, `child2_fk1` INT, `child2_fk2` INT, +PRIMARY KEY (`id`)); +CREATE TABLE `child3` (`id` INT , `child3_fk1` INT, PRIMARY KEY (`id`)); +ALTER TABLE `child1` ADD FOREIGN KEY (`child1_fk1`) REFERENCES `parent` +(`parent_id`); +ALTER TABLE `child1` ADD FOREIGN KEY (`child1_fk1`) REFERENCES +`parent` (`parent_id`); +ALTER TABLE `child1` ADD FOREIGN KEY (`child1_fk2`) REFERENCES `parent` +(`parent_id`); + +ALTER TABLE `child2` ADD FOREIGN KEY (`child2_fk1`) REFERENCES `parent` +(`parent_id`); + +ALTER TABLE `child2` ADD FOREIGN KEY (`child2_fk2`) REFERENCES `parent` +(`parent_id`); + +ALTER TABLE `child3` ADD FOREIGN KEY (`child3_fk1`) REFERENCES `parent` +(`parent_id`); +ALTER TABLE `child1` ADD FOREIGN KEY (`child1_fk2`) REFERENCES +`parent` (`parent_id`); +ALTER TABLE `child2` ADD FOREIGN KEY (`child2_fk1`) REFERENCES +`parent` (`parent_id`); +ALTER TABLE `child2` ADD FOREIGN KEY (`child2_fk2`) REFERENCES +`parent` (`parent_id`); +ALTER TABLE `child3` ADD FOREIGN KEY (`child3_fk1`) REFERENCES +`parent` (`parent_id`); + +drop table child3, child2, child1, parent; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob-update-debug.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob-update-debug.test new file mode 100644 index 00000000..e12c351e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob-update-debug.test @@ -0,0 +1,17 @@ +# This file contains tests involving update operations on blob data type. + +--source include/have_innodb.inc +--source include/have_debug.inc + +--echo # +--echo # Bug#18185930 UPD_NODE_INSERT_BLOB CAUSES BTR_EXTERN_OWNER_FLAG +--echo # ASSERTION +--echo # + +create table t1 (f1 int primary key, f2 blob) engine = innodb; +insert into t1 values (1, repeat('*', 50000)); +select f1, substring(f2, 1, 40) from t1; +set debug = 'd,row_ins_index_entry_timeout'; +update t1 set f1 = 3; +select f1, substring(f2, 1, 40) from t1; +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob_redo-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob_redo-master.opt new file mode 100644 index 00000000..36994abf --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob_redo-master.opt @@ -0,0 +1 @@ +--innodb-log-files-in-group=12 --innodb-log-file-size=5M diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob_redo.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob_redo.test new file mode 100644 index 00000000..d292a729 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/blob_redo.test @@ -0,0 +1,92 @@ +--source include/not_embedded.inc +--source include/not_crashrep.inc +--source include/have_innodb.inc +--source include/have_innodb_16k.inc + +--echo # +--echo # Bug #19498877 LIMITATION ON BLOB SIZE IS TOO STRICT, BLOB CAN +--echo # BE 10% OF TOTAL REDO LOG SIZE +--echo # + +# Save the initial number of concurrent sessions. +--source include/count_sessions.inc + +call mtr.add_suppression("InnoDB: Resizing redo log from"); +call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files."); +call mtr.add_suppression("InnoDB: New log files created, LSN="); + +SET GLOBAL max_allowed_packet = 100*1024*1024; + +--echo # Connection big_packets: +connect(big_packets,localhost,root,,); +connection big_packets; + +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; + +# Insert a few rows (it doesn't really matter how many). These transactions +# are committed once they are acked, so they should not be lost. +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); + +start transaction; +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 6*1024*1024)); + +--echo # Connection default: +connection default; + +# We expect a restart. +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # Quick shutdown and restart server +--shutdown_server 0 + +# Wait for the server to come back up, and reconnect. +--enable_reconnect +--source include/wait_until_connected_again.inc +--disable_reconnect + +--echo # Connection default: +connection default; + +--disconnect big_packets + +# We should see (1,2,3,4,5) here. +SELECT a, b FROM t1; + +SET GLOBAL max_allowed_packet = 100*1024*1024; + +--echo # Connection big_packets: +connect(big_packets,localhost,root,,); + +start transaction; +UPDATE t1 SET b = REPEAT('a', 6*1024*1024) WHERE a = 1; + +--echo # Connection default: +connection default; + +# We expect a restart. +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # Quick shutdown and restart server +--shutdown_server 0 + +# Wait for the server to come back up, and reconnect. +--enable_reconnect +--source include/wait_until_connected_again.inc +--disable_reconnect + +--echo # Connection default: +connection default; + +--disconnect big_packets + +# We should see (1,2,3,4,5) here. +SELECT a, b FROM t1; + +# Clean up. +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/checksum.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/checksum.test new file mode 100644 index 00000000..4b371aa1 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/checksum.test @@ -0,0 +1,15 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source suite/innodb/include/checksum_not_strict.inc +--echo # +--echo # Bug#19500258 ZERO CAN BE A VALID INNODB CHECKSUM, +--echo # BUT VALIDATION WILL FAIL LATER +--echo # +--let $old_checksum_algorithm= `SELECT @@GLOBAL.innodb_checksum_algorithm` +SET GLOBAL innodb_checksum_algorithm = 'CRC32'; +CREATE TABLE t1 (a INT PRIMARY KEY, b VARBINARY(512)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, X'666F72636520637263333220a0be0639'); +--source include/restart_mysqld.inc +SELECT count(*) FROM t1; +--eval SET GLOBAL innodb_checksum_algorithm = '$old_checksum_algorithm'; +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/create-index.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/create-index.test new file mode 100644 index 00000000..e1e5b856 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/create-index.test @@ -0,0 +1,11 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug #18010711 UNIQUE PREFIX INDEX ON BINARY COLUMN: FAILING +--echo # ASSERTION: FLEN == LEN +--echo # +create table t1 (f1 binary(5)) engine=innodb; +insert into t1 values ('w'), ('w'); +--error ER_DUP_ENTRY +create unique index index_t1 on t1(f1(4)); +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/foreign_key.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/foreign_key.test new file mode 100644 index 00000000..6cba3c2b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/foreign_key.test @@ -0,0 +1,87 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug #19027905 ASSERT RET.SECOND DICT_CREATE_FOREIGN_CONSTRAINTS_LOW +--echo # DICT_CREATE_FOREIGN_CONSTR +--echo # + +create table t1 (f1 int primary key) engine=InnoDB; +--error ER_CANNOT_ADD_FOREIGN +create table t2 (f1 int primary key, +constraint c1 foreign key (f1) references t1(f1), +constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB; +create table t2 (f1 int primary key, + constraint c1 foreign key (f1) references t1(f1)) engine=innodb; + +--replace_regex /#sql-[0-9a-f_]*'/#sql-temporary'/ +--error ER_DUP_KEY +alter table t2 add constraint c1 foreign key (f1) references t1(f1); + +set foreign_key_checks = 0; +--error ER_FK_DUP_NAME +alter table t2 add constraint c1 foreign key (f1) references t1(f1); + +drop table t2, t1; + +--echo # +--echo # Bug #20031243 CREATE TABLE FAILS TO CHECK IF FOREIGN KEY COLUMN +--echo # NULL/NOT NULL MISMATCH +--echo # + +set foreign_key_checks = 1; +show variables like 'foreign_key_checks'; + +CREATE TABLE t1 +(a INT NOT NULL, + b INT NOT NULL, + INDEX idx(a)) ENGINE=InnoDB; + +CREATE TABLE t2 +(a INT KEY, + b INT, + INDEX ind(b), + FOREIGN KEY (b) REFERENCES t1(a) ON DELETE CASCADE ON UPDATE CASCADE) + ENGINE=InnoDB; + +show create table t1; +show create table t2; + +INSERT INTO t1 VALUES (1, 80); +INSERT INTO t1 VALUES (2, 81); +INSERT INTO t1 VALUES (3, 82); +INSERT INTO t1 VALUES (4, 83); +INSERT INTO t1 VALUES (5, 84); + +INSERT INTO t2 VALUES (51, 1); +INSERT INTO t2 VALUES (52, 2); +INSERT INTO t2 VALUES (53, 3); +INSERT INTO t2 VALUES (54, 4); +INSERT INTO t2 VALUES (55, 5); + +SELECT a, b FROM t1 ORDER BY a; +SELECT a, b FROM t2 ORDER BY a; + +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO t2 VALUES (56, 6); + +ALTER TABLE t1 CHANGE a id INT; + +SELECT id, b FROM t1 ORDER BY id; +SELECT a, b FROM t2 ORDER BY a; + +--echo # Operations on child table +--error ER_NO_REFERENCED_ROW_2 +INSERT INTO t2 VALUES (56, 6); +--error ER_NO_REFERENCED_ROW_2 +UPDATE t2 SET b = 99 WHERE a = 51; +DELETE FROM t2 WHERE a = 53; +SELECT id, b FROM t1 ORDER BY id; +SELECT a, b FROM t2 ORDER BY a; + +--echo # Operations on parent table +DELETE FROM t1 WHERE id = 1; +UPDATE t1 SET id = 50 WHERE id = 5; +SELECT id, b FROM t1 ORDER BY id; +SELECT a, b FROM t2 ORDER BY a; + +DROP TABLE t2, t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/index_tree_operation.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/index_tree_operation.test new file mode 100644 index 00000000..b9695db9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/index_tree_operation.test @@ -0,0 +1,74 @@ +-- source include/have_innodb.inc +-- source include/have_innodb_16k.inc +--echo # +--echo # Bug#15923864 (Bug#67718): +--echo # INNODB DRASTICALLY UNDER-FILLS PAGES IN CERTAIN CONDITIONS +--echo # +# InnoDB should try to insert to the next page before split, +# if the insert record for split_and_insert is last of the page. +# Otherwise, the follwing records 999,998,997 cause each page per record. +# + +--disable_query_log +SET @old_innodb_file_per_table = @@innodb_file_per_table; +--enable_query_log + +SET GLOBAL innodb_file_per_table=ON; + +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b VARCHAR(4096)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (0, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (1000, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (1001, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (1002, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (1, REPEAT('a', 4096)); +INSERT INTO t1 VALUES (2, REPEAT('a', 4096)); + +# | 0, 1, 2 | 1000, 1001, 1002| + +SELECT page_number, number_records +FROM information_schema.innodb_sys_tablespaces s1, +information_schema.innodb_buffer_page s2 +WHERE s1.space = s2.space AND name = 'test/t1' +AND page_type = "INDEX" ORDER BY page_number; + +INSERT INTO t1 VALUES (999, REPEAT('a', 4096)); + +# try to insert '999' to the end of '0,1,2' page, but no space +# the next '1000,1001,1002' page has also no space. +# | 0, 1, 2 | 999 | 1000, 1001, 1002| + +SELECT page_number, number_records +FROM information_schema.innodb_sys_tablespaces s1, +information_schema.innodb_buffer_page s2 +WHERE s1.space = s2.space AND name = 'test/t1' +AND page_type = "INDEX" ORDER BY page_number; + + +INSERT INTO t1 VALUES (998, REPEAT('a', 4096)); + +# try to insert to the end of '0,1,2' page, but no space +# the next '998' page has space. +# | 0, 1, 2 | 998, 999 | 1000, 1001, 1002| + +SELECT page_number, number_records +FROM information_schema.innodb_sys_tablespaces s1, +information_schema.innodb_buffer_page s2 +WHERE s1.space = s2.space AND name = 'test/t1' +AND page_type = "INDEX" ORDER BY page_number; + +INSERT INTO t1 VALUES (997, REPEAT('a', 4096)); + +# same +# | 0, 1, 2 | 997, 998, 999 | 1000, 1001, 1002| + +SELECT page_number, number_records +FROM information_schema.innodb_sys_tablespaces s1, +information_schema.innodb_buffer_page s2 +WHERE s1.space = s2.space AND name = 'test/t1' +AND page_type = "INDEX" ORDER BY page_number; + +DROP TABLE t1; + +--disable_query_log +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/innodb-alter-tempfile.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter-tempfile.test new file mode 100644 index 00000000..aff179a8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter-tempfile.test @@ -0,0 +1,72 @@ +# Not supported in embedded +--source include/not_embedded.inc + +# This test case needs to crash the server. Needs a debug server. +--source include/have_debug.inc + +# Don't test this under valgrind, memory leaks will occur. +--source include/not_valgrind.inc + +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc + +--echo # +--echo # Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS +--echo # +--echo # Temporary tablename will be unique. This makes sure that future +--echo # in-place ALTERs of the same table will not be blocked due to +--echo # temporary tablename. + +let datadir= `select @@datadir`; + +--let $_server_id= `SELECT @@server_id` +--let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect + +--echo # Crash the server in ha_innobase::commit_inplace_alter_table() +CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; +SET debug='d,innodb_alter_commit_crash_before_commit'; + +let $orig_table_id = `SELECT table_id + FROM information_schema.innodb_sys_tables + WHERE name = 'test/t1'`; + +--echo # Write file to make mysql-test-run.pl expect crash +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # Execute the statement that causes the crash +--error 2013 +ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); +--echo # Startup the server after the crash +--source include/start_mysqld.inc + +--echo # Read and remember the temporary table name +let $temp_table_name = `SELECT SUBSTRING(name,6) + FROM information_schema.innodb_sys_tables + WHERE name LIKE "test/#sql-ib$orig_table_id%"`; +# This second copy is an environment variable for the perl script below. +let temp_table_name = $temp_table_name; +show create table t1; +--echo # Consecutive Alter table does not create same temporary file name +ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); +--echo # Shutdown the server to allow manual recovery +--source include/shutdown_mysqld.inc + +--echo # Manual recovery begin. The dictionary was not updated +--echo # and the files were not renamed. The rebuilt table +--echo # was left behind on purpose, to faciliate data recovery. + +perl; +my @frm_file = glob "$ENV{'datadir'}/test/#sql-*.frm"; +my $target_frm = "$ENV{'datadir'}/test/$ENV{'temp_table_name'}.frm"; +rename($frm_file[0], $target_frm); +EOF +--echo # Manual recovery end +--echo # Startup the server after manual recovery +--source include/start_mysqld.inc + +--echo # Drop the orphaned rebuilt table. +--disable_query_log +eval DROP TABLE `#mysql50#$temp_table_name`; +--enable_query_log +show create table t1; +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter.test index daf1c853..9abc448b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-alter.test @@ -398,3 +398,43 @@ DROP TABLE t; --disable_query_log call mtr.add_suppression("deleting orphaned .ibd file"); --enable_query_log + +--echo # +--echo # Bug #19465984 INNODB DATA DICTIONARY IS NOT UPDATED WHILE +--echo # RENAMING THE COLUMN +--echo # +CREATE TABLE t1(c1 INT NOT NULL, PRIMARY KEY(c1))ENGINE=INNODB; +CREATE TABLE t2(c2 INT NOT NULL, FOREIGN KEY(c2) REFERENCES t1(c1))ENGINE=INNODB; +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t2; +ALTER TABLE t1 CHANGE COLUMN c1 C1 INT; +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t2; +ALTER TABLE t1 CHANGE COLUMN C1 c5 INT; +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t2; +DROP TABLE t2, t1; + +--echo # +--echo # BUG 20029625 - HANDLE_FATAL_SIGNAL (SIG=11) IN +--echo # DICT_MEM_TABLE_COL_RENAME_LOW +--echo # +CREATE TABLE parent(a INT, b INT, KEY(a, b)) ENGINE = InnoDB; +CREATE TABLE t1(a1 INT, a2 INT) ENGINE = InnoDB; + +set foreign_key_checks=0; +ALTER TABLE t1 ADD CONSTRAINT fk_a FOREIGN KEY(a1, a2) REFERENCES parent(a, b) ON DELETE SET NULL ON UPDATE CASCADE; + +ALTER TABLE t1 CHANGE a2 a3 INT,ADD CONSTRAINT fk_1 FOREIGN KEY(a1, a3) REFERENCES parent(a, b) ON DELETE SET NULL ON UPDATE CASCADE; +SHOW CREATE TABLE t1; +CHECK TABLE t1; + +ALTER TABLE t1 CHANGE a3 a4 INT; +SHOW CREATE TABLE t1; +CHECK TABLE t1; + +ALTER TABLE parent CHANGE b c INT; +SHOW CREATE TABLE t1; +CHECK TABLE t1; + +DROP TABLE t1, parent; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-autoinc.test index 38038de7..3d9f5916 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -685,3 +685,17 @@ SHOW CREATE TABLE t1; --error 1467 INSERT INTO t1 VALUES (); DROP TABLE t1; + +--echo # +--echo # Bug #14049391 INNODB MISCALCULATES AUTO-INCREMENT +--echo # AFTER CHANGING AUTO_INCREMENT_INCREMEMENT +--echo # +CREATE TABLE t ( i INT AUTO_INCREMENT, KEY(i) ) ENGINE=InnoDB; +SET auto_increment_increment = 300; +INSERT INTO t VALUES (NULL), (NULL); +SHOW CREATE TABLE t; +SET auto_increment_increment = 50; +INSERT INTO t VALUES (NULL); +SELECT * FROM t; +SHOW CREATE TABLE t; +DROP TABLE t; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-double-write.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-double-write.test new file mode 100644 index 00000000..39738ed6 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-double-write.test @@ -0,0 +1,388 @@ +--echo # +--echo # Bug #17335427 INNODB CAN NOT USE THE DOUBLEWRITE BUFFER PROPERLY +--echo # Bug #18144349 INNODB CANNOT USE THE DOUBLEWRITE BUFFER FOR THE FIRST +--echo # PAGE OF SYSTEM TABLESPACE +--echo # + +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/not_embedded.inc +--source include/not_valgrind.inc + +# Slow shutdown and restart to make sure ibuf merge is finished +SET GLOBAL innodb_fast_shutdown = 0; +--source include/restart_mysqld.inc + +--disable_query_log +call mtr.add_suppression("InnoDB: Database page .* contained only zeroes."); +call mtr.add_suppression("Header page consists of zero bytes"); +call mtr.add_suppression("Checksum mismatch in tablespace"); +call mtr.add_suppression("but the innodb_page_size start-up parameter is"); +call mtr.add_suppression("Database page corruption"); +call mtr.add_suppression("innodb-page-size mismatch in tablespace"); +--enable_query_log + +let INNODB_PAGE_SIZE=`select @@innodb_page_size`; +let MYSQLD_DATADIR=`select @@datadir`; + +show variables like 'innodb_doublewrite'; +show variables like 'innodb_fil_make_page_dirty_debug'; +show variables like 'innodb_saved_page_number_debug'; + +create table t1 (f1 int primary key, f2 blob) engine=innodb; + +start transaction; +insert into t1 values(1, repeat('#',12)); +insert into t1 values(2, repeat('+',12)); +insert into t1 values(3, repeat('/',12)); +insert into t1 values(4, repeat('-',12)); +insert into t1 values(5, repeat('.',12)); +commit work; + +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if first page of user +--echo # tablespace is full of zeroes. + +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; + +--echo # Wait for purge to complete +--source include/wait_innodb_all_purged.inc + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +--echo # Make the first page dirty for table t1 +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +set debug='+d,crash_commit_before'; +--error 2013 +insert into t1 values (6, repeat('%', 12)); +--source include/wait_until_disconnected.inc + +--echo # Make the first page (page_no=0) of the user tablespace +--echo # full of zeroes. +perl; +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; +open(FILE, "+<", $fname) or die; +binmode FILE; +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Server must be started successfully, and table t1 must be fine... +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if first page of user +--echo # tablespace is corrupted. + +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +--echo # Make the first page dirty for table t1 +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +set debug='+d,crash_commit_before'; +--error 2013 +insert into t1 values (6, repeat('%', 12)); +--source include/wait_until_disconnected.inc + +--echo # Corrupt the first page (page_no=0) of the user tablespace. +perl; +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; +open(FILE, "+<", $fname) or die; +binmode FILE; +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2); +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Server must be started successfully, and table t1 must be fine... +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if 2nd page of user +--echo # tablespace is full of zeroes. + +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +--echo # Make the 2nd page dirty for table t1 +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +set debug='+d,crash_commit_before'; +--error 2013 +insert into t1 values (6, repeat('%', 400)); +--source include/wait_until_disconnected.inc + +--echo # Make the 2nd page (page_no=1) of the tablespace all zeroes. +perl; +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; +open(FILE, "+<", $fname) or die; +binmode FILE; +seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Server must be started successfully, and table t1 must be fine... +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if 2nd page of user +--echo # tablespace is corrupted. + +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +--echo # Make the 2nd page dirty for table t1 +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = @space_id; + +--echo # Ensure that dirty pages of table t1 is flushed. +flush tables t1 for export; +unlock tables; + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +set debug='+d,crash_commit_before'; +--error 2013 +insert into t1 values (6, repeat('%', 400)); +--source include/wait_until_disconnected.inc + +--echo # Corrupt the 2nd page (page_no=1) of the user tablespace. +perl; +my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; +open(FILE, "+<", $fname) or die; +binmode FILE; +seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2); +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Server must be started successfully, and table t1 must be fine... +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if first page of +--echo # system tablespace is full of zeroes. + +--echo # Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; + +--echo # Make the first page dirty for system tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 0; + +--echo # Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +set debug='+d,crash_commit_before'; +--error 2013 +insert into t1 values (6, repeat('%', 400)); +--source include/wait_until_disconnected.inc + +--echo # Make the first page (page_no=0) of the system tablespace +--echo # all zeroes. +perl; +my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1"; +open(FILE, "+<", $fname) or die; +binmode FILE; +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Server must be started successfully, and table t1 must be fine... +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if first page of +--echo # system tablespace is corrupted. + +--echo # Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; + +--echo # Make the first page dirty for system tablespace +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = 0; + +--echo # Ensure that the dirty page of system tablespace is also flushed. +set global innodb_buf_flush_list_now = 1; + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +set debug='+d,crash_commit_before'; +--error 2013 +insert into t1 values (6, repeat('%', 400)); +--source include/wait_until_disconnected.inc + +--echo # Corrupt the first page (page_no=0) of the system tablespace. +perl; +my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1"; +open(FILE, "+<", $fname) or die; +binmode FILE; +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2); +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Server must be started successfully, and table t1 must be fine... +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if 2nd page of +--echo # system tablespace is full of zeroes. + +--echo # Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; + +--echo # Make the second page dirty for system tablespace +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = 0; + +--echo # Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +set debug='+d,crash_commit_before'; +--error 2013 +insert into t1 values (6, repeat('%', 400)); +--source include/wait_until_disconnected.inc + +--echo # Make the 2nd page (page_no=1) of the system tablespace +--echo # all zeroes. +perl; +my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1"; +open(FILE, "+<", $fname) or die; +binmode FILE; +seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}); +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Server must be started successfully, and table t1 must be fine... +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- +--echo # Test Begin: Test if recovery works if 2nd page of +--echo # system tablespace is corrupted. + +--echo # Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; + +--echo # Make the second page dirty for system tablespace +set global innodb_saved_page_number_debug = 1; +set global innodb_fil_make_page_dirty_debug = 0; + +--echo # Ensure that the dirty page of system tablespace is flushed. +set global innodb_buf_flush_list_now = 1; + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +set debug='+d,crash_commit_before'; +--error 2013 +insert into t1 values (6, repeat('%', 400)); +--source include/wait_until_disconnected.inc + +--echo # Make the 2nd page (page_no=1) of the system tablespace +--echo # all zeroes. +perl; +my $fname= "$ENV{'MYSQLD_DATADIR'}ibdata1"; +open(FILE, "+<", $fname) or die; +binmode FILE; +seek(FILE, $ENV{'INNODB_PAGE_SIZE'}, SEEK_SET); +print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2); +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Server must be started successfully, and table t1 must be fine... +check table t1; +select f1, f2 from t1; + +--echo # Test End +--echo # --------------------------------------------------------------- + +drop table t1; + diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-lock.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-lock.test index 4d8d3d54..ef7bec1d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-lock.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-lock.test @@ -168,3 +168,22 @@ disconnect con2; connection default; DROP TABLE t1; + + +--echo Bug#19803418 ASSERTION: TABLE->QUIESCE == QUIESCE_NONE +--echo IN ROW0QUIESCE.CC LINE 683 + +CREATE TABLE t1(C TEXT CHARACTER SET UJIS) ENGINE=INNODB; +LOCK TABLES t1 WRITE,t1 AS t0 READ,t1 AS t2 READ; +FLUSH TABLE t1; + +LOCK TABLES t1 READ,t1 AS t0 WRITE,t1 AS t2 READ; +FLUSH TABLE t1; + +LOCK TABLES t1 READ,t1 AS t0 READ,t1 AS t2 READ; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +FLUSH TABLE t1; +UNLOCK TABLES; +FLUSH TABLE t1; + +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-multiple-tablespaces.test old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-update-insert.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-update-insert.test new file mode 100644 index 00000000..95387e05 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-update-insert.test @@ -0,0 +1,38 @@ +# +# Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. +# + +# This file contains test cases for checking the functionality "update by +# delete + insert". + +--source include/have_innodb.inc + +--echo # +--echo # Bug#14668683 ASSERT REC_GET_DELETED_FLAG(REC, PAGE_IS_COMP(PAGE)) +--echo # + +create table t1(f1 char(1) primary key, f2 int not null, f3 blob) +engine=innodb; +show create table t1; + +insert into t1 values ('a', 0, repeat('b',8102)); +select f1 from t1; +update t1 set f1='A'; +select f1 from t1; +drop table t1; + +--echo # +--echo # Another test case +--echo # +create table t1 (f1 char(1), f2 longblob, f3 blob, primary key(f1)) +charset=utf8 engine=innodb; + +replace into t1 set f1=0xa3; +select f1 from t1; +update t1 set f1=0x6a; +update t1 set f3=repeat(0xb1,8103); +update t1 set f1=0x4a; +update t1 set f1=0x82; +select f1 from t1; + +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-alter.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-alter.test old mode 100755 new mode 100644 index f762be2f..2815a6fc --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-alter.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-alter.test @@ -8,7 +8,7 @@ --disable_query_log # These values can change during the test LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`; -LET $regexp=/FTS_([0-9a-f_]+)([A-Z_]+)\.ibd/FTS_AUX_\2.ibd/; +LET $regexp=/FTS_([0-9a-f_]+)([A-Z0-9_]+)\.ibd/FTS_AUX_\2.ibd/; # Set up some variables LET $MYSQL_DATA_DIR = `select @@datadir`; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-debug.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-debug.test old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-discard.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-discard.test old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-linux.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-linux.test old mode 100755 new mode 100644 index 5bddf3d7..fbe6ddf6 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-linux.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-linux.test @@ -13,7 +13,7 @@ --source include/not_embedded.inc --echo # Skip this test other platfoms and run only on Linux. -if (`select convert(@@version_compile_os using latin1) IN ("Linux", "solaris10", "osx10.6", "osx10.7") = 0`) +if (`select convert(@@version_compile_os using latin1) IN ("Linux") = 0`) { skip Need Linux; } diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-windows.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb-wl5980-windows.test old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test new file mode 100644 index 00000000..16fb5707 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test @@ -0,0 +1,55 @@ +--source include/not_embedded.inc +--source include/not_crashrep.inc +--source include/have_innodb.inc + +call mtr.add_suppression("InnoDB: The total blob data length"); + +let $old_max_allowed_packet = `select @@max_allowed_packet`; +SET GLOBAL max_allowed_packet = 100*1024*1024; + +--echo # Connection big_packets: +connect(big_packets,localhost,root,,); +connection big_packets; + +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; + +# Insert a few rows (it doesn't really matter how many). These transactions +# are committed once they are acked, so they should not be lost. +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); + +# The BLOB insert will fail, and should disappear. However all data committed +# up to this point should not be lost. +start transaction; +--replace_regex /\(> [0-9]*\)/(> ####)/ +--error ER_TOO_BIG_ROWSIZE +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); + +--echo # Connection default: +connection default; + +# We expect a restart. +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # Quick shutdown and restart server +--shutdown_server 0 + +# Wait for the server to come back up, and reconnect. +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Connection default: +connection default; + +# We should see (1,2,3,4,5) here. +SELECT a FROM t1; + +# Clean up. +DROP TABLE t1; + +--disable_query_log +eval set global max_allowed_packet = $old_max_allowed_packet; +--enable_query_log diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug14169459.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug14169459.test old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug34300.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug34300.test index 7f0adfca..800f3267 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug34300.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug34300.test @@ -8,25 +8,25 @@ -- disable_query_log -- disable_result_log -call mtr.add_suppression("InnoDB: Warning: a long semaphore wait:"); -call mtr.add_suppression("the age of the last checkpoint is"); +call mtr.add_suppression("InnoDB: The total blob data length"); # set packet size and reconnect let $max_packet=`select @@global.max_allowed_packet`; SET @@global.max_allowed_packet=16777216; --connect (newconn, localhost, root,,) -DROP TABLE IF EXISTS bug34300; +--enable_result_log + CREATE TABLE bug34300 ( f4 TINYTEXT, f6 MEDIUMTEXT, f8 TINYBLOB ) ENGINE=InnoDB; +--replace_regex /\(> [0-9]*\)/(> ####)/ +--error ER_TOO_BIG_ROWSIZE INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz'); --- enable_result_log - SELECT f4, f8 FROM bug34300; ALTER TABLE bug34300 ADD COLUMN (f10 INT); diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug57904.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug57904.test old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60196-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60196-master.opt old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_bug60196.test old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_corrupt_bit.test index 0834b488..f1a10927 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_corrupt_bit.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_corrupt_bit.test @@ -18,14 +18,20 @@ call mtr.add_suppression("Flagged corruption of idx.*in CHECK TABLE"); # It instructs InnoDB to try to evict pages from the buffer pool when # change buffering is possible, so that the change buffer will be used # whenever possible. --- error 0,ER_UNKNOWN_SYSTEM_VARIABLE SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug; --- error 0,ER_UNKNOWN_SYSTEM_VARIABLE SET GLOBAL innodb_change_buffering_debug = 1; # Turn off Unique Check to create corrupted index with dup key SET UNIQUE_CHECKS=0; +CREATE DATABASE pad; +let $i=338; +while ($i) +{ +--eval CREATE TABLE pad.t$i(a INT PRIMARY KEY)ENGINE=InnoDB STATS_PERSISTENT=0; + dec $i; +} + -- enable_query_log set names utf8; @@ -121,6 +127,6 @@ select z from corrupt_bit_test_Ä limit 10; # Drop table drop table corrupt_bit_test_Ä; +DROP DATABASE pad; --- error 0, ER_UNKNOWN_SYSTEM_VARIABLE SET GLOBAL innodb_change_buffering_debug = 0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_stats_external_pages.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_stats_external_pages.test new file mode 100644 index 00000000..f4080280 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_stats_external_pages.test @@ -0,0 +1,83 @@ +# +# Bug#18384390 WRONG STATISTICS WITH BIG ROW LENGTH AND PERSISTENT STATS +# + +-- source include/have_innodb.inc + +CREATE TABLE bug18384390 ( + id INT AUTO_INCREMENT PRIMARY KEY, + txt VARCHAR(10000) +) ENGINE=INNODB STATS_AUTO_RECALC=0; + +INSERT INTO bug18384390 (txt) VALUES (REPEAT('0', 10000)); +-- let $i = 0 +while ($i < 10) { + INSERT INTO bug18384390 (txt) SELECT txt FROM bug18384390; + -- inc $i +} + +# Now we have 1024 rows in bug18384390 + +-- let $count = `SELECT COUNT(*) FROM bug18384390` + +ANALYZE TABLE bug18384390; + +-- let $n_rows = `SELECT n_rows FROM mysql.innodb_table_stats WHERE table_name = 'bug18384390'` + +-- let $table_rows = `SELECT table_rows FROM information_schema.tables WHERE table_name = 'bug18384390'` + +-- let $n_diff = `SELECT stat_value FROM mysql.innodb_index_stats WHERE table_name = 'bug18384390' AND stat_name = 'n_diff_pfx01'` + +-- let $cardinality = `SELECT cardinality FROM information_schema.statistics WHERE table_name = 'bug18384390'` + +-- let $margin_of_err_pct = 30 +-- let $margin_of_err_rows = `SELECT ROUND($count * $margin_of_err_pct / 100)` + +-- let $min_allowed = `SELECT $count - $margin_of_err_rows` +-- let $max_allowed = `SELECT $count + $margin_of_err_rows` + +-- let $dump_sql = SELECT COUNT(*) FROM bug18384390; SELECT * FROM mysql.innodb_table_stats; SELECT * FROM mysql.innodb_index_stats; SELECT * FROM information_schema.tables WHERE table_name = 'bug18384390'; SELECT * FROM information_schema.statistics WHERE table_name = 'bug18384390'; + +-- vertical_results + +if ($n_rows < $min_allowed) { + -- echo mysql.innodb_table_stats.n_rows is too small ($n_rows < $min_allowed) + -- eval $dump_sql +} + +if ($n_rows > $max_allowed) { + -- echo mysql.innodb_table_stats.n_rows is too big ($n_rows > $max_allowed) + -- eval $dump_sql +} + +if ($table_rows < $min_allowed) { + -- echo information_schema.tables.table_rows is too small ($table_rows < $min_allowed) + -- eval $dump_sql +} + +if ($table_rows > $max_allowed) { + -- echo information_schema.tables.table_rows is too big ($table_rows > $max_allowed) + -- eval $dump_sql +} + +if ($n_diff < $min_allowed) { + -- echo mysql.innodb_index_stats.stat_value is too small ($n_diff < $min_allowed) + -- eval $dump_sql +} + +if ($n_diff > $max_allowed) { + -- echo mysql.innodb_index_stats.stat_value is too big ($n_diff > $max_allowed) + -- eval $dump_sql +} + +if ($cardinality < $min_allowed) { + -- echo information_schema.statistics.cardinality is too small ($cardinality < $min_allowed) + -- eval $dump_sql +} + +if ($cardinality > $max_allowed) { + -- echo information_schema.statistics.cardinality is too big ($cardinality > $max_allowed) + -- eval $dump_sql +} + +DROP TABLE bug18384390; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/insert_debug.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/insert_debug.test new file mode 100644 index 00000000..96ac0473 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/insert_debug.test @@ -0,0 +1,16 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +--echo # +--echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 +--echo # CAUSES INFINITE PAGE SPLIT +--echo # + +SET GLOBAL innodb_change_buffering_debug=1; +SET GLOBAL innodb_limit_optimistic_insert_debug=1; +CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB +PARTITION BY HASH (c1) PARTITIONS 15; +DROP TABLE t1; + +SET GLOBAL innodb_change_buffering_debug=0; +SET GLOBAL innodb_limit_optimistic_insert_debug=0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/monitor.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/monitor.test new file mode 100644 index 00000000..864e0cae --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/monitor.test @@ -0,0 +1,387 @@ +# 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/monitor_debug.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/monitor_debug.test new file mode 100644 index 00000000..088dcd7a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/monitor_debug.test @@ -0,0 +1,40 @@ +source include/have_innodb.inc; +source include/have_debug.inc; +source include/not_embedded.inc; + +--echo # +--echo # BUG#20080942 - ADAPTIVE_HASH_SEARCHES_BTREE NOT UPDATED +--echo # + +# To make sure that the change buffer is empty +SET GLOBAL innodb_fast_shutdown=0; +--source include/restart_mysqld.inc + +SET GLOBAL innodb_stats_persistent = OFF; +SET GLOBAL innodb_stats_auto_recalc = OFF; +SET GLOBAL innodb_purge_stop_now = ON; + +CREATE TABLE t1(a INT PRIMARY KEY, b BLOB) STATS_PERSISTENT=0; + +let $start=`SELECT COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME LIKE +'adaptive_hash_searches_btree' ORDER BY NAME`; + +INSERT INTO t1 VALUES(1, 'abc'); +INSERT INTO t1 VALUES(2, 'def'); +INSERT INTO t1 VALUES(3, 'ghi'); +SELECT * FROM t1; + +let $end=`SELECT COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME LIKE +'adaptive_hash_searches_btree' ORDER BY NAME`; + +let $diff=`SELECT $end-$start`; + +if ($diff != 3) { + echo "Unexpected count: $diff"; +} + +DROP TABLE t1; + +SET GLOBAL innodb_stats_persistent = default; +SET GLOBAL innodb_stats_auto_recalc = default; +SET GLOBAL innodb_purge_run_now = ON; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/portability_wl5980_linux.zip b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/portability_wl5980_linux.zip old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/portability_wl5980_windows.zip b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/portability_wl5980_windows.zip old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/sp_temp_table.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/sp_temp_table.test new file mode 100644 index 00000000..b2883f55 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/sp_temp_table.test @@ -0,0 +1,103 @@ +--source include/have_innodb.inc +--source include/big_test.inc + +--echo # +--echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE +--echo # CALLED FROM A FUNCTION +--echo # + +call mtr.add_suppression("MySQL is trying to drop table"); + +DELIMITER $$; +CREATE PROCEDURE cachedata( + IN obj_id BIGINT UNSIGNED, + IN start DATETIME, + IN end DATETIME +) + +cachedata:BEGIN + DECLARE cache_count BIGINT; + + SET @timestamp := NOW(); + + CREATE TEMPORARY TABLE IF NOT EXISTS cachedata ( + timestamp DATETIME, + object_id BIGINT UNSIGNED NOT NULL, + start DATETIME, + end DATETIME, + seqno BIGINT AUTO_INCREMENT, + value FLOAT, + PRIMARY KEY (seqno), + INDEX (timestamp), + INDEX (object_id, start, end) + ) ENGINE=INNODB; + + DELETE FROM cachedata WHERE + timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND); + + SELECT count(*) INTO cache_count FROM cachedata WHERE + object_id = obj_id + AND start = start + AND end = end; + + IF cache_count > 0 THEN LEAVE cachedata; + END IF; + + INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 2345), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 2345), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 2345); + +END$$ + + +CREATE FUNCTION get_cache( + obj_id BIGINT UNSIGNED, + start DATETIME, + end DATETIME +) + RETURNS FLOAT + READS SQL DATA +BEGIN + DECLARE result FLOAT; + + CALL cachedata(obj_id, start, end); + + SELECT SUM(value) INTO result FROM cachedata WHERE + object_id = obj_id + AND start = start + AND end = end; + + RETURN result; +END$$ + +DELIMITER ;$$ + +let $i = 30; +while ($i) +{ + SELECT get_cache(1, '2014-01-01', '2014-02-01'); + select sleep(1); + dec $i; +} + +DROP FUNCTION get_cache; +DROP PROCEDURE cachedata; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/strict_mode.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/strict_mode.test new file mode 100644 index 00000000..9b3ed8d9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/strict_mode.test @@ -0,0 +1,249 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN +--echo # INNODB_STRICT_MODE = 1 +--echo # + +set innodb_strict_mode = 0; + +--replace_regex /> [0-9]+/> NNNN/ +create table t1 (id int auto_increment primary key, +v varchar(32), +col1 text, +col2 text, +col3 text, +col4 text, +col5 text, +col6 text, +col7 text, +col8 text, +col9 text, +col10 text, +col11 text, +col12 text, +col13 text, +col14 text, +col15 text, +col16 text, +col17 text, +col18 text, +col19 text, +col20 text, +col21 text, +col22 text, +col23 text, +col24 text, +col25 text, +col26 text, +col27 text, +col28 text, +col29 text, +col30 text, +col31 text, +col32 text, +col33 text, +col34 text, +col35 text, +col36 text, +col37 text, +col38 text, +col39 text, +col40 text, +col41 text, +col42 text, +col43 text, +col44 text, +col45 text , +col46 text, +col47 text, +col48 text, +col49 text, +col50 text, +col51 text, +col52 text, +col53 text, +col54 text, +col55 text, +col56 text, +col57 text, +col58 text, +col59 text, +col60 text, +col61 text, +col62 text, +col63 text, +col64 text, +col65 text, +col66 text, +col67 text, +col68 text , +col69 text, +col70 text, +col71 text, +col72 text, +col73 text, +col74 text, +col75 text, +col76 text, +col77 text, +col78 text, +col79 text, +col80 text, +col81 text, +col82 text, +col83 text, +col84 text, +col85 text, +col86 text, +col87 text, +col88 text, +col89 text, +col90 text, +col91 text, +col92 text, +col93 text, +col94 text, +col95 text, +col96 text, +col97 text, +col98 text, +col99 text, +col100 text, +col101 text, +col102 text, +col103 text, +col104 text, +col105 text, +col106 text, +col107 text, +col108 text, +col109 text, +col110 text, +col111 text, +col112 text, +col113 text, +col114 text, +col115 text, +col116 text, +col117 text, +col118 text, +col119 text, +col120 text, +col121 text, +col122 text, +col123 text, +col124 text, +col125 text, +col126 text , +col127 text, +col128 text, +col129 text, +col130 text, +col131 text, +col132 text, +col133 text, +col134 text, +col135 text, +col136 text, +col137 text, +col138 text, +col139 text, +col140 text, +col141 text, +col142 text, +col143 text, +col144 text, +col145 text, +col146 text, +col147 text , +col148 text, +col149 text, +col150 text, +col151 text, +col152 text, +col153 text, +col154 text, +col155 text, +col156 text, +col157 text, +col158 text, +col159 text, +col160 text, +col161 text, +col162 text, +col163 text, +col164 text, +col165 text, +col166 text, +col167 text, +col168 text, +col169 text, +col170 text, +col171 text, +col172 text , +col173 text, +col174 text, +col175 text, +col176 text, +col177 text, +col178 text, +col179 text, +col180 text, +col181 text, +col182 text, +col183 text, +col184 text, +col185 text, +col186 text, +col187 text, +col188 text, +col189 text, +col190 text, +col191 text, +col192 text, +col193 text, +col194 text, +col195 text, +col196 text, +col197 text, +col198 text, +col199 text, +col200 text, +col201 text, +col202 text, +col203 text, +col204 text, +col205 text, +col206 text, +col207 text, +col208 text, +col209 text, +col210 text, +col211 text, +col212 text, +col213 text, +col214 text, +col215 text, +col216 text, +col217 text, +col218 text, +col219 text, +col220 text, +col221 text, +col222 text, +col223 text, +col224 text, +col225 text, +col226 text, +col227 text, +col228 text +) ENGINE=InnoDB; + +set innodb_strict_mode = 1; + +--replace_regex /is [0-9]+/is NNNN/ +--error ER_TOO_BIG_ROWSIZE +alter table t1 engine=InnoDB; + +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility.result new file mode 100644 index 00000000..73c127d5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility.result @@ -0,0 +1,262 @@ +# Bug #18285007 COPY OF TABLES WITH INNODB FTS +# FROM WINDOWS TO LINUX CAUSES CRASH +# Simulating old non-windows(< 5.6.16) data directory +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 +DROP TABLE t1; +# Simulating old windows (< 5.6.16) data directory +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 +DROP TABLE t1; +# Simulation current non windows data directory +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 +DROP TABLE t1; +# Non windows aux table flag failure and rebuild the corrupted index. +call mtr.add_suppression("\\[Warning\\] InnoDB: Parent table of FTS auxiliary table .* not found."); +call mtr.add_suppression("\\[ERROR] InnoDB: Flagged corruption of .* in table .* in DROP ORPHANED TABLE"); +call mtr.add_suppression("\\[Warning\\] InnoDB: Setting aux table .* to hex format failed."); +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT `AB` (a, b), FULLTEXT `C1` (c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +SET GLOBAL DEBUG='-d,innodb_test_wrong_fts_sys_table_name'; +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +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); +# 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 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +ERROR HY000: The table does not have FULLTEXT index to support this query +# Drop the corrupted index. +ALTER TABLE t1 DROP INDEX `AB`; +ALTER TABLE t1 DROP INDEX `C1`; +# Rebuild the index. +ALTER TABLE t1 ADD FULLTEXT(a, b); +ALTER TABLE t1 ADD FULLTEXT(c); +# Read the record using fts index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +DROP TABLE t1; +# Non windows parent table flag failure. +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT(a, b), FULLTEXT(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +SET GLOBAL DEBUG='-d,innodb_test_wrong_fts_sys_table_name'; +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +DROP TABLE t1; +# Drop FTS table and rename the common tables. +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT f1(a, b)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +alter table t1 drop index f1; +SET SESSION debug='-d,innodb_test_wrong_fts_sys_table_name'; +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 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 * FROM t1; +a b c +TEST1 TEST2 TEXT3 +TEXT1 TEXT2 TEXT5 +DROP TABLE t1; +# Rename failure for old windows data directory and rebuild the +# corrupted index +call mtr.add_suppression("\\[Warning\\] InnoDB: Failed to rename one aux table .* will revert all successful rename operations."); +call mtr.add_suppression("\\[Warning\\] InnoDB: Rollback operations on all aux tables of table .* All the fts index associated with the table are marked as corrupted. Please rebuild the index again."); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Flagged corruption of .* in table .* in DROP ORPHANED TABLE"); +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT `AB`(a, b), FULLTEXT `C1`(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +SET SESSION debug='-d,innodb_test_wrong_fts_sys_table_name'; +# Restart server. +ALTER TABLE t1 ADD FULLTEXT(b); +ERROR HY000: Upgrade index name failed, please use create index(alter table) algorithm copy to rebuild index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +ERROR HY000: The table does not have FULLTEXT index to support this query +# Restart server. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +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 +# Drop the corrupted index. +ALTER TABLE t1 DROP INDEX `AB`; +ALTER TABLE t1 DROP INDEX `C1`; +# Rebuild the index. +ALTER TABLE t1 ADD FULLTEXT(a, b); +ALTER TABLE t1 ADD FULLTEXT(c); +# Read the record using fts index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +TRUNCATE TABLE t1; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility_win.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility_win.result new file mode 100644 index 00000000..fc1be3e2 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/fts_compatibility_win.result @@ -0,0 +1,262 @@ +# Bug #18285007 COPY OF TABLES WITH INNODB FTS +# FROM WINDOWS TO LINUX CAUSES CRASH +# Simulating old non-windows(< 5.6.16) data directory +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_non_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 +DROP TABLE t1; +# Simulating old windows (< 5.6.16) data directory +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 +DROP TABLE t1; +# Simulation current windows data directory +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b +TEST1 TEST2 +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_INDEX_1 +FTS_0 test/FTS_AUX_INDEX_2 +FTS_0 test/FTS_AUX_INDEX_3 +FTS_0 test/FTS_AUX_INDEX_4 +FTS_0 test/FTS_AUX_INDEX_5 +FTS_0 test/FTS_AUX_INDEX_6 +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 +DROP TABLE t1; +# Non windows aux table flag failure and rebuild the corrupted index. +call mtr.add_suppression("\\[Warning\\] InnoDB: Parent table of FTS auxiliary table .* not found."); +call mtr.add_suppression("\\[ERROR] InnoDB: Flagged corruption of .* in table .* in DROP ORPHANED TABLE"); +call mtr.add_suppression("\\[Warning\\] InnoDB: Setting aux table .* to hex format failed."); +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_non_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT `AB` (a, b), FULLTEXT `C1`(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +SET GLOBAL DEBUG='-d,innodb_test_wrong_fts_sys_table_name'; +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +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); +# 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 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +ERROR HY000: The table does not have FULLTEXT index to support this query +# Drop the corrupted index. +ALTER TABLE t1 DROP INDEX `AB`; +ALTER TABLE t1 DROP INDEX `C1`; +# Rebuild the index. +ALTER TABLE t1 ADD FULLTEXT(a, b); +ALTER TABLE t1 ADD FULLTEXT(c); +# Read the record using fts index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +DROP TABLE t1; +# Non windows parent table flag failure. +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_non_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT(a, b), FULLTEXT(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +SET GLOBAL DEBUG='-d,innodb_test_wrong_fts_sys_table_name'; +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +DROP TABLE t1; +# Drop FTS table and rename the common tables. +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT f1(a, b)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +alter table t1 drop index f1; +SET SESSION debug='-d,innodb_test_wrong_fts_sys_table_name'; +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 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 * FROM t1; +a b c +TEST1 TEST2 TEXT3 +TEXT1 TEXT2 TEXT5 +DROP TABLE t1; +# Rename failure for old windows data directory and rebuild the +# corrupted index +call mtr.add_suppression("\\[Warning\\] InnoDB: Failed to rename one aux table .* Will revert all successful rename operations."); +call mtr.add_suppression("\\[Warning\\] InnoDB: Rollback operations on all aux tables of table .* All the fts index associated with the table are marked as corrupted. Please rebuild the index again."); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Flagged corruption of .* in table .* in DROP ORPHANED TABLE"); +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT `AB`(a, b), FULLTEXT `C1`(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +SET SESSION debug='-d,innodb_test_wrong_fts_sys_table_name'; +# Restart server. +ALTER TABLE t1 ADD FULLTEXT(b); +ERROR HY000: Upgrade index name failed, please use create index(alter table) algorithm copy to rebuild index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +ERROR HY000: The table does not have FULLTEXT index to support this query +# Restart server. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +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 +# Drop the corrupted index. +ALTER TABLE t1 DROP INDEX `AB`; +ALTER TABLE t1 DROP INDEX `C1`; +# Rebuild the index. +ALTER TABLE t1 ADD FULLTEXT(a, b); +ALTER TABLE t1 ADD FULLTEXT(c); +# Read the record using fts index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +a b c +TEST1 TEST2 TEXT3 +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +a b c +TEXT1 TEXT2 TEXT5 +TRUNCATE TABLE t1; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result index a39c430e..d6f67877 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result @@ -200,6 +200,8 @@ create table articles(`FTS_DOC_ID` serial, `col32` timestamp not null,`col115` text) engine=innodb; create fulltext index `idx5` on articles(`col115`) ; alter ignore table articles add primary key (`col32`) ; +Warnings: +Warning 1681 'IGNORE' is deprecated and will be removed in a future release. drop table articles; CREATE TABLE articles ( id INT UNSIGNED NOT NULL, diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result index f6be36a2..d1653307 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result @@ -1426,3 +1426,440 @@ SELECT * FROM t1 WHERE MATCH (a) AGAINST ('+"good database"' IN BOOLEAN MODE); id a 1 know mysql good database DROP TABLE t1; +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 ('Test Article','blah blah +blah'),("Matt's Noise",'this is noisy'),('February Weather','It was terrible +this year.'),('Peter Pan','Tis a kids story.'),('Test1','nada'),('Database +database database','foo database database database'),('Database article +title','body with lots of words.'),('myfulltext database', 'my test fulltext +database'); +SELECT id, title, body FROM articles ORDER BY MATCH (title,body) AGAINST ('database' IN BOOLEAN MODE) DESC; +id title body +6 Database +database database foo database database database +8 myfulltext database my test fulltext +database +7 Database article +title body with lots of words. +1 Test Article blah blah +blah +2 Matt's Noise this is noisy +3 February Weather It was terrible +this year. +4 Peter Pan Tis a kids story. +5 Test1 nada +DELETE from articles WHERE title like "myfulltext database"; +INSERT INTO articles (title,body) VALUES ('myfulltext database', 'my test fulltext database'); +SELECT id, title, body FROM articles ORDER BY MATCH (title,body) AGAINST ('database' IN BOOLEAN MODE) DESC; +id title body +6 Database +database database foo database database database +9 myfulltext database my test fulltext database +7 Database article +title body with lots of words. +1 Test Article blah blah +blah +2 Matt's Noise this is noisy +3 February Weather It was terrible +this year. +4 Peter Pan Tis a kids story. +5 Test1 nada +DELETE from articles WHERE title like "myfulltext database"; +INSERT INTO articles (title,body) VALUES ('myfulltext database', 'my test fulltext database'); +SELECT id, title, body FROM articles ORDER BY MATCH (title,body) AGAINST ('database' IN BOOLEAN MODE) DESC; +id title body +6 Database +database database foo database database database +10 myfulltext database my test fulltext database +7 Database article +title body with lots of words. +1 Test Article blah blah +blah +2 Matt's Noise this is noisy +3 February Weather It was terrible +this year. +4 Peter Pan Tis a kids story. +5 Test1 nada +DROP TABLE articles; +CREATE TABLE t1( +a TEXT CHARSET ujis COLLATE ujis_japanese_ci, +b TEXT CHARSET utf8mb4 COLLATE utf8mb4_turkish_ci, +c TEXT CHARSET eucjpms COLLATE eucjpms_bin, +d TEXT CHARSET utf8mb4, +FULLTEXT INDEX(a), +FULLTEXT INDEX(b), +FULLTEXT INDEX(c), +FULLTEXT INDEX(d) +) ENGINE = InnoDB; +INSERT INTO t1 VALUES +('myisam', 'myisam', 'myisam', 'myisam'), +('innodb', 'innodb', 'innodb', 'innodb'), +('innodb myisam', 'innodb myisam', 'innodb myisam', 'innodb myisam'), +('memory', 'memory', 'memory', 'memory'), +('archive', 'archive', 'archive', 'archive'), +('federated', 'federated', 'federated', 'federated'), +('storage engine innodb', 'storage engine innodb', 'storage engine innodb', 'storage engine innodb'), +('storage engine myisam', 'storage engine myisam', 'storage engine myisam', 'storage engine myisam'), +('innobase', 'innobase', 'innobase', 'innobase'), +('myisam innodb', 'myisam innodb', 'myisam innodb', 'myisam innodb'), +('innodb myisam engines', 'innodb myisam engines', 'innodb myisam engines', 'innodb myisam engines'); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00)); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', ' ', '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, '"', 0x00)); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '&', 0x00, '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, '&', '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '%', '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +a +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +a +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, 0x00, 0x00, '"')); +a +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"')); +a +innodb myisam +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', '(', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', ')')); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm')); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm', '"')); +a +innodb myisam +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"','@', '2') IN BOOLEAN MODE); +a +innodb myisam +myisam innodb +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 'm', 'y', 'i', 's', 'a', 'm', '"','@', '4') IN BOOLEAN MODE); +a +innodb myisam +myisam innodb +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 's', 't', 'o', 'r', 'a', 'g', 'e', '"','@', '4', 0x00) IN BOOLEAN MODE); +ERROR 42000: syntax error, unexpected FTS_TERM, expecting FTS_NUMB +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"')); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00)); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', '"')); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', ' ', '"')); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 0x00, '"')); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00, '"', 0x00, '"', 0x00)); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', '&', 0x00, '"')); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 0x00, '&', '"')); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', '%', '"')); +b +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +b +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +b +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, 0x00, 0x00, '"')); +b +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +b +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"','@', '2') IN BOOLEAN MODE); +b +innodb myisam +myisam innodb +innodb myisam engines +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 'm', 'y', 'i', 's', 'a', 'm', '"','@', '4') IN BOOLEAN MODE); +b +innodb myisam +myisam innodb +innodb myisam engines +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00, '"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 's', 't', 'o', 'r', 'a', 'g', 'e', '"','@', '4', 0x00) IN BOOLEAN MODE); +ERROR 42000: syntax error, unexpected FTS_TERM, expecting FTS_NUMB +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"')); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00)); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', '"')); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', ' ', '"')); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, '"')); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00, '"', 0x00, '"', 0x00)); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', '&', 0x00, '"')); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, '&', '"')); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', '%', '"')); +c +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +c +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +c +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, 0x00, 0x00, '"')); +c +innodb +innodb myisam +storage engine innodb +myisam innodb +innodb myisam engines +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +c +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +c +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"')); +c +innodb myisam +innodb myisam engines +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', '(', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', ')')); +c +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm')); +c +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm', '"')); +c +innodb myisam +innodb myisam engines +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"','@', '2') IN BOOLEAN MODE); +c +innodb myisam +myisam innodb +innodb myisam engines +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 'm', 'y', 'i', 's', 'a', 'm', '"','@', '4') IN BOOLEAN MODE); +c +innodb myisam +myisam innodb +innodb myisam engines +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00, '"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 's', 't', 'o', 'r', 'a', 'g', 'e', '"','@', '4', 0x00) IN BOOLEAN MODE); +ERROR 42000: syntax error, unexpected FTS_TERM, expecting FTS_NUMB +ALTER TABLE t1 ENGINE = MyISAM; +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00)); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', ' ', '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, '"', 0x00)); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '&', 0x00, '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, '&', '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '%', '"')); +a +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +a +innodb +innodb myisam +myisam innodb +storage engine innodb +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +a +innodb +innodb myisam +myisam innodb +storage engine innodb +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, 0x00, 0x00, '"')); +a +innodb +innodb myisam +myisam innodb +storage engine innodb +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"')); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', '(', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', ')')); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm')); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm', '"')); +a +innodb myisam +myisam innodb +innodb myisam engines +myisam +innodb +storage engine innodb +storage engine myisam +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"','@', '2') IN BOOLEAN MODE); +a +innodb myisam +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 'm', 'y', 'i', 's', 'a', 'm', '"','@', '4') IN BOOLEAN MODE); +a +innodb myisam +innodb myisam engines +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 's', 't', 'o', 'r', 'a', 'g', 'e', '"','@', '4', 0x00) IN BOOLEAN MODE); +a +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result index f46f94ee..0cbb378d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result @@ -487,6 +487,9 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`id`), FULLTEXT KEY `idx` (`a`,`b`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED +SELECT count(*) FROM information_schema.innodb_sys_tables WHERE name LIKE "%FTS_%" AND space !=0; +count(*) +11 INSERT INTO t1 (a,b) VALUES ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/subexpr.result b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/subexpr.result new file mode 100644 index 00000000..cf476abb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/r/subexpr.result @@ -0,0 +1,105 @@ +# +# Bug #20028323 INNODB FULLTEXT BOOLEAN SEARCH INCORRECTLY HANDLES +# PARENTHESES +# +CREATE TABLE t1 ( +f1 INT NOT NULL AUTO_INCREMENT, +f2 TEXT NOT NULL, +PRIMARY KEY (f1), +FULLTEXT (f2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t1 (f2) VALUES +('Pumpkin soup with cheese bread'), +('Yellow chicken curry'), +('Fresh green vegetables with garlic'); +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+pumpkin' IN BOOLEAN MODE); +f1 f2 +1 Pumpkin soup with cheese bread +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+cheese' IN BOOLEAN MODE); +f1 f2 +1 Pumpkin soup with cheese bread +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+(pumpkin cheese)' IN BOOLEAN MODE); +f1 f2 +1 Pumpkin soup with cheese bread +SELECT * FROM t1 WHERE MATCH(f2) +AGAINST('+pumpkin +(souffle)' IN BOOLEAN MODE); +f1 f2 +SELECT * FROM t1 WHERE MATCH(f2) +AGAINST('+pumpkin +(souffle tart)' IN BOOLEAN MODE); +f1 f2 +SELECT * FROM t1 WHERE MATCH(f2) +AGAINST('+pumpkin +(>souffle <tart)' IN BOOLEAN MODE); +f1 f2 +SELECT * FROM t1 WHERE MATCH(f2) +AGAINST('+pumpkin +(souffle tart)' IN BOOLEAN MODE); +f1 f2 +INSERT INTO t1 (f2) VALUES +('This row contains only souffle'), +('This row contains only tart'), +('This row contains only pumpkin'), +('This row contains only cheese'), +('This row contains pumpkin and souffle'), +('This row contains pumpkin and tart'), +('This row contains pumpkin and cheese'), +('This row contains both souffle and tart'), +('This row contains both souffle and cheese'), +('This row contains both tart and cheese'), +('This row contains all three souffle, pumpkin and tart'), +('This row contains all four cheese, souffle, pumpkin and tart'); +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+pumpkin' IN BOOLEAN MODE); +f1 f2 +1 Pumpkin soup with cheese bread +6 This row contains only pumpkin +8 This row contains pumpkin and souffle +9 This row contains pumpkin and tart +10 This row contains pumpkin and cheese +14 This row contains all three souffle, pumpkin and tart +15 This row contains all four cheese, souffle, pumpkin and tart +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+cheese' IN BOOLEAN MODE); +f1 f2 +1 Pumpkin soup with cheese bread +7 This row contains only cheese +10 This row contains pumpkin and cheese +12 This row contains both souffle and cheese +13 This row contains both tart and cheese +15 This row contains all four cheese, souffle, pumpkin and tart +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+(pumpkin cheese)' IN BOOLEAN MODE); +f1 f2 +1 Pumpkin soup with cheese bread +10 This row contains pumpkin and cheese +15 This row contains all four cheese, souffle, pumpkin and tart +7 This row contains only cheese +12 This row contains both souffle and cheese +13 This row contains both tart and cheese +6 This row contains only pumpkin +8 This row contains pumpkin and souffle +9 This row contains pumpkin and tart +14 This row contains all three souffle, pumpkin and tart +SELECT * FROM t1 WHERE MATCH(f2) +AGAINST('+pumpkin +(souffle)' IN BOOLEAN MODE); +f1 f2 +8 This row contains pumpkin and souffle +14 This row contains all three souffle, pumpkin and tart +15 This row contains all four cheese, souffle, pumpkin and tart +SELECT * FROM t1 WHERE MATCH(f2) +AGAINST('+pumpkin +(souffle tart)' IN BOOLEAN MODE); +f1 f2 +14 This row contains all three souffle, pumpkin and tart +15 This row contains all four cheese, souffle, pumpkin and tart +8 This row contains pumpkin and souffle +9 This row contains pumpkin and tart +SELECT * FROM t1 WHERE MATCH(f2) +AGAINST('+pumpkin +(>souffle <tart)' IN BOOLEAN MODE); +f1 f2 +8 This row contains pumpkin and souffle +14 This row contains all three souffle, pumpkin and tart +15 This row contains all four cheese, souffle, pumpkin and tart +9 This row contains pumpkin and tart +SELECT * FROM t1 WHERE MATCH(f2) +AGAINST('+pumpkin +(souffle tart)' IN BOOLEAN MODE); +f1 f2 +14 This row contains all three souffle, pumpkin and tart +15 This row contains all four cheese, souffle, pumpkin and tart +8 This row contains pumpkin and souffle +9 This row contains pumpkin and tart +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility.test new file mode 100644 index 00000000..0d5220d4 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility.test @@ -0,0 +1,269 @@ +--source include/not_windows.inc +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/not_valgrind.inc + +--echo # Bug #18285007 COPY OF TABLES WITH INNODB FTS +--echo # FROM WINDOWS TO LINUX CAUSES CRASH + +LET $regexp=/FTS_([0-9a-f_]+)([A-Z_]+)/FTS_AUX_\2/; + +--echo # Simulating old non-windows(< 5.6.16) data directory + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +--source include/restart_mysqld.inc + +# Set flags2 for all the table. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +DROP TABLE t1; + +--echo # Simulating old windows (< 5.6.16) data directory + +let $MYSQLD_DATADIR= `select @@datadir`; +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +--source include/restart_mysqld.inc + +# Renaming the tables. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +DROP TABLE t1; + +--echo # Simulation current non windows data directory + +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +--source include/restart_mysqld.inc + +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +DROP TABLE t1; + +--echo # Non windows aux table flag failure and rebuild the corrupted index. + +# Remove the orphaned table +-- source include/restart_mysqld.inc + +call mtr.add_suppression("\\[Warning\\] InnoDB: Parent table of FTS auxiliary table .* not found."); +call mtr.add_suppression("\\[ERROR] InnoDB: Flagged corruption of .* in table .* in DROP ORPHANED TABLE"); +call mtr.add_suppression("\\[Warning\\] InnoDB: Setting aux table .* to hex format failed."); + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT `AB` (a, b), FULLTEXT `C1` (c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +SET GLOBAL DEBUG='-d,innodb_test_wrong_fts_sys_table_name'; + +# 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 + +# 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. +# Set the flag to force the aux table fail and restart the server + +--exec echo "restart:--debug=d,aux_table_flag_fail" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +ALTER TABLE t1 ADD FULLTEXT(b); + +--echo # Restart the server +-- source include/restart_mysqld.inc + +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +--echo # Drop the corrupted index. +ALTER TABLE t1 DROP INDEX `AB`; +ALTER TABLE t1 DROP INDEX `C1`; + +-- echo # Rebuild the index. +ALTER TABLE t1 ADD FULLTEXT(a, b); +ALTER TABLE t1 ADD FULLTEXT(c); + +--echo # Read the record using fts index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +DROP TABLE t1; + +--echo # Non windows parent table flag failure. + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT(a, b), FULLTEXT(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +SET GLOBAL DEBUG='-d,innodb_test_wrong_fts_sys_table_name'; + +# 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 + +# 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. +# Set the flag to force the parent table fail and restart the server + +-- disable_query_log +--error 1 +--exec $MYSQLD_CMD --debug="d,parent_table_flag_fail" +-- enable_query_log + +# Restart the server +--enable_reconnect +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/wait_until_connected_again.inc +--disable_reconnect + +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +DROP TABLE t1; + +--echo # Drop FTS table and rename the common tables. + +# Remove the orphaned table +-- source include/restart_mysqld.inc + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT f1(a, b)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +alter table t1 drop index f1; +SET SESSION debug='-d,innodb_test_wrong_fts_sys_table_name'; +--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; + +--source include/restart_mysqld.inc +# Renaming the common tables. +--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 * FROM t1; +DROP TABLE t1; + +--echo # Rename failure for old windows data directory and rebuild the +--echo # corrupted index + +call mtr.add_suppression("\\[Warning\\] InnoDB: Failed to rename one aux table .* will revert all successful rename operations."); + +call mtr.add_suppression("\\[Warning\\] InnoDB: Rollback operations on all aux tables of table .* All the fts index associated with the table are marked as corrupted. Please rebuild the index again."); + +call mtr.add_suppression("\\[ERROR\\] InnoDB: Flagged corruption of .* in table .* in DROP ORPHANED TABLE"); + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT `AB`(a, b), FULLTEXT `C1`(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +SET SESSION debug='-d,innodb_test_wrong_fts_sys_table_name'; + +# 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. +# Set the flag to force the rename fail and restart the server +--exec echo "restart:--debug=d,rename_aux_table_fail" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Will fail to alter table +--error ER_INNODB_FT_AUX_NOT_HEX_ID +ALTER TABLE t1 ADD FULLTEXT(b); + +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); + +--echo # Restart server. +-- source include/restart_mysqld.inc + +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +--echo # Drop the corrupted index. +ALTER TABLE t1 DROP INDEX `AB`; +ALTER TABLE t1 DROP INDEX `C1`; + +-- echo # Rebuild the index. +ALTER TABLE t1 ADD FULLTEXT(a, b); +ALTER TABLE t1 ADD FULLTEXT(c); + +--echo # Read the record using fts index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +TRUNCATE TABLE t1; +DROP TABLE t1; +-- source include/restart_mysqld.inc +--list_files $MYSQLD_DATADIR/test diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility_win.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility_win.test new file mode 100644 index 00000000..2f580d7e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/fts_compatibility_win.test @@ -0,0 +1,263 @@ +--source include/windows.inc +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_debug.inc + +--echo # Bug #18285007 COPY OF TABLES WITH INNODB FTS +--echo # FROM WINDOWS TO LINUX CAUSES CRASH + +LET $regexp=/FTS_([0-9a-f_]+)([A-Z_]+)/FTS_AUX_\2/; + +--echo # Simulating old non-windows(< 5.6.16) data directory + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_non_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +--source include/restart_mysqld.inc + +# Set flags2 for all the table. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +DROP TABLE t1; + +--echo # Simulating old windows (< 5.6.16) data directory + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +--source include/restart_mysqld.inc + +# Renaming the tables. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +DROP TABLE t1; + +--echo # Simulation current windows data directory + +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a, b))engine=innodb; +INSERT INTO t1 VALUES('TEST1', 'TEST2'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +--source include/restart_mysqld.inc + +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--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; +DROP TABLE t1; + +--echo # Non windows aux table flag failure and rebuild the corrupted index. + +call mtr.add_suppression("\\[Warning\\] InnoDB: Parent table of FTS auxiliary table .* not found."); +call mtr.add_suppression("\\[ERROR] InnoDB: Flagged corruption of .* in table .* in DROP ORPHANED TABLE"); +call mtr.add_suppression("\\[Warning\\] InnoDB: Setting aux table .* to hex format failed."); + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_non_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT `AB` (a, b), FULLTEXT `C1`(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +SET GLOBAL DEBUG='-d,innodb_test_wrong_fts_sys_table_name'; + +# 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 + +# 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. +# Set the flag to force the aux table fail and restart the server + +--exec echo "restart:--debug=d,aux_table_flag_fail" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +ALTER TABLE t1 ADD FULLTEXT(b); + +--echo # Restart the server +-- source include/restart_mysqld.inc + +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +--echo # Drop the corrupted index. +ALTER TABLE t1 DROP INDEX `AB`; +ALTER TABLE t1 DROP INDEX `C1`; + +-- echo # Rebuild the index. +ALTER TABLE t1 ADD FULLTEXT(a, b); +ALTER TABLE t1 ADD FULLTEXT(c); + +--echo # Read the record using fts index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +DROP TABLE t1; + +--echo # Non windows parent table flag failure. + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +SET GLOBAL DEBUG='+d,innodb_test_wrong_non_windows_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT(a, b), FULLTEXT(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +SET GLOBAL DEBUG='-d,innodb_test_wrong_fts_sys_table_name'; + +# 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 + +# 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. +# Set the flag to force the parent table fail and restart the server + +-- disable_query_log +--error 1 +--exec $MYSQLD_CMD --debug="d,parent_table_flag_fail" +-- enable_query_log + +# Restart the server +--enable_reconnect +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/wait_until_connected_again.inc +--disable_reconnect + +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); +DROP TABLE t1; + +--echo # Drop FTS table and rename the common tables. + +# Remove the orphaned table +-- source include/restart_mysqld.inc + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT f1(a, b)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +alter table t1 drop index f1; +SET SESSION debug='-d,innodb_test_wrong_fts_sys_table_name'; +--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; + +--source include/restart_mysqld.inc +# Renaming the common tables. +--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 * FROM t1; +DROP TABLE t1; + +--echo # Rename failure for old windows data directory and rebuild the +--echo # corrupted index + +call mtr.add_suppression("\\[Warning\\] InnoDB: Failed to rename one aux table .* Will revert all successful rename operations."); + +call mtr.add_suppression("\\[Warning\\] InnoDB: Rollback operations on all aux tables of table .* All the fts index associated with the table are marked as corrupted. Please rebuild the index again."); + +call mtr.add_suppression("\\[ERROR\\] InnoDB: Flagged corruption of .* in table .* in DROP ORPHANED TABLE"); + +SET GLOBAL DEBUG='+d,innodb_test_wrong_fts_aux_table_name'; +CREATE TABLE t1(a TEXT, b TEXT, c TEXT, FULLTEXT `AB`(a, b), FULLTEXT `C1`(c)); +INSERT INTO t1 VALUES('TEST1', 'TEST2', 'TEXT3'); +INSERT INTO t1 VALUES('TEXT1', 'TEXT2', 'TEXT5'); +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +SET SESSION debug='-d,innodb_test_wrong_fts_sys_table_name'; + +# 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. +# Set the flag to force the rename fail and restart the server +--exec echo "restart:--debug=d,rename_aux_table_fail" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Will fail to alter table +--error ER_INNODB_FT_AUX_NOT_HEX_ID +ALTER TABLE t1 ADD FULLTEXT(b); + +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); + +--echo # Restart server. +-- source include/restart_mysqld.inc + +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +--error ER_TABLE_HAS_NO_FT +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +--echo # Drop the corrupted index. +ALTER TABLE t1 DROP INDEX `AB`; +ALTER TABLE t1 DROP INDEX `C1`; + +-- echo # Rebuild the index. +ALTER TABLE t1 ADD FULLTEXT(a, b); +ALTER TABLE t1 ADD FULLTEXT(c); + +--echo # Read the record using fts index. +SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ('TEST2'); +SELECT * FROM t1 WHERE MATCH(c) AGAINST ('TEXT5'); + +TRUNCATE TABLE t1; +DROP TABLE t1; +-- source include/restart_mysqld.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test index 2b05ae14..4d75dd2d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test @@ -1326,3 +1326,155 @@ INSERT INTO t1 (a) VALUES SELECT * FROM t1 WHERE MATCH (a) AGAINST ('+"good database"' IN BOOLEAN MODE); DROP TABLE t1; + +# Test single term ranking +CREATE TABLE articles ( + id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + title VARCHAR(200), + body TEXT, + FULLTEXT (title,body) + ) ENGINE=InnoDB; + +# Repeatedly insert/delete records, the ranking should be the same for +# each of them +INSERT INTO articles (title,body) VALUES ('Test Article','blah blah +blah'),("Matt's Noise",'this is noisy'),('February Weather','It was terrible +this year.'),('Peter Pan','Tis a kids story.'),('Test1','nada'),('Database +database database','foo database database database'),('Database article +title','body with lots of words.'),('myfulltext database', 'my test fulltext +database'); + +SELECT id, title, body FROM articles ORDER BY MATCH (title,body) AGAINST ('database' IN BOOLEAN MODE) DESC; +DELETE from articles WHERE title like "myfulltext database"; + +INSERT INTO articles (title,body) VALUES ('myfulltext database', 'my test fulltext database'); + +SELECT id, title, body FROM articles ORDER BY MATCH (title,body) AGAINST ('database' IN BOOLEAN MODE) DESC; +DELETE from articles WHERE title like "myfulltext database"; + +INSERT INTO articles (title,body) VALUES ('myfulltext database', 'my test fulltext database'); + +SELECT id, title, body FROM articles ORDER BY MATCH (title,body) AGAINST ('database' IN BOOLEAN MODE) DESC; + +DROP TABLE articles; + +# Test for BUG 18277305 - FTS: FAILING ASSERTION: PTR[1] == '\"' +# IN FTS_AST_CREATE_NODE_TEXT +CREATE TABLE t1( + a TEXT CHARSET ujis COLLATE ujis_japanese_ci, + b TEXT CHARSET utf8mb4 COLLATE utf8mb4_turkish_ci, + c TEXT CHARSET eucjpms COLLATE eucjpms_bin, + d TEXT CHARSET utf8mb4, + FULLTEXT INDEX(a), + FULLTEXT INDEX(b), + FULLTEXT INDEX(c), + FULLTEXT INDEX(d) +) ENGINE = InnoDB; + +INSERT INTO t1 VALUES + ('myisam', 'myisam', 'myisam', 'myisam'), + ('innodb', 'innodb', 'innodb', 'innodb'), + ('innodb myisam', 'innodb myisam', 'innodb myisam', 'innodb myisam'), + ('memory', 'memory', 'memory', 'memory'), + ('archive', 'archive', 'archive', 'archive'), + ('federated', 'federated', 'federated', 'federated'), + ('storage engine innodb', 'storage engine innodb', 'storage engine innodb', 'storage engine innodb'), + ('storage engine myisam', 'storage engine myisam', 'storage engine myisam', 'storage engine myisam'), + ('innobase', 'innobase', 'innobase', 'innobase'), + ('myisam innodb', 'myisam innodb', 'myisam innodb', 'myisam innodb'), + ('innodb myisam engines', 'innodb myisam engines', 'innodb myisam engines', 'innodb myisam engines'); + +# Test the ujis_japanese_ci +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00)); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', ' ', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, '"', 0x00)); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '&', 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, '&', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '%', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, 0x00, 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', '(', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', ')')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"','@', '2') IN BOOLEAN MODE); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 'm', 'y', 'i', 's', 'a', 'm', '"','@', '4') IN BOOLEAN MODE); +--error ER_PARSE_ERROR +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 's', 't', 'o', 'r', 'a', 'g', 'e', '"','@', '4', 0x00) IN BOOLEAN MODE); + + +# Test the utf8mb4_turkish_ci +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00)); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', ' ', '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 0x00, '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00, '"', 0x00, '"', 0x00)); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', '&', 0x00, '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 0x00, '&', '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', '%', '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, 0x00, 0x00, '"')); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"','@', '2') IN BOOLEAN MODE); +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 'm', 'y', 'i', 's', 'a', 'm', '"','@', '4') IN BOOLEAN MODE); +--error ER_PARSE_ERROR +SELECT b FROM t1 WHERE MATCH (b) AGAINST (CONCAT(0x00, '"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 's', 't', 'o', 'r', 'a', 'g', 'e', '"','@', '4', 0x00) IN BOOLEAN MODE); + +# Test the eucjpms_bin +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00)); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', ' ', '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00, '"', 0x00, '"', 0x00)); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', '&', 0x00, '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, '&', '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', '%', '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, 0x00, 0x00, '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', '(', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', ')')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm', '"')); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"','@', '2') IN BOOLEAN MODE); +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 'm', 'y', 'i', 's', 'a', 'm', '"','@', '4') IN BOOLEAN MODE); +--error ER_PARSE_ERROR +SELECT c FROM t1 WHERE MATCH (c) AGAINST (CONCAT(0x00, '"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 's', 't', 'o', 'r', 'a', 'g', 'e', '"','@', '4', 0x00) IN BOOLEAN MODE); + +ALTER TABLE t1 ENGINE = MyISAM; + +# Test the query against myisam to verify +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00)); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', ' ', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, '"', 0x00)); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '&', 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, '&', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', '%', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, 0x00, 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', 0x00, '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00)); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', '(', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', ')')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', 'm', 'y', 'i', 's', 'a', 'm', '"')); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 0x00, 'i', 'n', 'n', 'o', 'd', 'b', '@', '$', 'm', 'y', 'i', 's', 'a', 'm', '%', 0x00, 0x00, '"','@', '2') IN BOOLEAN MODE); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT('"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 'm', 'y', 'i', 's', 'a', 'm', '"','@', '4') IN BOOLEAN MODE); +SELECT a FROM t1 WHERE MATCH (a) AGAINST (CONCAT(0x00, '"', 'i', 'n', 'n', 'o', 'd', 'b', ' ', '$', 's', 't', 'o', 'r', 'a', 'g', 'e', '"','@', '4', 0x00) IN BOOLEAN MODE); + +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test index 328b718a..e4f5396c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test @@ -458,6 +458,9 @@ INSERT INTO t1 (a,b) VALUES ALTER TABLE t1 ADD FULLTEXT INDEX idx (a,b); EVAL SHOW CREATE TABLE t1; +# Check whether individual space id created for AUX tables +SELECT count(*) FROM information_schema.innodb_sys_tables WHERE name LIKE "%FTS_%" AND space !=0; + # Insert rows INSERT INTO t1 (a,b) VALUES ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/subexpr.test b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/subexpr.test new file mode 100644 index 00000000..63294066 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/subexpr.test @@ -0,0 +1,58 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug #20028323 INNODB FULLTEXT BOOLEAN SEARCH INCORRECTLY HANDLES +--echo # PARENTHESES +--echo # + +CREATE TABLE t1 ( + f1 INT NOT NULL AUTO_INCREMENT, + f2 TEXT NOT NULL, + PRIMARY KEY (f1), + FULLTEXT (f2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO t1 (f2) VALUES +('Pumpkin soup with cheese bread'), +('Yellow chicken curry'), +('Fresh green vegetables with garlic'); + +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+pumpkin' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+cheese' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+(pumpkin cheese)' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) + AGAINST('+pumpkin +(souffle)' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) + AGAINST('+pumpkin +(souffle tart)' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) + AGAINST('+pumpkin +(>souffle <tart)' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) + AGAINST('+pumpkin +(souffle tart)' IN BOOLEAN MODE); + +INSERT INTO t1 (f2) VALUES +('This row contains only souffle'), +('This row contains only tart'), +('This row contains only pumpkin'), +('This row contains only cheese'), +('This row contains pumpkin and souffle'), +('This row contains pumpkin and tart'), +('This row contains pumpkin and cheese'), +('This row contains both souffle and tart'), +('This row contains both souffle and cheese'), +('This row contains both tart and cheese'), +('This row contains all three souffle, pumpkin and tart'), +('This row contains all four cheese, souffle, pumpkin and tart'); + +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+pumpkin' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+cheese' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) AGAINST('+(pumpkin cheese)' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) + AGAINST('+pumpkin +(souffle)' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) + AGAINST('+pumpkin +(souffle tart)' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) + AGAINST('+pumpkin +(>souffle <tart)' IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH(f2) + AGAINST('+pumpkin +(souffle tart)' IN BOOLEAN MODE); + +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/ndb/t/ndb_show_tables_result.inc b/mysql-wsrep-5.6/mysql-test/suite/ndb/t/ndb_show_tables_result.inc old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/include/bugs.inc b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/include/bugs.inc index 966e5ae7..9fe571cd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/include/bugs.inc +++ b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/include/bugs.inc @@ -264,3 +264,74 @@ SELECT 1 FROM t1 WHERE 1 LIKE (SELECT a FROM t1 WHERE a = 1 ORDER BY c); SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; DROP TABLE t1; + +--echo # +--echo # Bug#18791851 CRASH IN ST_SELECT_LEX::PRINT WITH OPTIMIZER_TRACE ON SUBQUERY +--echo # + +CREATE TABLE t1 ( + pk INT NOT NULL, + col_int_nokey INT, + col_int_key INT, + col_time_key time, + col_varchar_key VARCHAR(1), + col_varchar_nokey VARCHAR(1), + PRIMARY KEY (pk), + KEY col_varchar_key (col_varchar_key,col_int_key) +); + +CREATE TABLE t2 ( + pk INT NOT NULL, + col_int_nokey INT, + col_int_key INT, + col_varchar_key VARCHAR(1), + col_varchar_nokey VARCHAR(1), + PRIMARY KEY (pk), + KEY col_varchar_key (col_varchar_key,col_int_key) +); + +CREATE TABLE t3 ( + pk INT NOT NULL, + col_int_nokey INT, + col_int_key INT, + col_varchar_key VARCHAR(1), + col_varchar_nokey VARCHAR(1), + PRIMARY KEY (pk), + KEY col_varchar_key (col_varchar_key,col_int_key) +); + +CREATE TABLE t4 ( + pk INT NOT NULL, + col_int_nokey INT, + col_int_key INT, + col_time_key time, + col_varchar_key VARCHAR(1), + col_varchar_nokey VARCHAR(1), + PRIMARY KEY (pk), + KEY col_varchar_key (col_varchar_key,col_int_key) +); + +SELECT alias1.col_int_nokey AS field1, + alias2.col_varchar_key AS field2, + alias1.col_time_key AS field3, + MIN( alias1.col_int_nokey ) AS field4 +FROM ( + ( + SELECT SQ1_alias1.* + FROM ( t1 AS SQ1_alias1, t2 AS SQ1_alias2 ) + ) AS alias1, + t4 AS alias2 + ) +WHERE + EXISTS ( + SELECT DISTINCT SQ2_alias2.col_varchar_nokey AS SQ2_field1 + FROM t2 AS SQ2_alias1 + INNER JOIN (t4 AS SQ2_alias2 + INNER JOIN t3 AS SQ2_alias3 + ON SQ2_alias3.pk = SQ2_alias2.pk) + ON SQ2_alias3.col_varchar_key = SQ2_alias2.col_varchar_nokey + ) + AND alias1.col_int_key = alias2.pk +HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ; + +DROP TABLE t1,t2,t3,t4; diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result index 1302fbf5..f2f9af7d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result +++ b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_no_prot_all.result @@ -2370,3 +2370,68 @@ SELECT 1 FROM t1 WHERE 1 LIKE ] /* steps */ } 0 0 DROP TABLE t1; +# +# Bug#18791851 CRASH IN ST_SELECT_LEX::PRINT WITH OPTIMIZER_TRACE ON SUBQUERY +# +CREATE TABLE t1 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_time_key time, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t2 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t3 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t4 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_time_key time, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +SELECT alias1.col_int_nokey AS field1, +alias2.col_varchar_key AS field2, +alias1.col_time_key AS field3, +MIN( alias1.col_int_nokey ) AS field4 +FROM ( +( +SELECT SQ1_alias1.* +FROM ( t1 AS SQ1_alias1, t2 AS SQ1_alias2 ) +) AS alias1, +t4 AS alias2 +) +WHERE +EXISTS ( +SELECT DISTINCT SQ2_alias2.col_varchar_nokey AS SQ2_field1 +FROM t2 AS SQ2_alias1 +INNER JOIN (t4 AS SQ2_alias2 +INNER JOIN t3 AS SQ2_alias3 +ON SQ2_alias3.pk = SQ2_alias2.pk) +ON SQ2_alias3.col_varchar_key = SQ2_alias2.col_varchar_nokey +) +AND alias1.col_int_key = alias2.pk +HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ; +field1 field2 field3 field4 +DROP TABLE t1,t2,t3,t4; diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result index b3a4f65c..19f93e64 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result +++ b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_no_prot_none.result @@ -1830,3 +1830,68 @@ SELECT 1 FROM t1 WHERE 1 LIKE ] /* steps */ } 0 0 DROP TABLE t1; +# +# Bug#18791851 CRASH IN ST_SELECT_LEX::PRINT WITH OPTIMIZER_TRACE ON SUBQUERY +# +CREATE TABLE t1 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_time_key time, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t2 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t3 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t4 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_time_key time, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +SELECT alias1.col_int_nokey AS field1, +alias2.col_varchar_key AS field2, +alias1.col_time_key AS field3, +MIN( alias1.col_int_nokey ) AS field4 +FROM ( +( +SELECT SQ1_alias1.* +FROM ( t1 AS SQ1_alias1, t2 AS SQ1_alias2 ) +) AS alias1, +t4 AS alias2 +) +WHERE +EXISTS ( +SELECT DISTINCT SQ2_alias2.col_varchar_nokey AS SQ2_field1 +FROM t2 AS SQ2_alias1 +INNER JOIN (t4 AS SQ2_alias2 +INNER JOIN t3 AS SQ2_alias3 +ON SQ2_alias3.pk = SQ2_alias2.pk) +ON SQ2_alias3.col_varchar_key = SQ2_alias2.col_varchar_nokey +) +AND alias1.col_int_key = alias2.pk +HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ; +field1 field2 field3 field4 +DROP TABLE t1,t2,t3,t4; diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result index 1302fbf5..f2f9af7d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result +++ b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_ps_prot_all.result @@ -2370,3 +2370,68 @@ SELECT 1 FROM t1 WHERE 1 LIKE ] /* steps */ } 0 0 DROP TABLE t1; +# +# Bug#18791851 CRASH IN ST_SELECT_LEX::PRINT WITH OPTIMIZER_TRACE ON SUBQUERY +# +CREATE TABLE t1 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_time_key time, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t2 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t3 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t4 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_time_key time, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +SELECT alias1.col_int_nokey AS field1, +alias2.col_varchar_key AS field2, +alias1.col_time_key AS field3, +MIN( alias1.col_int_nokey ) AS field4 +FROM ( +( +SELECT SQ1_alias1.* +FROM ( t1 AS SQ1_alias1, t2 AS SQ1_alias2 ) +) AS alias1, +t4 AS alias2 +) +WHERE +EXISTS ( +SELECT DISTINCT SQ2_alias2.col_varchar_nokey AS SQ2_field1 +FROM t2 AS SQ2_alias1 +INNER JOIN (t4 AS SQ2_alias2 +INNER JOIN t3 AS SQ2_alias3 +ON SQ2_alias3.pk = SQ2_alias2.pk) +ON SQ2_alias3.col_varchar_key = SQ2_alias2.col_varchar_nokey +) +AND alias1.col_int_key = alias2.pk +HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ; +field1 field2 field3 field4 +DROP TABLE t1,t2,t3,t4; diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result index f2daa36b..ef8b165d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result +++ b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/bugs_ps_prot_none.result @@ -1794,3 +1794,68 @@ SELECT 1 FROM t1 WHERE 1 LIKE ] /* steps */ } 0 0 DROP TABLE t1; +# +# Bug#18791851 CRASH IN ST_SELECT_LEX::PRINT WITH OPTIMIZER_TRACE ON SUBQUERY +# +CREATE TABLE t1 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_time_key time, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t2 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t3 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +CREATE TABLE t4 ( +pk INT NOT NULL, +col_int_nokey INT, +col_int_key INT, +col_time_key time, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key,col_int_key) +); +SELECT alias1.col_int_nokey AS field1, +alias2.col_varchar_key AS field2, +alias1.col_time_key AS field3, +MIN( alias1.col_int_nokey ) AS field4 +FROM ( +( +SELECT SQ1_alias1.* +FROM ( t1 AS SQ1_alias1, t2 AS SQ1_alias2 ) +) AS alias1, +t4 AS alias2 +) +WHERE +EXISTS ( +SELECT DISTINCT SQ2_alias2.col_varchar_nokey AS SQ2_field1 +FROM t2 AS SQ2_alias1 +INNER JOIN (t4 AS SQ2_alias2 +INNER JOIN t3 AS SQ2_alias3 +ON SQ2_alias3.pk = SQ2_alias2.pk) +ON SQ2_alias3.col_varchar_key = SQ2_alias2.col_varchar_nokey +) +AND alias1.col_int_key = alias2.pk +HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ; +field1 field2 field3 field4 +DROP TABLE t1,t2,t3,t4; diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/subquery_no_prot.result b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/subquery_no_prot.result index 72c8e5c8..74ed21c9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/subquery_no_prot.result +++ b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/subquery_no_prot.result @@ -1698,11 +1698,11 @@ field4,field5,field6 { "creating_tmp_table": { "tmp_table_info": { "table": "intermediate_tmp_table", - "row_length": 23, + "row_length": 13, "key_length": 12, "unique_constraint": false, "location": "memory (heap)", - "row_limit_estimate": 45590 + "row_limit_estimate": 80659 } /* tmp_table_info */ } /* creating_tmp_table */ }, diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/subquery_ps_prot.result b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/subquery_ps_prot.result index 3b36ecff..4c39ce51 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/subquery_ps_prot.result +++ b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/subquery_ps_prot.result @@ -1676,11 +1676,11 @@ field4,field5,field6 { "creating_tmp_table": { "tmp_table_info": { "table": "intermediate_tmp_table", - "row_length": 23, + "row_length": 13, "key_length": 12, "unique_constraint": false, "location": "memory (heap)", - "row_limit_estimate": 45590 + "row_limit_estimate": 80659 } /* tmp_table_info */ } /* creating_tmp_table */ }, diff --git a/mysql-wsrep-5.6/mysql-test/suite/opt_trace/validate_json.py b/mysql-wsrep-5.6/mysql-test/suite/opt_trace/validate_json.py old mode 100644 new mode 100755 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_debug.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_debug.result index 7b6b18cb..6b1ef9ec 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_debug.result +++ b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_debug.result @@ -1,5 +1,21 @@ DROP TABLE IF EXISTS t1; # +# Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT +# Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE +# +CREATE TABLE t1 (a INT, b VARCHAR(64), KEY(b,a)) +PARTITION BY HASH (a) PARTITIONS 3; +INSERT INTO t1 VALUES (1, "1"), (2, "2"), (3, "3"), (4, "Four"), (5, "Five"), +(6, "Six"), (7, "Seven"), (8, "Eight"), (9, "Nine"); +SET SESSION debug="+d,ha_partition_fail_index_init"; +SELECT * FROM t1 WHERE b = "Seven"; +ERROR HY000: Table has no partition for value 0 +SET SESSION debug="-d,ha_partition_fail_index_init"; +SELECT * FROM t1 WHERE b = "Seven"; +a b +7 Seven +DROP TABLE t1; +# # WL#4445: EXCHANGE PARTITION WITH TABLE # Verify ddl_log in case of crashing. call mtr.add_suppression("Attempting backtrace. You can use the following information to find out"); diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_innodb.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_myisam.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_10.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_10.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_11.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_11.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_14.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_14.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_3.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_3.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_6.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_6.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/parts/t/partition_debug.test b/mysql-wsrep-5.6/mysql-test/suite/parts/t/partition_debug.test index aa943e5f..c4583bfa 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/parts/t/partition_debug.test +++ b/mysql-wsrep-5.6/mysql-test/suite/parts/t/partition_debug.test @@ -12,6 +12,24 @@ DROP TABLE IF EXISTS t1; --enable_warnings +# Partitioning test that require debug features + +--echo # +--echo # Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT +--echo # Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE +--echo # +CREATE TABLE t1 (a INT, b VARCHAR(64), KEY(b,a)) + PARTITION BY HASH (a) PARTITIONS 3; + INSERT INTO t1 VALUES (1, "1"), (2, "2"), (3, "3"), (4, "Four"), (5, "Five"), + (6, "Six"), (7, "Seven"), (8, "Eight"), (9, "Nine"); +SET SESSION debug="+d,ha_partition_fail_index_init"; +--error ER_NO_PARTITION_FOR_GIVEN_VALUE +SELECT * FROM t1 WHERE b = "Seven"; +SET SESSION debug="-d,ha_partition_fail_index_init"; +SELECT * FROM t1 WHERE b = "Seven"; +DROP TABLE t1; + + --let $DATADIR= `SELECT @@datadir;` --echo # diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/func_file_io.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/func_file_io.result index a71c8e60..d710774a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/func_file_io.result +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/func_file_io.result @@ -3,6 +3,7 @@ UPDATE performance_schema.setup_instruments SET enabled = 'YES' WHERE name LIKE 'wait/io/file/%'; update performance_schema.threads SET instrumented = 'YES' WHERE PROCESSLIST_ID=connection_id(); +truncate table performance_schema.events_statements_summary_by_digest; flush status; DROP TABLE IF EXISTS t1; CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/func_mutex.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/func_mutex.result index fa4c585e..60f531f4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/func_mutex.result +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/func_mutex.result @@ -2,6 +2,7 @@ UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES'; UPDATE performance_schema.setup_instruments SET enabled = 'YES' WHERE name LIKE 'wait/synch/mutex/%' OR name LIKE 'wait/synch/rwlock/%'; +truncate table performance_schema.events_statements_summary_by_digest; flush status; select NAME from performance_schema.mutex_instances where NAME = 'wait/synch/mutex/sql/LOCK_open'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/innodb_table_io.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/innodb_table_io.result index 9b5bd783..460518ae 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/innodb_table_io.result +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/innodb_table_io.result @@ -106,9 +106,6 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL -wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL -wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/myisam_file_io.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/myisam_file_io.result index 40a282d9..f7bb9238 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/myisam_file_io.result +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/myisam_file_io.result @@ -4,6 +4,7 @@ update performance_schema.setup_instruments set enabled='YES' update performance_schema.setup_consumers set enabled='YES'; truncate table performance_schema.events_waits_history_long; +truncate table performance_schema.events_statements_summary_by_digest; flush status; drop table if exists test.no_index_tab; create table test.no_index_tab ( a varchar(255), b int ) engine=myisam; diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/unary_digest.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/unary_digest.result new file mode 100644 index 00000000..40fcc026 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/unary_digest.result @@ -0,0 +1,47 @@ +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_binary' doesn't exist +ERROR 42S02: Table 'test.expect_binary' doesn't exist +ERROR 42S02: Table 'test.expect_binary' doesn't exist +ERROR 42S02: Table 'test.expect_binary' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/func_file_io.test index 014ab5e0..2055fa9a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/func_file_io.test +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/func_file_io.test @@ -16,6 +16,7 @@ update performance_schema.threads SET instrumented = 'YES' WHERE PROCESSLIST_ID=connection_id(); # reset lost counters +truncate table performance_schema.events_statements_summary_by_digest; flush status; --disable_warnings diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/func_mutex.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/func_mutex.test index f8f85274..3b0803ea 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/func_mutex.test +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/func_mutex.test @@ -14,6 +14,7 @@ WHERE name LIKE 'wait/synch/mutex/%' OR name LIKE 'wait/synch/rwlock/%'; # reset lost counters +truncate table performance_schema.events_statements_summary_by_digest; flush status; # Make sure objects are instrumented diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/myisam_file_io.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/myisam_file_io.test index 5888c29f..786ae88e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/myisam_file_io.test +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/myisam_file_io.test @@ -15,6 +15,7 @@ update performance_schema.setup_consumers truncate table performance_schema.events_waits_history_long; # Reset lost counters to a known state +truncate table performance_schema.events_statements_summary_by_digest; flush status; # Code to test diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/nesting.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/nesting.test index 51e5ae0e..4535e0e0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/nesting.test +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/nesting.test @@ -51,6 +51,7 @@ update performance_schema.setup_instruments set enabled='YES', timed='YES' 'statement/com/error'); # Start from a known clean state, to avoid noise from previous tests +truncate table performance_schema.events_statements_summary_by_digest; flush tables; flush status; diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/unary_digest.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/unary_digest.test new file mode 100644 index 00000000..c4583484 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/unary_digest.test @@ -0,0 +1,98 @@ +# ---------------------------------------------------- +# Tests for the performance schema statement Digests. +# ---------------------------------------------------- + +# Test case to show behavior of statements digest when +# statement-digest-size is 0 + +--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 + +--error ER_NO_SUCH_TABLE +select 1 from expect_unary; +--error ER_NO_SUCH_TABLE +select +1 from expect_unary; +--error ER_NO_SUCH_TABLE +select -1 from expect_unary; +--error ER_NO_SUCH_TABLE +select ++++++++++++++++++++++++++++++++++++++++++++++++1 from expect_unary; +--error ER_NO_SUCH_TABLE +select ------------------------------------------------1 from expect_unary; + +--error ER_NO_SUCH_TABLE +select 0+1 from expect_binary; +--error ER_NO_SUCH_TABLE +select 0-1 from expect_binary; +--error ER_NO_SUCH_TABLE +select 0 ++++++++++++++++++++++++++++++++++++++++++++++++1 from expect_binary; +--error ER_NO_SUCH_TABLE +select 0 ------------------------------------------------1 from expect_binary; + +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, 0, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, 0, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, 0, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, -1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, -1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, -1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, +1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, +1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, +1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, 0, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, 0, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, 0, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, -1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, -1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, -1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, +1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, +1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, +1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, 0, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, 0, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, 0, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, -1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, -1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, -1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, +1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, +1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, +1, +1); + +--error ER_NO_SUCH_TABLE +select a-b, a+b, -a, -b, +a, +b from expect_unchanged; + +--enable_query_log + +SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR + FROM performance_schema.events_statements_summary_by_digest; + diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000010.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000010.result index dbc64430..93745564 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000010.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000010.result @@ -6,9 +6,11 @@ Note #### Storing MySQL user name or password information in the master info rep create table t1 (n int not null auto_increment primary key); insert into t1 values(NULL); insert into t1 values(2); +include/sync_slave_sql_with_master.inc select n from t1; n 1 2 drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000011.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000011.result index b7666d38..e1d6eef2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000011.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000011.result @@ -5,14 +5,17 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] create table t1 (n int); insert into t1 values(1); +include/sync_slave_sql_with_master.inc stop slave; include/wait_for_slave_to_stop.inc start slave; include/wait_for_slave_to_start.inc insert into t1 values(2); +include/sync_slave_sql_with_master.inc select * from t1; n 1 2 drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000017.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000017.result index d7d1e61e..1c5d48b7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000017.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_000017.result @@ -8,6 +8,7 @@ grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaa include/start_slave.inc create table t1(n int); insert into t1 values(24); +include/sync_slave_sql_with_master.inc select * from t1; n 24 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_4threads_deadlock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_4threads_deadlock.result new file mode 100644 index 00000000..1f2256ca --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_4threads_deadlock.result @@ -0,0 +1,54 @@ +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] +FLUSH LOGS; +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='+d,before_dump_thread_acquires_current_mutex,processlist_acquiring_dump_threads_LOCK_thd_data'; +include/stop_slave.inc +include/start_slave.inc +"Wait_for dump_thread_signal" +SET DEBUG_SYNC='now WAIT_FOR dump_thread_signal'; +SET DEBUG_SYNC='show_binlogs_after_lock_log_before_lock_index SIGNAL parked1 WAIT_FOR go_parked1'; +SHOW BINARY LOGS; +"Wait_for parked1" +SET DEBUG_SYNC='now WAIT_FOR parked1'; +SET DEBUG_SYNC='purge_logs_after_lock_index_before_thread_count SIGNAL parked2 WAIT_FOR go_parked2'; +PURGE BINARY LOGS BEFORE '9999-12-31'; +"Wait_for parked2" +SET DEBUG_SYNC='now WAIT_FOR parked2'; +SET DEBUG_SYNC='processlist_after_LOCK_thd_count_before_LOCK_thd_data SIGNAL parked3 WAIT_FOR go_parked3'; +SELECT * FROM information_schema.processlist; +"Wait_for parked3" +SET DEBUG_SYNC='now WAIT_FOR parked3'; +"now signal go to all 4 waiting threads" +SET DEBUG_SYNC='now SIGNAL go_dump_thread'; +SET DEBUG_SYNC='now SIGNAL go_parked1'; +SET DEBUG_SYNC='now SIGNAL go_parked2'; +SET DEBUG_SYNC='now SIGNAL go_parked3'; +include/stop_slave.inc +include/start_slave.inc +"Wait_for dump_thread_signal" +SET DEBUG_SYNC='now WAIT_FOR dump_thread_signal'; +SET DEBUG_SYNC='show_binlogs_after_lock_log_before_lock_index SIGNAL parked1 WAIT_FOR go_parked1'; +SHOW BINARY LOGS; +"Wait_for parked1" +SET DEBUG_SYNC='now WAIT_FOR parked1'; +SET DEBUG_SYNC='purge_logs_after_lock_index_before_thread_count SIGNAL parked2 WAIT_FOR go_parked2'; +PURGE BINARY LOGS BEFORE '9999-12-31'; +"Wait_for parked2" +SET DEBUG_SYNC='now WAIT_FOR parked2'; +SET DEBUG_SYNC='processlist_after_LOCK_thd_count_before_LOCK_thd_data SIGNAL parked3 WAIT_FOR go_parked3'; +SHOW PROCESSLIST; +"Wait_for parked3" +SET DEBUG_SYNC='now WAIT_FOR parked3'; +"now signal go to all 4 waiting threads" +SET DEBUG_SYNC='now SIGNAL go_dump_thread'; +SET DEBUG_SYNC='now SIGNAL go_parked1'; +SET DEBUG_SYNC='now SIGNAL go_parked2'; +SET DEBUG_SYNC='now SIGNAL go_parked3'; +"Cleanup" +SET DEBUG_SYNC='RESET'; +SET GLOBAL DEBUG=@save_debug; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_DML_error.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_DML_error.result index d0813442..e4077734 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_DML_error.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_DML_error.result @@ -18,6 +18,7 @@ include/show_binlog_events.inc # A row is inserted. INSERT INTO t1 VALUES(2),(1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] # Nothing is inserted. @@ -28,11 +29,13 @@ include/show_binlog_events.inc # A row is inserted. INSERT INTO t1 SELECT 3 UNION SELECT 2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] # A row is updated. UPDATE t1 SET c1=4; ERROR 23000: Duplicate entry '4' for key 'PRIMARY' +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] # Nothing is updated. UPDATE t1 SET c1=4; @@ -42,6 +45,7 @@ include/show_binlog_events.inc # A row is updated. UPDATE t1, t2 SET t1.c1= 5, t2.c1=5; ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] Nothing is updated. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_LD_INFILE.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_LD_INFILE.result index a0898cb8..bdaad43b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_LD_INFILE.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_LD_INFILE.result @@ -61,6 +61,7 @@ abasements abasement abased abase +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY a DESC; a aberration @@ -114,4 +115,5 @@ abasement abased abase DROP TABLE test.t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter.result index adb943c3..01f89e6c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter.result @@ -10,6 +10,7 @@ insert into mysqltest.t1 values (1,2); create table mysqltest.t2 (n int); insert into mysqltest.t2 values (45); rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2; +include/sync_slave_sql_with_master.inc select * from mysqltest.t2; n m 1 2 @@ -17,4 +18,5 @@ select * from mysqltest.t3; n 45 drop database mysqltest; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_db.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_db.result index 2d9b1176..ef438d99 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_db.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_db.result @@ -7,6 +7,8 @@ Note #### Storing MySQL user name or password information in the master info rep create database temp_db; use temp_db; alter database collate latin1_bin; +include/sync_slave_sql_with_master.inc ==== Clean up ==== drop database temp_db; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_repository.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_repository.result index 5c84b665..863d2598 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_repository.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_repository.result @@ -47,6 +47,7 @@ call mtr.add_suppression("Failed to create or recover replication info repositor call mtr.add_suppression("Error in checking.* repository info type of"); call mtr.add_suppression("Error creating.*: Error checking repositories"); INSERT INTO t_innodb VALUES (1), (2), (3); +include/sync_slave_sql_with_master.inc ALTER TABLE mysql.slave_relay_log_info DROP COLUMN Number_of_workers; INSERT INTO t_innodb VALUES (1), (2), (3); include/wait_for_slave_sql_error.inc [errno=1805] @@ -60,6 +61,7 @@ UPDATE mysql.slave_relay_log_info SET Number_of_workers= 0; include/rpl_restart_server.inc [server_number=2 parameters: --sync-master-info=1 --master-info-repository=TABLE --relay-log-info-repository=TABLE] include/start_slave.inc INSERT INTO t_innodb VALUES (1), (2), (3); +include/sync_slave_sql_with_master.inc ALTER TABLE mysql.slave_relay_log_info DROP COLUMN Number_of_workers; INSERT INTO t_innodb VALUES (1), (2), (3); include/wait_for_slave_sql_error.inc [errno=1805] @@ -79,6 +81,7 @@ 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. include/start_slave.inc +include/sync_slave_sql_with_master.inc ALTER TABLE mysql.slave_master_info DROP COLUMN Enabled_auto_position; INSERT INTO t_innodb VALUES (1), (2), (3); include/wait_for_slave_io_error.inc [errno=1593] @@ -110,6 +113,7 @@ 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. include/start_slave.inc +include/sync_slave_sql_with_master.inc ANALYZE TABLE mysql.slave_master_info, mysql.slave_relay_log_info; Table Op Msg_type Msg_text mysql.slave_master_info analyze status OK @@ -172,6 +176,7 @@ slave_relay_log_info CREATE TABLE `slave_relay_log_info` ( # Search for occurrences of slave_master_info in the output from mysqldump - Occurrences: 1 DROP TABLE t_innodb; +include/sync_slave_sql_with_master.inc include/stop_slave.inc SELECT * FROM mysql.slave_master_info; SELECT * FROM mysql.slave_relay_log_info; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment.result index c990150c..0d858cf4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment.result @@ -10,6 +10,7 @@ a b 12 1 22 2 32 3 +include/sync_slave_sql_with_master.inc select * from t1; a b 12 1 @@ -27,6 +28,7 @@ a b 3 3 22 5 32 6 +include/sync_slave_sql_with_master.inc select * from t1; a b 1 1 @@ -63,6 +65,7 @@ a 400 410 1000 +include/sync_slave_sql_with_master.inc select * from t1; a 5 @@ -97,6 +100,7 @@ a 400 410 1000 +include/sync_slave_sql_with_master.inc select * from t1; a 5 @@ -142,6 +146,7 @@ a 600 610 611 +include/sync_slave_sql_with_master.inc select * from t1; a 1 @@ -159,6 +164,7 @@ a drop table t1; set @@session.auto_increment_increment=10, @@session.auto_increment_offset=1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; +include/sync_slave_sql_with_master.inc insert into t1 values(2),(12),(22),(32),(42); insert into t1 values (NULL),(NULL); insert into t1 values (3),(NULL),(NULL); @@ -169,6 +175,7 @@ a 11 21 31 +include/sync_slave_sql_with_master.inc select * from t1; a 1 @@ -214,6 +221,7 @@ Warning 1264 Out of range value for column 'a' at row 1 select * from t3 order by a; a 127 +include/sync_slave_sql_with_master.inc select * from t1 order by a; a 103 @@ -226,6 +234,7 @@ select * from t3 order by a; a 127 drop table t1,t2,t3; +include/sync_slave_sql_with_master.inc set auto_increment_increment=1; set auto_increment_offset=1; CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb; @@ -236,6 +245,7 @@ t1 CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 +include/sync_slave_sql_with_master.inc show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -297,21 +307,25 @@ id INSERT INTO t1 VALUES(4); INSERT INTO t2 VALUES(4); FLUSH LOGS; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1; DROP TABLE t2; +include/sync_slave_sql_with_master.inc include/stop_slave.inc RESET SLAVE; RESET MASTER; RESET MASTER; FLUSH LOGS; include/start_slave.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1; DROP TABLE t2; SET SQL_MODE=''; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb; BEGIN; # Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing @@ -325,12 +339,15 @@ COMMIT; SELECT * FROM t1; id data 0 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; id data 0 2 DROP TABLE t1; +include/sync_slave_sql_with_master.inc create table t1(a int auto_increment primary key) engine=innodb; insert into t1 values (null),(null),(1025),(null); +include/sync_slave_sql_with_master.inc select * from t1; a 1 @@ -339,4 +356,5 @@ a 1026 include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result index 073e868b..87aacf7b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result @@ -38,6 +38,7 @@ select * from t1; id fname 1 testtest 1 2 test +include/sync_slave_sql_with_master.inc use test1; select * from t1; id fname diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result index 30563b5b..3e8a2acd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result @@ -39,6 +39,8 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT into autoincrement field which is not the first part in the composed primary key is unsafe. set @@binlog_format=mixed; insert into tm set b=null, a=2; +include/sync_slave_sql_with_master.inc drop table tm, ti; drop function multi_part_pk_with_autoinc; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result index 466d9dce..749e0d5f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result @@ -107,6 +107,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; delete from t3 where b = 2 master-bin.000001 # Xid # # COMMIT /* XID */ commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INVOKES A TRIGGER with after insert action' include/diff_tables.inc [master:t2, slave:t2] @@ -119,6 +120,7 @@ DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; DROP FUNCTION f1_insert_triggered; +include/sync_slave_sql_with_master.inc # Test case2: INVOKES A TRIGGER with before insert action create table t1(a int, b int) engine=innodb; create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb; @@ -223,6 +225,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; delete from t3 where b = 2 master-bin.000001 # Xid # # COMMIT /* XID */ commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INVOKES A TRIGGER with before insert action' include/diff_tables.inc [master:t2, slave:t2] @@ -235,6 +238,7 @@ DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; DROP FUNCTION f1_insert_triggered; +include/sync_slave_sql_with_master.inc # Test case3: INVOKES A TRIGGER with after update action create table t1(a int, b int) engine=innodb; create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb; @@ -339,6 +343,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; delete from t3 where b = 2 master-bin.000001 # Xid # # COMMIT /* XID */ commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INVOKES A TRIGGER with after update action' include/diff_tables.inc [master:t2, slave:t2] @@ -351,6 +356,7 @@ DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; DROP FUNCTION f1_insert_triggered; +include/sync_slave_sql_with_master.inc # Test case4: INVOKES A TRIGGER with before update action create table t1(a int, b int) engine=innodb; create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb; @@ -455,6 +461,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; delete from t3 where b = 2 master-bin.000001 # Xid # # COMMIT /* XID */ commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INVOKES A TRIGGER with before update action' include/diff_tables.inc [master:t2, slave:t2] @@ -467,6 +474,7 @@ DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; DROP FUNCTION f1_insert_triggered; +include/sync_slave_sql_with_master.inc # Test case5: INVOKES A TRIGGER with after delete action create table t1(a int, b int) engine=innodb; create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb; @@ -571,6 +579,7 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INVOKES A TRIGGER with after delete action' include/diff_tables.inc [master:t2, slave:t2] @@ -583,6 +592,7 @@ DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; DROP FUNCTION f1_insert_triggered; +include/sync_slave_sql_with_master.inc # Test case6: INVOKES A TRIGGER with before delete action create table t1(a int, b int) engine=innodb; create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb; @@ -687,6 +697,7 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INVOKES A TRIGGER with before delete action' include/diff_tables.inc [master:t2, slave:t2] @@ -699,6 +710,7 @@ DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; DROP FUNCTION f1_insert_triggered; +include/sync_slave_sql_with_master.inc # Test case7: CALLS A FUNCTION which INVOKES A TRIGGER with after insert action create table t1(a int) engine=innodb; create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb; @@ -758,6 +770,7 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'CALLS A FUNCTION which INVOKES A TRIGGER with after insert action' include/diff_tables.inc [master:t2, slave:t2] @@ -766,6 +779,7 @@ drop table t1; drop table t2; drop table t3; drop function f1_two_inserts_trigger; +include/sync_slave_sql_with_master.inc # Test case8: CALLS A FUNCTION which INVOKES A TRIGGER with before insert action create table t1(a int) engine=innodb; create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb; @@ -825,6 +839,7 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'CALLS A FUNCTION which INVOKES A TRIGGER with before insert action' include/diff_tables.inc [master:t2, slave:t2] @@ -833,6 +848,7 @@ drop table t1; drop table t2; drop table t3; drop function f1_two_inserts_trigger; +include/sync_slave_sql_with_master.inc # Test case9: INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS with after insert action CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb; CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb; @@ -850,6 +866,7 @@ INSERT INTO v16(c2) VALUES (21),(22); INSERT INTO v16(c1) VALUES (23), (24); INSERT INTO v16(c1) VALUES (25), (26); commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS' include/diff_tables.inc [master:t3, slave:t3] @@ -857,6 +874,7 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; DROP VIEW v16; +include/sync_slave_sql_with_master.inc # Test case10: INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS with before insert action CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb; CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb; @@ -874,6 +892,7 @@ INSERT INTO v16(c2) VALUES (21),(22); INSERT INTO v16(c1) VALUES (23), (24); INSERT INTO v16(c1) VALUES (25), (26); commit; +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS' include/diff_tables.inc [master:t3, slave:t3] @@ -881,6 +900,7 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; DROP VIEW v16; +include/sync_slave_sql_with_master.inc # Test case11: INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES INTO A TABLE WITH AUTOINC COLUMN create table t1(a int) engine=innodb; create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb; @@ -905,6 +925,7 @@ i1 a 4 5 5 2 6 2 +include/sync_slave_sql_with_master.inc #Test result for INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES on slave select * from t2 ORDER BY i1; i1 a @@ -917,6 +938,7 @@ i1 a drop table t1; drop table t2; drop function f1_two_inserts; +include/sync_slave_sql_with_master.inc # Test case12: INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES OF A TABLE WITH AUTOINC COLUMN create table t1(a int) engine=innodb; create table t2(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb; @@ -943,6 +965,7 @@ i1 a b 2 12 2 3 13 3 4 14 4 +include/sync_slave_sql_with_master.inc #Test result for INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES on slave select * from t2 ORDER BY i1; i1 a b @@ -953,6 +976,7 @@ i1 a b drop table t1; drop table t2; drop function f1_two_updates; +include/sync_slave_sql_with_master.inc # Test case13: UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT create table t1(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb; create table t2(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb; @@ -977,12 +1001,14 @@ master-bin.000001 # Query # # use `test`; insert into t1(a,b) values(3,3) master-bin.000001 # Intvar # # INSERT_ID=3 master-bin.000001 # Query # # use `test`; insert into t2(a,b) values(3,3) master-bin.000001 # Xid # # COMMIT /* XID */ +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT' include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] drop table t1; drop table t2; +include/sync_slave_sql_with_master.inc # Test case14: INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb; CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb; @@ -1031,6 +1057,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=7 master-bin.000001 # Query # # use `test`; INSERT INTO v15(c2) VALUES (25), (26) master-bin.000001 # Xid # # COMMIT /* XID */ +include/sync_slave_sql_with_master.inc #Test if the results are consistent on master and slave #for 'INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES' include/diff_tables.inc [master:t1, slave:t1] @@ -1038,4 +1065,5 @@ include/diff_tables.inc [master:t2, slave:t2] drop table t1; drop table t2; drop view v15; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result index 2b0c0bc4..75974fd9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result @@ -13,6 +13,7 @@ CREATE DATABASE db2; use db1; CREATE TABLE db1.t1 (a INT) ENGINE=InnoDB; CREATE TABLE db1.t2 (s CHAR(255)) ENGINE=MyISAM; +include/sync_slave_sql_with_master.inc include/stop_slave.inc [on master] CREATE PROCEDURE db1.p1 () @@ -163,6 +164,7 @@ master-bin.000001 # Query # # ROLLBACK TO `has_comment` master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("after rollback to") master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(50) master-bin.000001 # Xid # # COMMIT /* XID */ +include/sync_slave_sql_with_master.inc [on slave] # # Verify INSERT statements in savepoints are executed, for MyISAM table @@ -191,6 +193,7 @@ CREATE TABLE t2(c1 INT) ENGINE=MyISAM; CREATE TABLE t3(c1 INT) ENGINE=InnoDB; INSERT INTO t1 VALUES(1, "master"); SET @@session.binlog_direct_non_transactional_updates= FALSE; +include/sync_slave_sql_with_master.inc # [ on slave ] USE db1; SET @timeout_old= @@GLOBAL.innodb_lock_wait_timeout; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_binlog_gcommit_options.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_binlog_gcommit_options.result index ccbe4f56..91b1ec33 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_binlog_gcommit_options.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_binlog_gcommit_options.result @@ -10,11 +10,13 @@ Note #### Storing MySQL user name or password information in the master info rep SELECT COUNT(a) FROM t; COUNT(a) 200 +include/sync_slave_sql_with_master.inc # Slave results SELECT COUNT(a) FROM t; COUNT(a) 200 # Clean up DROP TABLE t; +include/sync_slave_sql_with_master.inc include/stop_slave.inc # End of tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bit.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bit.result index e6678d17..32f1278d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bit.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bit.result @@ -94,6 +94,7 @@ hex(bit3) 15 24 35 +include/sync_slave_sql_with_master.inc SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; oSupp sSuppD GSuppDf VNotSupp x034 5 5 3 2 1 @@ -135,4 +136,5 @@ hex(bit3) 24 35 DROP TABLE IF EXISTS test.t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bit_npk.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bit_npk.result index 2207e898..14e0c35f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bit_npk.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bit_npk.result @@ -97,6 +97,7 @@ hex(bit3) 15 24 35 +include/sync_slave_sql_with_master.inc SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1 ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034; @@ -155,6 +156,7 @@ SELECT * FROM test.t3 ORDER BY a,b; a b 1 NULL 2 0 +include/sync_slave_sql_with_master.inc SELECT a, hex(b) FROM test.t2 ORDER BY a,b; a hex(b) 1 0 @@ -166,4 +168,5 @@ a b DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_blackhole.result index baced5f5..ea79ec61 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_blackhole.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_blackhole.result @@ -6,11 +6,14 @@ Note #### Storing MySQL user name or password information in the master info rep call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); CREATE TABLE t1 (a INT, b INT, c INT); CREATE TABLE t2 (a INT, b INT, c INT); +include/sync_slave_sql_with_master.inc ALTER TABLE t1 ENGINE=BLACKHOLE; INSERT INTO t2 VALUES (1,9,1), (2,9,2), (3,9,3), (4,9,4); +include/sync_slave_sql_with_master.inc [on master] INSERT INTO t1 VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4); [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -19,6 +22,7 @@ COUNT(*) [on master] UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 1; [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -27,6 +31,7 @@ COUNT(*) [on master] DELETE FROM t1 WHERE a % 2 = 0 AND b = 1; [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -35,6 +40,7 @@ COUNT(*) [on master] INSERT INTO t1 SELECT * FROM t2; [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -44,6 +50,7 @@ ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b); [on master] INSERT INTO t1 VALUES (1,2,1),(2,2,2),(3,2,3),(4,2,4); [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -52,6 +59,7 @@ COUNT(*) [on master] UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 2; [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -60,6 +68,7 @@ COUNT(*) [on master] DELETE FROM t1 WHERE a % 2 = 0 AND b = 2; [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -69,6 +78,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, ADD KEY key_t1 (a); [on master] INSERT INTO t1 VALUES (1,3,1),(2,3,2),(3,3,3),(4,3,4); [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -77,6 +87,7 @@ COUNT(*) [on master] UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 3; [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) @@ -85,6 +96,7 @@ COUNT(*) [on master] DELETE FROM t1 WHERE a % 2 = 0 AND b = 3; [on slave] +include/sync_slave_sql_with_master.inc # Expect 0 SELECT COUNT(*) FROM t1; COUNT(*) diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug31076.result index bb9ab599..718c476d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug31076.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug31076.result @@ -72,5 +72,6 @@ event_id visit_id timestamp src data visits_events_id 20000 21231038 2007-09-18 03:59:02 Downloads/MySQL-4.1/mysql-4.1.12a-win32.zip 33712207 SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; DROP DATABASE track; +include/sync_slave_sql_with_master.inc End of 5.1 tests include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug37426.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug37426.result index b356ef29..ae5d8433 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug37426.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug37426.result @@ -8,8 +8,10 @@ INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ); SELECT * FROM char128_utf8; i1 c i2 1 123 1 +include/sync_slave_sql_with_master.inc SELECT * FROM char128_utf8; i1 c i2 1 123 1 DROP TABLE char128_utf8; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug41902.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug41902.result index d00531cd..4c365911 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug41902.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_bug41902.result @@ -3,6 +3,7 @@ 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] +include/sync_slave_sql_with_master.inc stop slave; SET @@debug="d,simulate_find_log_pos_error"; reset slave; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_charset.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_charset.result index ffaaa9be..bcd5ae8a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_charset.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_charset.result @@ -15,6 +15,7 @@ mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ show create database mysqltest3; Database Create Database mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */ +include/sync_slave_sql_with_master.inc --- --slave-- show create database mysqltest2; @@ -31,6 +32,7 @@ create database mysqltest3; show create database mysqltest3; Database Create Database mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ +include/sync_slave_sql_with_master.inc --- --slave-- show create database mysqltest3; @@ -52,6 +54,7 @@ a b 3 cp850 4 latin2 5 latin2_croatian_ci +include/sync_slave_sql_with_master.inc --- --slave-- select * from mysqltest2.t1 order by a; a b @@ -74,6 +77,7 @@ a b 2 Muffler 3 latin1_german2_ci 4 Müller +include/sync_slave_sql_with_master.inc --- --slave-- select * from mysqltest2.t1 order by a; a b @@ -88,12 +92,14 @@ insert into t1 (b) values(collation(@a)); select * from t1 order by a; a b 1 cp850_general_ci +include/sync_slave_sql_with_master.inc --- --slave-- select * from mysqltest2.t1 order by a; a b 1 cp850_general_ci drop database mysqltest2; drop database mysqltest3; +include/sync_slave_sql_with_master.inc set global character_set_server=latin2; set global character_set_server=latin1; set global character_set_server=latin2; @@ -111,10 +117,12 @@ INSERT INTO t1 (c1, c2) VALUES (' select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +include/sync_slave_sql_with_master.inc select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 drop table t1; +include/sync_slave_sql_with_master.inc create table `t1` ( `pk` varchar(10) not null default '', primary key (`pk`) diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_charset_sjis.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_charset_sjis.result index 9955a950..cc036b9a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_charset_sjis.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_charset_sjis.result @@ -15,6 +15,7 @@ select "--- on master ---"; select hex(a) from t1 ; hex(a) 965C +include/sync_slave_sql_with_master.inc select "--- on slave ---"; --- on slave --- --- on slave --- @@ -23,4 +24,5 @@ hex(a) 965C 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_check_gtid.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_check_gtid.result index 3785636b..63e101dd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_check_gtid.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_check_gtid.result @@ -14,6 +14,7 @@ INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; extra/rpl_tests/rpl_check_gtid.inc +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc BEGIN; @@ -29,6 +30,7 @@ INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; extra/rpl_tests/rpl_check_gtid.inc +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc BEGIN; @@ -44,6 +46,7 @@ INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; extra/rpl_tests/rpl_check_gtid.inc +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc BEGIN; @@ -59,6 +62,7 @@ INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; extra/rpl_tests/rpl_check_gtid.inc +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc BEGIN; @@ -78,6 +82,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc FLUSH LOGS; ---- i=2 ---- @@ -85,6 +90,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc FLUSH LOGS; ---- i=3 ---- @@ -92,6 +98,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc FLUSH LOGS; ---- i=4 ---- @@ -99,6 +106,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc FLUSH LOGS; ==== Part 3 ==== @@ -111,6 +119,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -123,6 +132,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -135,6 +145,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -147,6 +158,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -162,6 +174,7 @@ INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; extra/rpl_tests/rpl_check_gtid.inc +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -175,6 +188,7 @@ INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; extra/rpl_tests/rpl_check_gtid.inc +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -188,6 +202,7 @@ INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; extra/rpl_tests/rpl_check_gtid.inc +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -201,6 +216,7 @@ INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; extra/rpl_tests/rpl_check_gtid.inc +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -213,6 +229,7 @@ FLUSH LOGS; include/stop_slave.inc RESET SLAVE; RESET MASTER; +RESET MASTER; include/start_slave.inc BEGIN; INSERT INTO t1 VALUES(1); @@ -222,6 +239,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc FLUSH LOGS; FLUSH LOGS; @@ -229,6 +247,7 @@ FLUSH LOGS; include/stop_slave.inc RESET SLAVE; RESET MASTER; +RESET MASTER; include/start_slave.inc BEGIN; INSERT INTO t1 VALUES(1); @@ -238,6 +257,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc FLUSH LOGS; FLUSH LOGS; @@ -245,6 +265,7 @@ FLUSH LOGS; include/stop_slave.inc RESET SLAVE; RESET MASTER; +RESET MASTER; include/start_slave.inc BEGIN; INSERT INTO t1 VALUES(1); @@ -254,6 +275,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc FLUSH LOGS; FLUSH LOGS; @@ -261,6 +283,7 @@ FLUSH LOGS; include/stop_slave.inc RESET SLAVE; RESET MASTER; +RESET MASTER; include/start_slave.inc BEGIN; INSERT INTO t1 VALUES(1); @@ -270,6 +293,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc FLUSH LOGS; FLUSH LOGS; @@ -421,6 +445,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -434,6 +459,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -447,6 +473,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -460,6 +487,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -475,6 +503,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -488,6 +517,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -501,6 +531,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc @@ -514,6 +545,7 @@ BEGIN; INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); COMMIT; +include/sync_slave_sql_with_master.inc extra/rpl_tests/rpl_check_gtid.inc extra/rpl_tests/rpl_check_gtid.inc include/stop_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_checksum_cache.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_checksum_cache.result index 7c516d5f..9c218a77 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_checksum_cache.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_checksum_cache.result @@ -41,10 +41,12 @@ Binlog_cache_use 1 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] begin; delete from t1; commit; +include/sync_slave_sql_with_master.inc flush status; create table t2(a int auto_increment primary key, data VARCHAR(12288)) ENGINE=Innodb; show status like "binlog_cache_use"; @@ -54,10 +56,12 @@ Binlog_cache_use 1 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] begin; delete from t2; commit; +include/sync_slave_sql_with_master.inc flush status; create table t3(a int auto_increment primary key, data VARCHAR(8192)) engine=innodb; show status like "binlog_cache_use"; @@ -67,10 +71,12 @@ Binlog_cache_use 1 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t3, slave:t3] begin; delete from t3; commit; +include/sync_slave_sql_with_master.inc flush status; create procedure test.p1 (n int) begin @@ -105,6 +111,7 @@ Binlog_cache_use 1 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] include/diff_tables.inc [master:t3, slave:t3] diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_colSize.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_colSize.result index 2f0b7caf..f7710e96 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_colSize.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_colSize.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep DROP TABLE IF EXISTS t1; **** Testing WL#3228 changes. **** *** Create "wider" table on slave *** +include/sync_slave_sql_with_master.inc STOP SLAVE; include/wait_for_slave_to_stop.inc RESET SLAVE; @@ -84,6 +85,7 @@ SELECT * FROM t1 ORDER BY a; a b c d e f g h j k l m n o p q r s t 17.567 2.123 10.20 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4 *** Select data from slave to compare *** +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a b c d e f g h j k l m n o p q r s t 17.567 2.123000000 10.200000000000000000000000000000 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4 @@ -95,6 +97,7 @@ b VARCHAR(100), c VARCHAR(300), d CHAR(5) ); +include/sync_slave_sql_with_master.inc Alter varchar table on slave ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100); ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400); @@ -116,6 +119,7 @@ t1 CREATE TABLE `t1` ( `c` varchar(300) DEFAULT NULL, `d` char(5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 +include/sync_slave_sql_with_master.inc Insert some values and select them on slave SELECT * FROM t1; a b c d @@ -138,6 +142,7 @@ d BIT(11), e BIT(11) ); Create bit table on slave +include/sync_slave_sql_with_master.inc DROP TABLE t1; CREATE TABLE t1 ( a BIT(16), @@ -166,6 +171,7 @@ t1 CREATE TABLE `t1` ( `d` bit(11) DEFAULT NULL, `e` bit(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 +include/sync_slave_sql_with_master.inc Insert some values and select them on master SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1; BIN(a) BIN(b) BIN(c) BIN(d) BIN(e) @@ -179,7 +185,22 @@ t1 CREATE TABLE `t1` ( `d` bit(25) DEFAULT NULL, `e` bit(13) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t2(i INTEGER); +CREATE TRIGGER t1_tr BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +INSERT INTO t2 VALUES(1); +END $$ +INSERT INTO t1 VALUES ( +b'1010101', +b'10101011', +b'101010110101010101111', +b'10101010101', +b'10101011111' + ); +include/sync_slave_sql_with_master.inc *** Cleanup *** DROP TABLE t1; +DROP TABLE t2; +include/sync_slave_sql_with_master.inc SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_commit_after_flush.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_commit_after_flush.result index 9a51a664..ee4b3249 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_commit_after_flush.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_commit_after_flush.result @@ -8,6 +8,8 @@ begin; insert into t1 values(1); flush tables with read lock; commit; +include/sync_slave_sql_with_master.inc unlock tables; drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_concurrency_error.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_concurrency_error.result index 00906e32..84eba1eb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_concurrency_error.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_concurrency_error.result @@ -117,6 +117,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 1' WHERE f = 'red' master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (1 * 10),"brown") master-bin.000001 # Xid # # COMMIT /* XID */ +include/sync_slave_sql_with_master.inc include/rpl_diff.inc include/rpl_diff.inc ######################################################################## @@ -125,4 +126,5 @@ include/rpl_diff.inc DROP TRIGGER tr; DROP TABLE t; DROP TABLE n; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_conditional_comments.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_conditional_comments.result index 3e3177db..b05134f3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_conditional_comments.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_conditional_comments.result @@ -18,6 +18,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; /* 99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /* 99999 ,(11)*/ master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1,slave:t1] # Case 2: @@ -29,6 +30,7 @@ EXECUTE stmt; DROP TABLE t1; CREATE TABLE t1(c1 INT); EXECUTE stmt; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1,slave:t1] SET @value=62; @@ -55,6 +57,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT) master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla */ t1 VALUES(62) /* 99999 ,(63)*/ master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1,slave:t1] # Case 3: diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_corruption.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_corruption.result index f1073491..91e57f8f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_corruption.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_corruption.result @@ -13,6 +13,7 @@ SET @old_master_verify_checksum = @@master_verify_checksum; # 1. Creating test table/data and set corruption position for testing * insert/update/delete rows in table t1 * CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100)); +include/sync_slave_sql_with_master.inc include/stop_slave.inc # 2. Corruption in master binlog and SHOW BINLOG EVENTS SET GLOBAL debug="d,corrupt_read_log_event_char"; @@ -40,8 +41,10 @@ include/wait_for_slave_sql_error.inc [errno=1593] # 7. Seek diff for tables on master and slave SET GLOBAL debug= ""; include/start_slave.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] # 8. Clean up SET GLOBAL master_verify_checksum = @old_master_verify_checksum; DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_crash_safe_master.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_crash_safe_master.result index e76360e7..bca62215 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_crash_safe_master.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_crash_safe_master.result @@ -16,6 +16,7 @@ CREATE TABLE t1(a LONGBLOB) ENGINE=INNODB; # Lets stop the slave IO thread first, so that it does not timeout on # reconnection while the master is down (it happened before on some # slow hosts). +include/sync_slave_sql_with_master.inc include/stop_slave_io.inc BEGIN; INSERT INTO t1 (a) VALUES (REPEAT('a',2)); @@ -32,6 +33,7 @@ include/assert.inc [On master, test the data will be rolled back after restart.] # lets restart the slave io thread and check that # the slave gets synchronized again include/start_slave_io.inc +include/sync_slave_sql_with_master.inc # On slave, test replication will work fine, and the data # is not replicated include/diff_tables.inc [master:test.t1, slave:test.t1] @@ -40,6 +42,7 @@ include/diff_tables.inc [master:test.t1, slave:test.t1] # Lets stop the slave IO thread first, so that it does not timeout on # reconnection while the master is down (it happened before on some # slow hosts). +include/sync_slave_sql_with_master.inc include/stop_slave_io.inc BEGIN; INSERT INTO t1 (a) VALUES (REPEAT('a',2)); @@ -63,9 +66,11 @@ include/assert.inc [On master, test the data will be recovered after the master # lets restart the slave io thread and check that # the slave gets synchronized again include/start_slave_io.inc +include/sync_slave_sql_with_master.inc # On slave, test replication will work fine, and the data is replicated include/diff_tables.inc [master:test.t1, slave:test.t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc CREATE TABLE t1(a LONGBLOB) ENGINE=INNODB; # Test case3: Set DEBUG POINT in the middle of binlog to @@ -125,3 +130,4 @@ SELECT COUNT(*) FROM t2; COUNT(*) 0 DROP TABLE t1, t2; +CHANGE MASTER TO MASTER_AUTO_POSITION= 0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_database.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_database.result index eb9157d5..505c633f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_database.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_database.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_bob; +include/sync_slave_sql_with_master.inc DROP DATABASE IF EXISTS mysqltest_bob; CREATE DATABASE mysqltest_prometheus; CREATE DATABASE mysqltest_sisyfos; @@ -25,6 +26,7 @@ mysql mysqltest_bob mysqltest_prometheus mysqltest_sisyfos +include/sync_slave_sql_with_master.inc SHOW DATABASES LIKE 'mysql%'; Database (mysql%) mysql @@ -43,6 +45,7 @@ mysql mysqltest_bob mysqltest_prometheus mysqltest_sisyfos +include/sync_slave_sql_with_master.inc SHOW DATABASES LIKE 'mysql%'; Database (mysql%) mysql @@ -59,4 +62,5 @@ t2 DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_bob; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_drop_temp_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_drop_temp_table.result new file mode 100644 index 00000000..7e54265d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_drop_temp_table.result @@ -0,0 +1,13 @@ +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 TEMPORARY TABLE temp (i INT); +include/stop_slave_io.inc +include/rpl_stop_server.inc [server_number=1] +include/rpl_start_server.inc [server_number=1] +include/start_slave_io.inc +include/sync_slave_io_with_master.inc +include/assert.inc [Slave_open_temp_tables should be 0] +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result index 80c4acc8..eb13f3aa 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result @@ -12,6 +12,7 @@ CREATE TABLE IF NOT EXISTS t2 SELECT * FROM t; CREATE EVENT IF NOT EXISTS e ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT now(); +include/sync_slave_sql_with_master.inc DROP DATABASE mysqltest; CREATE DATABASE IF NOT EXISTS mysqltest; USE mysqltest; @@ -21,6 +22,7 @@ CREATE TABLE IF NOT EXISTS t2 SELECT * FROM t; CREATE EVENT IF NOT EXISTS e ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT now(); +include/sync_slave_sql_with_master.inc SHOW TABLES in mysqltest; Tables_in_mysqltest t @@ -46,6 +48,7 @@ c1 SELECT * FROM t2; c1 1 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; c1 33 @@ -115,6 +118,7 @@ CREATE TABLE IF NOT EXISTS v1 SELECT 2 as a; Warnings: Note 1050 Table 'v1' already exists include/show_binlog_events.inc +include/sync_slave_sql_with_master.inc DROP VIEW v1; DROP TABLE t1, t2; # @@ -131,4 +135,5 @@ Warnings: Note 1050 Table 't2' already exists # Clean-up. DROP TABLE t1, t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_current_user.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_current_user.result index c0ece6fb..ed8d07c4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_current_user.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_current_user.result @@ -109,12 +109,14 @@ SELECT * FROM t1; c1 root@localhost 1234 +include/sync_slave_sql_with_master.inc # [On slave] SELECT * FROM t1; c1 @ 1234 # [On server_3] +include/sync_slave_sql_with_master.inc SELECT * FROM t1; c1 @ @@ -127,11 +129,13 @@ SELECT * FROM t1; c1 root@localhost root@localhost +include/sync_slave_sql_with_master.inc # [On slave] SELECT * FROM t1; c1 @ @ +include/sync_slave_sql_with_master.inc # [On server_3] SELECT * FROM t1; c1 @@ -143,9 +147,11 @@ Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. SELECT * FROM t1; c1 +include/sync_slave_sql_with_master.inc # [On slave] SELECT * FROM t1; c1 +include/sync_slave_sql_with_master.inc # [On server_3] SELECT * FROM t1; c1 @@ -166,6 +172,7 @@ root@localhost SELECT * FROM t2; c1 root@localhost +include/sync_slave_sql_with_master.inc # [On slave] SELECT * FROM t1; c1 @@ -173,6 +180,7 @@ c1 SELECT * FROM t2; c1 @ +include/sync_slave_sql_with_master.inc # [On server_3] SELECT * FROM t1; c1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result index 3e6c5068..30aa3d86 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result @@ -133,17 +133,6 @@ zero START SLAVE; *** Now the slave must be stopped due to timeout *** include/wait_for_slave_sql_error.inc [errno=1205] -==== BEGIN include/wait_for_slave_sql_error.inc [errno=1205] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/wait_for_slave_param.inc [Slave_SQL_Running] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -Waiting until 'Slave_SQL_Running' = 'No' [timeout='300', $slave_error_param='1'] -[connection slave] -.==== END include/wait_for_slave_param.inc [Slave_SQL_Running] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/wait_for_slave_sql_error.inc [errno=1205] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' rollback; set @@global.slave_transaction_retries= @save.slave_transaction_retries; include/start_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_delete_no_where.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_delete_no_where.result index 4f19254b..cb3fbe37 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_delete_no_where.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_delete_no_where.result @@ -5,11 +5,14 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] create table t1 (a int, b int) engine=myisam; insert into t1 values(1,1); +include/sync_slave_sql_with_master.inc select * from t1; a b 1 1 delete from t1; +include/sync_slave_sql_with_master.inc select * from t1; a b drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_db_filter.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_db_filter.result index e552f193..6eb60943 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_db_filter.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_db_filter.result @@ -21,7 +21,9 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc # On slave include/show_binlog_events.inc DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_table_filter_insensitive.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_table_filter_insensitive.result index 7e08e9ea..00a2b4c3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_table_filter_insensitive.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_table_filter_insensitive.result @@ -21,6 +21,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc # On slave include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -30,5 +31,6 @@ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) slave-bin.000001 # Query # # COMMIT DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc Replicate_Do_Table: mydb.T2,mýdb.Å£1 include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_table_filter_sensitive.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_table_filter_sensitive.result index 6b2bf807..5e74d9f0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_table_filter_sensitive.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_do_table_filter_sensitive.result @@ -21,6 +21,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc # On slave include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -30,5 +31,6 @@ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) slave-bin.000001 # Query # # COMMIT DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc Replicate_Do_Table: mydb.Å¢1,mydb.t2 include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop.result index e877be85..eea559ff 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop.result @@ -6,4 +6,5 @@ Note #### Storing MySQL user name or password information in the master info rep create table t1 (a int); drop table t1, t2; ERROR 42S02: Unknown table 'test.t2' +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_db_fail.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_db_fail.result new file mode 100644 index 00000000..95eeef8f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_db_fail.result @@ -0,0 +1,20 @@ +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 IF NOT EXISTS db1; +CREATE DATABASE IF NOT EXISTS db2; +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; +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); +DROP DATABASE db1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +DROP DATABASE db2; +include/sync_slave_sql_with_master.inc +DROP DATABASE db1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_temp_gtid.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_temp_gtid.result new file mode 100644 index 00000000..31ea8133 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_temp_gtid.result @@ -0,0 +1,35 @@ +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] +# Initial setup +[connection master] +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=InnoDB; +# Insert the data in the master +BEGIN; +INSERT INTO temp_t1 VALUES (1); +COMMIT; +BEGIN; +INSERT INTO t1 VALUES ((SELECT COUNT(*) FROM temp_t1)); +COMMIT; +include/sync_slave_sql_with_master.inc +[connection slave] +# Stop the IO thread +include/stop_slave_io.inc +# Restart IO thread +include/start_slave_io.inc +# Do one more insert on master and then sync slave with master +[connection master] +BEGIN; +INSERT INTO t1 VALUES ((SELECT COUNT(*) FROM temp_t1)); +COMMIT; +include/sync_slave_sql_with_master.inc +# Now compare master and slave's t1 table data +[connection master] +include/diff_tables.inc [master:t1, slave:t1] +# Cleanup +[connection master] +DROP TABLE t1, temp_t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_view.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_view.result index 4f15edae..ec5f628b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_view.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_drop_view.result @@ -18,6 +18,7 @@ ERROR 42S02: Unknown table 'test.not_exist_view' select * from v1; ERROR 42S02: Table 'test.v1' doesn't exist drop view v2, v3; +include/sync_slave_sql_with_master.inc select * from v1; ERROR 42S02: Table 'test.v1' doesn't exist select * from v2; @@ -26,4 +27,5 @@ select * from v3; ERROR 42S02: Table 'test.v3' doesn't exist ==== clean up ==== drop table t1, t2, t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result index 0757cc43..bdaa2f24 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result @@ -6,8 +6,10 @@ 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. create table t1 (n int); +include/sync_slave_sql_with_master.inc include/stop_slave.inc create table t2 (n int); +include/sync_slave_sql_with_master.inc show tables; Tables_in_test t1 @@ -48,6 +50,8 @@ include/start_slave.inc create table t4 (n int); create table t5 (n int); create table t6 (n int); +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc show tables; Tables_in_test t1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result index 8594d160..855dc939 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result @@ -8,6 +8,7 @@ create table t4 (a int primary key); insert into t1 values (1),(1); Got one of the listed errors insert into t4 values (1),(2); +include/sync_slave_sql_with_master.inc show tables like 't1'; Tables_in_test (t1) show tables like 't4'; @@ -18,6 +19,7 @@ a 1 2 drop table t1; +include/sync_slave_sql_with_master.inc select get_lock('crash_lock%20C', 10); get_lock('crash_lock%20C', 10) 1 @@ -32,6 +34,7 @@ select (@id := id) - id from t3; kill @id; drop table t2,t3; insert into t4 values (3),(4); +include/sync_slave_sql_with_master.inc SELECT * FROM test.t4 ORDER BY a; a 1 @@ -39,4 +42,5 @@ a 3 4 DROP TABLE test.t4; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_events.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_events.result index b0140e1d..65db3acc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_events.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_events.result @@ -99,6 +99,7 @@ DO BEGIN select * from t28953; END;| ALTER EVENT event1 RENAME TO event2; +include/sync_slave_sql_with_master.inc DROP EVENT event2; CREATE TABLE test.t1(details CHAR(30)); CREATE EVENT /*!50000 event44331_1 */ @@ -142,6 +143,7 @@ select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events where EVENT_NAME='event44331_4'; EVENT_SCHEMA EVENT_NAME DEFINER test event44331_4 user44331@% +include/sync_slave_sql_with_master.inc #on slave select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events where EVENT_NAME='event44331_1'; @@ -166,4 +168,5 @@ DROP EVENT event44331_1; DROP EVENT event44331_2; DROP EVENT event44331_3; DROP EVENT event44331_4; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_extra_row_data.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_extra_row_data.result index 055a1361..6306cb85 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_extra_row_data.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_extra_row_data.result @@ -40,10 +40,12 @@ UPDATE t1 SET a = a+1; UPDATE t1 SET a = a+1; DELETE FROM t1 WHERE a > 390; **** On Slave **** +include/sync_slave_sql_with_master.inc Check row count and that slave is running ok SELECT count(*) from t1; count(*) 80 include/check_slave_is_running.inc DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_database.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_database.result index d4b742db..865086e4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_database.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_database.result @@ -3,4 +3,7 @@ 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] +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result index 3c58eb3a..a639aa1b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result @@ -21,6 +21,7 @@ INSERT INTO t6 VALUES (1, 1), (2, 2), (3, 3); INSERT INTO t7 VALUES (1, 1), (2, 2), (3, 3); INSERT INTO t8 VALUES (1, 1), (2, 2), (3, 3); INSERT INTO t9 VALUES (1, 1), (2, 2), (3, 3); +include/sync_slave_sql_with_master.inc [on slave] SHOW TABLES LIKE 't%'; Tables_in_test (t%) @@ -45,6 +46,7 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1; UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1; UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1; +include/sync_slave_sql_with_master.inc call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1; @@ -79,6 +81,7 @@ UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id include/wait_for_slave_sql_error_and_skip.inc [errno=1146] UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1; include/wait_for_slave_sql_error_and_skip.inc [errno=1146] +include/sync_slave_sql_with_master.inc [on slave] show tables like 't%'; Tables_in_test (t%) @@ -102,10 +105,12 @@ id c 3 3 [on master] drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +include/sync_slave_sql_with_master.inc CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); CREATE TABLE test.t1 (a INT); INSERT INTO test.t1 VALUES(1); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +include/sync_slave_sql_with_master.inc call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW @@ -118,11 +123,13 @@ Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. SELECT b into @b FROM test.t5; UPDATE test.t1 SET a=2; +include/sync_slave_sql_with_master.inc SELECT a AS 'ONE' into @a FROM test.t_slave; SELECT c AS 'NULL' into @c FROM test.t_slave; SELECT b into @b FROM test.t_slave; include/assert.inc [Random values from master and slave must be different] drop table test.t5; drop table test.t1; +include/sync_slave_sql_with_master.inc drop table test.t_slave; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_warnings.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_warnings.result new file mode 100644 index 00000000..4449b33a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_filter_warnings.result @@ -0,0 +1,21 @@ +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 t2 (c1 INT) ENGINE=InnoDB; +include/sync_slave_sql_with_master.inc +INSERT INTO test.t2 VALUES (100); +INSERT INTO test.t2 VALUES (200); +INSERT INTO test.t2 VALUES (300); +DROP TABLE t2; +include/sync_slave_sql_with_master.inc +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 + +--TIME-- [Warning] Error log throttle: 3 time(s) Error_code: 1237 "Slave SQL thread ignored the query because of replicate-*-table rules" got suppressed. + +--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 + +Occurrences of the Slave SQL thread ignored the query because of replicate in the input file : 3 +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_flush_logs.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_flush_logs.result index ffdc0e25..9f6adb37 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_flush_logs.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_flush_logs.result @@ -7,10 +7,12 @@ Note #### Storing MySQL user name or password information in the master info rep flush error logs; # Make sure binary logs was not be flushed # after execute 'flush error logs' statement. +include/sync_slave_sql_with_master.inc # Make sure relay logs was not be flushed # after execute 'flush error logs' statement. # Test if support 'flush relay logs' statement. flush relay logs; +include/sync_slave_sql_with_master.inc # Check the 'slave-relay-bin.000003' file is created # after executed 'flush relay logs' statement. # Make sure binary logs was not be flushed @@ -33,21 +35,26 @@ flush engine logs; flush binary logs; # Check the 'master-bin.000002' file is created # after executed 'flush binary logs' statement. +include/sync_slave_sql_with_master.inc # Make sure the 'slave-relay-bin.000006' file does not exist # exist before execute 'flush error logs, relay logs' statement. # Test if support to combine all kinds of logs into one statement. flush error logs, relay logs; # Make sure binary logs was not be flushed # after execute 'flush error logs, relay logs' statement. +include/sync_slave_sql_with_master.inc # Check the 'slave-relay-bin.000006' file is created after # execute 'flush error logs, relay logs' statement. # Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008' # files do not exist before execute 'flush error logs, relay logs' # statement. +include/stop_slave_sql.inc # Test if 'flush logs' statement works fine and flush all the logs. flush logs; # Check 'master-bin.000003' is created # after execute 'flush logs' statement. +include/sync_slave_io_with_master.inc # Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008' # files are created after execute 'flush logs' statement. +include/start_slave_sql.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_flushlog_loop.result index 493d0297..7056a635 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_flushlog_loop.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_flushlog_loop.result @@ -16,9 +16,13 @@ relay_log_purge ON relay_log_recovery OFF relay_log_space_limit 0 CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM; +include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUE(1); FLUSH LOGS; +include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUE(2); +include/sync_slave_sql_with_master.inc include/check_slave_is_running.inc Relay_Log_File = 'mysqld-relay-bin.000003' +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result index 6fa343e3..d0e20fcb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result @@ -21,6 +21,7 @@ SELECT * FROM t2 ORDER BY b; b c 5 0 6 11 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a 10 @@ -36,9 +37,11 @@ CREATE TABLE t3 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; INSERT INTO t3 VALUES (1),(1); Got one of the listed errors +include/sync_slave_sql_with_master.inc SET FOREIGN_KEY_CHECKS=0; DROP TABLE IF EXISTS t1,t2,t3; SET FOREIGN_KEY_CHECKS=1; +include/sync_slave_sql_with_master.inc create table t1 (b int primary key) engine = INNODB; create table t2 (a int primary key, b int, foreign key (b) references t1(b)) engine = INNODB; @@ -47,6 +50,7 @@ insert into t2 set a=1, b=1; set foreign_key_checks=0; delete from t1; must sync w/o a problem (could not with the buggy code) +include/sync_slave_sql_with_master.inc select count(*) from t1 /* must be zero */; count(*) 0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_free_items.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_free_items.result index a4de82cc..4801f34f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_free_items.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_free_items.result @@ -5,6 +5,8 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] create table t1 (a int); create table t2 (a int); +include/sync_slave_sql_with_master.inc drop table t1; drop table t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_function_defaults.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_function_defaults.result index b8e11d5b..7e11ace9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_function_defaults.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_function_defaults.result @@ -56,6 +56,7 @@ o INT ); INSERT INTO t2 ( o ) VALUES ( 1 ); sync_slave_with_master +include/sync_slave_sql_with_master.inc connection slave SELECT * FROM t1; a 1970-01-02 10:17:36 @@ -97,6 +98,7 @@ CURRENT_TIMESTAMP UPDATE t1 SET o = 2; UPDATE t2 SET o = 2; sync_slave_with_master +include/sync_slave_sql_with_master.inc connection slave SELECT * FROM t1; a 1970-01-02 10:17:36 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_general_log.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_general_log.result index 0dc56877..bbf43a6e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_general_log.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_general_log.result @@ -9,8 +9,10 @@ SET GLOBAL log_output= 'TABLE'; TRUNCATE mysql.general_log; include/start_slave.inc CREATE TABLE t1 (i int NOT NULL PRIMARY KEY); +include/sync_slave_sql_with_master.inc include/assert.inc [The slave thread does not write the same statement twice to the general log] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc SET GLOBAL log_output= @old_log_output; TRUNCATE mysql.general_log; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_geometry.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_geometry.result index 23d394f1..6c6138ab 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_geometry.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_geometry.result @@ -14,5 +14,6 @@ create table t2 (a int(11) not null auto_increment primary key, b geometrycollection default null, c decimal(10,0)); insert into t2(c) values (null); +include/sync_slave_sql_with_master.inc drop table t1, t2; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_get_lock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_get_lock.result index b3034dd5..7c58c931 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_get_lock.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_get_lock.result @@ -12,6 +12,7 @@ get_lock("lock",2) select release_lock("lock"); release_lock("lock") 1 +include/sync_slave_sql_with_master.inc select get_lock("lock",3); get_lock("lock",3) 1 @@ -33,4 +34,5 @@ select is_free_lock(NULL); is_free_lock(NULL) NULL drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_grant.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_grant.result index 4bb31da0..4f0e5f44 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_grant.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_grant.result @@ -14,6 +14,7 @@ dummy2 localhost SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%'; COUNT(*) 3 +include/sync_slave_sql_with_master.inc **** On Slave **** SELECT user,host FROM mysql.user WHERE user like 'dummy%'; user host @@ -34,6 +35,7 @@ user host SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%'; COUNT(*) 0 +include/sync_slave_sql_with_master.inc **** On Slave **** SELECT user,host FROM mysql.user WHERE user like 'dummy%'; user host @@ -63,11 +65,13 @@ call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the mas include/wait_for_slave_sql_error.inc [errno=1590] SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave_sql.inc +include/sync_slave_sql_with_master.inc ****** Checking grants on the master for user: b54866_user ****** SHOW GRANTS FOR 'b54866_user'@'localhost'; Grants for b54866_user@localhost GRANT USAGE ON *.* TO 'b54866_user'@'localhost' ************************************************************* +include/sync_slave_sql_with_master.inc ****** Checking grants on the slave for user: b54866_user ******* SHOW GRANTS FOR 'b54866_user'@'localhost'; Grants for b54866_user@localhost @@ -84,6 +88,7 @@ Grants for b54866_user@localhost GRANT USAGE ON *.* TO 'b54866_user'@'localhost' GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO 'b54866_user'@'localhost' ************************************************************* +include/sync_slave_sql_with_master.inc ****** Checking grants on the slave for user: b54866_user ******* SHOW GRANTS FOR 'b54866_user'@'localhost'; Grants for b54866_user@localhost @@ -102,6 +107,7 @@ GRANT CREATE, DROP ON `b54866`.`t1` TO 'b54866_user'@'localhost' include/wait_for_slave_sql_error.inc [errno=1590] SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave_sql.inc +include/sync_slave_sql_with_master.inc ****** Checking grants on the slave for user: b54866_user ******* SHOW GRANTS FOR 'b54866_user'@'localhost'; Grants for b54866_user@localhost @@ -124,6 +130,7 @@ GRANT CREATE, DROP ON `b54866`.`t1` TO 'b54866_user'@'localhost' GRANT EXECUTE ON PROCEDURE `b54866`.`b54866_p` TO 'b54866_user'@'localhost' GRANT EXECUTE ON FUNCTION `b54866`.`b54866_f` TO 'b54866_user'@'localhost' ************************************************************* +include/sync_slave_sql_with_master.inc ****** Checking grants on the slave for user: b54866_user ******* SHOW GRANTS FOR 'b54866_user'@'localhost'; Grants for b54866_user@localhost @@ -149,6 +156,7 @@ GRANT EXECUTE ON FUNCTION `b54866`.`b54866_f` TO 'b54866_user'@'localhost' include/wait_for_slave_sql_error.inc [errno=1590] SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave_sql.inc +include/sync_slave_sql_with_master.inc ****** Checking grants on the slave for user: b54866_user ******* SHOW GRANTS FOR 'b54866_user'@'localhost'; Grants for b54866_user@localhost @@ -172,6 +180,7 @@ GRANT CREATE, DROP ON `b54866`.`t1` TO 'b54866_user'@'localhost' include/wait_for_slave_sql_error.inc [errno=1590] SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; include/start_slave_sql.inc +include/sync_slave_sql_with_master.inc ****** Checking grants on the slave for user: b54866_user ******* SHOW GRANTS FOR 'b54866_user'@'localhost'; Grants for b54866_user@localhost @@ -190,6 +199,7 @@ REVOKE EXECUTE ON FUNCTION b54866_f FROM 'fake_user'@'localhost'; ERROR 42000: There is no such grant defined for user 'fake_user' on host 'localhost' REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'fake_user'@'localhost'; ERROR HY000: Can't revoke all privileges for one or more of the requested users +include/sync_slave_sql_with_master.inc ########## ########## Cleanup ########## @@ -197,9 +207,11 @@ DROP PROCEDURE b54866_p; DROP FUNCTION b54866_f; DROP USER 'b54866_user'@'localhost'; DROP DATABASE b54866; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE USER foo IDENTIFIED WITH 'my_plugin'; ERROR HY000: Plugin 'my_plugin' is not loaded +include/sync_slave_sql_with_master.inc # Search for occurrences of CREATE USER in the output from mysqlbinlog - Occurrences: 0 include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_grant_plugin.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_grant_plugin.result index 93eef8d5..eb067ed4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_grant_plugin.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_grant_plugin.result @@ -4,6 +4,10 @@ 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] include/assert.inc [Logged query must match the one issued.] +include/sync_slave_sql_with_master.inc include/assert.inc [Logged query must match the one issued.] +include/sync_slave_sql_with_master.inc include/assert.inc [Logged query must match the one issued but properly escaped.] +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_group_commit_deadlock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_group_commit_deadlock.result index 17ca959e..70a6ac3e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_group_commit_deadlock.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_group_commit_deadlock.result @@ -8,12 +8,14 @@ SET @@GLOBAL.MAX_BINLOG_SIZE= 4096; # Disable diff_table test # Test tables with MyISAM 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 # Enable diff_table test # Test tables with InnoDB engine when enableing 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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binary_log_as_relay_log.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binary_log_as_relay_log.result new file mode 100644 index 00000000..67991e50 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binary_log_as_relay_log.result @@ -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] +include/stop_slave_sql.inc +CREATE TABLE t1(i INT); +INSERT INTO t1 values (1); +INSERT INTO t1 values (2); +include/sync_slave_io_with_master.inc +SET @save.slave_parallel_workers=@@global.slave_parallel_workers; +SET @@global.slave_parallel_workers=1; +SET @save.slave_transaction_retries=@@global.slave_transaction_retries; +SET @@global.slave_transaction_retries=0; +include/start_slave_sql.inc +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1,slave:t1] +DROP TABLE t1; +include/stop_slave_sql.inc +SET @@global.slave_parallel_workers=@save.slave_parallel_workers; +SET @@global.slave_transaction_retries=@save.slave_transaction_retries; +include/start_slave_sql.inc +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binlog_errors.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binlog_errors.result new file mode 100644 index 00000000..a3cda67a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_binlog_errors.result @@ -0,0 +1,270 @@ +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] +####################################################################### +####################### PART 1: MASTER TESTS ########################## +####################################################################### +include/stop_slave.inc +SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data'; +SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data'; +RESET MASTER; +###################### TEST #1 +FLUSH LOGS; +# assert: must show two binlogs +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +###################### TEST #2 +RESET MASTER; +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 # +RESET MASTER; +###################### TEST #3 +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB; +CREATE TABLE t4 (a VARCHAR(16384)) Engine=MyISAM; +INSERT INTO t1 VALUES (1); +RESET MASTER; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; +# assert: must show three binlog +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +DELETE FROM t2; +RESET MASTER; +###################### TEST #4 +SELECT count(*) FROM t2; +count(*) +0 +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) + +# assert: must still be empty since the LOAD DATA INFILE failed +SELECT count(*) FROM t2; +count(*) +1 +DELETE FROM t2; +RESET MASTER; +###################### TEST #5 +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2; +# assert: must show one entry +SELECT count(*) FROM t2; +count(*) +1 +DELETE FROM t2; +RESET MASTER; +###################### TEST #6 +# Table should be empty +SELECT count(*) FROM t2; +count(*) +0 +SET AUTOCOMMIT=0; +INSERT INTO t2 VALUES ('muse'); +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2; +INSERT INTO t2 VALUES ('muse'); +COMMIT; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# Table should still be empty since the commit failed. +SELECT count(*) FROM t2; +count(*) +3 +SET AUTOCOMMIT= 1; +DELETE FROM t2; +RESET MASTER; +###################### TEST #7 +SELECT count(*) FROM t4; +count(*) +0 +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) + +# assert: must show 1 entry +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; +RESET MASTER; +###################### TEST #8 +SET @xxx = REPEAT('xxx', 1000); +SET @yyy = REPEAT('yyy', 1000); +INSERT INTO t2 VALUES (@xxx),(@yyy); +# must show 0 entries +SELECT count(*) FROM t4; +count(*) +0 +# must show 2 entries +SELECT count(*) FROM t2; +count(*) +2 +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) + +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) + +set @aaa = repeat('aaa',1000); +set @bbb = repeat('bbb',1000); +set @ccc = repeat('ccc',1000); +INSERT INTO t2 VALUES (@aaa), (@bbb), (@ccc); +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# INFO: Count(*) Before Offending DELETEs +# assert: must show 1 entry +SELECT count(*) FROM t4; +count(*) +1 +# assert: must show 2 entries since the LOAD DATA INFILE and +# INSERT INTO above was rolled back due to error. Only the +# original rows remain +SELECT count(*) FROM t2; +count(*) +6 +DELETE FROM t4 WHERE a IN (@xxx, @yyy) OR 1; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +DELETE FROM t2 WHERE a IN (@aaa, @bbb, @ccc) OR 1; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +# INFO: Count(*) After Offending DELETEs +# assert: must show zero entries +SELECT count(*) FROM t4; +count(*) +0 +# assert: must show 2 entries: the original two rows +SELECT count(*) FROM t2; +count(*) +0 +DELETE FROM t2; +###################### TEST #9 +SET SQL_LOG_BIN=0; +INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd'); +INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh'); +# assert: must show four entries +SELECT count(*) FROM t2; +count(*) +4 +SELECT count(*) FROM t4; +count(*) +4 +DELETE FROM t2; +DELETE FROM t4; +# assert: must show zero entries +SELECT count(*) FROM t2; +count(*) +0 +SELECT count(*) FROM t4; +count(*) +0 +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 .*"); +RESET MASTER; +SHOW WARNINGS; +Level Code Message +FLUSH LOGS; +ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1 - Operation not permitted) +SHOW BINARY LOGS; +ERROR HY000: You are not using binary logging +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +###################### TEST #11 +include/rpl_restart_server.inc [server_number=1] +FLUSH LOGS; +ERROR HY000: Can't open file: 'master-bin.index' (errno: 1 - Operation not permitted) +RESET MASTER; +ERROR HY000: Binlog closed, cannot RESET MASTER +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +include/rpl_restart_server.inc [server_number=1] +###################### TEST #12 +FLUSH LOGS; +ERROR HY000: Can't open file: 'master-bin' (errno: 2 - No such file or directory) +RESET MASTER; +ERROR HY000: Binlog closed, cannot RESET MASTER +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +include/rpl_restart_server.inc [server_number=1] +DROP TABLE t1, t2, t4; +RESET MASTER; +include/start_slave.inc +####################################################################### +####################### PART 2: SLAVE TESTS ########################### +####################################################################### +include/rpl_reset.inc +call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); +call mtr.add_suppression("Error writing file .*"); +call mtr.add_suppression("Could not open .*"); +call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Can't generate a unique log-filename .*"); +###################### TEST #13 +SET @old_debug=@@global.debug; +include/stop_slave.inc +SET GLOBAL debug="+d,error_unique_log_filename"; +START SLAVE io_thread; +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="-d,error_unique_log_filename"; +SET GLOBAL debug=@old_debug; +include/rpl_restart_server.inc [server_number=2] +###################### TEST #14 +SET @old_debug=@@global.debug; +include/stop_slave.inc +SET GLOBAL debug="+d,fault_injection_new_file_rotate_event"; +START SLAVE io_thread; +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="-d,fault_injection_new_file_rotate_event"; +SET GLOBAL debug=@old_debug; +include/rpl_restart_server.inc [server_number=2] +###################### TEST #15 +SET @old_debug=@@global.debug; +include/stop_slave.inc +SET GLOBAL debug="+d,fault_injection_registering_index"; +START SLAVE io_thread; +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="-d,fault_injection_registering_index"; +SET GLOBAL debug=@old_debug; +include/rpl_restart_server.inc [server_number=2] +###################### TEST #16 +SET @old_debug=@@global.debug; +include/stop_slave.inc +SET GLOBAL debug="+d,fault_injection_openning_index"; +START SLAVE io_thread; +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="-d,fault_injection_openning_index"; +SET GLOBAL debug=@old_debug; +include/rpl_restart_server.inc [server_number=2] +include/stop_slave_sql.inc +Warnings: +Note 1255 Slave already has been stopped +RESET SLAVE; +RESET MASTER; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_do_table_filter_insensitive.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_do_table_filter_insensitive.result new file mode 100644 index 00000000..0b387e4c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_do_table_filter_insensitive.result @@ -0,0 +1,40 @@ +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 mydb; +USE mydb; +CREATE TABLE T1 (a INT) ENGINE= MYISAM; +CREATE TABLE t2 (a INT) ENGINE= MYISAM; +INSERT INTO T1 VALUES (1); +INSERT INTO t2 VALUES (1); +# On master +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # CREATE DATABASE mydb +master-bin.000001 # Query # # use `mydb`; CREATE TABLE T1 (a INT) ENGINE= MYISAM +master-bin.000001 # Query # # use `mydb`; CREATE TABLE t2 (a INT) ENGINE= MYISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mydb`; INSERT INTO T1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) +master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc +# On slave +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # CREATE DATABASE mydb +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # use `mydb`; CREATE TABLE t2 (a INT) ENGINE= MYISAM +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) +slave-bin.000001 # Query # # COMMIT +DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc +Replicate_Do_Table: mydb.T2,mýdb.Å£1 +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_do_table_filter_sensitive.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_do_table_filter_sensitive.result new file mode 100644 index 00000000..f63d2c93 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_do_table_filter_sensitive.result @@ -0,0 +1,40 @@ +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 mydb; +USE mydb; +CREATE TABLE T1 (a INT) ENGINE= MYISAM; +CREATE TABLE t2 (a INT) ENGINE= MYISAM; +INSERT INTO T1 VALUES (1); +INSERT INTO t2 VALUES (1); +# On master +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # CREATE DATABASE mydb +master-bin.000001 # Query # # use `mydb`; CREATE TABLE T1 (a INT) ENGINE= MYISAM +master-bin.000001 # Query # # use `mydb`; CREATE TABLE t2 (a INT) ENGINE= MYISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mydb`; INSERT INTO T1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) +master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc +# On slave +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # CREATE DATABASE mydb +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # use `mydb`; CREATE TABLE t2 (a INT) ENGINE= MYISAM +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) +slave-bin.000001 # Query # # COMMIT +DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc +Replicate_Do_Table: mydb.Å¢1,mydb.t2 +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_drop_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_drop_table.result new file mode 100644 index 00000000..5d2d5dfc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_drop_table.result @@ -0,0 +1,204 @@ +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. +include/rpl_default_connections.inc +# +# First part +# +[connection master] +CREATE TABLE trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TABLE non_trans_t1 (c1 INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +# Error cases ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, non_trans_t1, temp_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, non_trans_t1, temp_trans_t1, temp_non_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, non_trans_t1, temp_trans_t1, temp_non_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, non_trans_t1, temp_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, non_trans_t1, temp_non_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, non_trans_t1, temp_non_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, temp_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, temp_trans_t1, temp_non_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, temp_trans_t1, temp_non_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, temp_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, temp_non_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE trans_t1, temp_non_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE non_trans_t1, temp_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE non_trans_t1, temp_trans_t1, temp_non_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE non_trans_t1, temp_trans_t1, temp_non_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE non_trans_t1, temp_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE non_trans_t1, temp_non_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE non_trans_t1, temp_non_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE temp_trans_t1, temp_non_trans_t1; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE temp_trans_t1, temp_non_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE temp_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP after the statement +DROP TABLE temp_non_trans_t1, non_existent; +ERROR HY000: Cannot execute statement because it needs to be written to the binary log as multiple statements, and this is not allowed when @@SESSION.GTID_NEXT == 'UUID:NUMBER'. +ROLLBACK; +# Error cases ER_BAD_TABLE_ERROR +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:1'; +## Expecting error ER_BAD_TABLE_ERROR after the statement +DROP TABLE trans_t1, non_trans_t1, non_existent; +ERROR 42S02: Unknown table 'test.non_existent' +ROLLBACK; +SET GTID_NEXT= AUTOMATIC; +CREATE TABLE trans_t1 (c1 INT) ENGINE=InnoDB; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:2'; +## Expecting error ER_BAD_TABLE_ERROR after the statement +DROP TABLE trans_t1, non_existent; +ERROR 42S02: Unknown table 'test.non_existent' +ROLLBACK; +SET GTID_NEXT= AUTOMATIC; +CREATE TABLE non_trans_t1 (c1 INT) ENGINE=MyISAM; +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:3'; +## Expecting error ER_BAD_TABLE_ERROR after the statement +DROP TABLE non_trans_t1, non_existent; +ERROR 42S02: Unknown table 'test.non_existent' +ROLLBACK; +SET GTID_NEXT= AUTOMATIC; +CREATE TABLE trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TABLE non_trans_t1 (c1 INT) ENGINE=MyISAM; +# Non-error cases +SET GTID_NEXT= '11111111-1111-1111-1111-111111111111:4'; +DROP TABLE trans_t1, non_trans_t1; +SET GTID_NEXT= AUTOMATIC; +CREATE TABLE trans_t1 (c1 INT) ENGINE=InnoDB; +# +# Second part +# +CREATE TEMPORARY TABLE temp_ignore (c1 INT) ENGINE=MyISAM; +DROP TEMPORARY TABLE IF EXISTS temp_ignore, temp_non_trans_t1; +include/sync_slave_sql_with_master.inc +[connection master] +CREATE TEMPORARY TABLE temp_ignore (c1 INT) ENGINE=InnoDB; +DROP TEMPORARY TABLE IF EXISTS temp_ignore, temp_trans_t1; +include/sync_slave_sql_with_master.inc +# +# Third part +# +[connection master] +call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal"); +CREATE DATABASE test2; +CREATE DATABASE test3; +use test; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +USE test2; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +USE test3; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_trans_t2 (c1 INT) ENGINE=InnoDB; +[connection master1] +use test; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +USE test2; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +USE test3; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE temp_non_trans_t2 (c1 INT) ENGINE=MyISAM; +include/sync_slave_sql_with_master.inc +include/stop_slave_io.inc +include/rpl_stop_server.inc [server_number=1] +include/rpl_start_server.inc [server_number=1] +[connection slave] +include/start_slave_io.inc +[connection master] +include/sync_slave_io_with_master.inc +include/assert.inc [Slave_open_temp_tables should be 0] +[connection master] +USE test; +DROP TABLE trans_t1; +DROP DATABASE test2; +DROP DATABASE test3; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result new file mode 100644 index 00000000..dad16f7c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_empty_transaction.result @@ -0,0 +1,111 @@ +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. +include/rpl_default_connections.inc +include/rpl_reset.inc +==== Case 1A: Transaction filtered out ==== +include/gtid_step_reset.inc +CREATE TABLE t_ignore(id INT); +INSERT INTO t_ignore VALUES (1); +DROP TABLE t_ignore; +CREATE TABLE t_ignore_wild(id INT); +INSERT INTO t_ignore_wild VALUES (1); +DROP TABLE t_ignore_wild; +include/gtid_step_assert.inc [count=6, only_count=0] +include/rpl_sync.inc +==== Case 1B: CREATE/ALTER/DROP TEMPORARY filtered out ==== +CREATE TEMPORARY TABLE t_ignore(a INT); +ALTER TABLE t_ignore ADD COLUMN b INT; +INSERT INTO t_ignore VALUES (1, 2); +DROP TEMPORARY TABLE t_ignore; +CREATE TEMPORARY TABLE t_ignore_wild(a INT); +ALTER TABLE t_ignore_wild ADD COLUMN b INT; +INSERT INTO t_ignore_wild VALUES (1, 2); +DROP TEMPORARY TABLE t_ignore_wild; +include/gtid_step_assert.inc [count=8, only_count=0] +include/rpl_sync.inc +==== Case 1C: database filters on slave applier ==== +include/gtid_step_reset.inc +CREATE DATABASE db_ignore; +USE db_ignore; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +USE test; +include/gtid_step_assert.inc [count=3, only_count=0] +include/rpl_sync.inc +include/assert.inc [db_ignore should not be created on slave] +include/assert.inc [db_ignore should not be created on second slave] +DROP DATABASE db_ignore; +include/rpl_sync.inc +==== Case 1D: database filters on slave binary log ==== +include/gtid_step_reset.inc +CREATE DATABASE db_binlog_ignore; +USE db_binlog_ignore; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +USE test; +include/gtid_step_assert.inc [count=3, only_count=0] +include/rpl_sync.inc +include/assert.inc [db_binlog_ignore should not be created on slave] +include/assert.inc [db_binlog_ignore should not be created on second slave] +DROP DATABASE db_binlog_ignore; +include/rpl_sync.inc +==== Case 2A: temp table transaction not logged in row format ==== +---- Initialize ---- +SET @save.binlog_format= @@global.binlog_format; +SET @@global.binlog_format= row; +include/restart_slave.inc +---- Test ---- +include/gtid_step_reset.inc +CREATE TEMPORARY TABLE t2 (a INT); +ALTER TABLE t2 ADD COLUMN b INT; +INSERT INTO t2 VALUES (1, 2); +include/gtid_step_assert.inc [count=3, only_count=0] +include/rpl_sync.inc +---- Clean up ---- +DROP TEMPORARY TABLE t2; +include/rpl_sync.inc +SET @@global.binlog_format= @save.binlog_format; +==== Case 2B: transaction with no effect not logged in row format ==== +---- Initialize ---- +SET @save.binlog_format= @@global.binlog_format; +SET @@global.binlog_format= row; +include/restart_slave.inc +SET @@session.binlog_format= statement; +CREATE TABLE t1(id INT) ENGINE = InnoDB; +include/rpl_sync.inc +INSERT INTO t1 VALUES (0); +---- Test ---- +UPDATE t1 SET id= 1 WHERE id = 0; +include/rpl_sync.inc +---- Clean up ---- +DROP TABLE t1; +include/rpl_sync.inc +SET @@global.binlog_format= @save.binlog_format; +==== Case 3: explicit empty transaction on master ==== +include/gtid_step_reset.inc +SET @@SESSION.GTID_NEXT = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'; +COMMIT; +SET @@SESSION.GTID_NEXT = 'AUTOMATIC'; +include/gtid_step_assert.inc [count=1, only_count=1] +include/rpl_sync.inc +==== Case 4: Nothing logged for ROLLBACK transactions ==== +---- Initialize ---- +CREATE TABLE t1 (a INT) ENGINE = InnoDB; +---- Test ---- +include/gtid_step_reset.inc +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; +include/gtid_step_assert.inc [count=0, only_count=0] +---- Clean Up ---- +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_execution.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_execution.result index 033dfcb6..3257f8b9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_execution.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_execution.result @@ -4,7 +4,6 @@ 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] #### Initialize #### -include/gtid_utils.inc CREATE table t (a INT PRIMARY KEY) ENGINE = InnoDB; INSERT INTO t VALUES (1); #### Specify test cases #### @@ -175,6 +174,7 @@ include/rpl_reset.inc ==== row-id = 1000 ==== [connection server_1_1] 1:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1000 @@GLOBAL.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1000 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1000 @@SESSION.GTID_OWNED: '' + '1:1' = '1:1'] @@ -185,6 +185,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1001 ==== [connection server_1_1] AUTOCOMMIT=1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1001 @@GLOBAL.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1001 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1001 @@SESSION.GTID_OWNED: '1:1' + '' = '1:1'] @@ -195,6 +196,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1002 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1002 @@GLOBAL.GTID_EXECUTED: '' + '1:1' = '1:1'] include/assert.inc [#1002 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1002 @@SESSION.GTID_OWNED: '1:1' + '~1:1' = ''] @@ -205,6 +207,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1003 ==== [connection server_1_1] 1:3 +include/sync_slave_sql_with_master.inc include/assert.inc [#1003 @@GLOBAL.GTID_EXECUTED: '1:1' + '' = '1:1'] include/assert.inc [#1003 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1003 @@SESSION.GTID_OWNED: '' + '1:3' = '1:3'] @@ -215,6 +218,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1004 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1004 @@GLOBAL.GTID_EXECUTED: '1:1' + '1:3' = '1:1:3'] include/assert.inc [#1004 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1004 @@SESSION.GTID_OWNED: '1:3' + '~1:3' = ''] @@ -225,6 +229,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1010 ==== [connection server_1_1] 1:3 +include/sync_slave_sql_with_master.inc include/assert.inc [#1010 @@GLOBAL.GTID_EXECUTED: '1:1:3' + '' = '1:1:3'] include/assert.inc [#1010 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1010 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -235,6 +240,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1011 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1011 @@GLOBAL.GTID_EXECUTED: '1:1:3' + '' = '1:1:3'] include/assert.inc [#1011 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1011 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -245,6 +251,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1012 ==== [connection server_1_1] 1:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1012 @@GLOBAL.GTID_EXECUTED: '1:1:3' + '' = '1:1:3'] include/assert.inc [#1012 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1012 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -255,6 +262,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1013 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1013 @@GLOBAL.GTID_EXECUTED: '1:1:3' + '' = '1:1:3'] include/assert.inc [#1013 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1013 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -265,6 +273,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1020 ==== [connection server_1_1] 2:3 +include/sync_slave_sql_with_master.inc include/assert.inc [#1020 @@GLOBAL.GTID_EXECUTED: '1:1:3' + '' = '1:1:3'] include/assert.inc [#1020 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1020 @@SESSION.GTID_OWNED: '' + '2:3' = '2:3'] @@ -275,6 +284,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1021 ==== [connection server_1_1] CREATE +include/sync_slave_sql_with_master.inc include/assert.inc [#1021 @@GLOBAL.GTID_EXECUTED: '1:1:3' + '2:3' = '1:1:3,2:3'] include/assert.inc [#1021 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1021 @@SESSION.GTID_OWNED: '2:3' + '~2:3' = ''] @@ -285,6 +295,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1022 ==== [connection server_1_1] 2:4 +include/sync_slave_sql_with_master.inc include/assert.inc [#1022 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3' + '' = '1:1:3,2:3'] include/assert.inc [#1022 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1022 @@SESSION.GTID_OWNED: '' + '2:4' = '2:4'] @@ -295,6 +306,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1023 ==== [connection server_1_1] CREATE +include/sync_slave_sql_with_master.inc include/assert.inc [#1023 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3' + '2:4' = '1:1:3,2:3-4'] include/assert.inc [#1023 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1023 @@SESSION.GTID_OWNED: '2:4' + '~2:4' = ''] @@ -305,6 +317,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1030 ==== [connection server_1_1] 2:3 +include/sync_slave_sql_with_master.inc include/assert.inc [#1030 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '' = '1:1:3,2:3-4'] include/assert.inc [#1030 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1030 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -315,6 +328,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1031 ==== [connection server_1_1] CREATE-NODROP +include/sync_slave_sql_with_master.inc include/assert.inc [#1031 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '' = '1:1:3,2:3-4'] include/assert.inc [#1031 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1031 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -325,6 +339,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1032 ==== [connection server_1_1] 2:4 +include/sync_slave_sql_with_master.inc include/assert.inc [#1032 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '' = '1:1:3,2:3-4'] include/assert.inc [#1032 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1032 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -335,6 +350,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1033 ==== [connection server_1_1] CREATE-NODROP +include/sync_slave_sql_with_master.inc include/assert.inc [#1033 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '' = '1:1:3,2:3-4'] include/assert.inc [#1033 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1033 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -345,6 +361,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1040 ==== [connection server_1_1] 4:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1040 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '' = '1:1:3,2:3-4'] include/assert.inc [#1040 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1040 @@SESSION.GTID_OWNED: '' + '4:1' = '4:1'] @@ -355,6 +372,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1041 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1041 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '' = '1:1:3,2:3-4'] include/assert.inc [#1041 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1041 @@SESSION.GTID_OWNED: '4:1' + '' = '4:1'] @@ -365,6 +383,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1042 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1042 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '' = '1:1:3,2:3-4'] include/assert.inc [#1042 @@SESSION.GTID_EXECUTED: '' + '4:1' = '4:1'] include/assert.inc [#1042 @@SESSION.GTID_OWNED: '4:1' + '' = '4:1'] @@ -375,6 +394,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1043 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1043 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '' = '1:1:3,2:3-4'] include/assert.inc [#1043 @@SESSION.GTID_EXECUTED: '4:1' + '' = '4:1'] include/assert.inc [#1043 @@SESSION.GTID_OWNED: '4:1' + '' = '4:1'] @@ -385,6 +405,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1044 ==== [connection server_1_1] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1044 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4' + '4:1' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1044 @@SESSION.GTID_EXECUTED: '4:1' + '~4:1' = ''] include/assert.inc [#1044 @@SESSION.GTID_OWNED: '4:1' + '~4:1' = ''] @@ -395,6 +416,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1050 ==== [connection server_1_1] 4:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1050 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1050 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1050 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -405,6 +427,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1051 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1051 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1051 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1051 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -415,6 +438,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1052 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1052 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1052 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1052 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -425,6 +449,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1053 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1053 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1053 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1053 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -435,6 +460,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1054 ==== [connection server_1_1] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1054 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1054 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1054 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -445,6 +471,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1060 ==== [connection server_1_1] 6:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1060 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1060 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1060 @@SESSION.GTID_OWNED: '' + '6:1' = '6:1'] @@ -455,6 +482,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1061 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1061 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1061 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1061 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -465,6 +493,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1062 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1062 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1062 @@SESSION.GTID_EXECUTED: '' + '6:1' = '6:1'] include/assert.inc [#1062 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -475,6 +504,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1063 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1063 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1063 @@SESSION.GTID_EXECUTED: '6:1' + '' = '6:1'] include/assert.inc [#1063 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -485,6 +515,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1064 ==== [connection server_1_1] ROLLBACK +include/sync_slave_sql_with_master.inc include/assert.inc [#1064 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1064 @@SESSION.GTID_EXECUTED: '6:1' + '~6:1' = ''] include/assert.inc [#1064 @@SESSION.GTID_OWNED: '6:1' + '~6:1' = ''] @@ -495,6 +526,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1070 ==== [connection server_1_1] 6:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1070 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1070 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1070 @@SESSION.GTID_OWNED: '' + '6:1' = '6:1'] @@ -505,6 +537,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1071 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1071 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1071 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1071 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -515,6 +548,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1072 ==== [connection server_1_1] SAVEPOINT 1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1072 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1072 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1072 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -525,6 +559,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1073 ==== [connection server_1_1] SAVEPOINT 2 +include/sync_slave_sql_with_master.inc include/assert.inc [#1073 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1073 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1073 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -535,6 +570,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1074 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1074 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1074 @@SESSION.GTID_EXECUTED: '' + '6:1' = '6:1'] include/assert.inc [#1074 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -545,6 +581,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1075 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1075 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1075 @@SESSION.GTID_EXECUTED: '6:1' + '' = '6:1'] include/assert.inc [#1075 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -555,6 +592,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1076 ==== [connection server_1_1] ROLLBACK 2 +include/sync_slave_sql_with_master.inc include/assert.inc [#1076 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1076 @@SESSION.GTID_EXECUTED: '6:1' + '~6:1' = ''] include/assert.inc [#1076 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -565,6 +603,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1077 ==== [connection server_1_1] SAVEPOINT 3 +include/sync_slave_sql_with_master.inc include/assert.inc [#1077 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1077 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1077 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -575,6 +614,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1078 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1078 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1078 @@SESSION.GTID_EXECUTED: '' + '6:1' = '6:1'] include/assert.inc [#1078 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -585,6 +625,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1079 ==== [connection server_1_1] SAVEPOINT 4 +include/sync_slave_sql_with_master.inc include/assert.inc [#1079 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1079 @@SESSION.GTID_EXECUTED: '6:1' + '' = '6:1'] include/assert.inc [#1079 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -595,6 +636,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1080 ==== [connection server_1_1] ROLLBACK 3 +include/sync_slave_sql_with_master.inc include/assert.inc [#1080 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1080 @@SESSION.GTID_EXECUTED: '6:1' + '~6:1' = ''] include/assert.inc [#1080 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -605,6 +647,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1081 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1081 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1081 @@SESSION.GTID_EXECUTED: '' + '6:1' = '6:1'] include/assert.inc [#1081 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -615,6 +658,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1082 ==== [connection server_1_1] SAVEPOINT 2 +include/sync_slave_sql_with_master.inc include/assert.inc [#1082 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1082 @@SESSION.GTID_EXECUTED: '6:1' + '' = '6:1'] include/assert.inc [#1082 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -625,6 +669,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1083 ==== [connection server_1_1] ROLLBACK 2 +include/sync_slave_sql_with_master.inc include/assert.inc [#1083 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1083 @@SESSION.GTID_EXECUTED: '6:1' + '' = '6:1'] include/assert.inc [#1083 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -635,6 +680,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1084 ==== [connection server_1_1] ROLLBACK 1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1084 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1084 @@SESSION.GTID_EXECUTED: '6:1' + '~6:1' = ''] include/assert.inc [#1084 @@SESSION.GTID_OWNED: '6:1' + '' = '6:1'] @@ -645,6 +691,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1085 ==== [connection server_1_1] ROLLBACK +include/sync_slave_sql_with_master.inc include/assert.inc [#1085 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1085 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1085 @@SESSION.GTID_OWNED: '6:1' + '~6:1' = ''] @@ -655,6 +702,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1090 ==== [connection server_1_1] 9:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1090 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '' = '1:1:3,2:3-4,4:1'] include/assert.inc [#1090 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1090 @@SESSION.GTID_OWNED: '' + '9:1' = '9:1'] @@ -665,6 +713,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1091 ==== [connection server_1_1] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1091 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1' + '9:1' = '1:1:3,2:3-4,4:1,9:1'] include/assert.inc [#1091 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1091 @@SESSION.GTID_OWNED: '9:1' + '~9:1' = ''] @@ -675,6 +724,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1100 ==== [connection server_1_1] 9:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1100 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '' = '1:1:3,2:3-4,4:1,9:1'] include/assert.inc [#1100 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1100 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -685,6 +735,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1101 ==== [connection server_1_1] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1101 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '' = '1:1:3,2:3-4,4:1,9:1'] include/assert.inc [#1101 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1101 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -695,6 +746,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1110 ==== [connection server_1_1] 11:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1110 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '' = '1:1:3,2:3-4,4:1,9:1'] include/assert.inc [#1110 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1110 @@SESSION.GTID_OWNED: '' + '11:1' = '11:1'] @@ -705,6 +757,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1111 ==== [connection server_1_1] ROLLBACK +include/sync_slave_sql_with_master.inc include/assert.inc [#1111 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '' = '1:1:3,2:3-4,4:1,9:1'] include/assert.inc [#1111 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1111 @@SESSION.GTID_OWNED: '11:1' + '~11:1' = ''] @@ -715,6 +768,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1120 ==== [connection server_1_1] 12:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1120 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '' = '1:1:3,2:3-4,4:1,9:1'] include/assert.inc [#1120 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1120 @@SESSION.GTID_OWNED: '' + '12:1' = '12:1'] @@ -728,6 +782,7 @@ send 12:1 ==== row-id = 1122 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1122 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '' = '1:1:3,2:3-4,4:1,9:1'] include/assert.inc [#1122 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1122 @@SESSION.GTID_OWNED: '12:1' + '' = '12:1'] @@ -738,6 +793,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1123 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1123 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '' = '1:1:3,2:3-4,4:1,9:1'] include/assert.inc [#1123 @@SESSION.GTID_EXECUTED: '' + '12:1' = '12:1'] include/assert.inc [#1123 @@SESSION.GTID_OWNED: '12:1' + '' = '12:1'] @@ -752,6 +808,7 @@ Checking that thread is still running query ==== row-id = 1125 ==== [connection server_1_1] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1125 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '12:1' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1125 @@SESSION.GTID_EXECUTED: '12:1' + '~12:1' = ''] include/assert.inc [#1125 @@SESSION.GTID_OWNED: '12:1' + '~12:1' = ''] @@ -762,6 +819,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1126 ==== [connection server_1_2] reap +include/sync_slave_sql_with_master.inc include/assert.inc [#1126 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1' + '12:1' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1126 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1126 @@SESSION.GTID_OWNED: '' + '' = ''] @@ -772,6 +830,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1130 ==== [connection server_1_1] 13:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1130 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1130 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1130 @@SESSION.GTID_OWNED: '' + '13:1' = '13:1'] @@ -785,6 +844,7 @@ send 13:1 ==== row-id = 1132 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1132 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1132 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1132 @@SESSION.GTID_OWNED: '13:1' + '' = '13:1'] @@ -795,6 +855,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1133 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1133 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1133 @@SESSION.GTID_EXECUTED: '' + '13:1' = '13:1'] include/assert.inc [#1133 @@SESSION.GTID_OWNED: '13:1' + '' = '13:1'] @@ -809,6 +870,7 @@ Checking that thread is still running query ==== row-id = 1135 ==== [connection server_1_1] ROLLBACK +include/sync_slave_sql_with_master.inc include/assert.inc [#1135 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1135 @@SESSION.GTID_EXECUTED: '13:1' + '~13:1' = ''] include/assert.inc [#1135 @@SESSION.GTID_OWNED: '13:1' + '~13:1' = ''] @@ -819,6 +881,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1136 ==== [connection server_1_2] reap +include/sync_slave_sql_with_master.inc include/assert.inc [#1136 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1136 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1136 @@SESSION.GTID_OWNED: '' + '13:1' = '13:1'] @@ -829,6 +892,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1137 ==== [connection server_1_2] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1137 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1137 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1137 @@SESSION.GTID_OWNED: '13:1' + '' = '13:1'] @@ -839,6 +903,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1138 ==== [connection server_1_2] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1138 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1'] include/assert.inc [#1138 @@SESSION.GTID_EXECUTED: '' + '13:1' = '13:1'] include/assert.inc [#1138 @@SESSION.GTID_OWNED: '13:1' + '' = '13:1'] @@ -849,6 +914,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1139 ==== [connection server_1_2] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1139 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1' + '13:1' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1139 @@SESSION.GTID_EXECUTED: '13:1' + '~13:1' = ''] include/assert.inc [#1139 @@SESSION.GTID_OWNED: '13:1' + '~13:1' = ''] @@ -859,6 +925,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1140 ==== [connection server_1_1] 14:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1140 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1140 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1140 @@SESSION.GTID_OWNED: '' + '14:1' = '14:1'] @@ -872,6 +939,7 @@ send 14:1 ==== row-id = 1142 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1142 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1142 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1142 @@SESSION.GTID_OWNED: '14:1' + '' = '14:1'] @@ -882,6 +950,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1143 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1143 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1143 @@SESSION.GTID_EXECUTED: '' + '14:1' = '14:1'] include/assert.inc [#1143 @@SESSION.GTID_OWNED: '14:1' + '' = '14:1'] @@ -896,6 +965,7 @@ Checking that thread is still running query ==== row-id = 1145 ==== [connection server_1_1] ROLLBACK +include/sync_slave_sql_with_master.inc include/assert.inc [#1145 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1145 @@SESSION.GTID_EXECUTED: '14:1' + '~14:1' = ''] include/assert.inc [#1145 @@SESSION.GTID_OWNED: '14:1' + '~14:1' = ''] @@ -906,6 +976,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1146 ==== [connection server_1_2] reap +include/sync_slave_sql_with_master.inc include/assert.inc [#1146 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1146 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1146 @@SESSION.GTID_OWNED: '' + '14:1' = '14:1'] @@ -916,6 +987,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1147 ==== [connection server_1_2] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1147 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1147 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1147 @@SESSION.GTID_OWNED: '14:1' + '' = '14:1'] @@ -926,6 +998,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1148 ==== [connection server_1_2] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1148 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1148 @@SESSION.GTID_EXECUTED: '' + '14:1' = '14:1'] include/assert.inc [#1148 @@SESSION.GTID_OWNED: '14:1' + '' = '14:1'] @@ -943,6 +1016,7 @@ Checking that thread is still running query ==== row-id = 1151 ==== [connection server_1_2] ROLLBACK +include/sync_slave_sql_with_master.inc include/assert.inc [#1151 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1151 @@SESSION.GTID_EXECUTED: '14:1' + '~14:1' = ''] include/assert.inc [#1151 @@SESSION.GTID_OWNED: '14:1' + '~14:1' = ''] @@ -953,6 +1027,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1152 ==== [connection server_1_3] reap +include/sync_slave_sql_with_master.inc include/assert.inc [#1152 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1152 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1152 @@SESSION.GTID_OWNED: '' + '14:1' = '14:1'] @@ -966,6 +1041,7 @@ send 14:1 ==== row-id = 1154 ==== [connection server_1_3] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1154 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1154 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1154 @@SESSION.GTID_OWNED: '14:1' + '' = '14:1'] @@ -976,6 +1052,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1155 ==== [connection server_1_3] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1155 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1155 @@SESSION.GTID_EXECUTED: '' + '14:1' = '14:1'] include/assert.inc [#1155 @@SESSION.GTID_OWNED: '14:1' + '' = '14:1'] @@ -990,6 +1067,7 @@ Checking that thread is still running query ==== row-id = 1157 ==== [connection server_1_3] ROLLBACK +include/sync_slave_sql_with_master.inc include/assert.inc [#1157 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1157 @@SESSION.GTID_EXECUTED: '14:1' + '~14:1' = ''] include/assert.inc [#1157 @@SESSION.GTID_OWNED: '14:1' + '~14:1' = ''] @@ -1000,6 +1078,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1158 ==== [connection server_1_1] reap +include/sync_slave_sql_with_master.inc include/assert.inc [#1158 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1158 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1158 @@SESSION.GTID_OWNED: '' + '14:1' = '14:1'] @@ -1010,6 +1089,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1159 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1159 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1159 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1159 @@SESSION.GTID_OWNED: '14:1' + '' = '14:1'] @@ -1020,6 +1100,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1160 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1160 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1'] include/assert.inc [#1160 @@SESSION.GTID_EXECUTED: '' + '14:1' = '14:1'] include/assert.inc [#1160 @@SESSION.GTID_OWNED: '14:1' + '' = '14:1'] @@ -1030,6 +1111,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1161 ==== [connection server_1_1] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1161 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1' + '14:1' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1161 @@SESSION.GTID_EXECUTED: '14:1' + '~14:1' = ''] include/assert.inc [#1161 @@SESSION.GTID_OWNED: '14:1' + '~14:1' = ''] @@ -1040,6 +1122,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1170 ==== [connection server_1_1] 17:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1170 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1170 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1170 @@SESSION.GTID_OWNED: '' + '17:1' = '17:1'] @@ -1053,6 +1136,7 @@ send 17:1 ==== row-id = 1172 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1172 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1172 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1172 @@SESSION.GTID_OWNED: '17:1' + '' = '17:1'] @@ -1063,6 +1147,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1173 ==== [connection server_1_1] SAVEPOINT 1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1173 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1173 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1173 @@SESSION.GTID_OWNED: '17:1' + '' = '17:1'] @@ -1073,6 +1158,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1174 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1174 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1174 @@SESSION.GTID_EXECUTED: '' + '17:1' = '17:1'] include/assert.inc [#1174 @@SESSION.GTID_OWNED: '17:1' + '' = '17:1'] @@ -1083,6 +1169,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1175 ==== [connection server_1_1] ROLLBACK 1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1175 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1175 @@SESSION.GTID_EXECUTED: '17:1' + '~17:1' = ''] include/assert.inc [#1175 @@SESSION.GTID_OWNED: '17:1' + '' = '17:1'] @@ -1093,6 +1180,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1176 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1176 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1176 @@SESSION.GTID_EXECUTED: '' + '17:1' = '17:1'] include/assert.inc [#1176 @@SESSION.GTID_OWNED: '17:1' + '' = '17:1'] @@ -1107,6 +1195,7 @@ Checking that thread is still running query ==== row-id = 1178 ==== [connection server_1_1] ROLLBACK +include/sync_slave_sql_with_master.inc include/assert.inc [#1178 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1178 @@SESSION.GTID_EXECUTED: '17:1' + '~17:1' = ''] include/assert.inc [#1178 @@SESSION.GTID_OWNED: '17:1' + '~17:1' = ''] @@ -1117,6 +1206,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1179 ==== [connection server_1_2] reap +include/sync_slave_sql_with_master.inc include/assert.inc [#1179 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1179 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1179 @@SESSION.GTID_OWNED: '' + '17:1' = '17:1'] @@ -1127,6 +1217,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1180 ==== [connection server_1_2] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1180 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1180 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1180 @@SESSION.GTID_OWNED: '17:1' + '' = '17:1'] @@ -1137,6 +1228,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1181 ==== [connection server_1_2] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1181 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1'] include/assert.inc [#1181 @@SESSION.GTID_EXECUTED: '' + '17:1' = '17:1'] include/assert.inc [#1181 @@SESSION.GTID_OWNED: '17:1' + '' = '17:1'] @@ -1147,6 +1239,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1182 ==== [connection server_1_2] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1182 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1' + '17:1' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1182 @@SESSION.GTID_EXECUTED: '17:1' + '~17:1' = ''] include/assert.inc [#1182 @@SESSION.GTID_OWNED: '17:1' + '~17:1' = ''] @@ -1157,6 +1250,7 @@ include/assert.inc [The first added event in the binlog should be a Gtid_log_eve ==== row-id = 1190 ==== [connection server_1_1] 19:1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1190 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1190 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1190 @@SESSION.GTID_OWNED: '' + '19:1' = '19:1'] @@ -1167,6 +1261,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1191 ==== [connection server_1_1] BEGIN +include/sync_slave_sql_with_master.inc include/assert.inc [#1191 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1191 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1191 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1177,6 +1272,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1192 ==== [connection server_1_1] SAVEPOINT 1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1192 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1192 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1192 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1187,6 +1283,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1193 ==== [connection server_1_1] SAVEPOINT 2 +include/sync_slave_sql_with_master.inc include/assert.inc [#1193 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1193 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1193 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1197,6 +1294,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1194 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1194 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1194 @@SESSION.GTID_EXECUTED: '' + '19:1' = '19:1'] include/assert.inc [#1194 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1207,6 +1305,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1195 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1195 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1195 @@SESSION.GTID_EXECUTED: '19:1' + '' = '19:1'] include/assert.inc [#1195 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1217,6 +1316,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1196 ==== [connection server_1_1] ROLLBACK 2 +include/sync_slave_sql_with_master.inc include/assert.inc [#1196 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1196 @@SESSION.GTID_EXECUTED: '19:1' + '~19:1' = ''] include/assert.inc [#1196 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1227,6 +1327,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1197 ==== [connection server_1_1] SAVEPOINT 3 +include/sync_slave_sql_with_master.inc include/assert.inc [#1197 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1197 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1197 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1237,6 +1338,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1198 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1198 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1198 @@SESSION.GTID_EXECUTED: '' + '19:1' = '19:1'] include/assert.inc [#1198 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1247,6 +1349,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1199 ==== [connection server_1_1] SAVEPOINT 4 +include/sync_slave_sql_with_master.inc include/assert.inc [#1199 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1199 @@SESSION.GTID_EXECUTED: '19:1' + '' = '19:1'] include/assert.inc [#1199 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1257,6 +1360,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1200 ==== [connection server_1_1] ROLLBACK 3 +include/sync_slave_sql_with_master.inc include/assert.inc [#1200 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1200 @@SESSION.GTID_EXECUTED: '19:1' + '~19:1' = ''] include/assert.inc [#1200 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1267,6 +1371,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1201 ==== [connection server_1_1] INSERT +include/sync_slave_sql_with_master.inc include/assert.inc [#1201 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1201 @@SESSION.GTID_EXECUTED: '' + '19:1' = '19:1'] include/assert.inc [#1201 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1277,6 +1382,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1202 ==== [connection server_1_1] SAVEPOINT 2 +include/sync_slave_sql_with_master.inc include/assert.inc [#1202 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1202 @@SESSION.GTID_EXECUTED: '19:1' + '' = '19:1'] include/assert.inc [#1202 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1287,6 +1393,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1203 ==== [connection server_1_1] ROLLBACK 2 +include/sync_slave_sql_with_master.inc include/assert.inc [#1203 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1203 @@SESSION.GTID_EXECUTED: '19:1' + '' = '19:1'] include/assert.inc [#1203 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1297,6 +1404,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1204 ==== [connection server_1_1] ROLLBACK 1 +include/sync_slave_sql_with_master.inc include/assert.inc [#1204 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1'] include/assert.inc [#1204 @@SESSION.GTID_EXECUTED: '19:1' + '~19:1' = ''] include/assert.inc [#1204 @@SESSION.GTID_OWNED: '19:1' + '' = '19:1'] @@ -1307,6 +1415,7 @@ include/assert.inc [Binlog position was not updated] ==== row-id = 1205 ==== [connection server_1_1] COMMIT +include/sync_slave_sql_with_master.inc include/assert.inc [#1205 @@GLOBAL.GTID_EXECUTED: '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1' + '19:1' = '1:1:3,2:3-4,4:1,9:1,12:1,13:1,14:1,17:1,19:1'] include/assert.inc [#1205 @@SESSION.GTID_EXECUTED: '' + '' = ''] include/assert.inc [#1205 @@SESSION.GTID_OWNED: '19:1' + '~19:1' = ''] @@ -1329,5 +1438,4 @@ DROP TABLE t1; DROP TABLE t_1021; DROP TABLE t_1023;; DROP TABLE stmts; DROP TABLE t; -include/gtid_utils_end.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_failover.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_failover.result index 469223c8..0c301638 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_failover.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_failover.result @@ -12,12 +12,16 @@ include/stop_slave.inc change master to master_port=SERVER_MYPORT_1;; include/start_slave.inc insert into t1 values (NULL, 1); +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [server_1:test.t1, server_2:test.t1, server_3:test.t1] include/stop_slave.inc insert into t1 values (NULL, 2); +include/sync_slave_sql_with_master.inc include/stop_slave.inc change master to master_port=SERVER_MYPORT_2; include/start_slave.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [server_1:test.t1, server_2:test.t1, server_3:test.t1] change master to master_port=SERVER_MYPORT_1; include/start_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_heartbeat_2slave.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_heartbeat_2slave.result new file mode 100644 index 00000000..881b7b0f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_heartbeat_2slave.result @@ -0,0 +1,53 @@ +include/rpl_init.inc [topology=1->2,1->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. +include/rpl_connect.inc [creating master] +include/rpl_connect.inc [creating slave_1] +include/rpl_connect.inc [creating slave_2] +include/stop_slave.inc +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1; +include/start_slave.inc +include/stop_slave.inc +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1; +include/start_slave.inc +Slave has received heartbeat event +include/assert.inc [slave_1 should have received more heartbeats than slave_2] + +include/rpl_stop_slaves.inc +include/rpl_change_topology.inc [new topology=1->3->2] +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. +include/rpl_start_slaves.inc +include/stop_slave.inc +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1; +include/start_slave.inc +slave_1 has received heartbeat event +[on master] +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); +INSERT INTO t1 VALUES (1, 'on master', ''); +SHOW TABLES; +Tables_in_test +t1 +[on slave_2] +include/sync_slave_sql_with_master.inc +SHOW TABLES; +Tables_in_test +t1 +[on slave_1] +include/sync_slave_sql_with_master.inc +SHOW TABLES; +Tables_in_test +t1 +[on master] +creating updates on master and send to slave_2 during 5 second +[on slave_1] +include/assert.inc [slave_1 should have received heartbeats] + +*** Clean up *** +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_ignore_table_filter_insensitive.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_ignore_table_filter_insensitive.result new file mode 100644 index 00000000..a8f40b76 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_ignore_table_filter_insensitive.result @@ -0,0 +1,40 @@ +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 mydb; +USE mydb; +CREATE TABLE T1 (a INT) ENGINE= MYISAM; +CREATE TABLE t2 (a INT) ENGINE= MYISAM; +INSERT INTO T1 VALUES (1); +INSERT INTO t2 VALUES (1); +# On master +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # CREATE DATABASE mydb +master-bin.000001 # Query # # use `mydb`; CREATE TABLE T1 (a INT) ENGINE= MYISAM +master-bin.000001 # Query # # use `mydb`; CREATE TABLE t2 (a INT) ENGINE= MYISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mydb`; INSERT INTO T1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) +master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc +# On slave +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # CREATE DATABASE mydb +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # use `mydb`; CREATE TABLE t2 (a INT) ENGINE= MYISAM +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) +slave-bin.000001 # Query # # COMMIT +DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc +Replicate_Ignore_Table: mydb.t3,mydb.Å£2 +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_ignore_table_filter_sensitive.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_ignore_table_filter_sensitive.result new file mode 100644 index 00000000..4823d61b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_ignore_table_filter_sensitive.result @@ -0,0 +1,40 @@ +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 mydb; +USE mydb; +CREATE TABLE T1 (a INT) ENGINE= MYISAM; +CREATE TABLE t2 (a INT) ENGINE= MYISAM; +INSERT INTO T1 VALUES (1); +INSERT INTO t2 VALUES (1); +# On master +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # CREATE DATABASE mydb +master-bin.000001 # Query # # use `mydb`; CREATE TABLE T1 (a INT) ENGINE= MYISAM +master-bin.000001 # Query # # use `mydb`; CREATE TABLE t2 (a INT) ENGINE= MYISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mydb`; INSERT INTO T1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) +master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc +# On slave +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # CREATE DATABASE mydb +slave-bin.000001 # Query # # use `mydb`; CREATE TABLE T1 (a INT) ENGINE= MYISAM +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `mydb`; INSERT INTO T1 VALUES (1) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc +Replicate_Ignore_Table: mydb.t3,mydb.t2 +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_loaddata_s.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_loaddata_s.result new file mode 100644 index 00000000..09366d4b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_loaddata_s.result @@ -0,0 +1,21 @@ +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] +reset master; +create table test.t1(a int, b int, unique(b)); +load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; +include/sync_slave_sql_with_master.inc +select count(*) from test.t1; +count(*) +2 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # COMMIT +drop table test.t1; +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_mode.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode.result index 20f6124c..e7474f48 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_mode.result @@ -5,6 +5,7 @@ call mtr.add_suppression("Error reading packet from server: Lost connection to M call mtr.add_suppression("Aborting"); call mtr.add_suppression(".* Found a Gtid_log_event or Previous_gtids_log_event when @@GLOBAL.GTID_MODE = OFF."); call mtr.add_suppression("MASTER_AUTO_POSITION in the master info file was 1 but server is started with @@GLOBAL.GTID_MODE = OFF. Forcing MASTER_AUTO_POSITION to 0."); +include/sync_slave_sql_with_master.inc include/stop_slave.inc ==== Master and slave have GTID_MODE = OFF ==== ---- Default value for GTID_MODE ---- @@ -36,6 +37,7 @@ 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 # # BEGIN +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 # # BEGIN @@ -81,6 +83,7 @@ INSERT INTO t1 VALUES (2); include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Previous_gtids # # +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.000002 # Previous_gtids # # @@ -92,6 +95,7 @@ include/stop_slave.inc CHANGE MASTER TO MASTER_AUTO_POSITION = 1; include/start_slave.inc INSERT INTO t1 VALUES (3); +include/sync_slave_sql_with_master.inc include/stop_slave.inc ==== Checks performed at server start when GTID_MODE = OFF ==== include/rpl_stop_server.inc [server_number=2] diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_parallel.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_parallel.result index 41b40090..ba0c8538 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_parallel.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_parallel.result @@ -50,3 +50,4 @@ connection slave; DROP TABLE t_end; DROP PROCEDURE show_slave_status; DROP PROCEDURE read_gtid_executed; +CHANGE MASTER TO MASTER_AUTO_POSITION= 0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_purged_fail_to_connect.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_purged_fail_to_connect.result index 14313049..6310fd7a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_purged_fail_to_connect.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_purged_fail_to_connect.result @@ -4,9 +4,9 @@ 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("Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires."); -include/gtid_utils.inc ######## Initialize ######## CREATE TABLE t1 (a INT) ENGINE = InnoDB; +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/stop_dump_threads.inc INSERT INTO t1 VALUES (1); @@ -33,5 +33,5 @@ RESET MASTER; include/start_slave.inc === Sync slave with master (connection master/slave) ==== DROP TABLE t1; -include/gtid_utils_end.inc +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_purged_maintained.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_purged_maintained.result index 171c3a59..0229c4c2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_purged_maintained.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_purged_maintained.result @@ -4,9 +4,9 @@ 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] include/rpl_set_gtid_mode.inc -include/gtid_utils.inc ######## Initialize ######## CREATE TABLE t1 (a INT) ENGINE = InnoDB; +include/sync_slave_sql_with_master.inc ######## corruption_mode = 1 of 2 ######## Phase one: Generating logs include/rpl_reset.inc @@ -20,6 +20,7 @@ FLUSH LOGS; INSERT INTO t1 VALUES (1); FLUSH LOGS; [on slave] +include/sync_slave_sql_with_master.inc include/assert.inc [no gtids lost yet on slave] include/assert.inc [committed gno 1 on slave] [on master] @@ -31,6 +32,7 @@ INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); FLUSH LOGS; [on slave] +include/sync_slave_sql_with_master.inc include/assert.inc [no gtids lost yet on slave] include/assert.inc [committed gno 3 on slave] [on master] @@ -46,6 +48,7 @@ FLUSH LOGS; INSERT INTO t1 VALUES (4); FLUSH LOGS; [on slave] +include/sync_slave_sql_with_master.inc include/assert.inc [no gtids lost yet on slave] include/assert.inc [committed gno 4 on slave] [on master] @@ -57,12 +60,14 @@ INSERT INTO t1 VALUES (5); INSERT INTO t1 VALUES (6); FLUSH LOGS; [on slave] +include/sync_slave_sql_with_master.inc include/assert.inc [no gtids lost yet on slave] include/assert.inc [committed gno 6 on slave] [on master] include/assert.inc [no gtids lost yet on master] include/assert.inc [committed gno 6 on master] FLUSH LOGS; +include/sync_slave_sql_with_master.inc ######## corruption_mode = 1 ######## Phase two: Purging logs ======== restart_i = 1 of 2 ======== @@ -108,6 +113,7 @@ FLUSH LOGS; INSERT INTO t1 VALUES (1); FLUSH LOGS; [on slave] +include/sync_slave_sql_with_master.inc include/assert.inc [no gtids lost yet on slave] include/assert.inc [committed gno 1 on slave] [on master] @@ -119,6 +125,7 @@ INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); FLUSH LOGS; [on slave] +include/sync_slave_sql_with_master.inc include/assert.inc [no gtids lost yet on slave] include/assert.inc [committed gno 3 on slave] [on master] @@ -134,6 +141,7 @@ FLUSH LOGS; INSERT INTO t1 VALUES (4); FLUSH LOGS; [on slave] +include/sync_slave_sql_with_master.inc include/assert.inc [no gtids lost yet on slave] include/assert.inc [committed gno 4 on slave] [on master] @@ -145,12 +153,14 @@ INSERT INTO t1 VALUES (5); INSERT INTO t1 VALUES (6); FLUSH LOGS; [on slave] +include/sync_slave_sql_with_master.inc include/assert.inc [no gtids lost yet on slave] include/assert.inc [committed gno 6 on slave] [on master] include/assert.inc [no gtids lost yet on master] include/assert.inc [committed gno 6 on master] FLUSH LOGS; +include/sync_slave_sql_with_master.inc ######## corruption_mode = 2 ######## Phase two: Purging logs ======== restart_i = 1 of 2 ======== @@ -185,5 +195,4 @@ include/purge_first_log.inc include/assert.inc [lost gtids from 1 to 6 on master] ######## Clean up ######## DROP TABLE t1; -include/gtid_utils_end.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_row_event_max_size.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_row_event_max_size.result new file mode 100644 index 00000000..5b42009a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_row_event_max_size.result @@ -0,0 +1,70 @@ +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 (a int not null auto_increment, data1 LONGBLOB, +data2 LONGBLOB, PRIMARY KEY(a)); +INSERT INTO t1 (data1, data2) VALUES (repeat('a',1000000), repeat('a', 1000000)); +DELETE FROM t1 WHERE a = 1; +# On master, test the inserted data is deleted +SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; +LENGTH(data1) LENGTH(data2) +SET @@global.max_allowed_packet=4194304; +FLUSH LOGS; +include/rpl_reset.inc +# On master, test the added 'binlog-row-event-max-size' mysqlbinlog option +# works fine and the data is inserted by executing the dumped ROW event +SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; +LENGTH(data1) LENGTH(data2) +1000000 1000000 +set @@global.max_allowed_packet= 4194304; +INSERT INTO t1 (data1, data2) VALUES (repeat('a',1048576), repeat('a',1048576)); +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid 1 # SET @@SESSION.GTID_NEXT= 'GTID'; +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Query 1 # COMMIT +master-bin.000001 # Gtid 1 # SET @@SESSION.GTID_NEXT= 'GTID'; +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Query 1 # COMMIT +include/sync_slave_sql_with_master.inc +# On slave, test the row event data is replicated when the value of +# the bigger one of max_allowed_packet and binlog_row_event_max_size +# is larger than the required size. +SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; +LENGTH(data1) LENGTH(data2) +1000000 1000000 +# On slave, test the row event data is replicated when the value of +# the bigger one of max_allowed_packet and binlog_row_event_max_size +# is equal to the required size. +SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 2; +LENGTH(data1) LENGTH(data2) +1048576 1048576 +DROP TABLE t1; +include/sync_slave_sql_with_master.inc +include/rpl_reset.inc +# Test it will cause ER_MASTER_FATAL_ERROR_READING_BINLOG when the value +# of the bigger one of max_allowed_packet and binlog_row_event_max_size +# is lower than the the required size. +CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, +data2 LONGBLOB, data3 LONGBLOB, PRIMARY KEY(a)); +include/sync_slave_sql_with_master.inc +INSERT INTO t1 (data1, data2, data3) VALUES (repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet)); +SELECT LENGTH(data1), LENGTH(data2), LENGTH(data3) FROM t1 WHERE a = 1; +LENGTH(data1) LENGTH(data2) LENGTH(data3) +4194304 4194304 4194304 +drop table t1; +include/sync_slave_sql_with_master.inc +call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log: .*"); +call mtr.add_suppression("Found invalid event in binary log"); +call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); +==== clean up ==== +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_row_show_relaylog_events.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_row_show_relaylog_events.result new file mode 100644 index 00000000..c9922dbc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_row_show_relaylog_events.result @@ -0,0 +1,203 @@ +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] +include/rpl_reset.inc +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +******** [master] SHOW BINLOG EVENTS IN <FILE> ******** +include/show_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 # # 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 # # 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 # # 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] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_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] SHOW BINLOG EVENTS ******** +include/show_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 # # 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 # # 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 # # 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 +include/sync_slave_sql_with_master.inc +******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +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 # Query # # COMMIT +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 # Query # # COMMIT +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 # Query # # COMMIT +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +******** [slave] SHOW BINLOG EVENTS ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +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 # Query # # COMMIT +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 # Query # # COMMIT +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 # Query # # COMMIT +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Table_map # # table_id: # (test.t1) +slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +slave-relay-bin.000003 # Query # # COMMIT +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +******** [slave] SHOW RELAYLOG EVENTS ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=POS +FLUSH LOGS; +FLUSH LOGS; +DROP TABLE t1; +******** [master] SHOW BINLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [master] SHOW BINLOG EVENTS ******** +include/show_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 # # 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 # # 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 # # 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 # Rotate # # master-bin.000002;pos=POS +include/sync_slave_sql_with_master.inc +******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW BINLOG EVENTS ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +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 # Query # # COMMIT +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 # Query # # COMMIT +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 # Query # # COMMIT +slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +******** [slave] SHOW RELAYLOG EVENTS ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=POS +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_server_sighup.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_server_sighup.result new file mode 100644 index 00000000..ef121127 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_server_sighup.result @@ -0,0 +1,41 @@ +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 pid_table(pid_no INT); +[connection server_1] +LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table; +DELETE FROM pid_table; +include/sync_slave_sql_with_master.inc +[connection server_1] +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Previous_gtids # # Gtid_set +master-bin.000002 # Gtid # # SET @@SESSION.GTID_NEXT= 'Gtid_set' +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Query # # use `test`; DELETE FROM pid_table +master-bin.000002 # Query # # COMMIT +include/rpl_stop_server.inc [server_number=1] +include/rpl_start_server.inc [server_number=1 gtids=on] +include/sync_slave_sql_with_master.inc +[connection server_2] +LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table; +[connection server_1] +DELETE FROM pid_table; +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.000006 # Previous_gtids # # Gtid_set +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Gtid # # SET @@SESSION.GTID_NEXT= 'Gtid_set' +slave-relay-bin.000006 # Query # # BEGIN +slave-relay-bin.000006 # Query # # use `test`; DELETE FROM pid_table +slave-relay-bin.000006 # Query # # COMMIT +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2 gtids=on] +include/rpl_start_slaves.inc +[connection server_1] +DROP TABLE pid_table; +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_sql_until_before_after.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_sql_until_before_after.result index b85eb916..5416d278 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_sql_until_before_after.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_sql_until_before_after.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] include/rpl_set_gtid_mode.inc CREATE TABLE t1(c1 INTEGER) ENGINE= Innodb; +include/sync_slave_sql_with_master.inc [connection slave] include/stop_slave.inc [connection master] diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stm_insert_delayed.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stm_insert_delayed.result new file mode 100644 index 00000000..01c725b3 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stm_insert_delayed.result @@ -0,0 +1,84 @@ +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 SCHEMA IF NOT EXISTS mysqlslap; +USE mysqlslap; +select @@global.binlog_format; +@@global.binlog_format +STATEMENT +CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)); +FLUSH TABLE t1; +SELECT COUNT(*) FROM t1; +COUNT(*) +5000 +include/sync_slave_sql_with_master.inc +use mysqlslap; +SELECT COUNT(*) FROM t1; +COUNT(*) +5000 +truncate table t1; +insert delayed into t1 values(10, "my name"); +Warnings: +Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future release. Please use INSERT instead +flush table t1; +insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); +ERROR 23000: Duplicate entry '10' for key 'PRIMARY' +flush table t1; +select * from t1; +id name +10 my name +include/sync_slave_sql_with_master.inc +select * from t1; +id name +10 my name +delete from t1 where id!=10; +insert delayed into t1 values(20, "is Bond"), (10, "James Bond"); +ERROR 23000: Duplicate entry '10' for key 'PRIMARY' +flush table t1; +select * from t1; +id name +10 my name +20 is Bond +include/sync_slave_sql_with_master.inc +select * from t1; +id name +10 my name +20 is Bond +USE test; +DROP SCHEMA mysqlslap; +include/sync_slave_sql_with_master.inc +use test; +FLUSH LOGS; +FLUSH LOGS; +CREATE TABLE t1(a int, UNIQUE(a)); +INSERT DELAYED IGNORE INTO t1 VALUES(1); +Warnings: +Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future release. Please use INSERT instead +INSERT DELAYED IGNORE INTO t1 VALUES(1); +Warnings: +Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future release. Please use INSERT instead +flush table t1; +BEGIN +use `test`; INSERT IGNORE INTO t1 VALUES(1) +select * from t1; +a +1 +include/sync_slave_sql_with_master.inc +On slave +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; CREATE TABLE t1(a int, UNIQUE(a)) +slave-bin.000002 # Query # # BEGIN +slave-bin.000002 # Query # # use `test`; INSERT IGNORE INTO t1 VALUES(1) +slave-bin.000002 # Query # # COMMIT +select * from t1; +a +1 +drop table t1; +include/sync_slave_sql_with_master.inc +FLUSH LOGS; +FLUSH LOGS; +End of 5.0 tests +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stm_mix_show_relaylog_events.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stm_mix_show_relaylog_events.result new file mode 100644 index 00000000..17935bbc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stm_mix_show_relaylog_events.result @@ -0,0 +1,182 @@ +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] +include/rpl_reset.inc +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +******** [master] SHOW BINLOG EVENTS IN <FILE> ******** +include/show_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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +master-bin.000001 # Query # # COMMIT +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_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] SHOW BINLOG EVENTS ******** +include/show_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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc +******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-bin.000001 # Query # # COMMIT +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +******** [slave] SHOW BINLOG EVENTS ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-bin.000001 # Query # # COMMIT +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN +slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-relay-bin.000003 # Query # # COMMIT +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS +******** [slave] SHOW RELAYLOG EVENTS ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=POS +FLUSH LOGS; +FLUSH LOGS; +DROP TABLE t1; +******** [master] SHOW BINLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [master] SHOW BINLOG EVENTS ******** +include/show_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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Rotate # # master-bin.000002;pos=POS +include/sync_slave_sql_with_master.inc +******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW BINLOG EVENTS ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS +******** [slave] SHOW RELAYLOG EVENTS ******** +include/show_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS +slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=POS +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stress_failover.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stress_failover.result index ddaffb32..f7782294 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stress_failover.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_stress_failover.result @@ -15,4 +15,5 @@ Check that GTID_EXECUTED is equal on all servers. Check that database state is equal on all servers. include/diff_servers.inc [servers=1 2 3 4 5 ] ==== Clean up ==== +include/rpl_sync.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_validate_slave_gtids.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_validate_slave_gtids.result new file mode 100644 index 00000000..7e723082 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_validate_slave_gtids.result @@ -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 GTID_PURGED= "master_uuid:1-2"; +CREATE TABLE t1(i INT); +DROP TABLE t1; +START SLAVE IO_THREAD; +include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.'' +SET GLOBAL GTID_PURGED= "master_uuid:1-2"; +include/start_slave.inc +include/sync_slave_sql_with_master.inc +include/assert.inc [Slave should be able to get GTID-3 and 4 now.] +call mtr.add_suppression(".*Master has purged binary logs containing GTIDs that the slave requires.*"); +include/rpl_reset.inc +CREATE TABLE t1(i INT); +DROP TABLE t1; +include/stop_slave.inc +include/rpl_restart_server.inc [server_number=1] +START SLAVE IO_THREAD; +include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replica'' +call mtr.add_suppression(".*Slave has more GTIDs than the master has.*"); +SET GLOBAL GTID_PURGED= "master_uuid:1-2"; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtids_restart_slave_io_lost_trx.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtids_restart_slave_io_lost_trx.result new file mode 100644 index 00000000..6ad5c4cc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtids_restart_slave_io_lost_trx.result @@ -0,0 +1,74 @@ +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; +FLUSH LOGS; +include/sync_slave_sql_with_master.inc +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_gtid_log_event'; +BEGIN; +INSERT INTO t1 VALUES (1); +SET @v= 1 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +INSERT INTO t1 VALUES (1); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +SET GLOBAL DEBUG='d,stop_io_after_reading_query_log_event'; +BEGIN; +INSERT INTO t1 VALUES (2); +SET @v= 2 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +INSERT INTO t1 VALUES (2); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +include/stop_slave_sql.inc +SET GLOBAL DEBUG='d,stop_io_after_reading_xid_log_event'; +BEGIN; +INSERT INTO t1 VALUES (3); +SET @v= 3 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +include/start_slave_sql.inc +INSERT INTO t1 VALUES (3); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +BEGIN; +INSERT INTO t1 VALUES (4); +SET @v= 4 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/sync_slave_sql_with_master.inc +include/stop_slave_io.inc +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +INSERT INTO t1 VALUES (4); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +SET GLOBAL DEBUG='d,stop_io_after_reading_user_var_log_event'; +BEGIN; +INSERT INTO t1 VALUES (5); +SET @v= 5 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +INSERT INTO t1 VALUES (5); +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_heartbeat.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat.result index b6ddce11..b901c948 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat.result @@ -74,6 +74,7 @@ Variable_name Slave_heartbeat_period Value 0.500 start slave; create table t1 (f1 int); +include/sync_slave_sql_with_master.inc include/check_slave_param.inc [Relay_Log_File] show status like 'Slave_heartbeat_period';; Variable_name Slave_heartbeat_period @@ -81,5 +82,6 @@ Value 0.500 A heartbeat has been received by the slave include/assert.inc [Slave_last_heartbeat should not be empty] drop table t1; +include/sync_slave_sql_with_master.inc set @@global.slave_net_timeout= @restore_slave_net_timeout; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result index bd76c7a6..d1e91432 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result @@ -34,10 +34,12 @@ SHOW TABLES; Tables_in_test t1 [on slave_2] +include/sync_slave_sql_with_master.inc SHOW TABLES; Tables_in_test t1 [on slave_1] +include/sync_slave_sql_with_master.inc SHOW TABLES; Tables_in_test [on master] diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index 7626e150..bb36646f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -7,6 +7,7 @@ call mtr.add_suppression("Slave I/O: The slave I/O thread stops because a fatal call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); *** Preparing *** +include/sync_slave_sql_with_master.inc include/stop_slave.inc RESET SLAVE; RESET MASTER; @@ -99,6 +100,7 @@ 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. include/start_slave.inc +include/sync_slave_sql_with_master.inc SHOW VARIABLES LIKE 'slave_net_timeout'; Variable_name Value slave_net_timeout 200 @@ -118,6 +120,7 @@ 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. include/start_slave.inc +include/sync_slave_sql_with_master.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value Slave_heartbeat_period 20.000 @@ -150,6 +153,7 @@ SHOW STATUS LIKE 'slave_received_heartbeats'; Variable_name Value Slave_received_heartbeats 0 include/start_slave.inc +include/sync_slave_sql_with_master.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; Variable_name Value Slave_heartbeat_period 0.000 @@ -235,6 +239,7 @@ 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. SELECT unix_timestamp() into @time_0; include/start_slave.inc +include/sync_slave_sql_with_master.inc SELECT unix_timestamp() into @time_1; Heartbeat event received @@ -270,6 +275,7 @@ Heartbeat event received *** Stopped SQL thread by error *** CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); +include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES (1, 'on slave', NULL); INSERT INTO t1 VALUES (1, 'on master', NULL); call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); @@ -278,8 +284,10 @@ Heartbeat events are received while sql thread stopped (1 means 'yes'): 1 include/stop_slave.inc DELETE FROM t1; include/start_slave.inc +include/sync_slave_sql_with_master.inc DROP TABLE t1; +include/sync_slave_sql_with_master.inc *** Flush logs on slave *** include/rpl_reset.inc CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.5; @@ -314,6 +322,7 @@ 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. include/start_slave.inc RESET MASTER; +include/sync_slave_sql_with_master.inc Heartbeat events are received after reset of master (1 means 'yes'): 1 *** Reload master *** @@ -344,6 +353,7 @@ INSERT INTO t1 VALUES(1, 'on master'); CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1; include/start_slave.inc INSERT INTO t1 VALUES(2, 'on slave'); +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a b 1 on master diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_idempotency.result index 1250577f..90d94d16 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_idempotency.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -11,6 +11,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (-1),(-2),(-3); INSERT INTO t2 VALUES (-1),(-2),(-3); +include/sync_slave_sql_with_master.inc SET @old_slave_exec_mode= @@global.slave_exec_mode; SET @@global.slave_exec_mode= IDEMPOTENT; DELETE FROM t1 WHERE a = -2; @@ -25,6 +26,7 @@ SELECT * FROM t2 ORDER BY a; a -3 -1 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a -3 @@ -41,6 +43,7 @@ a -3 -2 -1 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a -3 @@ -60,6 +63,7 @@ SELECT * FROM t2 ORDER BY a; a -3 1 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a -3 @@ -71,5 +75,6 @@ a 1 include/check_slave_no_error.inc DROP TABLE t1, t2; +include/sync_slave_sql_with_master.inc SET @@global.slave_exec_mode= @old_slave_exec_mode; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_db_filter.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_db_filter.result index e552f193..6eb60943 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_db_filter.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_db_filter.result @@ -21,7 +21,9 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc # On slave include/show_binlog_events.inc DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_revoke.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_revoke.result index 0a2b6c10..76863be6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_revoke.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_revoke.result @@ -8,6 +8,7 @@ revoke select on *.* from 'user_foo'@'%'; select select_priv from mysql.user where user='user_foo' /* master:must be N */; select_priv N +include/sync_slave_sql_with_master.inc grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; revoke select on *.* from 'user_foo'@'%'; select select_priv from mysql.user where user='user_foo' /* slave:must be N */; @@ -21,10 +22,12 @@ revoke select on *.* from 'user_foo'; select select_priv from mysql.user where user='user_foo' /* master:must be N */; select_priv N +include/sync_slave_sql_with_master.inc select select_priv from mysql.user where user='user_foo' /* slave:must get Y */; select_priv Y revoke select on *.* FROM 'user_foo'; delete from mysql.user where user="user_foo"; +include/sync_slave_sql_with_master.inc delete from mysql.user where user="user_foo"; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_table_filter_insensitive.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_table_filter_insensitive.result index 2dc5fcee..c034b623 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_table_filter_insensitive.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_table_filter_insensitive.result @@ -21,6 +21,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc # On slave include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -30,5 +31,6 @@ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) slave-bin.000001 # Query # # COMMIT DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc Replicate_Ignore_Table: mydb.t3,mydb.Å£2 include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_table_filter_sensitive.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_table_filter_sensitive.result index 289638d7..8c630bbb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_table_filter_sensitive.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ignore_table_filter_sensitive.result @@ -21,6 +21,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc # On slave include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -30,5 +31,6 @@ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `mydb`; INSERT INTO T1 VALUES (1) slave-bin.000001 # Query # # COMMIT DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc Replicate_Ignore_Table: mydb.t3,mydb.t2 include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_incident.result index 59b9eb2e..3846ae3a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_incident.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_incident.result @@ -37,4 +37,5 @@ a 4 include/check_slave_is_running.inc DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_init_slave.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_init_slave.result index 1c3a54b7..f6392f85 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_init_slave.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_init_slave.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep set global max_connections=151; include/stop_slave.inc include/start_slave.inc +include/sync_slave_sql_with_master.inc show variables like 'init_slave'; Variable_name Value init_slave set global max_connections=500 @@ -19,11 +20,13 @@ init_slave show variables like 'max_connections'; Variable_name Value max_connections 151 +include/sync_slave_sql_with_master.inc set @my_global_init_connect= @@global.init_connect; set global init_connect="set @c=1"; show variables like 'init_connect'; Variable_name Value init_connect set @c=1 +include/sync_slave_sql_with_master.inc set global init_connect= @my_global_init_connect; set global max_connections= default; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result index f42edc0c..444c8972 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result @@ -105,6 +105,7 @@ Master bykey 500 CALL test.proc_byrange(); SELECT count(*) as "Master byrange" FROM test.byrange_tbl; Master byrange 500 +include/sync_slave_sql_with_master.inc show create table test.byrange_tbl; Table byrange_tbl Create Table CREATE TABLE `byrange_tbl` ( diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result index 68dd35fb..34f01d05 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result @@ -30,6 +30,7 @@ SET del_count = del_count - 2; END WHILE; END| CALL test.proc_norm(); +include/sync_slave_sql_with_master.inc DROP PROCEDURE test.proc_norm; DROP TABLE test.regular_tbl; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert.result index 72d7ca32..2ce15c9b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert.result @@ -9,6 +9,7 @@ Note #### Storing MySQL user name or password information in the master info rep CREATE SCHEMA IF NOT EXISTS mysqlslap; USE mysqlslap; CREATE TABLE t1 (id INT, name VARCHAR(64)); +include/sync_slave_sql_with_master.inc SELECT COUNT(*) FROM mysqlslap.t1; COUNT(*) 5000 @@ -20,4 +21,5 @@ COUNT(*) # USE test; DROP SCHEMA mysqlslap; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_id.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_id.result index a6306a7d..eb0f4bb1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_id.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_id.result @@ -19,6 +19,7 @@ create table t2(b int auto_increment, c int, key(b)) engine=myisam; insert into t1 values (1),(2),(3); insert into t1 values (null); insert into t2 values (null,last_insert_id()); +include/sync_slave_sql_with_master.inc select * from t1 ORDER BY a; a 1 @@ -38,6 +39,7 @@ insert into t1 values (null),(null),(null); insert into t2 values (5,0); insert into t2 values (null,last_insert_id()); SET FOREIGN_KEY_CHECKS=1; +include/sync_slave_sql_with_master.inc select * from t1; a 10 @@ -66,6 +68,7 @@ b c 7 11 8 12 9 13 +include/sync_slave_sql_with_master.inc select * from t1 ORDER BY a; a 10 @@ -81,6 +84,7 @@ b c 9 13 drop table t1; drop table t2; +include/sync_slave_sql_with_master.inc # # Bug#8412: Error codes reported in binary log for CHARACTER SET, # FOREIGN_KEY_CHECKS @@ -90,7 +94,9 @@ CREATE TABLE t1 ( a INT UNIQUE ) engine=myisam; SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); Got one of the listed errors +include/sync_slave_sql_with_master.inc drop table t1; +include/sync_slave_sql_with_master.inc # # Bug#14553: NULL in WHERE resets LAST_INSERT_ID # @@ -103,6 +109,7 @@ insert into t2 (a) select a from t1 where a is null; select * from t2; a 1 +include/sync_slave_sql_with_master.inc select * from t2; a 1 @@ -181,6 +188,7 @@ id last_id 1 3 2 4 3 5 +include/sync_slave_sql_with_master.inc select * from t1; id last_id 1 0 @@ -214,6 +222,7 @@ insert into t1 values(null,100); select * from t1 order by n; n b 1 100 +include/sync_slave_sql_with_master.inc insert into t1 values(null,200),(null,300); delete from t1 where b <> 100; select * from t1 order by n; @@ -224,6 +233,7 @@ select * from t1 order by n; n b 2 100 3 350 +include/sync_slave_sql_with_master.inc select * from t1 order by n; n b 2 100 @@ -235,6 +245,7 @@ n b 4 400 5 600 1000 350 +include/sync_slave_sql_with_master.inc select * from t1 order by n; n b 2 100 @@ -248,6 +259,7 @@ insert into t1 values(null,100); select * from t1 order by n; n b 1 100 +include/sync_slave_sql_with_master.inc insert into t1 values(null,200),(null,300); delete from t1 where b <> 100; select * from t1 order by n; @@ -258,11 +270,13 @@ select * from t1 order by n; n b 2 100 3 350 +include/sync_slave_sql_with_master.inc select * from t1 order by n; n b 2 100 3 350 drop table t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, UNIQUE(b)) ENGINE=myisam; INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; @@ -270,6 +284,7 @@ SELECT * FROM t1 ORDER BY a; a b 1 10 2 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a b 1 10 @@ -312,6 +327,7 @@ id field_1 field_2 field_3 4 4 d 4d 5 5 e 5e 6 6 f 6f +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY id; id field_1 field_2 field_3 1 1 a 1a @@ -348,6 +364,7 @@ id last_id SELECT * FROM t2 ORDER BY id; id last_id 1 0 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY id; id last_id 0 1 @@ -429,6 +446,7 @@ i 5 6 16 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; i j 1 -1 @@ -460,6 +478,7 @@ DROP FUNCTION f1; DROP FUNCTION f2; DROP FUNCTION f3; DROP TABLE t1, t2; +include/sync_slave_sql_with_master.inc # # End of 5.0 tests # @@ -494,6 +513,7 @@ select * from t2 order by id; id last_id 4 0 8 0 +include/sync_slave_sql_with_master.inc select * from t1 order by id; id 0 @@ -520,6 +540,7 @@ n b select * from t2 order by id; id last_id 1 3 +include/sync_slave_sql_with_master.inc select * from t1 order by n; n b 1 10 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_id_pk.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_id_pk.result index 1bfaa34e..be24d0ee 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_id_pk.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_id_pk.result @@ -9,6 +9,7 @@ create table t2(b int auto_increment, c int, primary key(b)); insert into t1 values (1),(2),(3); insert into t1 values (null); insert into t2 values (null,last_insert_id()); +include/sync_slave_sql_with_master.inc select * from t1 ORDER BY a; a 1 @@ -28,6 +29,7 @@ insert into t1 values (null),(null),(null); insert into t2 values (5,0); insert into t2 values (null,last_insert_id()); SET FOREIGN_KEY_CHECKS=1; +include/sync_slave_sql_with_master.inc select * from t1; a 10 @@ -53,6 +55,7 @@ b c 7 11 8 12 9 13 +include/sync_slave_sql_with_master.inc select * from t1 ORDER BY a; a 10 @@ -68,10 +71,12 @@ b c 9 13 drop table t1; drop table t2; +include/sync_slave_sql_with_master.inc SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); Got one of the listed errors +include/sync_slave_sql_with_master.inc drop table t1; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_ignore.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_ignore.result index acdc0576..8052c31a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_ignore.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_ignore.result @@ -25,6 +25,7 @@ INSERT INTO t2 VALUES (5, 4); INSERT INTO t2 VALUES (6, 6); INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; include/assert.inc [Count of elements in t1 should be 6.] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1 , slave:test.t1] INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; include/assert.inc [Count of elements in t1 should be 6.] @@ -43,6 +44,7 @@ INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t include/assert.inc [Sum of elements in t1 should be 1.] include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.] drop table t1, t2; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned, @@ -64,6 +66,7 @@ INSERT INTO t2 VALUES (5, 4); INSERT INTO t2 VALUES (6, 6); INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; include/assert.inc [Count of elements in t1 should be 6.] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1 , slave:test.t1] INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; include/assert.inc [Count of elements in t1 should be 6.] @@ -82,4 +85,5 @@ INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t include/assert.inc [Sum of elements in t1 should be 1.] include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.] drop table t1, t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_on_update.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_on_update.result new file mode 100644 index 00000000..ea62c027 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_insert_on_update.result @@ -0,0 +1,12 @@ +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 t(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,k INT,UNIQUE KEY(k)) ENGINE=InnoDB; +INSERT INTO t(k) VALUES (1), (2), (3); +INSERT INTO t(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE id=10; +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t,slave:t] +DROP TABLE t; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_invoked_features.result index 21b5e823..3343f23e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_invoked_features.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_invoked_features.result @@ -266,6 +266,7 @@ a b 101 101 102 102 103 103 +include/sync_slave_sql_with_master.inc SHOW TABLES LIKE 't%'; Tables_in_test (t%) @@ -435,6 +436,7 @@ UPDATE t12 SET c=''; UPDATE t13 SET c=''; ALTER TABLE t3 ORDER BY a; ALTER TABLE t13 ORDER BY a; +include/sync_slave_sql_with_master.inc @@ -446,4 +448,5 @@ DROP FUNCTION IF EXISTS f1; DROP FUNCTION IF EXISTS f2; DROP EVENT IF EXISTS e1; DROP EVENT IF EXISTS e11; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_kill_query.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_kill_query.result new file mode 100644 index 00000000..f007da7e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_kill_query.result @@ -0,0 +1,124 @@ +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("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +CALL mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); +==== Case 1: Killed query on master -> error on slave ==== +include/assert.inc [Test only works if binlog_format is statement] +[connection master] +CREATE DATABASE db1; +USE db1; +CREATE TABLE t1 (a INT) ENGINE = MyISAM; +CREATE TABLE trigger_table (a INT) ENGINE = MyISAM; +SET SQL_LOG_BIN=0; +CREATE TRIGGER trig1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +IF NEW.a != 0 THEN +SET @@GLOBAL.BINLOG_FORMAT = 'row'; +DO SLEEP(1000000); +END IF; +INSERT INTO trigger_table VALUES (1); +END| +SET SQL_LOG_BIN=1; +INSERT INTO t1 VALUES (0), (1); +[connection master1] +KILL QUERY <CONNECTION_ID>; +[connection master] +ERROR 70100: Query execution was interrupted +SET @@GLOBAL.BINLOG_FORMAT = 'STATEMENT'; +include/assert.inc [At most one row should be inserted in db1.t1] +include/assert.inc [At least one row should be inserted in db1.trigger_table] +SET SQL_LOG_BIN=0; +DROP TRIGGER trig1; +SET SQL_LOG_BIN=1; +DROP TABLE trigger_table; +DROP TABLE t1; +DROP DATABASE db1; +USE test; +---- Verify there is an error on slave ---- +include/sync_slave_io_with_master.inc +include/wait_for_slave_sql_error.inc [errno=1317 # ER_QUERY_INTERRUPTED] +---- Verify that nothing was inserted on slave ----- +include/assert.inc [Nothing should be inserted on slave] +---- Clean up ---- +include/stop_slave_io.inc +RESET SLAVE; +RESET MASTER; +DROP DATABASE db1; +[connection master] +RESET MASTER; +[connection slave] +include/start_slave.inc +[connection master] +==== Case 2: Master kills query -> no error if slave filters by db ==== +include/assert.inc [Test only works if binlog_format is statement] +[connection master] +CREATE DATABASE ignored_db; +USE ignored_db; +CREATE TABLE t1 (a INT) ENGINE = MyISAM; +CREATE TABLE trigger_table (a INT) ENGINE = MyISAM; +SET SQL_LOG_BIN=0; +CREATE TRIGGER trig1 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +IF NEW.a != 0 THEN +SET @@GLOBAL.BINLOG_FORMAT = 'row'; +DO SLEEP(1000000); +END IF; +INSERT INTO trigger_table VALUES (1); +END| +SET SQL_LOG_BIN=1; +INSERT INTO t1 VALUES (0), (1); +[connection master1] +KILL QUERY <CONNECTION_ID>; +[connection master] +ERROR 70100: Query execution was interrupted +SET @@GLOBAL.BINLOG_FORMAT = 'STATEMENT'; +include/assert.inc [At most one row should be inserted in ignored_db.t1] +include/assert.inc [At least one row should be inserted in ignored_db.trigger_table] +SET SQL_LOG_BIN=0; +DROP TRIGGER trig1; +SET SQL_LOG_BIN=1; +DROP TABLE trigger_table; +DROP TABLE t1; +DROP DATABASE ignored_db; +USE test; +---- Verify all was replicated ok ---- +include/sync_slave_sql_with_master.inc +[connection master] +==== Case 3: Master kills query -> no error if slave filters by table ==== +include/assert.inc [Test only works if binlog_format is statement] +[connection master] +CREATE DATABASE db1; +USE db1; +CREATE TABLE ignored_table (a INT) ENGINE = MyISAM; +CREATE TABLE trigger_table (a INT) ENGINE = MyISAM; +SET SQL_LOG_BIN=0; +CREATE TRIGGER trig1 BEFORE INSERT ON ignored_table FOR EACH ROW +BEGIN +IF NEW.a != 0 THEN +SET @@GLOBAL.BINLOG_FORMAT = 'row'; +DO SLEEP(1000000); +END IF; +INSERT INTO trigger_table VALUES (1); +END| +SET SQL_LOG_BIN=1; +INSERT INTO ignored_table VALUES (0), (1); +[connection master1] +KILL QUERY <CONNECTION_ID>; +[connection master] +ERROR 70100: Query execution was interrupted +SET @@GLOBAL.BINLOG_FORMAT = 'STATEMENT'; +include/assert.inc [At most one row should be inserted in db1.ignored_table] +include/assert.inc [At least one row should be inserted in db1.trigger_table] +SET SQL_LOG_BIN=0; +DROP TRIGGER trig1; +SET SQL_LOG_BIN=1; +DROP TABLE trigger_table; +DROP TABLE ignored_table; +DROP DATABASE db1; +USE test; +---- Verify all was replicated ok ---- +include/sync_slave_sql_with_master.inc +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_killed_ddl.result index d7487cad..b12129aa 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_killed_ddl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_killed_ddl.result @@ -54,6 +54,7 @@ END; // CREATE INDEX i1 ON t1 (a); CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100; +include/sync_slave_sql_with_master.inc [on master] [on master1] CREATE DATABASE d2; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 6b6bd7bf..c239668f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, UNIQUE(b)); +include/sync_slave_sql_with_master.inc INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe @@ -38,6 +39,7 @@ INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b'); INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c'); INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d'); INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e'); +include/sync_slave_sql_with_master.inc INSERT INTO t1 (field_1, field_2, field_3) SELECT t2.field_a, t2.field_b, t2.field_c FROM t2 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_lcase_tblnames_rewrite_db.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_lcase_tblnames_rewrite_db.result index f4f5b2e7..98901dd6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_lcase_tblnames_rewrite_db.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_lcase_tblnames_rewrite_db.result @@ -18,6 +18,7 @@ INSERT INTO T1 VALUES (1); SHOW TABLES; Tables_in_B37656 T1 +include/sync_slave_sql_with_master.inc use bug37656; ### assertion: slave contains lowered case table SHOW TABLES; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata.result index e25ab0a1..4dbea976 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata.result @@ -15,6 +15,7 @@ create temporary table t2 (day date,id int(9),category enum('a','b','c'),name va load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); insert into t3 select * from t2; +include/sync_slave_sql_with_master.inc select * from t1; a b 1 10 @@ -28,6 +29,7 @@ drop table t1; drop table t2; drop table t3; create table t1(a int, b int, unique(b)); +include/sync_slave_sql_with_master.inc insert into t1 values(1,10); load data infile '../../std_data/rpl_loaddata.dat' into table t1; call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); @@ -109,10 +111,12 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1; ### assertion: works without stating the default database LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1; ### disconnect and switch back to master connection +include/sync_slave_sql_with_master.inc use b48297_db1; include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1] DROP DATABASE b48297_db1; DROP DATABASE b42897_db2; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc use test; CREATE TABLE t1 (`key` TEXT, `text` TEXT); @@ -124,5 +128,6 @@ Field 1 'Field 2' Field 3 'Field 4' 'Field 5' 'Field 6' Field 6 'Field 7' +include/sync_slave_sql_with_master.inc DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_charset.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_charset.result index c588317b..07c0b743 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_charset.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_charset.result @@ -24,6 +24,7 @@ C3BF C3BF D0AA D0AA +include/sync_slave_sql_with_master.inc select hex(a) from t1; hex(a) C3BF @@ -34,6 +35,7 @@ C3BF D0AA D0AA drop table t1; +include/sync_slave_sql_with_master.inc -------------test bug#45516------------------ DROP DATABASE IF EXISTS mysqltest; CREATE DATABASE mysqltest CHARSET UTF8; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result index 7f715719..f0ee8531 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result @@ -5,9 +5,11 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10); +include/sync_slave_sql_with_master.inc LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593"); call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); include/wait_for_slave_sql_error_and_skip.inc [errno=1593] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_m.result index ddf94e63..9ac2a179 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_m.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_m.result @@ -17,6 +17,7 @@ LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1; SELECT COUNT(*) FROM mysqltest.t1; COUNT(*) 2 +include/sync_slave_sql_with_master.inc SHOW DATABASES; Database information_schema @@ -37,4 +38,5 @@ COUNT(*) 2 DROP DATABASE mysqltest; DROP TABLE IF EXISTS test.t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_map.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_map.result index c5ccad1d..c7c344ba 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_map.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_map.result @@ -24,10 +24,12 @@ master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTE master-bin.000001 # Query # # COMMIT ==== Verify results on slave ==== [on slave] +include/sync_slave_sql_with_master.inc select count(*) from t2 /* 5 000 */; count(*) 5000 ==== Clean up ==== [on master] drop table t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_s.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_s.result index 1d393f4d..2d3da337 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_s.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_s.result @@ -6,9 +6,11 @@ Note #### Storing MySQL user name or password information in the master info rep reset master; create table test.t1(a int, b int, unique(b)); load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; +include/sync_slave_sql_with_master.inc select count(*) from test.t1; count(*) 2 include/show_binlog_events.inc drop table test.t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_simple.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_simple.result index 5cfc5b71..acb160e6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_simple.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_simple.result @@ -77,6 +77,7 @@ Aberdeen Abernathy aberrant aberration +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY word; word Aarhus @@ -150,4 +151,5 @@ Abernathy aberrant aberration drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result index eab3d70d..66a818c6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result @@ -9,9 +9,11 @@ select * from t1; a b 1 10 2 15 +include/sync_slave_sql_with_master.inc select * from t1; a b 1 10 2 15 drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddatalocal.result index 98bc06fd..2fdd6971 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddatalocal.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loaddatalocal.result @@ -7,10 +7,12 @@ create table t1(a int); select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1; truncate table t1; load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1; +include/sync_slave_sql_with_master.inc select a,count(*) from t1 group by a; a count(*) 1 10000 drop table t1; +include/sync_slave_sql_with_master.inc create table t1(a int); insert into t1 values (1), (2), (2), (3); select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1; @@ -43,6 +45,7 @@ a 3 4 [on slave] +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a 1 @@ -53,6 +56,7 @@ a [on master] DROP TABLE t1; [on slave] +include/sync_slave_sql_with_master.inc Bug #43746: "return wrong query string when parse 'load data infile' sql statement" @@ -75,8 +79,13 @@ LOAD DATA/*!10000 LOCAL */INFILE 'MYSQLD_DATADIR/bug43746.sql'/* empty */INTO TA LOAD DATA/*!10000 LOCAL */INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO/* empty */TABLE t1; LOAD/*!99999 special comments that do not expand */DATA/*!99999 code from the future */LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql'/*!99999 have flux capacitor */INTO/*!99999 will travel */TABLE t1; SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER'; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1; [slave] +include/sync_slave_sql_with_master.inc Bug #59267: "LOAD DATA LOCAL INFILE not executed on slave with SBR" @@ -89,6 +98,7 @@ SELECT 'Master', COUNT(*) FROM t1; Master COUNT(*) Master 44 [slave] +include/sync_slave_sql_with_master.inc SELECT 'Slave', COUNT(*) FROM t1; Slave COUNT(*) Slave 44 @@ -96,6 +106,7 @@ Slave 44 DROP TABLE t1; SET SESSION sql_mode=@old_mode; [slave] +include/sync_slave_sql_with_master.inc Bug #60580/#11902767: "statement improperly replicated crashes slave sql thread" @@ -115,6 +126,7 @@ SELECT * FROM t1; f1 f2 NULL NULL [slave] +include/sync_slave_sql_with_master.inc SELECT * FROM t1; f1 f2 NULL NULL @@ -122,5 +134,6 @@ NULL NULL DROP VIEW v1; DROP TABLE t1, t2, t3; [slave] +include/sync_slave_sql_with_master.inc include/rpl_end.inc # End of 5.1 tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loadfile.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loadfile.result index 965dc9ce..b370ee2b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loadfile.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_loadfile.result @@ -118,6 +118,7 @@ Abernathy aberrant aberration +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY blob_column; a blob_column 1 abase @@ -224,6 +225,7 @@ aberration DROP PROCEDURE IF EXISTS test.p1; DROP TABLE test.t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data'; DROP TABLE IF EXISTS t1; @@ -235,6 +237,7 @@ END| include/stop_slave.inc CALL p('MYSQLTEST_VARDIR/tmp/bug_39701.data'); include/start_slave.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; DROP PROCEDURE p; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_locale.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_locale.result index 5012ddc9..f7075837 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_locale.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_locale.result @@ -12,9 +12,11 @@ select * from t1; s1 Montag Monday +include/sync_slave_sql_with_master.inc select * from t1; s1 Montag Monday drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_log_pos.result index f33435aa..5c65893a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -7,6 +7,7 @@ call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when read show master status; File Position Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> <Executed_Gtid_Set> +include/sync_slave_sql_with_master.inc include/stop_slave.inc change master to master_log_pos=MASTER_LOG_POS; Read_Master_Log_Pos = '75' @@ -29,5 +30,6 @@ n 2 3 drop table t1; +include/sync_slave_sql_with_master.inc End of 5.0 tests include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result index fa97dcfe..1dbc9900 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result @@ -10,6 +10,7 @@ INSERT INTO t VALUES (1); INSERT INTO t VALUES (2); FLUSH LOGS; SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t,slave:t] SET @@GLOBAL.DEBUG= @debug_saved; SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index 5a5637f8..5f99132f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] FLUSH LOGS; CREATE TABLE t1(c1 INT); +include/sync_slave_sql_with_master.inc FLUSH LOGS; call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); include/wait_for_slave_io_error.inc [errno=1236] @@ -16,6 +17,7 @@ FLUSH LOGS; CREATE TABLE t4(c1 INT); START SLAVE IO_THREAD; include/wait_for_slave_io_to_start.inc +include/sync_slave_sql_with_master.inc SHOW TABLES; Tables_in_test t1 @@ -23,6 +25,7 @@ t2 t3 t4 DROP TABLE t1, t2, t3, t4; +include/sync_slave_sql_with_master.inc # BUG#21437 server_errno=29 error message flood mysqld error log # -------------------------------------------------------------------------- @@ -37,6 +40,7 @@ DROP TABLE t1; FLUSH LOGS; CREATE TABLE t2(c1 int); DROP TABLE t2; +include/sync_slave_sql_with_master.inc [ on slave ] include/stop_slave.inc [ on master ] @@ -56,6 +60,7 @@ CHANGE MASTER TO master_host='127.0.0.1', master_log_file='master-bin.000002'; include/start_slave.inc [ on master ] CREATE TABLE t1(c1 INT); +include/sync_slave_sql_with_master.inc [ on slave ] SELECT * FROM t1; c1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_many_optimize.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_many_optimize.result index 8d6dabe1..db88e6b0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_many_optimize.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_many_optimize.result @@ -6,4 +6,5 @@ Note #### Storing MySQL user name or password information in the master info rep create table t1 (a int not null auto_increment primary key, b int, key(b)); INSERT INTO t1 (a) VALUES (1),(2); drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_master_pos_wait.result index cc0ae47e..e9ea667c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_master_pos_wait.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_master_pos_wait.result @@ -3,6 +3,7 @@ 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] +include/sync_slave_sql_with_master.inc select master_pos_wait('master-bin.999999',0,2); master_pos_wait('master-bin.999999',0,2) -1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_migration_crash_safe.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_migration_crash_safe.result index 7334dfe3..3c993cf4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_migration_crash_safe.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_migration_crash_safe.result @@ -14,4 +14,6 @@ SET @@GLOBAL.relay_log_info_repository= "FILE"; include/start_slave.inc SET @@GLOBAL.relay_log_info_repository= "TABLE"; ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first +include/sync_slave_sql_with_master.inc DROP TABLE test; +include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_misc_functions.result index c973d7f6..bacf473d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_misc_functions.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_misc_functions.result @@ -14,6 +14,7 @@ set sql_log_bin=1; insert into t1 values(3, 0, 0, 0, password('does_this_work?')); insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?')); select * into outfile 'rpl_misc_functions.outfile' from t1; +include/sync_slave_sql_with_master.inc create temporary table t2 like t1; load data local infile 'MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2; select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); @@ -41,6 +42,7 @@ CALL test_replication_sp2(); INSERT INTO t1 (col_a) VALUES (test_replication_sf()); INSERT INTO t1 (col_a) VALUES (test_replication_sf()); INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +include/sync_slave_sql_with_master.inc select * from t1 into outfile "../../tmp/t1_slave.txt"; create temporary table t1_slave select * from t1 where 1=0; load data infile '../../tmp/t1_slave.txt' into table t1_slave; @@ -53,4 +55,5 @@ DROP TABLE t1, t1_slave; DROP PROCEDURE test_replication_sp1; DROP PROCEDURE test_replication_sp2; DROP FUNCTION test_replication_sf; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_found_rows.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_found_rows.result index 1360d640..bf384a3b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_found_rows.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_found_rows.result @@ -19,6 +19,7 @@ INSERT INTO t1 SELECT 2*a+3 FROM t1; CREATE PROCEDURE just_log(sect INT, test INT) BEGIN INSERT INTO logtbl VALUES (sect,test,FOUND_ROWS()); END $$ +include/sync_slave_sql_with_master.inc **** On Master 1 **** SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; a @@ -34,11 +35,13 @@ SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; a 1 CALL just_log(1,3); +include/sync_slave_sql_with_master.inc **** On Master **** SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; a 7 CALL just_log(1,4); +include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; sect test count 1 1 183 @@ -46,6 +49,7 @@ sect test count 1 3 3 1 4 183 **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; sect test count 1 1 183 @@ -118,6 +122,7 @@ sect test count 2 6 0 2 6 183 2 7 0 +include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; sect test count 2 1 3 @@ -135,4 +140,5 @@ DROP PROCEDURE just_log; DROP PROCEDURE log_me; DROP PROCEDURE log_me_inner; DROP FUNCTION log_rows; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result index fa3300b9..7bd8642c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result @@ -13,6 +13,7 @@ FLUSH TABLE t1; SELECT COUNT(*) FROM t1; COUNT(*) 5000 +include/sync_slave_sql_with_master.inc use mysqlslap; SELECT COUNT(*) FROM t1; COUNT(*) @@ -30,6 +31,7 @@ select * from t1; id name 10 my name 20 James Bond +include/sync_slave_sql_with_master.inc select * from t1; id name 10 my name @@ -43,12 +45,14 @@ select * from t1; id name 10 my name 20 is Bond +include/sync_slave_sql_with_master.inc select * from t1; id name 10 my name 20 is Bond USE test; DROP SCHEMA mysqlslap; +include/sync_slave_sql_with_master.inc use test; CREATE TABLE t1(a int, UNIQUE(a)); INSERT DELAYED IGNORE INTO t1 VALUES(1); @@ -61,11 +65,13 @@ flush table t1; select * from t1; a 1 +include/sync_slave_sql_with_master.inc On slave select * from t1; a 1 drop table t1; +include/sync_slave_sql_with_master.inc FLUSH LOGS; FLUSH LOGS; End of 5.0 tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result index fe0a0d1e..7819650a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result @@ -28,5 +28,7 @@ INSERT INTO `t7` ( `bit` ) VALUES ( 0 ); DELETE FROM `t7` WHERE `bit` < 2 LIMIT 4; INSERT INTO `t8` ( `bit` ) VALUES ( 0 ); DELETE FROM `t8` WHERE `bit` < 2 LIMIT 4; +include/sync_slave_sql_with_master.inc DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result index 304e21b8..b09e8c7f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep create table t1 (n int auto_increment primary key); set insert_id = 2000; insert into t1 values (NULL),(NULL),(NULL); +include/sync_slave_sql_with_master.inc select * from t1; n 2000 @@ -15,6 +16,7 @@ SHOW SLAVE HOSTS; Server_id Host Port Master_id Slave_UUID 2 127.0.0.1 SLAVE_PORT 1 SLAVE_UUID drop table t1; +include/sync_slave_sql_with_master.inc stop slave; include/wait_for_slave_to_stop.inc create table t2(id int auto_increment primary key, created datetime); @@ -46,4 +48,5 @@ t5 CREATE TABLE `t5` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2,t3,t5; drop temporary table if exists t4; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result index fecffaf5..528acd5c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result @@ -129,8 +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` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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'; @@ -441,11 +440,10 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -464,18 +462,16 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -960,12 +956,8 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R'; @@ -986,19 +978,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'B T Drop-Temp-TN-Temp R'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result index f057f2e4..bf4789c3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result @@ -590,8 +590,10 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db ################################################################################### # CHECK CONSISTENCY ################################################################################### +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:tt_1,slave:tt_1] ################################################################################### # CLEAN ################################################################################### +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_debug.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_debug.result index 0ec31304..a5fb90fa 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_debug.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_debug.result @@ -7,6 +7,7 @@ CREATE DATABASE db_1; CREATE DATABASE db_2; CREATE TABLE db_1.test_1 (id INTEGER) engine=Innodb; CREATE TABLE db_2.test_1 (id INTEGER) engine=Innodb; +include/sync_slave_sql_with_master.inc include/stop_slave.inc set @save.slave_parallel_workers= @@global.slave_parallel_workers; set @save.debug= @@global.debug; @@ -14,11 +15,13 @@ SET @@global.slave_parallel_workers= 2; ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb; ALTER TABLE mysql.slave_worker_info ENGINE= Innodb; include/start_slave.inc +include/sync_slave_sql_with_master.inc SET GLOBAL debug="d,mts_debug_concurrent_access"; INSERT INTO db_1.test_1 VALUES(1); INSERT INTO db_2.test_1 VALUES(1); DROP DATABASE db_1; DROP DATABASE db_2; +include/sync_slave_sql_with_master.inc include/stop_slave.inc SET @@global.slave_parallel_workers= @save.slave_parallel_workers; SET @@global.debug= @save.debug; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_execute_partial_trx_with_auto_pos_off.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_execute_partial_trx_with_auto_pos_off.result new file mode 100644 index 00000000..53f4fa1b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_execute_partial_trx_with_auto_pos_off.result @@ -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] +[connection slave] +include/stop_slave.inc +change master to master_auto_position=0; +include/start_slave.inc +[connection master] +CREATE TABLE t1(i INT) ENGINE=InnoDB; +FLUSH LOGS; +include/sync_slave_sql_with_master.inc +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_table_map_event'; +[connection master] +INSERT INTO t1 VALUES (1); +[connection slave] +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +[connection master] +include/sync_slave_sql_with_master.inc +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_execute_partial_trx_with_auto_pos_on.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_execute_partial_trx_with_auto_pos_on.result new file mode 100644 index 00000000..3f20f768 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_execute_partial_trx_with_auto_pos_on.result @@ -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] +[connection slave] +include/stop_slave.inc +change master to master_auto_position=1; +include/start_slave.inc +[connection master] +CREATE TABLE t1(i INT) ENGINE=InnoDB; +FLUSH LOGS; +include/sync_slave_sql_with_master.inc +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_table_map_event'; +[connection master] +INSERT INTO t1 VALUES (1); +[connection slave] +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +[connection master] +include/sync_slave_sql_with_master.inc +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_gtids_restart_slave_io_lost_trx.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_gtids_restart_slave_io_lost_trx.result new file mode 100644 index 00000000..6ad5c4cc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_gtids_restart_slave_io_lost_trx.result @@ -0,0 +1,74 @@ +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; +FLUSH LOGS; +include/sync_slave_sql_with_master.inc +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_gtid_log_event'; +BEGIN; +INSERT INTO t1 VALUES (1); +SET @v= 1 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +INSERT INTO t1 VALUES (1); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +SET GLOBAL DEBUG='d,stop_io_after_reading_query_log_event'; +BEGIN; +INSERT INTO t1 VALUES (2); +SET @v= 2 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +INSERT INTO t1 VALUES (2); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +include/stop_slave_sql.inc +SET GLOBAL DEBUG='d,stop_io_after_reading_xid_log_event'; +BEGIN; +INSERT INTO t1 VALUES (3); +SET @v= 3 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +include/start_slave_sql.inc +INSERT INTO t1 VALUES (3); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +BEGIN; +INSERT INTO t1 VALUES (4); +SET @v= 4 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/sync_slave_sql_with_master.inc +include/stop_slave_io.inc +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +INSERT INTO t1 VALUES (4); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +SET GLOBAL DEBUG='d,stop_io_after_reading_user_var_log_event'; +BEGIN; +INSERT INTO t1 VALUES (5); +SET @v= 5 * 100; +INSERT INTO t1 VALUES (@v); +COMMIT; +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +INSERT INTO t1 VALUES (5); +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_mts_slave_hang_with_partial_trx.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_slave_hang_with_partial_trx.result new file mode 100644 index 00000000..281f030a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_slave_hang_with_partial_trx.result @@ -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] +[connection slave] +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG= "d,stop_io_after_reading_write_rows_log_event"; +[connection master] +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 (c1) VALUES (1); +COMMIT; +BEGIN; +INSERT INTO t1 (c1) VALUES (2); +COMMIT; +[connection slave] +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG= @save_debug; +include/start_slave_io.inc +[connection master] +include/sync_slave_sql_with_master.inc +[connection master] +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_delete.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_delete.result index bc75c4a2..2594205b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_delete.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_delete.result @@ -19,4 +19,5 @@ select * from t2; a 1 drop table t1,t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_delete2.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_delete2.result index effe4997..bcffde24 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_delete2.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_delete2.result @@ -19,6 +19,7 @@ delete alias FROM a alias where alias.i=2; select * from a; i 3 +include/sync_slave_sql_with_master.inc use mysqltest_to; select * from a; i diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_engine.result index 5bca6b76..8ad31bf6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_engine.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_engine.result @@ -8,6 +8,7 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,PRIMARY KEY(id)); +include/sync_slave_sql_with_master.inc alter table t1 engine=myisam; show create table t1; Table Create Table @@ -23,6 +24,7 @@ t1 CREATE TABLE `t1` ( `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 +include/sync_slave_sql_with_master.inc alter table t1 engine=myisam; show create table t1; Table Create Table @@ -140,6 +142,7 @@ t1 CREATE TABLE `t1` ( `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 +include/sync_slave_sql_with_master.inc alter table t1 engine=myisam; show create table t1; Table Create Table @@ -257,6 +260,7 @@ t1 CREATE TABLE `t1` ( `t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +include/sync_slave_sql_with_master.inc alter table t1 engine=myisam; show create table t1; Table Create Table @@ -360,4 +364,5 @@ id hex(b1) vc bc d f total y t select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; id hex(b1) vc bc d f total y t DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update.result index 6895a2d9..c4528421 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update.result @@ -24,5 +24,6 @@ a b 1 0 2 1 UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a; +include/sync_slave_sql_with_master.inc drop table t1, t2; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update2.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update2.result index b8c9a33f..fa96ee8a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update2.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update2.result @@ -42,15 +42,19 @@ a b 1 0 2 1 drop table t1,t2; +include/sync_slave_sql_with_master.inc reset master; +RESET MASTER; CREATE TABLE t1 ( a INT ); INSERT INTO t1 VALUES (0); UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; select * from t1; a 3 +include/sync_slave_sql_with_master.inc select * from t1; a 3 drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update3.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update3.result index 027eb7c8..de55243a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update3.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update3.result @@ -34,6 +34,7 @@ SELECT * FROM t2 ORDER BY a; a b 1 6 2 6 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a b 1 0 @@ -69,6 +70,7 @@ WHERE b2 = 'baz') AND a.a3 IS NULL AND a.a4 = 'foo' AND a.a5 = 'bar'; +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a1 a2 a3 a4 a5 No 1 NULL foo bar @@ -118,6 +120,7 @@ FROM t3 WHERE y = 34 ) WHERE b.x = 23; +include/sync_slave_sql_with_master.inc SELECT * FROM t1; i j x y z 1 2 23 24 71 @@ -178,6 +181,7 @@ idpro price nbprice 1 1.0000 3 2 1.0000 2 3 2.0000 1 +include/sync_slave_sql_with_master.inc select "-- SLAVE AFTER JOIN --" as ""; -- SLAVE AFTER JOIN -- diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update4.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update4.result index 4a81eb0f..7278f498 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update4.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_multi_update4.result @@ -16,10 +16,12 @@ insert into t1 values (1), (2), (3), (4), (5); insert into t2 select id + 3 from t1; update t1 join t2 using (id) set t1.id = 0; insert into d1.t0 values (0); +include/sync_slave_sql_with_master.inc use d1; select * from t0 where id=0; id 0 drop database d1; drop database d2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result index 823e8ea1..7a1c5e76 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result @@ -6,6 +6,8 @@ Note #### Storing MySQL user name or password information in the master info rep call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`; CREATE DATABASE `#mysql50#mysqltest-1`; +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc Master position is not changed STOP SLAVE SQL_THREAD; include/wait_for_slave_sql_to_stop.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mysqlbinlog_gtid_on.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mysqlbinlog_gtid_on.result index 44bf5de6..d39fb36e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mysqlbinlog_gtid_on.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mysqlbinlog_gtid_on.result @@ -35,3 +35,4 @@ FLUSH LOGS; ==== --read-from-remote-master with --include-gtid ==== FLUSH LOGS; DROP TABLE t1; +CHANGE MASTER TO MASTER_AUTO_POSITION=0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_name_const.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_name_const.result index 781d4d37..652115ea 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_name_const.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_name_const.result @@ -18,6 +18,7 @@ end;$$ ==== enable the binary log, then call the procedure ==== call test_procedure(1234); [on slave] +include/sync_slave_sql_with_master.inc select * from t1 order by id; id 1234 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result index 10422602..25342c8a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result @@ -22,6 +22,7 @@ INSERT INTO t1 VALUES (UTC_TIMESTAMP()); INSERT INTO t1 VALUES (RAND()); INSERT INTO t1 VALUES (LAST_INSERT_ID()); +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_not_null_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_not_null_innodb.result index 67035cab..59bd2585 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_not_null_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_not_null_innodb.result @@ -43,6 +43,7 @@ INSERT INTO t4(a,b) VALUES (3, null); INSERT INTO t4(a,c) VALUES (4, 4); INSERT INTO t4(a) VALUES (5); ************* SHOWING THE RESULT SETS WITH INSERTS ************* +include/sync_slave_sql_with_master.inc TABLES t1 and t2 must be equal otherwise an error will be thrown. include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] @@ -78,6 +79,7 @@ REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2); UPDATE t1 set b= NULL, c= 300 where a= 1; REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300); ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES ************* +include/sync_slave_sql_with_master.inc TABLES t1 and t2 must be equal otherwise an error will be thrown. include/diff_tables.inc [master:t1, slave:t1] ************* CLEANING ************* @@ -85,6 +87,7 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; DROP TABLE t4; +include/sync_slave_sql_with_master.inc SET SQL_LOG_BIN= 0; CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL, PRIMARY KEY (`a`)) ENGINE= Innodb; @@ -99,6 +102,7 @@ INSERT INTO t1(a,c) VALUES (4, b'01'); INSERT INTO t1(a) VALUES (5); ************* SHOWING THE RESULT SETS WITH INSERTS ************* TABLES t1 and t2 must be different. +include/sync_slave_sql_with_master.inc SELECT a,b+0,c+0 FROM t1 ORDER BY a; a b+0 c+0 1 NULL 1 @@ -121,8 +125,10 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1; REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00'); ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES ************* TABLES t1 and t2 must be equal otherwise an error will be thrown. +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc ################################################################################ # NULL ---> NOT NULL (STRICT MODE) # UNCOMMENT THIS AFTER FIXING BUG#43992 @@ -162,6 +168,7 @@ REPLACE INTO t3(a, b) VALUES (5, null); REPLACE INTO t3(a, b) VALUES (3, null); UPDATE t3 SET b = NULL where a = 4; ************* SHOWING THE RESULT SETS ************* +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a b 1 NULL @@ -199,4 +206,5 @@ a b c DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_not_null_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_not_null_myisam.result index 1f8876cc..41453dc1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_not_null_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_not_null_myisam.result @@ -43,6 +43,7 @@ INSERT INTO t4(a,b) VALUES (3, null); INSERT INTO t4(a,c) VALUES (4, 4); INSERT INTO t4(a) VALUES (5); ************* SHOWING THE RESULT SETS WITH INSERTS ************* +include/sync_slave_sql_with_master.inc TABLES t1 and t2 must be equal otherwise an error will be thrown. include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] @@ -78,6 +79,7 @@ REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2); UPDATE t1 set b= NULL, c= 300 where a= 1; REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300); ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES ************* +include/sync_slave_sql_with_master.inc TABLES t1 and t2 must be equal otherwise an error will be thrown. include/diff_tables.inc [master:t1, slave:t1] ************* CLEANING ************* @@ -85,6 +87,7 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; DROP TABLE t4; +include/sync_slave_sql_with_master.inc SET SQL_LOG_BIN= 0; CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL, PRIMARY KEY (`a`)) ENGINE= MyISAM; @@ -99,6 +102,7 @@ INSERT INTO t1(a,c) VALUES (4, b'01'); INSERT INTO t1(a) VALUES (5); ************* SHOWING THE RESULT SETS WITH INSERTS ************* TABLES t1 and t2 must be different. +include/sync_slave_sql_with_master.inc SELECT a,b+0,c+0 FROM t1 ORDER BY a; a b+0 c+0 1 NULL 1 @@ -121,8 +125,10 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1; REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00'); ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES ************* TABLES t1 and t2 must be equal otherwise an error will be thrown. +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc ################################################################################ # NULL ---> NOT NULL (STRICT MODE) # UNCOMMENT THIS AFTER FIXING BUG#43992 @@ -162,6 +168,7 @@ REPLACE INTO t3(a, b) VALUES (5, null); REPLACE INTO t3(a, b) VALUES (3, null); UPDATE t3 SET b = NULL where a = 4; ************* SHOWING THE RESULT SETS ************* +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a b 1 NULL @@ -199,4 +206,5 @@ a b c DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_optimize.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_optimize.result index ad4a31dc..914b93d8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_optimize.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_optimize.result @@ -24,4 +24,5 @@ optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_packet.result index 45402d1b..479e58d7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_packet.result @@ -9,6 +9,7 @@ drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________ create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; SET @@global.max_allowed_packet=10240; SET @@global.net_buffer_length=1024; +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/start_slave.inc select @@net_buffer_length, @@max_allowed_packet; @@ -16,6 +17,7 @@ select @@net_buffer_length, @@max_allowed_packet; 1024 10240 create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); +include/sync_slave_sql_with_master.inc select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */; count(*) 1 @@ -26,24 +28,29 @@ select * from information_schema.session_status where variable_name= 'SLAVE_RUNN VARIABLE_NAME VARIABLE_VALUE SLAVE_RUNNING ON drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; +include/sync_slave_sql_with_master.inc SET @@global.max_allowed_packet=4096 + (floor(64 * 3 * 254 / 1024) + 1) * 1024; SET @@global.net_buffer_length=@@global.max_allowed_packet; include/stop_slave.inc include/start_slave.inc CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM; +include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES (REPEAT('a', @@global.max_allowed_packet)); include/wait_for_slave_io_error.inc [errno=1153] Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' include/stop_slave_sql.inc include/rpl_reset.inc DROP TABLE t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; +include/sync_slave_sql_with_master.inc INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); include/wait_for_slave_io_error.inc [errno=1153] Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' STOP SLAVE; RESET SLAVE; RESET MASTER; +RESET MASTER; SET @max_allowed_packet_0= @@session.max_allowed_packet; SHOW BINLOG EVENTS; SET @max_allowed_packet_1= @@session.max_allowed_packet; @@ -58,6 +65,7 @@ select @@global.max_allowed_packet; select @@global.net_buffer_length; @@global.net_buffer_length 53248 +include/sync_slave_sql_with_master.inc select @@global.max_allowed_packet; @@global.max_allowed_packet 2048 @@ -65,6 +73,7 @@ select @@global.net_buffer_length; @@global.net_buffer_length 1024 CREATE TABLE t1 (a TEXT) ENGINE=MyISAM; +include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES (REPEAT('a', @@global.max_allowed_packet)); # 1153 = ER_NET_PACKET_TOO_LARGE include/wait_for_slave_io_error.inc [errno=1153] diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel.result index ae92f129..ba7884c2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep call mtr.add_suppression('Slave: Error dropping database'); include/stop_slave.inc start slave; +include/sync_slave_sql_with_master.inc stop slave sql_thread; insert into test0.benchmark set state='slave is processing load'; start slave sql_thread; @@ -16,68 +17,85 @@ select ts from test0.benchmark where state like 'master ends load' into @m_1; select ts from test0.benchmark where state like 'slave takes on load' into @s_0; select ts from test0.benchmark where state like 'slave ends load' into @s_1; select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta.out'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test15.tm_nk, slave:test15.tm_nk] include/diff_tables.inc [master:test15.ti_nk, slave:test15.ti_nk] include/diff_tables.inc [master:test15.tm_wk, slave:test15.tm_wk] include/diff_tables.inc [master:test15.ti_wk, slave:test15.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test14.tm_nk, slave:test14.tm_nk] include/diff_tables.inc [master:test14.ti_nk, slave:test14.ti_nk] include/diff_tables.inc [master:test14.tm_wk, slave:test14.tm_wk] include/diff_tables.inc [master:test14.ti_wk, slave:test14.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test13.tm_nk, slave:test13.tm_nk] include/diff_tables.inc [master:test13.ti_nk, slave:test13.ti_nk] include/diff_tables.inc [master:test13.tm_wk, slave:test13.tm_wk] include/diff_tables.inc [master:test13.ti_wk, slave:test13.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test12.tm_nk, slave:test12.tm_nk] include/diff_tables.inc [master:test12.ti_nk, slave:test12.ti_nk] include/diff_tables.inc [master:test12.tm_wk, slave:test12.tm_wk] include/diff_tables.inc [master:test12.ti_wk, slave:test12.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test11.tm_nk, slave:test11.tm_nk] include/diff_tables.inc [master:test11.ti_nk, slave:test11.ti_nk] include/diff_tables.inc [master:test11.tm_wk, slave:test11.tm_wk] include/diff_tables.inc [master:test11.ti_wk, slave:test11.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test10.tm_nk, slave:test10.tm_nk] include/diff_tables.inc [master:test10.ti_nk, slave:test10.ti_nk] include/diff_tables.inc [master:test10.tm_wk, slave:test10.tm_wk] include/diff_tables.inc [master:test10.ti_wk, slave:test10.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test9.tm_nk, slave:test9.tm_nk] include/diff_tables.inc [master:test9.ti_nk, slave:test9.ti_nk] include/diff_tables.inc [master:test9.tm_wk, slave:test9.tm_wk] include/diff_tables.inc [master:test9.ti_wk, slave:test9.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test8.tm_nk, slave:test8.tm_nk] include/diff_tables.inc [master:test8.ti_nk, slave:test8.ti_nk] include/diff_tables.inc [master:test8.tm_wk, slave:test8.tm_wk] include/diff_tables.inc [master:test8.ti_wk, slave:test8.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test7.tm_nk, slave:test7.tm_nk] include/diff_tables.inc [master:test7.ti_nk, slave:test7.ti_nk] include/diff_tables.inc [master:test7.tm_wk, slave:test7.tm_wk] include/diff_tables.inc [master:test7.ti_wk, slave:test7.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test6.tm_nk, slave:test6.tm_nk] include/diff_tables.inc [master:test6.ti_nk, slave:test6.ti_nk] include/diff_tables.inc [master:test6.tm_wk, slave:test6.tm_wk] include/diff_tables.inc [master:test6.ti_wk, slave:test6.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test5.tm_nk, slave:test5.tm_nk] include/diff_tables.inc [master:test5.ti_nk, slave:test5.ti_nk] include/diff_tables.inc [master:test5.tm_wk, slave:test5.tm_wk] include/diff_tables.inc [master:test5.ti_wk, slave:test5.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test4.tm_nk, slave:test4.tm_nk] include/diff_tables.inc [master:test4.ti_nk, slave:test4.ti_nk] include/diff_tables.inc [master:test4.tm_wk, slave:test4.tm_wk] include/diff_tables.inc [master:test4.ti_wk, slave:test4.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test3.tm_nk, slave:test3.tm_nk] include/diff_tables.inc [master:test3.ti_nk, slave:test3.ti_nk] include/diff_tables.inc [master:test3.tm_wk, slave:test3.tm_wk] include/diff_tables.inc [master:test3.ti_wk, slave:test3.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test2.tm_nk, slave:test2.tm_nk] include/diff_tables.inc [master:test2.ti_nk, slave:test2.ti_nk] include/diff_tables.inc [master:test2.tm_wk, slave:test2.tm_wk] include/diff_tables.inc [master:test2.ti_wk, slave:test2.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test1.tm_nk, slave:test1.tm_nk] include/diff_tables.inc [master:test1.ti_nk, slave:test1.ti_nk] include/diff_tables.inc [master:test1.tm_wk, slave:test1.tm_wk] include/diff_tables.inc [master:test1.ti_wk, slave:test1.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test0.tm_nk, slave:test0.tm_nk] include/diff_tables.inc [master:test0.ti_nk, slave:test0.ti_nk] include/diff_tables.inc [master:test0.tm_wk, slave:test0.tm_wk] include/diff_tables.inc [master:test0.ti_wk, slave:test0.ti_wk] +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_change_master.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_change_master.result index f89f28f8..7f68f737 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_change_master.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_change_master.result @@ -15,6 +15,7 @@ CREATE TABLE d1.t1 (a int unique) ENGINE=INNODB; CREATE TABLE d2.t1 (a int unique) ENGINE=INNODB; INSERT INTO d1.t1 VALUES (1); FLUSH LOGS; +include/sync_slave_sql_with_master.inc include/stop_slave.inc CHANGE MASTER TO MASTER_DELAY=5; include/start_slave.inc @@ -55,4 +56,5 @@ DELETE FROM d1.t1 WHERE a = 13; include/start_slave.inc DROP DATABASE d1; DROP DATABASE d2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result index b9141ad4..77808ad5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_conf_limits.result @@ -21,6 +21,7 @@ include/start_slave.inc Configured number of Workers is started. create database d0; create table d0.t0 (a int auto_increment primary key, b text null) engine=innodb; +include/sync_slave_sql_with_master.inc begin; insert into d0.t0 set a= 1; begin; @@ -29,6 +30,7 @@ commit; rollback; set @@global.slave_pending_jobs_size_max= @save_slave_pending_jobs_size_max; drop database d0; +include/sync_slave_sql_with_master.inc drop view coord_wait_list; drop view worker_wait_list; set @@global.slave_parallel_workers= @save.slave_parallel_workers; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_conflicts.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_conflicts.result index 5f381a6a..2e9dc7e2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_conflicts.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_conflicts.result @@ -14,6 +14,7 @@ create database d3; create table d1.t1 (a int auto_increment primary key) engine=innodb; create table d2.t1 (a int auto_increment primary key) engine=innodb; create table d3.t1 (a int auto_increment primary key) engine=innodb; +include/sync_slave_sql_with_master.inc begin; insert into d2.t1 values (1); begin; @@ -73,6 +74,7 @@ rollback; drop database d1; drop database d2; drop database d3; +include/sync_slave_sql_with_master.inc drop view coord_wait_list; set @@global.slave_parallel_workers= @save.slave_parallel_workers; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_ddl.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_ddl.result index 51a216f1..49f285b3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_ddl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_ddl.result @@ -7,6 +7,7 @@ include/stop_slave.inc set @save.slave_parallel_workers= @@global.slave_parallel_workers; set @@global.slave_parallel_workers= 4; include/start_slave.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:d32.t8, slave:d32.t8] include/diff_tables.inc [master:d32.t7, slave:d32.t7] include/diff_tables.inc [master:d32.t6, slave:d32.t6] @@ -263,6 +264,7 @@ include/diff_tables.inc [master:d1.t4, slave:d1.t4] include/diff_tables.inc [master:d1.t3, slave:d1.t3] include/diff_tables.inc [master:d1.t2, slave:d1.t2] include/diff_tables.inc [master:d1.t1, slave:d1.t1] +include/sync_slave_sql_with_master.inc "database d32:" db.opt t1.MYD @@ -1005,5 +1007,6 @@ t7.frm t8.MYD t8.MYI t8.frm +include/sync_slave_sql_with_master.inc set @@global.slave_parallel_workers= @save.slave_parallel_workers; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_innodb.result index 25286a38..7c76cccd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_innodb.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep call mtr.add_suppression('Slave: Error dropping database'); include/stop_slave.inc start slave; +include/sync_slave_sql_with_master.inc stop slave sql_thread; insert into test0.benchmark set state='slave is processing load'; start slave sql_thread; @@ -20,36 +21,53 @@ select ts from test0.benchmark where state like 'slave is supposed to finish wit select ts from test0.benchmark where state like 'slave ends load' into @s_1; select ts from test0.benchmark where state like 'slave is processing load' into @s_0; select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta.out'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test15.ti_nk, slave:test15.ti_nk] include/diff_tables.inc [master:test15.ti_wk, slave:test15.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test14.ti_nk, slave:test14.ti_nk] include/diff_tables.inc [master:test14.ti_wk, slave:test14.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test13.ti_nk, slave:test13.ti_nk] include/diff_tables.inc [master:test13.ti_wk, slave:test13.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test12.ti_nk, slave:test12.ti_nk] include/diff_tables.inc [master:test12.ti_wk, slave:test12.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test11.ti_nk, slave:test11.ti_nk] include/diff_tables.inc [master:test11.ti_wk, slave:test11.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test10.ti_nk, slave:test10.ti_nk] include/diff_tables.inc [master:test10.ti_wk, slave:test10.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test9.ti_nk, slave:test9.ti_nk] include/diff_tables.inc [master:test9.ti_wk, slave:test9.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test8.ti_nk, slave:test8.ti_nk] include/diff_tables.inc [master:test8.ti_wk, slave:test8.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test7.ti_nk, slave:test7.ti_nk] include/diff_tables.inc [master:test7.ti_wk, slave:test7.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test6.ti_nk, slave:test6.ti_nk] include/diff_tables.inc [master:test6.ti_wk, slave:test6.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test5.ti_nk, slave:test5.ti_nk] include/diff_tables.inc [master:test5.ti_wk, slave:test5.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test4.ti_nk, slave:test4.ti_nk] include/diff_tables.inc [master:test4.ti_wk, slave:test4.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test3.ti_nk, slave:test3.ti_nk] include/diff_tables.inc [master:test3.ti_wk, slave:test3.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test2.ti_nk, slave:test2.ti_nk] include/diff_tables.inc [master:test2.ti_wk, slave:test2.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test1.ti_nk, slave:test1.ti_nk] include/diff_tables.inc [master:test1.ti_wk, slave:test1.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test0.ti_nk, slave:test0.ti_nk] include/diff_tables.inc [master:test0.ti_wk, slave:test0.ti_wk] +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result index 3beba648..4adffc2c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result @@ -207,6 +207,9 @@ insert into d1.t2 values (@var); create table d1.t1 (a int); select round(rand()*8) into @var; insert into d1.t1 values (@var); +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:d8.t8, slave:d8.t8] include/diff_tables.inc [master:d8.t7, slave:d8.t7] include/diff_tables.inc [master:d8.t6, slave:d8.t6] @@ -271,6 +274,7 @@ include/diff_tables.inc [master:d1.t4, slave:d1.t4] include/diff_tables.inc [master:d1.t3, slave:d1.t3] include/diff_tables.inc [master:d1.t2, slave:d1.t2] include/diff_tables.inc [master:d1.t1, slave:d1.t1] +include/sync_slave_sql_with_master.inc create database d20; create table d20.t1 (a int); select round(rand()*8) into @var; @@ -351,6 +355,7 @@ create database d1; create table d1.t1 (a int); select round(rand()*8) into @var; insert into d1.t1 values (@var); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:d20.t1, slave:d20.t1] include/diff_tables.inc [master:d19.t1, slave:d19.t1] include/diff_tables.inc [master:d18.t1, slave:d18.t1] @@ -371,5 +376,6 @@ 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] +include/sync_slave_sql_with_master.inc set @@global.slave_parallel_workers= @save.slave_parallel_workers; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result index 3d8e06c1..bc084af9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_seconds_behind_master.result @@ -9,10 +9,11 @@ set @@global.slave_parallel_workers= 4; set @save.slave_checkpoint_period= @@global.slave_checkpoint_period; set @@global.slave_checkpoint_period= 500; set @save.slave_transaction_retries= @@global.slave_transaction_retries; -start slave io_thread; -include/wait_for_slave_io_to_start.inc +include/start_slave.inc create table t1 (f1 int) engine=innodb; create table t2 (f1 int) engine=innodb; +include/sync_slave_sql_with_master.inc +include/stop_slave_sql.inc begin; insert into t1 values (sleep(3) + 1); Warnings: @@ -21,15 +22,16 @@ commit; begin; insert into t2 values (1); commit; -include/start_slave.inc include/sync_slave_io_with_master.inc lock table t2 write; +include/start_slave_sql.inc First transaction is done, now get Seconds_Behind_Master after it... include/wait_for_slave_param.inc [Seconds_Behind_Master] Seconds_Behind_Master after first transaction is as expected. unlock tables; include/wait_for_slave_param.inc [Seconds_Behind_Master] drop tables t1, t2; +include/sync_slave_sql_with_master.inc set @@global.slave_checkpoint_period= @save.slave_checkpoint_period; set @@global.slave_parallel_workers= @save.slave_parallel_workers; set @@global.slave_transaction_retries= @save.slave_transaction_retries; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result index c81a3ff9..64aa4063 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result @@ -23,15 +23,19 @@ include/wait_for_slave_sql_error.inc [errno=1756] include/start_slave.inc CREATE TABLE t1 (a int primary key) engine=innodb; insert into t1 values (1),(2); +include/sync_slave_sql_with_master.inc insert into t1 values (3); insert into t1 values (3); include/wait_for_slave_sql_to_stop.inc delete from t1 where a=3; include/start_slave.inc +include/sync_slave_sql_with_master.inc delete from t1; +include/sync_slave_sql_with_master.inc insert into t1 values (1),(2),(3); create table t2m (a int) engine=myisam; insert into t2m values (1); +include/sync_slave_sql_with_master.inc begin; update t1 set a=31 where a=3; insert into t1 values (5),(6),(7); @@ -45,6 +49,7 @@ update t1 set a=21 where a=2; include/wait_for_slave_sql_error.inc [errno=1213, 1205] rollback; include/start_slave.inc +include/sync_slave_sql_with_master.inc stop slave sql_thread; set @@global.sql_slave_skip_counter=7; begin; @@ -64,6 +69,7 @@ set @@global.slave_transaction_retries= 1; start slave sql_thread; Warnings: Note 1753 slave_transaction_retries is not supported in multi-threaded slave mode. In the event of a transient failure, the slave will not retry the transaction and will stop. +include/sync_slave_sql_with_master.inc include/stop_slave.inc create table t2 (a int); insert into t2 values (1); @@ -77,6 +83,7 @@ Note 1753 slave_transaction_retries is not supported in multi-threaded slave mod drop table t1; drop table t2m; drop table t2; +include/sync_slave_sql_with_master.inc drop view worker_proc_list; drop view coord_proc_list; set @@global.slave_transaction_retries= @save.slave_transaction_retries; @@ -101,6 +108,7 @@ create table d1.t2m (a int) engine=myisam; insert into d1.t1 values (1),(2),(3); insert into d2.t1 values (1),(2),(3); insert into d1.t2m values (1); +include/sync_slave_sql_with_master.inc begin; update d1.t1 set a=31 where a=3; insert into d1.t1 values (5),(6),(7); @@ -120,5 +128,6 @@ include/wait_for_slave_sql_to_stop.inc include/start_slave.inc drop database d1; drop database d2; +include/sync_slave_sql_with_master.inc set @@global.slave_parallel_workers= @save.slave_parallel_workers; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result index cb12ff99..e55eed1d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result @@ -33,6 +33,7 @@ create table d3.t1 (a int auto_increment primary key, b int) engine=innodb; insert into d3.t1 (b) select count(*) from tt_##; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. 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. +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] @@ -43,7 +44,10 @@ drop database d2; drop database d1; use d4; use d3; +include/sync_slave_sql_with_master.inc drop database d4; drop database d3; +include/sync_slave_sql_with_master.inc include/stop_slave.inc set @@global.slave_parallel_workers= @save.slave_parallel_workers; +CHANGE MASTER TO MASTER_AUTO_POSITION= 0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_worker_error.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_worker_error.result new file mode 100644 index 00000000..b940dac9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_worker_error.result @@ -0,0 +1,16 @@ +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 SQL: Worker.*failed executing transaction"); +call mtr.add_suppression("Slave SQL:.*The slave coordinator and worker threads are stopped"); +CREATE TABLE t (a TEXT) select "a" as a; +CREATE TABLE t (a TEXT) select "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" as a; +include/wait_for_slave_sql_error.inc [errno=1050] +DROP TABLE t; +include/start_slave_sql.inc +include/sync_slave_sql_with_master.inc +DROP TABLE t; +include/sync_slave_sql_with_master.inc +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ps.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ps.result index 64ff2725..700f4c94 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ps.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ps.result @@ -18,12 +18,14 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))'; prepare stmt2 from @var2; set @var1='from-master-3'; execute stmt2 using @var1; +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY n; n from-master-1 from-master-2-'', from-var-from-master-3 drop table t1; +include/sync_slave_sql_with_master.inc stop slave; include/wait_for_slave_to_stop.inc @@ -43,6 +45,7 @@ EXECUTE stmt_d_1; use mysqltest1; EXECUTE stmt_d_1; # Connection: slave +include/sync_slave_sql_with_master.inc SELECT * FROM t1; db_name db_col_name test latin1_swedish_ci diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result index d8f87332..de6b7f57 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result @@ -17,6 +17,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 +include/sync_slave_sql_with_master.inc **** On Slave **** include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result index e902c03a..8c4749f8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); DROP TABLE t1; +include/sync_slave_sql_with_master.inc ==== Check that we still understand the old format of relay-log.info ==== include/stop_slave.inc RESET SLAVE; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_read_only.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_read_only.result index 40da06f4..cd2af40d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_read_only.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_read_only.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); create user test; +include/sync_slave_sql_with_master.inc create table t1(a int) engine=InnoDB; create table t2(a int) engine=MyISAM; insert into t1 values(1001); @@ -19,6 +20,7 @@ a select * from t2; a 2001 +include/sync_slave_sql_with_master.inc select @@read_only; @@read_only 0 @@ -63,6 +65,7 @@ a 2001 2002 2004 +include/sync_slave_sql_with_master.inc select * from t1; a 1001 @@ -101,6 +104,7 @@ a 2002 2004 2005 +include/sync_slave_sql_with_master.inc select * from t1; a 1001 @@ -120,5 +124,6 @@ ERROR HY000: The MySQL server is running with the --read-only option so it canno drop user test; drop table t1; drop table t2; +include/sync_slave_sql_with_master.inc set global read_only=0; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_recovery_empty_sqlthd_pos.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_recovery_empty_sqlthd_pos.result new file mode 100644 index 00000000..c7005e1b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_recovery_empty_sqlthd_pos.result @@ -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] +[connection slave] +call mtr.add_suppression("Recovery from master pos .*"); +[connection slave] +include/stop_slave.inc +[connection master] +CREATE DATABASE test_jfg; +[connection slave] +CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root'; +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. +START SLAVE IO_THREAD; +include/wait_for_slave_io_to_start.inc +[connection master] +include/sync_slave_io_with_master.inc +include/rpl_restart_server.inc [server_number=2 parameters: --skip_slave_start=FALSE --master-info-repository=TABLE --relay-log-info-repository=TABLE --relay-log-recovery=1] +include/wait_for_slave_sql_to_start.inc +[connection master] +DROP DATABASE test_jfg; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_recovery_replicate_same_server_id.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_recovery_replicate_same_server_id.result new file mode 100644 index 00000000..1ed1a456 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_recovery_replicate_same_server_id.result @@ -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] +[connection slave] +call mtr.add_suppression("Failed to initialize the master info structure"); +call mtr.add_suppression("Error during --relay-log-recovery *"); +CREATE TABLE t1 ( n INT); +RESET MASTER; +include/stop_slave.inc +include/wait_for_slave_to_stop.inc +CHANGE MASTER TO MASTER_PORT=SLAVE_PORT; +START SLAVE IO_THREAD; +include/wait_for_slave_io_to_start.inc +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2 parameters: --skip_slave_start=FALSE --master-info-repository=TABLE --relay-log-info-repository=TABLE --relay-log-recovery=1] +Matching lines are: +--TIME-- [ERROR] Error during --relay-log-recovery: replicate_same_server_id is in use and sql thread's positions are not initialized, hence relay log recovery cannot happen. + +Occurrences of the Error during --relay-log-recovery in the input file : 1 +include/rpl_restart_server.inc [server_number=2 parameters: --master-info-repository=TABLE --relay-log-info-repository=TABLE --relay-log-recovery=0] +DROP TABLE t1; +change master to master_port=MASTER_PORT; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result index f55bb532..e62de4f9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result @@ -17,6 +17,7 @@ name age id Andy 31 00000001 Jacob 2 00000002 Caleb 1 00000003 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY id; name age id Andy 31 00000001 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result index eef31fa1..60e921c8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result @@ -17,6 +17,7 @@ name age id Andy 31 00000001 Jacob 2 00000002 Caleb 1 00000003 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY id; name age id Andy 31 00000001 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relayrotate.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relayrotate.result index 371cd50d..59e85884 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relayrotate.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_relayrotate.result @@ -4,6 +4,7 @@ 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 SQL: Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group'); +include/sync_slave_sql_with_master.inc stop slave; create table t1 (a int) engine=innodb; reset slave; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_do.result index a38b0443..a08b6805 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_do.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_do.result @@ -15,6 +15,7 @@ insert into t1 values(15),(16),(17); update t1 set m=20 where m=16; delete from t1 where m=17; create table t11 select * from t1; +include/sync_slave_sql_with_master.inc select * from t1 ORDER BY m; m 15 @@ -25,6 +26,7 @@ n select * from t11; ERROR 42S02: Table 'test.t11' doesn't exist drop table if exists t1,t2,t11; +include/sync_slave_sql_with_master.inc Replicate_Do_Table = 'test.t1' *** master *** create table t1 (a int, b int); @@ -39,6 +41,7 @@ show triggers; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation trg1 INSERT t1 set new.b=2 BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg2 INSERT t2 set new.b=2 BEFORE NULL NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +include/sync_slave_sql_with_master.inc *** slave *** show tables; Tables_in_test @@ -51,6 +54,7 @@ drop trigger trg1; drop trigger trg2; show triggers; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +include/sync_slave_sql_with_master.inc *** slave *** show tables; Tables_in_test @@ -60,4 +64,5 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie *** master *** drop table t1; drop table t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_event_after_sync_stage.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_event_after_sync_stage.result new file mode 100644 index 00000000..7aedda3f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_event_after_sync_stage.result @@ -0,0 +1,31 @@ +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] +# +# Case 1: The events cannot be replicated before they are synced to disk +# when sync_binlog is 1. +# +[connection master] +SET @save_sync_binlog = @@GLOBAL.sync_binlog; +SET GLOBAL sync_binlog = 1; +SET DEBUG_SYNC = 'before_sync_binlog_file WAIT_FOR continue'; +CREATE TABLE t1(c1 INT); +[connection slave] +include/assert.inc ["CREATE TABLE t1 is not be replicated"] +[connection default] +SET DEBUG_SYNC = "now SIGNAL continue"; +[connection master] +[connection master] +# +# Case 2: The events are able to be replicated before they are synced to +# disk when sync_binlog is 1. +# +SET GLOBAL sync_binlog = 0; +DROP TABLE t1; +SET DEBUG_SYNC = "now SIGNAL continue"; +[connection master] +SET DEBUG_SYNC = 'RESET'; +SET GLOBAL sync_binlog = @save_sync_binlog; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result index 537272e6..a02da154 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result @@ -10,14 +10,17 @@ create database mysqltest2; use mysqltest1; create table t1 (a int); insert into t1 values(1); +include/sync_slave_sql_with_master.inc select * from mysqltest1.t1; ERROR 42S02: Table 'mysqltest1.t1' doesn't exist use mysqltest2; create table t1 (a int); insert into t1 values(1); +include/sync_slave_sql_with_master.inc select * from mysqltest2.t1; a 1 drop database mysqltest1; drop database mysqltest2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_report_port.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_report_port.result index dec7b328..fbc2ad69 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_report_port.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_report_port.result @@ -11,6 +11,7 @@ include/assert.inc [The value shown for the slave's port number is user specifie include/rpl_restart_server.inc [server_number=2] include/start_slave.inc include/wait_for_slave_param.inc [Slave_IO_State] +include/sync_slave_sql_with_master.inc [Slave restarted with the report-port set to the value of slave's port number] include/assert.inc [The default value shown for the slave's port number is the actual port number of the slave.] include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rewrite_db_filter.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rewrite_db_filter.result index 233f9363..2b53d98a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rewrite_db_filter.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rewrite_db_filter.result @@ -22,6 +22,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mydb`; INSERT INTO t2 VALUES (1) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc # On slave include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -36,5 +37,6 @@ slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `rewrite`; INSERT INTO t2 VALUES (1) slave-bin.000001 # Query # # COMMIT DROP DATABASE mydb; +include/sync_slave_sql_with_master.inc DROP DATABASE rewrite; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rewrt_db.result index 291cfb52..73261a7e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rewrt_db.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rewrt_db.result @@ -11,6 +11,7 @@ insert into t1 values(9); select * from mysqltest1.t1; a 9 +include/sync_slave_sql_with_master.inc show databases like 'mysqltest1'; Database (mysqltest1) mysqltest1 @@ -19,6 +20,7 @@ a 9 drop table t1; drop database mysqltest1; +include/sync_slave_sql_with_master.inc drop database if exists rewrite; create database rewrite; use test; @@ -32,6 +34,7 @@ Warning 1264 Out of range value for column 'a' at row 2 Warning 1264 Out of range value for column 'b' at row 2 Warning 1265 Data truncated for column 'd' at row 2 load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +include/sync_slave_sql_with_master.inc select * from rewrite.t1; a b c d 0000-00-00 NULL 0000-00-00 0000-00-00 @@ -45,6 +48,7 @@ Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'd' at row 1 Warning 1264 Out of range value for column 'b' at row 2 Warning 1265 Data truncated for column 'd' at row 2 +include/sync_slave_sql_with_master.inc select * from rewrite.t1; a b c d NULL NULL 0000-00-00 0000-00-00 @@ -55,6 +59,7 @@ create table t1 (a text, b text); load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; Warnings: Warning 1261 Row 3 doesn't contain data for all columns +include/sync_slave_sql_with_master.inc select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; concat('|',a,'|') concat('|',b,'|') |Field A| |Field B| @@ -70,6 +75,7 @@ Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3 Warning 1262 Row 3 was truncated; it contained more data than there were input columns Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 5 Warning 1262 Row 5 was truncated; it contained more data than there were input columns +include/sync_slave_sql_with_master.inc select * from rewrite.t1; a b 1 row 1 @@ -83,6 +89,7 @@ Warnings: Warning 1366 Incorrect integer value: ' ' for column 'a' at row 4 Warning 1261 Row 4 doesn't contain data for all columns +include/sync_slave_sql_with_master.inc select * from rewrite.t1; a b 1 row 1 @@ -170,6 +177,7 @@ INSERT INTO t_03_03_temp VALUES(1); **** sure that the number of open temporary tables at slave becomes **** zero. If not,the test will time out. +include/sync_slave_sql_with_master.inc show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 10 @@ -194,4 +202,5 @@ DROP DATABASE database_slave_temp_01; DROP DATABASE database_slave_temp_02; DROP DATABASE database_slave_temp_03; SET sql_log_bin= 1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_gtid.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_gtid.result new file mode 100644 index 00000000..13e083cf --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_gtid.result @@ -0,0 +1,39 @@ +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] +# Preparing the relaylog +[connection slave] +include/stop_slave.inc +CHANGE MASTER TO MASTER_AUTO_POSITION=0; +include/start_slave_io.inc +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_gtid_log_event'; +# Create a transaction on the master +# that will have it's GTID and other events in separated relay log files +[connection master] +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +[connection slave] +include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG=@save_debug; +include/start_slave_io.inc +# Create other transaction on the master +[connection master] +CREATE TABLE t2 (c1 INT) ENGINE=InnoDB; +include/sync_slave_io_with_master.inc +# Restart the SQL thread until the beginning of the last relay log file +[connection slave] +START SLAVE SQL_THREAD UNTIL +RELAY_LOG_FILE= 'slave-relay-bin.000003', +RELAY_LOG_POS= 4; +include/wait_for_slave_sql_to_stop.inc +# Restart the SQL thread +include/start_slave_sql.inc +[connection master] +include/sync_slave_sql_with_master.inc +include/assert.inc [t1 should be replicated] +# Cleanup +[connection master] +DROP TABLE t1, t2; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_logs.result index 7fead23a..7e337982 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -21,6 +21,7 @@ create temporary table temp_table (a char(80) not null); insert into temp_table values ("testing temporary tables"); create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); +include/sync_slave_sql_with_master.inc Master_Log_File = 'master-bin.000001' Relay_Master_Log_File = 'master-bin.000001' include/check_slave_is_running.inc @@ -36,6 +37,7 @@ master-bin.000001 # master-bin.000002 # master-bin.000003 # create table t3 select * from temp_table; +include/sync_slave_sql_with_master.inc include/assert.inc [Data in t3 should be equal to temp_table] drop table temp_table, t3; insert into t2 values(1234); @@ -43,6 +45,7 @@ set insert_id=1234; insert into t2 values(NULL); call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] +include/sync_slave_sql_with_master.inc purge master logs to 'master-bin.000002'; show master logs; Log_name master-bin.000002 @@ -62,6 +65,7 @@ show binary logs; Log_name File_size master-bin.000003 # insert into t2 values (65); +include/sync_slave_sql_with_master.inc Master_Log_File = 'master-bin.000003' Relay_Master_Log_File = 'master-bin.000003' include/check_slave_is_running.inc @@ -75,6 +79,7 @@ insert into temp_table values ("testing temporary tables part 2"); create table t3 (n int); include/assert.inc [Table t3 should contain 90 lines on the master] create table t4 select * from temp_table; +include/sync_slave_sql_with_master.inc include/assert.inc [Data in t4 should be equal to temp_table] include/check_slave_is_running.inc lock tables t3 read; @@ -82,6 +87,7 @@ include/assert.inc [Table t3 should contain 90 lines on the slave] unlock tables; drop table if exists t1,t2,t3,t4; drop temporary table temp_table; +include/sync_slave_sql_with_master.inc End of 4.1 tests show binlog events in 'non existing_binlog_file'; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result index 60f767b1..f97d1018 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result @@ -24,10 +24,12 @@ master-bin.000003 # SET DEBUG_SYNC = 'now SIGNAL rotated'; SET DEBUG_SYNC = 'RESET'; SET DEBUG_SYNC = 'RESET'; +include/sync_slave_sql_with_master.inc SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated'; insert into t1 set f=repeat('b', 4096); SET DEBUG_SYNC = 'now SIGNAL rotated'; SET DEBUG_SYNC = 'RESET'; SET DEBUG_SYNC = 'RESET'; drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_row_trans.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_row_trans.result new file mode 100644 index 00000000..27e71c52 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_rotate_row_trans.result @@ -0,0 +1,39 @@ +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] +# Initial setup +[connection master] +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +# Sync slave with master and setup debug sync point +include/sync_slave_sql_with_master.inc +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_write_rows_log_event'; +# Insert the data in the master +[connection master] +BEGIN; +INSERT INTO t1 (c1) VALUES (0); +INSERT INTO t1 (c1) VALUES (1); +COMMIT; +# Restart the IO thread keeping SQL thread running until last relay log split +[connection slave] +include/wait_for_slave_io_to_stop.inc +START SLAVE IO_THREAD; +include/wait_for_slave_io_to_stop.inc +# Stop the SQL thread (it should be in the middle of the transaction/group) +include/stop_slave_sql.inc +# Remove the debug point and restart the both threads +SET GLOBAL DEBUG= @save_debug; +include/start_slave.inc +# Do one more insert on master and then sync slave with master +[connection master] +INSERT INTO t1 (c1) VALUES (2); +include/sync_slave_sql_with_master.inc +# Now compare master and slave's t1 table data +[connection master] +include/diff_tables.inc [master:t1, slave:t1] +# Cleanup +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_001.result index abcc09ea..6910e88c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_001.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_001.result @@ -39,6 +39,7 @@ RESET SLAVE; SELECT COUNT(*) FROM t1; COUNT(*) 5000 +RESET MASTER; LOCK TABLES t1 READ; START SLAVE; UNLOCK TABLES; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_4_bytes.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_4_bytes.result index c2ca3103..1236f5ae 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_4_bytes.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_4_bytes.result @@ -13,6 +13,7 @@ insert into t1 values("GUI"); insert into t2 values("LIL"); insert into t2 values("ABE"); insert into t2 values("ANG"); +include/sync_slave_sql_with_master.inc use mysqltest1; select * from t1 order by a; a @@ -24,4 +25,5 @@ ABE ANG LIL DROP DATABASE mysqltest1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_NOW.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_NOW.result index 540a586e..7651f65b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_NOW.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_NOW.result @@ -23,7 +23,9 @@ FOR EACH ROW BEGIN SET new.b = mysqltest1.f1(); END| INSERT INTO mysqltest1.t1 SET n = NULL, a = now(); +include/sync_slave_sql_with_master.inc DROP TABLE IF EXISTS mysqltest1.t1; DROP FUNCTION mysqltest1.f1; DROP DATABASE mysqltest1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_USER.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_USER.result index 42753dc9..cf9d9f47 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_USER.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_USER.result @@ -24,6 +24,7 @@ a users 2 @localhost% 3 tester@localhost 4 @localhost% +include/sync_slave_sql_with_master.inc SELECT * FROM mysqltest1.t1 ORDER BY a; a users 1 tester@localhost @@ -35,4 +36,5 @@ REVOKE ALL ON mysqltest1.* FROM 'tester'@'%'; REVOKE ALL ON mysqltest1.* FROM ''@'localhost%'; DROP USER tester@'%'; DROP USER ''@'localhost%'; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_UUID.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_UUID.result index 56b26706..d016ee78 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_UUID.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_UUID.result @@ -25,6 +25,7 @@ fn1(0) 0 create table t2 (a int) engine=myisam; insert into t2 values(fn1(2)); +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE test.t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index a336c55b..e13b7ad5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -32,6 +32,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 +include/sync_slave_sql_with_master.inc **** On Slave **** SHOW DATABASES; Database @@ -49,6 +50,7 @@ ERROR 42000: Unknown database 'test_ignore' DROP DATABASE test_ignore; USE test; DROP TABLE t1; +include/sync_slave_sql_with_master.inc USE test; include/rpl_reset.inc CREATE TABLE t1 (a INT); @@ -73,10 +75,12 @@ call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on tabl CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3); **** On Slave **** +include/sync_slave_sql_with_master.inc SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024; **** On Master **** INSERT INTO t1 VALUES (4),(5),(6); **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a 1 @@ -88,6 +92,7 @@ a **** On Master **** INSERT INTO t1 VALUES (7),(8),(9); **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a 1 @@ -104,10 +109,12 @@ DROP TABLE t1; ================ Test for BUG#22550 ================ include/rpl_reset.inc CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM; +include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES(1,2); SELECT HEX(a),b FROM t1; HEX(a) b 1 2 +include/sync_slave_sql_with_master.inc SELECT HEX(a),b FROM t1; HEX(a) b 1 2 @@ -115,10 +122,12 @@ UPDATE t1 SET a=0 WHERE b=2; SELECT HEX(a),b FROM t1; HEX(a) b 0 2 +include/sync_slave_sql_with_master.inc SELECT HEX(a),b FROM t1; HEX(a) b 0 2 DROP TABLE IF EXISTS t1; +include/sync_slave_sql_with_master.inc ================ Test for BUG#22583 ================ include/rpl_reset.inc **** On Master **** @@ -127,6 +136,7 @@ CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB; CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM; CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB; **** On Slave **** +include/sync_slave_sql_with_master.inc ALTER TABLE t1_myisam ENGINE=INNODB; ALTER TABLE t1_innodb ENGINE=MYISAM; ALTER TABLE t2_myisam ENGINE=INNODB; @@ -157,6 +167,7 @@ k HEX(a) HEX(b) 1 0 9 2 1 8 **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT k, HEX(a),HEX(b) FROM t1_myisam; k HEX(a) HEX(b) 1 0 101 @@ -195,6 +206,7 @@ k HEX(a) HEX(b) 1 0 9 2 0 8 **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT k, HEX(a),HEX(b) FROM t1_myisam; k HEX(a) HEX(b) 1 0 101 @@ -213,6 +225,7 @@ k HEX(a) HEX(b) 2 0 8 **** On Master **** DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb; +include/sync_slave_sql_with_master.inc drop table if exists t1, t2; CREATE TABLE `t1` ( `a` int(11) NOT NULL auto_increment, @@ -232,16 +245,19 @@ select * from t2 /* must be (3,1), (4,4) */; a b 3 1 4 4 +include/sync_slave_sql_with_master.inc select * from t2 /* must be (3,1), (4,4) */; a b 3 1 4 4 drop table t1,t2; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc **** On Master **** CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave')); INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave'); **** On Slave **** +include/sync_slave_sql_with_master.inc UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1; SELECT * FROM t1 ORDER BY a; a b @@ -255,6 +271,7 @@ a b 2 master,slave 5 master **** On Slave **** +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; Last_SQL_Error diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index 95c270cc..d9170f25 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'MYISAM' ; SELECT * FROM t1; C1 C2 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; C1 C2 INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X'); @@ -18,6 +19,7 @@ A C X X X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A A @@ -33,6 +35,7 @@ A B A C X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B @@ -46,6 +49,7 @@ A B A I X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B @@ -63,6 +67,7 @@ A B A I X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY c1,c2; C1 C2 A B @@ -91,6 +96,7 @@ c1 c12 c2 5 A 25 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 2 @@ -121,6 +127,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -144,6 +151,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -165,6 +173,7 @@ c1 c12 c2 6 A 36 7 A 49 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -186,6 +195,7 @@ A C 1 B 2 X X 3 B 1 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A A 3 B 2 @@ -201,6 +211,7 @@ A B 1 B 1 A C 1 B 2 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 @@ -214,6 +225,7 @@ A B 1 B 1 A I 1 B 2 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 @@ -231,6 +243,7 @@ X X 3 A C 4 X Z 5 A A 6 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -246,6 +259,7 @@ A B 1 X Y 2 A C 4 X Z 5 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -259,6 +273,7 @@ A B 1 X Y 2 A I 4 X Z 5 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -313,6 +328,7 @@ X Q 5 7 R 49 X Y 2 S 1 X Q 5 7 R 49 X Z 2 S 2 X Q 5 9 R 81 X Y 2 S 1 X Q 5 9 R 81 X Z 2 S 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2; C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2 X Q 2 1 R 1 X Y 2 S 1 @@ -362,10 +378,12 @@ INSERT INTO t4 SET C1 = 1; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 +include/sync_slave_sql_with_master.inc SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'MYISAM' ; +include/sync_slave_sql_with_master.inc --- on slave: original values --- INSERT INTO t7 VALUES (1,3), (2,6), (3,9); SELECT * FROM t7 ORDER BY C1; @@ -381,6 +399,7 @@ C1 C2 1 2 2 4 3 6 +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --- on slave: old values should be overwritten by replicated values --- SELECT * FROM t7 ORDER BY C1; @@ -400,6 +419,7 @@ ERROR 23000: Duplicate entry '99' for key 'c' SELECT * FROM t8 ORDER BY a; a b c 99 99 99 +include/sync_slave_sql_with_master.inc --- on slave --- SELECT * FROM t8 ORDER BY a; a b c @@ -414,6 +434,7 @@ a b c set @@global.slave_exec_mode= 'IDEMPOTENT'; --- on master --- INSERT INTO t8 VALUES (2,4,8); +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --- on slave --- SELECT * FROM t8 ORDER BY a; @@ -425,15 +446,18 @@ a b c **** Test for BUG#31552 **** **** On Master **** DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc **** On Master **** INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); **** On Master **** +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= 'IDEMPOTENT'; DELETE FROM t1 WHERE C1 = 'L'; DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; include/check_slave_is_running.inc SELECT COUNT(*) FROM t1 ORDER BY c1,c2; @@ -445,20 +469,24 @@ CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); INSERT INTO t1 VALUES( '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a b c 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'MYISAM' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'MYISAM' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'MYISAM' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, @@ -466,10 +494,12 @@ j INT NOT NULL) ENGINE = 'MYISAM' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'MYISAM' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'MYISAM' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, @@ -479,10 +509,12 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] [expecting slave to replicate correctly] INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); @@ -493,6 +525,7 @@ include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t4, slave:t4] [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); @@ -507,15 +540,19 @@ include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t7, slave:t7] drop table t1, t2, t3, t4, t5, t6, t7; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='MYISAM' ; INSERT INTO t1 VALUES (1), (2), (3); UPDATE t1 SET a = 10; ERROR 23000: Duplicate entry '10' for key 'PRIMARY' INSERT INTO t1 VALUES (4); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, @@ -567,6 +604,7 @@ UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6; ERROR 23000: Duplicate entry '6' for key 'PRIMARY' DELETE FROM t2 WHERE `pk` < 7 LIMIT 1; UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6; +include/sync_slave_sql_with_master.inc *** results: t2 must be consistent **** include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1, t2; @@ -584,8 +622,10 @@ UPDATE t1 SET a = 9 WHERE a < 3; INSERT INTO t1 ( a ) VALUES ( 3 ); UPDATE t1 SET a = 0 WHERE a < 4; UPDATE t1 SET a = 8 WHERE a < 5; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a bit) ENGINE='MYISAM' ; INSERT IGNORE INTO t1 VALUES (NULL); INSERT INTO t1 ( a ) VALUES ( 0 ); @@ -626,6 +666,8 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0; UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2; INSERT INTO t1 ( a ) VALUES ( 1 ); UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index 44b36041..5bff2ac3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -6,6 +6,7 @@ Note #### Storing MySQL user name or password information in the master info rep CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB' ; SELECT * FROM t1; C1 C2 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; C1 C2 INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X'); @@ -18,6 +19,7 @@ A C X X X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A A @@ -33,6 +35,7 @@ A B A C X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B @@ -46,6 +49,7 @@ A B A I X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B @@ -63,6 +67,7 @@ A B A I X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY c1,c2; C1 C2 A B @@ -91,6 +96,7 @@ c1 c12 c2 5 A 25 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 2 @@ -121,6 +127,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -144,6 +151,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -165,6 +173,7 @@ c1 c12 c2 6 A 36 7 A 49 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -186,6 +195,7 @@ A C 1 B 2 X X 3 B 1 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A A 3 B 2 @@ -201,6 +211,7 @@ A B 1 B 1 A C 1 B 2 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 @@ -214,6 +225,7 @@ A B 1 B 1 A I 1 B 2 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 @@ -231,6 +243,7 @@ X X 3 A C 4 X Z 5 A A 6 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -246,6 +259,7 @@ A B 1 X Y 2 A C 4 X Z 5 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -259,6 +273,7 @@ A B 1 X Y 2 A I 4 X Z 5 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -313,6 +328,7 @@ X Q 5 7 R 49 X Y 2 S 1 X Q 5 7 R 49 X Z 2 S 2 X Q 5 9 R 81 X Y 2 S 1 X Q 5 9 R 81 X Z 2 S 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2; C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2 X Q 2 1 R 1 X Y 2 S 1 @@ -364,11 +380,13 @@ INSERT INTO t4 SET C1 = 1; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 +include/sync_slave_sql_with_master.inc SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc --- on slave: original values --- INSERT INTO t7 VALUES (1,3), (2,6), (3,9); SELECT * FROM t7 ORDER BY C1; @@ -384,6 +402,7 @@ C1 C2 1 2 2 4 3 6 +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --- on slave: old values should be overwritten by replicated values --- SELECT * FROM t7 ORDER BY C1; @@ -403,6 +422,7 @@ ERROR 23000: Duplicate entry '99' for key 'c' SELECT * FROM t8 ORDER BY a; a b c 99 99 99 +include/sync_slave_sql_with_master.inc --- on slave --- SELECT * FROM t8 ORDER BY a; a b c @@ -417,6 +437,7 @@ a b c set @@global.slave_exec_mode= 'IDEMPOTENT'; --- on master --- INSERT INTO t8 VALUES (2,4,8); +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --- on slave --- SELECT * FROM t8 ORDER BY a; @@ -428,15 +449,18 @@ a b c **** Test for BUG#31552 **** **** On Master **** DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc **** On Master **** INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); **** On Master **** +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= 'IDEMPOTENT'; DELETE FROM t1 WHERE C1 = 'L'; DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; include/check_slave_is_running.inc SELECT COUNT(*) FROM t1 ORDER BY c1,c2; @@ -448,20 +472,24 @@ CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); INSERT INTO t1 VALUES( '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a b c 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, @@ -469,10 +497,12 @@ j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, @@ -482,10 +512,12 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] [expecting slave to replicate correctly] INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); @@ -496,6 +528,7 @@ include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t4, slave:t4] [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); @@ -510,15 +543,19 @@ include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t7, slave:t7] drop table t1, t2, t3, t4, t5, t6, t7; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='INNODB' ; INSERT INTO t1 VALUES (1), (2), (3); UPDATE t1 SET a = 10; ERROR 23000: Duplicate entry '10' for key 'PRIMARY' INSERT INTO t1 VALUES (4); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, @@ -570,6 +607,7 @@ UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6; ERROR 23000: Duplicate entry '6' for key 'PRIMARY' DELETE FROM t2 WHERE `pk` < 7 LIMIT 1; UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6; +include/sync_slave_sql_with_master.inc *** results: t2 must be consistent **** include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1, t2; @@ -587,8 +625,10 @@ UPDATE t1 SET a = 9 WHERE a < 3; INSERT INTO t1 ( a ) VALUES ( 3 ); UPDATE t1 SET a = 0 WHERE a < 4; UPDATE t1 SET a = 8 WHERE a < 5; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS; SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY'; CREATE TABLE t1 (a bit) ENGINE='INNODB' ; @@ -631,7 +671,9 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0; UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2; INSERT INTO t1 ( a ) VALUES ( 1 ); UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3; +include/sync_slave_sql_with_master.inc SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result index 549c2c54..e1c21279 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result @@ -42,6 +42,7 @@ t1 CREATE TABLE `t1` ( PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ --- On slave -- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -123,6 +124,7 @@ t1 CREATE TABLE `t1` ( PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ --- On slave --- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -210,6 +212,7 @@ t1 CREATE TABLE `t1` ( PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */ --- On slave --- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -285,6 +288,7 @@ t1 CREATE TABLE `t1` ( PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */ --- On slave --- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -365,6 +369,7 @@ t1 CREATE TABLE `t1` ( /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ --- On slave --- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -436,6 +441,7 @@ t1 CREATE TABLE `t1` ( /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ --- On slave --- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -515,6 +521,7 @@ t1 CREATE TABLE `t1` ( /*!50100 PARTITION BY KEY () PARTITIONS 4 */ --- On slave --- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -588,6 +595,7 @@ t1 CREATE TABLE `t1` ( /*!50100 PARTITION BY KEY () PARTITIONS 4 */ --- On slave --- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -661,6 +669,7 @@ t1 CREATE TABLE `t1` ( /*!50100 PARTITION BY KEY () PARTITIONS 4 */ --- On slave --- +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_allow_batching.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_allow_batching.result index 0a6b47bb..09234414 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_allow_batching.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_basic_allow_batching.result @@ -14,6 +14,7 @@ Now the normal test CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB' ; SELECT * FROM t1; C1 C2 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; C1 C2 INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X'); @@ -26,6 +27,7 @@ A C X X X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A A @@ -41,6 +43,7 @@ A B A C X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B @@ -54,6 +57,7 @@ A B A I X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B @@ -71,6 +75,7 @@ A B A I X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY c1,c2; C1 C2 A B @@ -99,6 +104,7 @@ c1 c12 c2 5 A 25 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 2 @@ -129,6 +135,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -152,6 +159,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -173,6 +181,7 @@ c1 c12 c2 6 A 36 7 A 49 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -194,6 +203,7 @@ A C 1 B 2 X X 3 B 1 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A A 3 B 2 @@ -209,6 +219,7 @@ A B 1 B 1 A C 1 B 2 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 @@ -222,6 +233,7 @@ A B 1 B 1 A I 1 B 2 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 @@ -239,6 +251,7 @@ X X 3 A C 4 X Z 5 A A 6 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -254,6 +267,7 @@ A B 1 X Y 2 A C 4 X Z 5 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -267,6 +281,7 @@ A B 1 X Y 2 A I 4 X Z 5 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -321,6 +336,7 @@ X Q 5 7 R 49 X Y 2 S 1 X Q 5 7 R 49 X Z 2 S 2 X Q 5 9 R 81 X Y 2 S 1 X Q 5 9 R 81 X Z 2 S 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2; C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2 X Q 2 1 R 1 X Y 2 S 1 @@ -370,10 +386,12 @@ INSERT INTO t4 SET C1 = 1; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 +include/sync_slave_sql_with_master.inc SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc --- on slave: original values --- INSERT INTO t7 VALUES (1,3), (2,6), (3,9); SELECT * FROM t7 ORDER BY C1; @@ -389,6 +407,7 @@ C1 C2 1 2 2 4 3 6 +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --- on slave: old values should be overwritten by replicated values --- SELECT * FROM t7 ORDER BY C1; @@ -408,6 +427,7 @@ ERROR 23000: Duplicate entry '99' for key 'c' SELECT * FROM t8 ORDER BY a; a b c 99 99 99 +include/sync_slave_sql_with_master.inc --- on slave --- SELECT * FROM t8 ORDER BY a; a b c @@ -422,6 +442,7 @@ a b c set @@global.slave_exec_mode= 'IDEMPOTENT'; --- on master --- INSERT INTO t8 VALUES (2,4,8); +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --- on slave --- SELECT * FROM t8 ORDER BY a; @@ -433,15 +454,18 @@ a b c **** Test for BUG#31552 **** **** On Master **** DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc **** On Master **** INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); **** On Master **** +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= 'IDEMPOTENT'; DELETE FROM t1 WHERE C1 = 'L'; DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; include/check_slave_is_running.inc SELECT COUNT(*) FROM t1 ORDER BY c1,c2; @@ -453,20 +477,24 @@ CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); INSERT INTO t1 VALUES( '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a b c 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, @@ -474,10 +502,12 @@ j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, @@ -487,10 +517,12 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] [expecting slave to replicate correctly] INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); @@ -501,6 +533,7 @@ include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t4, slave:t4] [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); @@ -515,15 +548,19 @@ include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t7, slave:t7] drop table t1, t2, t3, t4, t5, t6, t7; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='INNODB' ; INSERT INTO t1 VALUES (1), (2), (3); UPDATE t1 SET a = 10; ERROR 23000: Duplicate entry '10' for key 'PRIMARY' INSERT INTO t1 VALUES (4); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, @@ -575,6 +612,7 @@ UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6; ERROR 23000: Duplicate entry '6' for key 'PRIMARY' DELETE FROM t2 WHERE `pk` < 7 LIMIT 1; UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6; +include/sync_slave_sql_with_master.inc *** results: t2 must be consistent **** include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1, t2; @@ -592,8 +630,10 @@ UPDATE t1 SET a = 9 WHERE a < 3; INSERT INTO t1 ( a ) VALUES ( 3 ); UPDATE t1 SET a = 0 WHERE a < 4; UPDATE t1 SET a = 8 WHERE a < 5; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a bit) ENGINE='INNODB' ; INSERT IGNORE INTO t1 VALUES (NULL); INSERT INTO t1 ( a ) VALUES ( 0 ); @@ -634,8 +674,10 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0; UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2; INSERT INTO t1 ( a ) VALUES ( 1 ); UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc stop slave; set global slave_allow_batching=OFF; start slave; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result index e41edbc3..0741a616 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result @@ -27,6 +27,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3; LENGTH(data) 16384 +include/sync_slave_sql_with_master.inc **** Data Insert Validation Slave Section test.t1 **** @@ -53,6 +54,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; LENGTH(data) 17408 +include/sync_slave_sql_with_master.inc **** Data Update Validation Slave Section test.t1 **** @@ -112,6 +114,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 20000 b2 30000 dd2 +include/sync_slave_sql_with_master.inc **** Data Insert Validation Slave Section test.t2 **** @@ -139,6 +142,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 2256 b1 3000 dd1 +include/sync_slave_sql_with_master.inc **** Data Update Validation Slave Section test.t2 **** @@ -153,4 +157,5 @@ c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result index e41edbc3..0741a616 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result @@ -27,6 +27,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3; LENGTH(data) 16384 +include/sync_slave_sql_with_master.inc **** Data Insert Validation Slave Section test.t1 **** @@ -53,6 +54,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; LENGTH(data) 17408 +include/sync_slave_sql_with_master.inc **** Data Update Validation Slave Section test.t1 **** @@ -112,6 +114,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 20000 b2 30000 dd2 +include/sync_slave_sql_with_master.inc **** Data Insert Validation Slave Section test.t2 **** @@ -139,6 +142,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 2256 b1 3000 dd1 +include/sync_slave_sql_with_master.inc **** Data Update Validation Slave Section test.t2 **** @@ -153,4 +157,5 @@ c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_colSize.result index 4083b7b7..0ec9468b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] **** Testing WL#3228 changes. **** *** Create "wider" table on slave *** +include/sync_slave_sql_with_master.inc Checking MYSQL_TYPE_NEWDECIMAL fields DROP TABLE IF EXISTS t1; Warnings: @@ -207,4 +208,5 @@ call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be conve call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); *** Cleanup *** DROP TABLE IF EXISTS t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_conflicts.result index 4b4d5510..5a92dc84 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_conflicts.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_conflicts.result @@ -12,6 +12,7 @@ SET @@global.slave_exec_mode = 'STRICT'; [on master] CREATE TABLE t1(a INT PRIMARY KEY); [on slave] +include/sync_slave_sql_with_master.inc ==== Test: SQL thread sees 'INSERT' of existing key ==== ---- Prepare slave so that it will get duplicate key error ---- INSERT INTO t1 VALUES (1); @@ -47,6 +48,7 @@ a DELETE FROM t1; INSERT INTO t1 VALUES (1); [on slave] +include/sync_slave_sql_with_master.inc DELETE FROM t1 WHERE a = 1; ---- On master, remove the row that does not exist on slave ---- [on master] @@ -74,6 +76,7 @@ a [on master] DROP TABLE t1; [on slave] +include/sync_slave_sql_with_master.inc include/rpl_reset.inc ######## Run with slave_exec_mode=IDEMPOTENT ######## set @@global.slave_exec_mode= 'IDEMPOTENT'; @@ -81,6 +84,7 @@ set @@global.slave_exec_mode= 'IDEMPOTENT'; [on master] CREATE TABLE t1(a INT PRIMARY KEY); [on slave] +include/sync_slave_sql_with_master.inc ==== Test: SQL thread sees 'INSERT' of existing key ==== ---- Prepare slave so that it will get duplicate key error ---- INSERT INTO t1 VALUES (1); @@ -102,6 +106,7 @@ a DELETE FROM t1; INSERT INTO t1 VALUES (1); [on slave] +include/sync_slave_sql_with_master.inc DELETE FROM t1 WHERE a = 1; ---- On master, remove the row that does not exist on slave ---- [on master] @@ -117,5 +122,6 @@ a [on master] DROP TABLE t1; [on slave] +include/sync_slave_sql_with_master.inc SET @@global.slave_exec_mode= @old_slave_exec_mode; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_corrupt.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_corrupt.result new file mode 100644 index 00000000..b27fc0ec --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_corrupt.result @@ -0,0 +1,14 @@ +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] +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 'test.t1' +CREATE TABLE t1(a varchar(40000))ENGINE=INNODB; +INSERT INTO t1 VALUES (REPEAT('a',37000)); +INSERT INTO t1 VALUES (REPEAT('b',32552)); +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_row_corruption.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_corruption.result index 80abbc7f..71801843 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_corruption.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_corruption.result @@ -7,6 +7,7 @@ CREATE TABLE t1_11753004 (c1 INT); CREATE TABLE t2_11753004 (c1 INT); INSERT INTO t1_11753004 VALUES (1); INSERT INTO t2_11753004 VALUES (2); +include/sync_slave_sql_with_master.inc call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*"); call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); include/stop_slave.inc @@ -20,6 +21,7 @@ SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table"; include/start_slave.inc include/rpl_reset.inc DROP TABLE t1_11753004, t2_11753004; +include/sync_slave_sql_with_master.inc include/stop_slave.inc SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table"; include/start_slave.inc @@ -29,6 +31,7 @@ CREATE TABLE t2_11753004_ign (c1 INT); INSERT INTO t1_11753004 VALUES (1); INSERT INTO t2_11753004_ign VALUES (2); UPDATE t1_11753004, t2_11753004_ign SET t1_11753004.c1=3, t2_11753004_ign.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004_ign.c1=2; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (c1 INT); CREATE TABLE t2 (c1 INT); INSERT INTO t1 VALUES (1); @@ -49,5 +52,6 @@ DROP TABLE t1,t2; SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table"; DROP TABLE t1_11753004; DROP TABLE t2_11753004_ign; +include/sync_slave_sql_with_master.inc SET GLOBAL debug= @save_debug; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_crash_safe.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_crash_safe.result index 843e4370..ec0de75c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_crash_safe.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_crash_safe.result @@ -1584,6 +1584,474 @@ master-bin.000001 # Xid # # COMMIT /* XID */ include/rpl_reconnect.inc START SLAVE; include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 1); +include/show_binlog_events.inc +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 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -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 # # 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 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 1); +include/show_binlog_events.inc +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_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -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 # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (39, 1); +fc_i_tt_5_suc (39, 1) +fc_i_tt_5_suc +include/show_binlog_events.inc +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_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -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 # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (40, 1); +include/show_binlog_events.inc +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_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +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.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -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 # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +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.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -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 # # 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 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (42, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (42, 4); +fc_i_tt_5_suc (42, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -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 # # 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 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (43, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (43, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -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 # # 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 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (44, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -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 # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (45, 2); +fc_i_tt_5_suc (45, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -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 # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (46, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (46, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -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 # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc ################################################################################### # EXECUTE CASES CRASHING THE BEGIN/COMMIT ################################################################################### @@ -1596,7 +2064,7 @@ SET GLOBAL debug="d,crash_after_commit_and_update_pos";; FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 rpl_mixing_engines.inc [commands=N] -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1); +INSERT INTO nt_1(trans_id, stmt_id) VALUES (47, 1); include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -1625,7 +2093,7 @@ SET GLOBAL debug="d,crash_after_commit_and_update_pos";; FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 rpl_mixing_engines.inc [commands=N-trig] -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (48, 1); include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -1658,8 +2126,8 @@ SET GLOBAL debug="d,crash_after_commit_and_update_pos";; FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 rpl_mixing_engines.inc [commands=N-func] -b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- -SELECT fc_i_nt_5_suc (39, 1); -fc_i_nt_5_suc (39, 1) +SELECT fc_i_nt_5_suc (49, 1); +fc_i_nt_5_suc (49, 1) fc_i_nt_5_suc include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -1691,6 +2159,7 @@ include/wait_for_slave_to_start.inc ################################################################################### # CHECK CONSISTENCY ################################################################################### +include/sync_slave_sql_with_master.inc ################################################################################### # CLEAN ################################################################################### diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_create_select.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_create_select.result new file mode 100644 index 00000000..476f2a0f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_create_select.result @@ -0,0 +1,31 @@ +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] +# +# BUG#17994219: CREATE TABLE .. SELECT PRODUCES INVALID STRUCTURE, +# BREAKS RBR +# +#After the patch, the display width is set to a default +#value of 21. +CREATE TABLE t1 AS SELECT REPEAT('A', 1000) DIV 1 AS a; +Warnings: +Warning 1366 Incorrect decimal value: '' for column '' at row -1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t2 AS SELECT CONVERT(REPEAT('A', 255) USING UCS2) DIV 1 AS a; +Warnings: +Warning 1366 Incorrect decimal value: '' for column '' at row -1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` bigint(21) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +#After the patch, no error is reported. +DROP TABLE t1; +DROP TABLE t2; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop.result index 9e205a6f..378bf5eb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop.result @@ -11,6 +11,7 @@ SHOW TABLES; Tables_in_test t1 t2 +include/sync_slave_sql_with_master.inc **** On Slave **** SHOW TABLES; Tables_in_test @@ -22,6 +23,7 @@ SHOW TABLES; Tables_in_test t1 t2 +include/sync_slave_sql_with_master.inc **** On Slave **** SHOW TABLES; Tables_in_test @@ -33,6 +35,7 @@ SHOW TABLES; Tables_in_test t1 t2 +include/sync_slave_sql_with_master.inc **** On Slave **** SHOW TABLES; Tables_in_test @@ -50,8 +53,10 @@ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server SHOW TABLES; Tables_in_test t2 +include/sync_slave_sql_with_master.inc **** On Slave **** SHOW TABLES; Tables_in_test t2 +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result index c7100990..79923a51 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result @@ -129,8 +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` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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'; @@ -462,12 +461,11 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -486,20 +484,18 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -1016,13 +1012,8 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R'; @@ -1043,21 +1034,15 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'B T Drop-Temp-TN-Temp R'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_event_max_size.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_event_max_size.result index 388c8d47..6da86958 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_event_max_size.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_event_max_size.result @@ -30,6 +30,7 @@ master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT +include/sync_slave_sql_with_master.inc # On slave, test the row event data is replicated when the value of # the bigger one of max_allowed_packet and binlog_row_event_max_size # is larger than the required size. @@ -43,17 +44,20 @@ SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 2; LENGTH(data1) LENGTH(data2) 1048576 1048576 DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc # Test it will cause ER_MASTER_FATAL_ERROR_READING_BINLOG when the value # of the bigger one of max_allowed_packet and binlog_row_event_max_size # is lower than the the required size. CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, data2 LONGBLOB, data3 LONGBLOB, PRIMARY KEY(a)); +include/sync_slave_sql_with_master.inc INSERT INTO t1 (data1, data2, data3) VALUES (repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet)); SELECT LENGTH(data1), LENGTH(data2), LENGTH(data3) FROM t1 WHERE a = 1; LENGTH(data1) LENGTH(data2) LENGTH(data3) 4194304 4194304 4194304 drop table t1; +include/sync_slave_sql_with_master.inc call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log: .*"); call mtr.add_suppression("Found invalid event in binary log"); call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_find_row.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_find_row.result index a052ec33..12b0ded4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_find_row.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_find_row.result @@ -10,14 +10,19 @@ CREATE TABLE t (a int, b int, c int); INSERT INTO t VALUES (1,2,4); INSERT INTO t VALUES (4,3,4); DELETE FROM t; +include/sync_slave_sql_with_master.inc DROP TABLE t; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t (a int, b int, c int, key(b)); +include/sync_slave_sql_with_master.inc ALTER TABLE t DISABLE KEYS; INSERT INTO t VALUES (1,2,4); INSERT INTO t VALUES (4,3,4); DELETE FROM t; +include/sync_slave_sql_with_master.inc DROP TABLE t; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t2 (col4 CHAR(25) DEFAULT NULL, col1 BIGINT, @@ -27,13 +32,16 @@ col5 VARCHAR(25) DEFAULT '' ALTER TABLE t2 ADD INDEX idx1 ( col4 ) , ADD UNIQUE INDEX idx2 ( col5 ); INSERT INTO t2 ( col4 , col2 ) VALUES ( 'Hello', -77 ) ; UPDATE t2 SET col1 = 13 WHERE col2 = -77; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t2; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2)); INSERT INTO t1(c1,c2) VALUES(1,1); INSERT INTO t1(c1,c2) VALUES(1,2); UPDATE t1 SET c1=1000 WHERE c2=2; +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_row_flsh_tbls.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result index 80b94efe..60a5e249 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result @@ -17,6 +17,7 @@ master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; +include/sync_slave_sql_with_master.inc select * from t3; a stop slave; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func001.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func001.result index 34698e7b..5a458300 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func001.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func001.result @@ -21,10 +21,12 @@ select * from test.t1; a 1 2 +include/sync_slave_sql_with_master.inc select * from test.t1; a 1 2 DROP FUNCTION test.f1; DROP TABLE test.t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func002.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func002.result index e017be35..01b81486 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func002.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func002.result @@ -20,7 +20,9 @@ SET TIMESTAMP=1; INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP); SET TIMESTAMP=333300000; INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP); +include/sync_slave_sql_with_master.inc DROP FUNCTION test.f1; DROP TABLE test.t1; DROP TABLE test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func003.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func003.result index 36e00496..a2f0ea23 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func003.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_func003.result @@ -25,6 +25,7 @@ START TRANSACTION; INSERT INTO test.t1 VALUES (null,test.f1()); ROLLBACK; SET AUTOCOMMIT=1; +include/sync_slave_sql_with_master.inc DROP FUNCTION test.f1; DROP TABLE test.t1; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan.result index 8bef6978..39ad59a1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan.result @@ -14,14 +14,18 @@ SET @saved_slave_rows_search_algorithms= @@global.slave_rows_search_algorithms; SET GLOBAL slave_rows_search_algorithms= 'INDEX_SCAN,HASH_SCAN'; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1), (1), (2), (3); +include/sync_slave_sql_with_master.inc DELETE FROM t1; INSERT INTO t1 VALUES (2), (1), (3), (1); UPDATE t1 SET a=1000 WHERE a=1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] DELETE FROM t1 WHERE a=1000; DELETE FROM t1 WHERE a=2 OR a=3; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc SET SQL_LOG_BIN=0; CREATE TABLE t1 (a INT, b INT); @@ -35,6 +39,7 @@ a b 1000 2 2 1 2 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a 1000 @@ -45,12 +50,15 @@ DELETE FROM t1 WHERE a=1000; DELETE FROM t1 WHERE a=2; SELECT * FROM t1; a b +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1), (1), (2), (3); +include/sync_slave_sql_with_master.inc DELETE FROM t1 WHERE a=1; DELETE FROM t1 WHERE a=2; UPDATE t1 SET a=1000 WHERE a=1; @@ -58,28 +66,38 @@ include/wait_for_slave_sql_error_and_skip.inc [errno=1032] DELETE FROM t1 WHERE a=2; include/wait_for_slave_sql_error_and_skip.inc [errno=1032] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t1 (a INT, b TINYBLOB); INSERT INTO t1 VALUES (1,'a'), (1, 'b'), (2,'aa'), (2, 'aa'); UPDATE t1 SET b='c' WHERE a=1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] UPDATE t1 SET a=10000 WHERE b='aa'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] UPDATE t1 SET b='c' WHERE b='aa'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] DELETE FROM t1 WHERE b='c'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t1 (a TINYBLOB, b TINYBLOB); INSERT INTO t1 VALUES ('a','a'), ('b', 'b'), ('a','aa'), ('a', 'aa'); UPDATE t1 SET b='c' WHERE b='aa'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] INSERT INTO t1 VALUES (NULL,NULL), (NULL, NULL); DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1, slave:test.t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan_sanity.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan_sanity.result index 5ace96a6..b436e549 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan_sanity.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan_sanity.result @@ -11,6 +11,7 @@ INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); INSERT INTO t3 VALUES (1); INSERT INTO t4 VALUES (1); +include/sync_slave_sql_with_master.inc SET @saved_slave_rows_search_algorithms= @@global.slave_rows_search_algorithms; SET @@global.slave_rows_search_algorithms= 'TABLE_SCAN'; UPDATE t1 SET c1= 2; @@ -42,7 +43,29 @@ UPDATE t1 SET c1= 7; UPDATE t2 SET c1= 7; UPDATE t3 SET c1= 7; UPDATE t4 SET c1= 7; +SET @@global.slave_rows_search_algorithms= 'HASH_SCAN'; +CREATE TABLE t5(c1 INT, c2 INT, KEY(c2)); +INSERT INTO t5 VALUES (1,1),(2,2),(3,1),(4,NULL),(5,2),(6,3); +DELETE FROM t5 ORDER BY c1; +DROP TABLE t5; +include/sync_slave_sql_with_master.inc +CREATE TABLE t5(c1 BIGINT, c2 BIGINT, KEY(c2)); +INSERT INTO t5 VALUES (1,1),(2,2),(3,1),(4,NULL),(5,2),(6,3); +DELETE FROM t5 ORDER BY c1; +DROP TABLE t5; +include/sync_slave_sql_with_master.inc +CREATE TABLE t5(c1 INT, c2 VARCHAR(20), KEY(c2)); +INSERT INTO t5 VALUES (1,"value1"),(2,"value2"),(3,"value1"),(4,NULL),(5,"value2"),(6,"value3"); +DELETE FROM t5 ORDER BY c1; +DROP TABLE t5; +include/sync_slave_sql_with_master.inc +CREATE TABLE t5(c1 INT, c2 INT, c3 VARCHAR(20), KEY(c2,c3)); +INSERT INTO t5 VALUES (1,1,"ab"),(2,2,"cde"),(3,1,"12345"),(4,4,"random"),(5,NULL,NULL),(6,5,NULL),(7,NULL,"lmnopqr"); +DELETE FROM t5 ORDER BY c1; +DROP TABLE t5; +include/sync_slave_sql_with_master.inc SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms; DROP TABLE IF EXISTS t1, t2, t3, t4; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_idempotency.result index 86a34691..b138a6b1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_idempotency.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_idempotency.result @@ -18,6 +18,7 @@ engine = innodb; set foreign_key_checks=1 /* ensure the check */; insert into ti1 values (1),(2),(3); insert into ti2 set a=2, b=2; +include/sync_slave_sql_with_master.inc select * from ti1 order by b /* must be (1),(2),(3) */; b 1 @@ -35,6 +36,7 @@ select * from ti1 order by b /* must be (2),(3) */; b 2 3 +include/sync_slave_sql_with_master.inc select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; b 1 @@ -42,6 +44,7 @@ b 3 delete from ti1 where b=3; insert into ti2 set a=3, b=3; +include/sync_slave_sql_with_master.inc select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; a b 1 1 @@ -62,6 +65,7 @@ engine = innodb; set foreign_key_checks=1 /* ensure the check */; insert into ti1 values (1),(2),(3); insert into ti2 set a=2, b=2; +include/sync_slave_sql_with_master.inc select * from ti1 order by b /* must be (1),(2),(3) */; b 1 @@ -92,7 +96,9 @@ delete from ti2 where b=1; set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; +include/sync_slave_sql_with_master.inc *** conspire the following insert failure *** conspire future problem delete from ti1 where b=3; @@ -109,7 +115,9 @@ insert into ti1 set b=3; set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; +include/sync_slave_sql_with_master.inc select * from ti2 order by b /* must be (2,2),(3,3) */; a b 2 2 @@ -127,11 +135,13 @@ delete from ti1 where b=1; set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (-1),(-2),(-3); INSERT INTO t2 VALUES (-1),(-2),(-3); +include/sync_slave_sql_with_master.inc DELETE FROM t1 WHERE a = -2; DELETE FROM t2 WHERE a = -2; DELETE FROM t1 WHERE a = -2; @@ -141,6 +151,7 @@ Last_SQL_Error 1032 set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; DELETE FROM t2 WHERE a = -2; *** slave must stop (Key was not found) @@ -149,6 +160,7 @@ Last_SQL_Error 1032 set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; UPDATE t1 SET a = 1 WHERE a = -1; UPDATE t2 SET a = 1 WHERE a = -1; @@ -159,6 +171,7 @@ Last_SQL_Error 1032 set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; UPDATE t2 SET a = 1 WHERE a = -1; *** slave must stop (Key was not found) @@ -167,8 +180,10 @@ Last_SQL_Error 1032 set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc SET @@global.slave_exec_mode= @old_slave_exec_mode; drop table t1,t2,ti2,ti1; +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= @old_slave_exec_mode; include/rpl_reset.inc SET GLOBAL slave_rows_search_algorithms= 'INDEX_SCAN,HASH_SCAN'; @@ -180,6 +195,7 @@ engine = innodb; set foreign_key_checks=1 /* ensure the check */; insert into ti1 values (1),(2),(3); insert into ti2 set a=2, b=2; +include/sync_slave_sql_with_master.inc select * from ti1 order by b /* must be (1),(2),(3) */; b 1 @@ -197,6 +213,7 @@ select * from ti1 order by b /* must be (2),(3) */; b 2 3 +include/sync_slave_sql_with_master.inc select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; b 1 @@ -204,6 +221,7 @@ b 3 delete from ti1 where b=3; insert into ti2 set a=3, b=3; +include/sync_slave_sql_with_master.inc select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; a b 1 1 @@ -224,6 +242,7 @@ engine = innodb; set foreign_key_checks=1 /* ensure the check */; insert into ti1 values (1),(2),(3); insert into ti2 set a=2, b=2; +include/sync_slave_sql_with_master.inc select * from ti1 order by b /* must be (1),(2),(3) */; b 1 @@ -254,7 +273,9 @@ delete from ti2 where b=1; set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; +include/sync_slave_sql_with_master.inc *** conspire the following insert failure *** conspire future problem delete from ti1 where b=3; @@ -271,7 +292,9 @@ insert into ti1 set b=3; set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; +include/sync_slave_sql_with_master.inc select * from ti2 order by b /* must be (2,2),(3,3) */; a b 2 2 @@ -289,11 +312,13 @@ delete from ti1 where b=1; set foreign_key_checks= 1; set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (-1),(-2),(-3); INSERT INTO t2 VALUES (-1),(-2),(-3); +include/sync_slave_sql_with_master.inc DELETE FROM t1 WHERE a = -2; DELETE FROM t2 WHERE a = -2; DELETE FROM t1 WHERE a = -2; @@ -303,6 +328,7 @@ Last_SQL_Error 1032 set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; DELETE FROM t2 WHERE a = -2; *** slave must stop (Key was not found) @@ -311,6 +337,7 @@ Last_SQL_Error 1032 set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; UPDATE t1 SET a = 1 WHERE a = -1; UPDATE t2 SET a = 1 WHERE a = -1; @@ -321,6 +348,7 @@ Last_SQL_Error 1032 set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc set global slave_exec_mode='STRICT'; UPDATE t2 SET a = 1 WHERE a = -1; *** slave must stop (Key was not found) @@ -329,8 +357,10 @@ Last_SQL_Error 1032 set global slave_exec_mode='IDEMPOTENT'; start slave sql_thread; +include/sync_slave_sql_with_master.inc SET @@global.slave_exec_mode= @old_slave_exec_mode; drop table t1,t2,ti2,ti1; +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= @old_slave_exec_mode; set @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms; *** end of tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_ignorable_event.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_ignorable_event.result index 841e3c8d..ba9147cf 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_ignorable_event.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_ignorable_event.result @@ -909,6 +909,7 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t7` /* generated by server */ include/start_slave.inc +include/sync_slave_sql_with_master.inc # Test The Rows_query log event can be relayed. # SHOW BINLOG EVENTS ON SLAVE include/show_binlog_events.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_img_misc.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_img_misc.result index a809eb34..20decd41 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_img_misc.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_img_misc.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] CREATE TABLE t0 ( col1 INT NOT NULL, col2 INT ) ENGINE=InnoDB; INSERT INTO t0 (col1,col2) VALUES (4,7),(4,8); +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (col3 DECIMAL(35,0) DEFAULT NULL, col1 INT NOT NULL, col2 INT NOT NULL DEFAULT '0', @@ -12,6 +13,7 @@ PRIMARY KEY (col1)) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; SET SESSION BINLOG_ROW_IMAGE = minimal; REPLACE INTO t1 ( col1,col2) SELECT col1,col2 FROM t0; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t0, slave:t0] include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t0, t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_img_sanity.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_img_sanity.result index cfe96f03..00ee2d00 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_img_sanity.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_img_sanity.result @@ -36,6 +36,7 @@ INSERT INTO t(c1,c3) VALUES (1, 'a'); UPDATE t SET c1=2 WHERE c1=1;; DELETE FROM t;; DROP TABLE t; +include/sync_slave_sql_with_master.inc SET @img_types= 'MINIMAL NOBLOB FULL'; CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N' Variable_name Value @@ -49,6 +50,7 @@ ITERATIONS: row_img: MINIMAL, indexes: UK-NOT-NULL include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'UK-NOT-NULL' CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -61,10 +63,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: MINIMAL, indexes: PK include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'PK' CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -77,10 +81,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: MINIMAL, indexes: UK include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'UK' CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -93,10 +99,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: MINIMAL, indexes: K include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'K' CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -109,10 +117,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: MINIMAL, indexes: NONE include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'NONE' CREATE TABLE t (c1 int, c2 int, c3 blob); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -125,6 +135,7 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc CON: 'master', IMG: 'NOBLOB', RESTART SLAVE: 'N' Variable_name Value binlog_row_image NOBLOB @@ -137,6 +148,7 @@ ITERATIONS: row_img: NOBLOB, indexes: UK-NOT-NULL include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'UK-NOT-NULL' CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -149,10 +161,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: NOBLOB, indexes: PK include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'PK' CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -165,10 +179,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: NOBLOB, indexes: UK include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'UK' CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -181,10 +197,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: NOBLOB, indexes: K include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'K' CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -197,10 +215,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: NOBLOB, indexes: NONE include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'NONE' CREATE TABLE t (c1 int, c2 int, c3 blob); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -213,6 +233,7 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc CON: 'master', IMG: 'FULL', RESTART SLAVE: 'N' Variable_name Value binlog_row_image FULL @@ -225,6 +246,7 @@ ITERATIONS: row_img: FULL, indexes: UK-NOT-NULL include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'UK-NOT-NULL' CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -237,10 +259,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: FULL, indexes: PK include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'PK' CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -253,10 +277,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: FULL, indexes: UK include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'UK' CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -269,10 +295,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: FULL, indexes: K include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'K' CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1)); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -285,10 +313,12 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ITERATIONS: row_img: FULL, indexes: NONE include/rpl_reset.inc CREATING TABLE IN master WITH INDEX 'NONE' CREATE TABLE t (c1 int, c2 int, c3 blob); +include/sync_slave_sql_with_master.inc INSERT INTO t VALUES (1,2,"a"); INSERT INTO t(c1,c3) VALUES (10,"a"); INSERT DELAYED INTO t(c1,c3) VALUES (100,"a"); @@ -301,6 +331,7 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc SET @img_types= 'MINIMAL NOBLOB FULL'; CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N' Variable_name Value @@ -312,9 +343,13 @@ Variable_name Value binlog_row_image MINIMAL ITERATIONS: row_img: MINIMAL include/rpl_reset.inc +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc include/rpl_reset.inc ####### MINIMAL PARTICULAR SCENARIO ###### +include/sync_slave_sql_with_master.inc ####### MINIMAL OTHER PARTICULAR SCENARIO ###### +include/sync_slave_sql_with_master.inc CON: 'master', IMG: 'NOBLOB', RESTART SLAVE: 'N' Variable_name Value binlog_row_image NOBLOB @@ -325,8 +360,11 @@ Variable_name Value binlog_row_image NOBLOB ITERATIONS: row_img: NOBLOB include/rpl_reset.inc +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc include/rpl_reset.inc ####### NOBLOB PARTICULAR SCENARIO ###### +include/sync_slave_sql_with_master.inc CON: 'master', IMG: 'FULL', RESTART SLAVE: 'N' Variable_name Value binlog_row_image FULL @@ -337,6 +375,8 @@ Variable_name Value binlog_row_image FULL ITERATIONS: row_img: FULL include/rpl_reset.inc +include/sync_slave_sql_with_master.inc +include/sync_slave_sql_with_master.inc include/rpl_reset.inc ################## SPECIAL CASES ######################### include/rpl_reset.inc @@ -372,6 +412,7 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c1=2 WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ################################### # PK (does not contain blob, but blob is updated) ################################### @@ -389,6 +430,7 @@ Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future rele UPDATE t SET c3='b' WHERE c1=1; DELETE FROM t WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ################################### # AUTOINC columns ################################### @@ -412,6 +454,7 @@ binlog_row_image MINIMAL CREATE TABLE t (c1 int NOT NULL AUTO_INCREMENT, c2 int, c3 blob, primary key(c1,c2)); INSERT INTO t(c2) VALUES (2); DROP TABLE t; +include/sync_slave_sql_with_master.inc ################################################################## # Test that slave does not write more columns than the ones it has ################################################################## @@ -439,6 +482,7 @@ CREATE TABLE t (c1 int, c2 int, primary key(c1)); INSERT INTO t(c2,c3) VALUES (2,'aaaaa'); UPDATE t SET c2=3, c3='bbbbb' WHERE c2=2; DROP TABLE t; +include/sync_slave_sql_with_master.inc ################################################################## # Test that slave fills default columns in its own columns ################################################################## @@ -474,6 +518,7 @@ c1 c2 1 NULL 2 NULL DROP TABLE t; +include/sync_slave_sql_with_master.inc ################################################################## # Test that slave uses partial BI when master contains more columns ################################################################## @@ -507,6 +552,7 @@ SELECT * FROM t; c1 c2 c3 1 4 3 DROP TABLE t; +include/sync_slave_sql_with_master.inc ################################################################## # Test that if master has binlog_row_image=MINIMAL and slave has # NOBLOB or FULL, it will log the expected columns @@ -536,6 +582,7 @@ INSERT INTO t VALUES (1, 2, 3); UPDATE t SET c2= 4 WHERE c1=1; DELETE FROM t WHERE c2=4; DROP TABLE t; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N' SET SESSION binlog_row_image= 'MINIMAL'; @@ -561,6 +608,7 @@ INSERT INTO t VALUES (1, 2, 3); UPDATE t SET c2= 4 WHERE c1=1; DELETE FROM t WHERE c2=4; DROP TABLE t; +include/sync_slave_sql_with_master.inc ################################################################ # Test that the slave stop with error if no usable data is on BI ################################################################ diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result index 9ed8da74..ce727f4f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result @@ -630,8 +630,10 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db ################################################################################### # CHECK CONSISTENCY ################################################################################### +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:tt_1,slave:tt_1] ################################################################################### # CLEAN ################################################################################### +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result index 4beb1d06..30914273 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result @@ -7,6 +7,7 @@ Note #### Storing MySQL user name or password information in the master info rep [on master] CREATE TABLE t1 (a INT); [on slave] +include/sync_slave_sql_with_master.inc DROP TABLE t1; ==== Modify table on master ==== [on master] diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result index 7d36f8a1..19dbcc4a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result @@ -13,6 +13,7 @@ FLUSH TABLE t1; SELECT COUNT(*) FROM t1; COUNT(*) 5000 +include/sync_slave_sql_with_master.inc use mysqlslap; SELECT COUNT(*) FROM t1; COUNT(*) @@ -30,6 +31,7 @@ select * from t1; id name 10 my name 20 James Bond +include/sync_slave_sql_with_master.inc select * from t1; id name 10 my name @@ -43,12 +45,14 @@ select * from t1; id name 10 my name 20 is Bond +include/sync_slave_sql_with_master.inc select * from t1; id name 10 my name 20 is Bond USE test; DROP SCHEMA mysqlslap; +include/sync_slave_sql_with_master.inc use test; CREATE TABLE t1(a int, UNIQUE(a)); INSERT DELAYED IGNORE INTO t1 VALUES(1); @@ -61,10 +65,12 @@ flush table t1; select * from t1; a 1 +include/sync_slave_sql_with_master.inc On slave select * from t1; a 1 drop table t1; +include/sync_slave_sql_with_master.inc End of 5.0 tests include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_log.result index 6b8cb4cf..9534a1de 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_log.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_log.result @@ -3,6 +3,7 @@ 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] +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/wait_for_slave_to_stop.inc reset master; @@ -112,6 +113,7 @@ Aberdeen Abernathy aberrant aberration +include/sync_slave_sql_with_master.inc select * from t1 order by 1 asc; word Aarhus @@ -214,6 +216,7 @@ show binary logs; Log_name File_size master-bin.000001 # master-bin.000002 # +include/sync_slave_sql_with_master.inc show binary logs; Log_name File_size slave-bin.000001 # @@ -268,4 +271,5 @@ a b 5 1 6 1 drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_log_innodb.result index 31cc7dff..0412fbda 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_log_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_log_innodb.result @@ -3,6 +3,7 @@ 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] +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/wait_for_slave_to_stop.inc reset master; @@ -112,6 +113,7 @@ Aberdeen Abernathy aberrant aberration +include/sync_slave_sql_with_master.inc select * from t1 order by 1 asc; word Aarhus @@ -214,6 +216,7 @@ show binary logs; Log_name File_size master-bin.000001 # master-bin.000002 # +include/sync_slave_sql_with_master.inc show binary logs; Log_name File_size slave-bin.000001 # @@ -268,4 +271,5 @@ a b 5 1 6 1 drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result index dbe5d1f3..95e5a7ea 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result @@ -56,12 +56,14 @@ reset slave; start slave; flush logs; create table t1 (a int); +include/sync_slave_sql_with_master.inc include/check_slave_is_running.inc # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # flush logs; drop table t1; +include/sync_slave_sql_with_master.inc include/check_slave_is_running.inc flush logs; show master status; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_merge_engine.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_merge_engine.result index 643dfccc..325bfd48 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_merge_engine.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_merge_engine.result @@ -9,11 +9,14 @@ 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); +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] UPDATE t1_merge SET a=10 WHERE a=1; DELETE FROM t1_merge WHERE a=10; +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] DROP TABLE t1_merge, t1, t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result index 0b3f690f..a2ac87da 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_crash_safe.result @@ -473,69 +473,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -586,69 +529,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -718,69 +604,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -812,69 +641,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -925,69 +697,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1057,69 +772,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1170,69 +828,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1321,69 +922,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1510,69 +1054,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1623,69 +1110,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1774,69 +1204,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1963,69 +1336,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2095,69 +1411,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2284,69 +1543,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2530,69 +1732,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2662,69 +1807,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2851,69 +1939,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3097,69 +2128,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3210,69 +2184,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3342,69 +2259,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3455,69 +2315,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3587,69 +2390,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3700,69 +2446,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3832,69 +2521,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3983,69 +2615,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4172,69 +2747,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4323,69 +2841,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4512,69 +2973,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4663,69 +3067,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4852,69 +3199,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5041,69 +3331,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5287,69 +3520,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5476,69 +3652,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5722,69 +3841,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5911,69 +3973,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6157,69 +4162,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6289,69 +4237,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6421,69 +4312,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6553,69 +4387,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6685,69 +4462,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6874,69 +4594,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7063,69 +4726,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7252,69 +4858,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7441,69 +4990,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7687,69 +5179,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7933,69 +5368,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8179,69 +5557,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8425,69 +5746,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8498,6 +5762,7 @@ SET @@global.slave_checkpoint_period= 3; # CHECK CONSISTENCY ######################################################################## include/start_slave.inc +include/sync_slave_sql_with_master.inc ######################################################################## # CLEAN UP ######################################################################## diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_rec_crash_safe.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_rec_crash_safe.result index 0b3f690f..a2ac87da 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_rec_crash_safe.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_rec_crash_safe.result @@ -473,69 +473,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -586,69 +529,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -718,69 +604,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -812,69 +641,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -925,69 +697,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1057,69 +772,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1170,69 +828,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1321,69 +922,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1510,69 +1054,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1623,69 +1110,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1774,69 +1204,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1963,69 +1336,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2095,69 +1411,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2284,69 +1543,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2530,69 +1732,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2662,69 +1807,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2851,69 +1939,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3097,69 +2128,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3210,69 +2184,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3342,69 +2259,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3455,69 +2315,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3587,69 +2390,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3700,69 +2446,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3832,69 +2521,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3983,69 +2615,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4172,69 +2747,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4323,69 +2841,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4512,69 +2973,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4663,69 +3067,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4852,69 +3199,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5041,69 +3331,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5287,69 +3520,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5476,69 +3652,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5722,69 +3841,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5911,69 +3973,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6157,69 +4162,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6289,69 +4237,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6421,69 +4312,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6553,69 +4387,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6685,69 +4462,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6874,69 +4594,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7063,69 +4726,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7252,69 +4858,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7441,69 +4990,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7687,69 +5179,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7933,69 +5368,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8179,69 +5557,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8425,69 +5746,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8498,6 +5762,7 @@ SET @@global.slave_checkpoint_period= 3; # CHECK CONSISTENCY ######################################################################## include/start_slave.inc +include/sync_slave_sql_with_master.inc ######################################################################## # CLEAN UP ######################################################################## diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_show_relaylog_events.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_show_relaylog_events.result index 3512c0b7..180c80f3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_show_relaylog_events.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_mts_show_relaylog_events.result @@ -50,6 +50,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 +include/sync_slave_sql_with_master.inc ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -154,6 +155,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 # Rotate # # master-bin.000002;pos=POS +include/sync_slave_sql_with_master.inc ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result index a68334b8..fbf9e447 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result @@ -9,8 +9,10 @@ CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); UPDATE t1 SET c5 = 'a'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit ## (1 column less and no varchar) include/rpl_reset.inc @@ -18,14 +20,18 @@ CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); UPDATE t1 SET c5 = 'a'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc ## case #2 - X bit is wrongly set. include/rpl_reset.inc CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=InnoDB DEFAULT CHARSET= latin1; INSERT INTO t1(c1) VALUES (10); INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result index 6749e388..3c41fccb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result @@ -10,16 +10,20 @@ CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARS INSERT INTO t1(c1,c2) VALUES (10, b'1'); INSERT INTO t1(c1,c2) VALUES (NULL, b'1'); UPDATE t1 SET c1= 0; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc ## case #1 - last_null_bit_pos==0 in record_compare without X bit include/rpl_reset.inc CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); UPDATE t1 SET c5 = 'a'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit ## (1 column less and no varchar) include/rpl_reset.inc @@ -27,14 +31,18 @@ CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 ); INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 ); UPDATE t1 SET c5 = 'a'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc ## case #2 - X bit is wrongly set. include/rpl_reset.inc CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=MyISAM DEFAULT CHARSET= latin1; INSERT INTO t1(c1) VALUES (10); INSERT INTO t1(c1) VALUES (NULL); UPDATE t1 SET c1= 0; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result index 174bb127..db995fbb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result @@ -7,6 +7,7 @@ CREATE TABLE t1 ( i1 int, c1 char(1), key ( i1 )); INSERT IGNORE INTO t1 VALUES (1, 'a'); UPDATE t1 SET c1 = 'b' WHERE i1 = 1; DROP TABLE t1; +include/sync_slave_sql_with_master.inc CREATE TABLE table1_myisam ( `bit_key` bit, `int_key` int, key (`bit_key` ), key (`int_key` )); INSERT IGNORE INTO table1_myisam VALUES ('1', '-2146992385'); UPDATE `table1_myisam` SET `bit_key` = 0 WHERE `bit_key` = 1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result index d1f48126..312c5e56 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result @@ -50,6 +50,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 +include/sync_slave_sql_with_master.inc ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -154,6 +155,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 # Rotate # # master-bin.000002;pos=POS +include/sync_slave_sql_with_master.inc ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp001.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp001.result index ffb9d28e..7816b411 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp001.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp001.result @@ -33,6 +33,7 @@ a t 2 NEW 3 NEW 4 NEW +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; a t 1 NEW @@ -46,6 +47,7 @@ a t 2 Tex 3 Tex 4 Tex +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; a t 1 Tex @@ -59,6 +61,7 @@ a t 2 SQL 3 SQL 4 SQL +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; a t 1 SQL @@ -72,6 +75,7 @@ a t 2 NONE 3 NONE 4 NONE +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; a t 1 NONE @@ -82,4 +86,5 @@ DROP PROCEDURE test.p1; DROP PROCEDURE test.p2; DROP TABLE test.t1; DROP TABLE test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result index 6555f4d0..5c7707c5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result @@ -46,6 +46,7 @@ a f < -- test 1 select slave after p1 -- > -------------------------------------- +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; a t 1 texas @@ -79,6 +80,7 @@ a f < -- test 1 select slave after p2 -- > -------------------------------------- +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; a t 4 to @@ -137,6 +139,7 @@ a f < -- test 2 select Slave after p1 -- > -------------------------------------- +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; a t 1 texas @@ -178,6 +181,7 @@ a f < -- test 1 select Slave after p2 -- > -------------------------------------- +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; a t 1 texas @@ -212,6 +216,7 @@ START TRANSACTION; ROLLBACK; select * from test.t3; a t +include/sync_slave_sql_with_master.inc select * from test.t3; a t START TRANSACTION; @@ -219,6 +224,7 @@ COMMIT; select * from test.t3; a t 98 NONE +include/sync_slave_sql_with_master.inc select * from test.t3; a t 98 NONE diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp003.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp003.result index ad5c975b..1df429b6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp003.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp003.result @@ -33,6 +33,7 @@ release_lock("test") SELECT * FROM test.t1; a 5 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; a 5 @@ -48,10 +49,12 @@ release_lock("test") SELECT * FROM test.t1; a 8 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; a 8 DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp005.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp005.result index bdd27d7a..7e539b4e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp005.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp005.result @@ -60,6 +60,7 @@ id2 < ---- Slave selects-- > ------------------------ +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY id; id data 8 MySQL @@ -85,6 +86,7 @@ id3 c < ---- Slave selects-- > ------------------------ +include/sync_slave_sql_with_master.inc SELECT * FROM test.t3 ORDER BY id3; id3 c 1 MySQL @@ -97,4 +99,5 @@ DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result index 2154dc59..5860aa2a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result @@ -36,9 +36,12 @@ BEGIN INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1'); END| CALL p2(); +include/sync_slave_sql_with_master.inc CALL p1(); +include/sync_slave_sql_with_master.inc DROP TABLE t1; DROP TABLE t2; DROP PROCEDURE p1; DROP PROCEDURE p2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result index 5c08baa5..d6d61415 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result @@ -25,6 +25,7 @@ num < ---- Slave selects-- > ------------------------ +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; num 12 @@ -38,6 +39,7 @@ num < ---- Slave selects-- > ------------------------ +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; num 13 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp008.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp008.result index 342dbbe1..a853e304 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp008.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp008.result @@ -25,10 +25,12 @@ a < ---- Slave selects-- > ------------------------ +include/sync_slave_sql_with_master.inc SELECT * FROM test.t2; a 2 DROP PROCEDURE IF EXISTS test.p1; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp009.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp009.result index f24942f5..08dcf94a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp009.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp009.result @@ -52,6 +52,7 @@ SELECT * FROM test.t2 ORDER BY a; a 1 3 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t2 ORDER BY a; a 1 @@ -62,6 +63,7 @@ select * from test.t2 ORDER BY a; a 2 4 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t2 ORDER BY a; a 2 @@ -69,9 +71,11 @@ a truncate test.t2; SELECT * FROM test.t2 ORDER BY a; a +include/sync_slave_sql_with_master.inc SELECT * FROM test.t2 ORDER BY a; a DROP PROCEDURE test.p1; DROP TABLE test.t1; DROP TABLE test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp010.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp010.result index d76b05df..4e3de693 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp010.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp010.result @@ -25,6 +25,7 @@ SELECT * FROM test.t1 ORDER BY a; a 1 2 +include/sync_slave_sql_with_master.inc show tables; Tables_in_test CREATE PROCEDURE test.p3() @@ -43,6 +44,7 @@ SELECT * FROM test.t2 ORDER BY a; a 6 7 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t2 ORDER BY a; a 6 @@ -53,4 +55,5 @@ DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p4; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp011.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp011.result index c1176785..d275e229 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp011.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp011.result @@ -57,6 +57,7 @@ ALTER TABLE test.t2 DROP COLUMN to_drop; INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND()); END| CALL test.p1(); +include/sync_slave_sql_with_master.inc DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; @@ -66,4 +67,5 @@ DROP PROCEDURE IF EXISTS test.p6; DROP PROCEDURE IF EXISTS test.p7; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp012.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp012.result index 04151d62..024b5524 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp012.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_sp012.result @@ -20,6 +20,7 @@ CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1(); GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost; +include/sync_slave_sql_with_master.inc <******** Master user1 p3 & p2 calls *******> ---------------------------------------------- @@ -56,4 +57,5 @@ DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP USER user1@localhost; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result index bf630941..2be754c8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result @@ -157,9 +157,11 @@ PRIMARY KEY (`c1`) LOCK TABLES `t1` WRITE; INSERT INTO `t1`(c2) VALUES ('1'); FLUSH LOGS; +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match include/diff_tables.inc [master:t1, slave:t1] DROP TABLE `t1`; +include/sync_slave_sql_with_master.inc === Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail. include/rpl_reset.inc ### action: generating several tables with different metadata @@ -174,27 +176,38 @@ include/rpl_reset.inc ### testing table with 256 field metadata size. ### testing table with 257 field metadata size. ### testing table with 258 field metadata size. +include/sync_slave_sql_with_master.inc FLUSH LOGS; ### assertion: the slave replicated event successfully and tables match for t10 include/diff_tables.inc [master:t10, slave:t10] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t9 include/diff_tables.inc [master:t9, slave:t9] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t8 include/diff_tables.inc [master:t8, slave:t8] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t7 include/diff_tables.inc [master:t7, slave:t7] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t6 include/diff_tables.inc [master:t6, slave:t6] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t5 include/diff_tables.inc [master:t5, slave:t5] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t4 include/diff_tables.inc [master:t4, slave:t4] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t3 include/diff_tables.inc [master:t3, slave:t3] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t2 include/diff_tables.inc [master:t2, slave:t2] +include/sync_slave_sql_with_master.inc ### assertion: the slave replicated event successfully and tables match for t1 include/diff_tables.inc [master:t1, slave:t1] +include/sync_slave_sql_with_master.inc ### assertion: check that binlog is not corrupt. Using mysqlbinlog to ### detect failure. Before the patch mysqlbinlog would find ### a corrupted event, thence would fail. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig001.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig001.result index 2ed09e27..9e2b5850 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig001.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig001.result @@ -17,7 +17,9 @@ CREATE PROCEDURE test.p2() BEGIN INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW()); END// +include/sync_slave_sql_with_master.inc INSERT INTO test.t1 VALUES (1+1, NOW()); +include/sync_slave_sql_with_master.inc <End test section 2 (Tiggers & SP)> ----------------------------------- @@ -28,4 +30,5 @@ DROP TRIGGER test.t3_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig002.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig002.result index cc735962..20a74409 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig002.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig002.result @@ -19,6 +19,7 @@ id domain 3 earthmotherwear.com 4 yahoo.com 5 example.com +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY id; id domain 1 example.com @@ -36,6 +37,7 @@ select * from test.t3; value domain_id mailaccount_id program keey No 5 NULL spamfilter scan_incoming Yes 1 NULL spamfilter scan_incoming +include/sync_slave_sql_with_master.inc select * from test.t2; value domain_id mailaccount_id program keey Yes 1 NULL spamfilter scan_incoming @@ -56,6 +58,7 @@ id domain 3 earthmotherwear.com 4 yahoo.com 5 example.com +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY id; id domain 2 mysql.com @@ -66,4 +69,5 @@ DROP TRIGGER test.t2_ai; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig003.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig003.result index a605ad81..9f418558 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig003.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig003.result @@ -71,6 +71,7 @@ UPDATE test.t2 SET b1 = 0 WHERE b1 = 1; INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW()); DELETE FROM test.t1 WHERE id = 1; DELETE FROM test.t2 WHERE id = 1; +include/sync_slave_sql_with_master.inc DROP TRIGGER test.t1_bi; DROP TRIGGER test.t2_ai; DROP TRIGGER test.t1_bu; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig004.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig004.result index 2863f158..c9db6caf 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig004.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trig004.result @@ -18,6 +18,7 @@ n d select * from test.t2; n f 1 0 +include/sync_slave_sql_with_master.inc select * from test.t1; n d 1 1.234 @@ -27,4 +28,5 @@ n f DROP TRIGGER test.t1_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result index 65f5babc..3b07f0c4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] CREATE TEMPORARY TABLE t1(c1 INTEGER); CREATE TABLE t2(c1 INTEGER); +include/sync_slave_sql_with_master.inc CREATE TABLE t1(c1 INTEGER); INSERT INTO t1 VALUES(1), (2); INSERT INTO t2 VALUES(1), (2); @@ -18,6 +19,7 @@ c1 2 TRUNCATE t1; TRUNCATE t2; +include/sync_slave_sql_with_master.inc SELECT * FROM t1; c1 1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result index 25144c87..4bcf0a32 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result @@ -14,9 +14,11 @@ SELECT b FROM t2 ORDER BY a; b 1 3 +include/sync_slave_sql_with_master.inc SELECT b FROM t2 ORDER BY a; b 1 3 DROP TABLE t1, t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_until.result index a3c9a5a2..0216ae91 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_until.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_until.result @@ -10,6 +10,7 @@ CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); INSERT INTO t2 VALUES (1),(2); INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; +include/sync_slave_sql_with_master.inc include/stop_slave.inc RESET SLAVE; Warnings: @@ -35,6 +36,7 @@ n include/check_slave_param.inc [Exec_Master_Log_Pos] START SLAVE; include/wait_for_slave_to_start.inc +include/sync_slave_sql_with_master.inc include/stop_slave.inc START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2 include/wait_for_slave_param.inc [Until_Log_Pos] @@ -57,6 +59,7 @@ include/start_slave.inc include/rpl_reset.inc CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); +include/sync_slave_sql_with_master.inc include/stop_slave_sql.inc INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (3); @@ -65,4 +68,5 @@ include/wait_for_slave_sql_to_stop.inc include/assert.inc [table t1 should have two rows.] include/start_slave.inc DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_utf16.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_utf16.result index aa8903fb..c5d204cc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_utf16.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_utf16.result @@ -12,6 +12,7 @@ c1 abc hex(c1) 006100620063 c1 ola hex(c1) 006F006C0061 +include/sync_slave_sql_with_master.inc #### ON SLAVE SELECT c1, hex(c1) FROM t1; c1 abc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_utf32.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_utf32.result index 8b07e827..52f5fd78 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_utf32.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_utf32.result @@ -19,6 +19,7 @@ Warning 1071 Specified key was too long; max key length is 1000 bytes SET SQL_LOG_BIN=1; INSERT INTO t1(c1) VALUES ('insert into t1'); DROP TABLE t1; +include/sync_slave_sql_with_master.inc SET GLOBAL SLAVE_TYPE_CONVERSIONS= @saved_slave_type_conversions; include/stop_slave.inc include/start_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_view01.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_view01.result index 85379770..5b924cde 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_view01.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_view01.result @@ -36,6 +36,7 @@ a c c2 2 it is 3 Friday TGIF CREATE TABLE mysqltest1.t10 (a INT, PRIMARY KEY(a)); +include/sync_slave_sql_with_master.inc SELECT * FROM mysqltest1.v2; qty price value 3 50 150 @@ -58,6 +59,7 @@ a c c2 1 Thank GOD 2 it is 3 Friday TGIF +include/sync_slave_sql_with_master.inc SELECT * FROM mysqltest1.t5 ORDER BY qty; qty price total 3 50 150 @@ -80,6 +82,7 @@ a c 2 it 3 Friday 4 TEST +include/sync_slave_sql_with_master.inc SELECT * FROM mysqltest1.t1 ORDER BY a; a c 1 Thank @@ -101,4 +104,5 @@ DROP TABLE IF EXISTS mysqltest1.t2; DROP TABLE IF EXISTS mysqltest1.t4; DROP TABLE IF EXISTS mysqltest1.t10; DROP DATABASE mysqltest1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_wide_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_wide_table.result index d03e2f1a..99559c7c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_wide_table.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_wide_table.result @@ -307,6 +307,7 @@ f299 int, f300 int, primary key (f1)); insert into t300 set f1= 1; +include/sync_slave_sql_with_master.inc select f300 from t300; f300 NULL @@ -315,4 +316,5 @@ one 1 *** Cleanup *** DROP TABLE t300; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sbm_previous_gtid_event.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sbm_previous_gtid_event.result new file mode 100644 index 00000000..3173f1fd --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sbm_previous_gtid_event.result @@ -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] +SET @save_global_debug=@@GLOBAL.DEBUG; +SET @@GLOBAL.DEBUG= '+d,dbug.calculate_sbm_after_previous_gtid_log_event'; +SET @saved_slave_transaction_retries=@@global.slave_transaction_retries; +SET @@global.slave_transaction_retries=0; +include/start_slave_io.inc +include/stop_slave_io.inc +include/start_slave_io.inc +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (20); +INSERT INTO t1 VALUES (19); +INSERT INTO t1 VALUES (18); +INSERT INTO t1 VALUES (17); +INSERT INTO t1 VALUES (16); +INSERT INTO t1 VALUES (15); +INSERT INTO t1 VALUES (14); +INSERT INTO t1 VALUES (13); +INSERT INTO t1 VALUES (12); +INSERT INTO t1 VALUES (11); +INSERT INTO t1 VALUES (10); +INSERT INTO t1 VALUES (9); +INSERT INTO t1 VALUES (8); +INSERT INTO t1 VALUES (7); +INSERT INTO t1 VALUES (6); +INSERT INTO t1 VALUES (5); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (2); +DROP TABLE t1; +FLUSH LOGS; +FLUSH LOGS; +include/sync_slave_io_with_master.inc +include/start_slave_sql.inc +SET DEBUG_SYNC="now wait_for signal.reached"; +include/assert.inc [Seconds Behind Master should be less than 180 seconds.] +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +SET DEBUG_SYNC="now wait_for signal.reached"; +include/assert.inc [Seconds Behind Master should be less than 180 seconds.] +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +SET DEBUG_SYNC="now wait_for signal.reached"; +include/assert.inc [Seconds Behind Master should be less than 180 seconds.] +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +SET DEBUG_SYNC="now wait_for signal.reached"; +include/assert.inc [Seconds Behind Master should be less than 180 seconds.] +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +SET DEBUG_SYNC="now wait_for signal.reached"; +include/assert.inc [Seconds Behind Master should be less than 180 seconds.] +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +SET DEBUG_SYNC="now wait_for signal.reached"; +include/assert.inc [Seconds Behind Master should be less than 180 seconds.] +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +SET DEBUG_SYNC="now wait_for signal.reached"; +include/assert.inc [Seconds Behind Master should be less than 180 seconds.] +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +SET @@GLOBAL.DEBUG=@save_global_debug; +SET @@global.slave_transaction_retries=@saved_slave_transaction_retries; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_seconds_behind_master.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_seconds_behind_master.result index d2e7beff..de984779 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_seconds_behind_master.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_seconds_behind_master.result @@ -6,26 +6,31 @@ Note #### Storing MySQL user name or password information in the master info rep SET @old_debug= @@global.debug; call mtr.add_suppression('Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT'); create table t1 (f1 int); +include/sync_slave_sql_with_master.inc include/stop_slave.inc insert into t1 values (1); lock table t1 write; include/start_slave.inc include/assert.inc [Seconds_Behind_Master must be between 'lower_bound' and 'upper_bound'] unlock tables; +include/sync_slave_sql_with_master.inc lock table t1 write; insert into t1 values (2); flush logs; include/assert.inc [Seconds_Behind_Master must be between 'lower_bound' and 'upper_bound'] unlock tables; drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc SET GLOBAL DEBUG= '+d,dec_event_time_by_1_hour'; CREATE TABLE t1 (a INT); +include/sync_slave_sql_with_master.inc include/assert.inc [Seconds_Behind_Master must be 0] LOCK TABLE t1 WRITE; INSERT INTO t1 VALUES (3); include/assert.inc [Seconds_Behind_Master must be greater or equal than 'lower_bound'] UNLOCK TABLES; DROP TABLE t1; +include/sync_slave_sql_with_master.inc SET @@global.debug= @old_debug; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync.result index 4531e624..5f3f67e3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync.result @@ -3,6 +3,7 @@ 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] +include/sync_slave_sql_with_master.inc # # Uninstall semi-sync plugins on master and slave # @@ -103,6 +104,7 @@ Rpl_semi_sync_master_no_tx 0 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 11 +include/sync_slave_sql_with_master.inc [ on slave ] [ slave status after replicated inserts ] show status like 'Rpl_semi_sync_slave_status'; @@ -124,6 +126,7 @@ max(a) [ on master ] SET SESSION AUTOCOMMIT= 0; CREATE TABLE t2(c1 INT) ENGINE=innodb; +include/sync_slave_sql_with_master.inc BEGIN; # Even though it is in a transaction, this statement is binlogged into binlog @@ -136,6 +139,7 @@ INSERT INTO t2 VALUES(22); COMMIT; DROP TABLE t2, t3; SET SESSION AUTOCOMMIT= 1; +include/sync_slave_sql_with_master.inc # # Test semi-sync master will switch OFF after one transaction # timeout waiting for slave reply. @@ -218,6 +222,7 @@ Rpl_semi_sync_master_clients 1 # Test disable/enable master semi-sync on the fly. # drop table t1; +include/sync_slave_sql_with_master.inc [ on slave ] include/stop_slave.inc # @@ -269,6 +274,7 @@ include/start_slave.inc [ on master ] create table t1 (a int) engine = ENGINE_TYPE; drop table t1; +include/sync_slave_sql_with_master.inc show status like 'Rpl_relay%'; Variable_name Value [ test reset master ] @@ -292,6 +298,7 @@ include/start_slave.inc create table t1 (a int) engine = ENGINE_TYPE; insert into t1 values (1); insert into t1 values (2), (3); +include/sync_slave_sql_with_master.inc [ on slave ] select * from t1; a @@ -360,6 +367,7 @@ Rpl_semi_sync_master_yes_tx 2 # # Test semi-sync slave connect to non-semi-sync master # +include/sync_slave_sql_with_master.inc [ on slave ] include/stop_slave.inc SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; @@ -388,12 +396,14 @@ Rpl_semi_sync_master_clients 1 show status like 'Rpl_semi_sync_master_status'; Variable_name Value Rpl_semi_sync_master_status OFF +include/sync_slave_sql_with_master.inc [ on slave ] show status like 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status ON include/stop_slave.inc [ on master ] +include/stop_dump_threads.inc UNINSTALL PLUGIN rpl_semi_sync_master; SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled'; Variable_name Value @@ -404,6 +414,7 @@ rpl_semi_sync_slave_enabled ON include/start_slave.inc [ on master ] insert into t1 values (10); +include/sync_slave_sql_with_master.inc [ on slave ] SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value @@ -444,15 +455,15 @@ Rpl_semi_sync_slave_status OFF # # Clean up # +include/uninstall_semisync.inc include/stop_slave.inc -UNINSTALL PLUGIN rpl_semi_sync_slave; -UNINSTALL PLUGIN rpl_semi_sync_master; change master to master_user='root',master_password=''; 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. include/start_slave.inc drop table t1; +include/sync_slave_sql_with_master.inc drop user rpl@127.0.0.1; flush privileges; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_deadlock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_deadlock.result index 0bd134f4..f8b24b47 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_deadlock.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_deadlock.result @@ -6,8 +6,9 @@ Note #### Storing MySQL user name or password information in the master info rep include/install_semisync.inc SET @debug_save= @@GLOBAL.DEBUG; SET GLOBAL rpl_semi_sync_master_timeout= 600000; +include/sync_slave_sql_with_master.inc SET GLOBAL debug= 'd,semi_sync_3-way_deadlock'; -SET DEBUG_SYNC= "before_process_commit_stage_queue WAIT_FOR signal.rotate_finished"; +SET DEBUG_SYNC= "before_process_commit_stage_queue WAIT_FOR signal.rotate_finished no_clear_event"; # Build 10 connections to master server # Execute INSERT statement on these 10 connections in parallel SET DEBUG_SYNC= "before_rotate_binlog SIGNAL signal.rotate_finished"; @@ -15,5 +16,6 @@ SET DEBUG_SYNC= "before_rotate_binlog SIGNAL signal.rotate_finished"; FLUSH LOGS; SET DEBUG_SYNC= 'RESET'; SET @@GLOBAL.DEBUG= @debug_save; +include/sync_slave_sql_with_master.inc include/uninstall_semisync.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_event.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_event.result index c2f319e2..b5b70aa8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_event.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_event.result @@ -43,4 +43,5 @@ include/start_slave.inc DROP EVENT ev1; DROP EVENT ev2; DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_future_logpos.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_future_logpos.result new file mode 100644 index 00000000..f00311e7 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_future_logpos.result @@ -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] +include/install_semisync.inc +call mtr.add_suppression("Timeout waiting for reply of binlog*"); +call mtr.add_suppression("Read semi-sync reply network error"); +[connection master] +CREATE TABLE t1 (a INT); +include/sync_slave_sql_with_master.inc +include/stop_slave.inc +[connection master] +INSERT INTO t1 VALUES(0); +[connection master1] +[connection slave] +CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000002', MASTER_LOG_POS=4, MASTER_AUTO_POSITION=0; +START SLAVE; +include/wait_for_slave_io_error.inc [errno=1236] +[connection master] +INSERT INTO t1 VALUES (20); +[connection master] +include/assert.inc [semi sync master clients should be 0.] +[connection slave] +include/stop_slave.inc +CHANGE MASTER TO MASTER_LOG_FILE=FILE, MASTER_LOG_POS= POS, MASTER_AUTO_POSITION=0; +include/start_slave.inc +[connection master] +DROP TABLE t1; +include/sync_slave_sql_with_master.inc +include/uninstall_semisync.inc +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_group_commit_deadlock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_group_commit_deadlock.result index 1df96077..15a10231 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_group_commit_deadlock.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_group_commit_deadlock.result @@ -10,12 +10,14 @@ SET GLOBAL rpl_semi_sync_master_timeout= 600000; # Disable diff_table test # Test tables with MyISAM 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 # Enable diff_table test # Test tables with InnoDB engine when enableing 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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_non_group_commit_deadlock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_non_group_commit_deadlock.result index 92929aeb..ec321e77 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_non_group_commit_deadlock.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_non_group_commit_deadlock.result @@ -11,12 +11,14 @@ SET GLOBAL rpl_semi_sync_master_timeout= 600000; # Disable diff_table test # Test tables with MyISAM 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 # Enable diff_table test # Test tables with InnoDB engine when enableing 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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_shutdown_hang.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_shutdown_hang.result new file mode 100644 index 00000000..9cc81553 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_shutdown_hang.result @@ -0,0 +1,24 @@ +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] +include/install_semisync.inc +call mtr.add_suppression("Read semi-sync reply network error"); +call mtr.add_suppression("SEMISYNC: Forced shutdown. Some updates might not be replicated."); +[connection master] +SET GLOBAL rpl_semi_sync_master_timeout = 10000000; +[connection slave] +include/stop_slave_io.inc +[connection master] +CREATE TABLE t(f INT) ENGINE=INNODB;; +[connection master1] +[connection master] +include/rpl_start_server.inc [server_number=1] +[connection slave] +include/start_slave_io.inc +[connection master] +DROP TABLE t; +include/sync_slave_sql_with_master.inc +include/uninstall_semisync.inc +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result new file mode 100644 index 00000000..6051a951 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result @@ -0,0 +1,39 @@ +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] +INSTALL PLUGIN rpl_semi_sync_master SONAME 'SEMISYNC_MASTER_PLUGIN'; +INSTALL PLUGIN rpl_semi_sync_slave SONAME 'SEMISYNC_SLAVE_PLUGIN'; +UNINSTALL PLUGIN rpl_semi_sync_slave; +UNINSTALL PLUGIN rpl_semi_sync_master; +CREATE TABLE t1(i int); +INSERT INTO t1 values (1); +DROP TABLE t1; +include/install_semisync.inc +call mtr.add_suppression("Plugin 'rpl_semi_sync_slave' cannot be uninstalled now"); +UNINSTALL PLUGIN rpl_semi_sync_slave; +ERROR HY000: Plugin 'rpl_semi_sync_slave' cannot be uninstalled now. Stop any active semisynchronous I/O threads on this slave first. +call mtr.add_suppression("Plugin 'rpl_semi_sync_master' cannot be uninstalled now"); +UNINSTALL PLUGIN rpl_semi_sync_master; +ERROR HY000: Plugin 'rpl_semi_sync_master' cannot be uninstalled now. Stop any active semisynchronous slaves of this master first. +CREATE TABLE t1(i int); +INSERT INTO t1 values (2); +DROP TABLE t1; +include/assert.inc [semi sync slave status should be ON.] +include/assert.inc [semi sync master status should be ON.] +include/assert.inc [semi sync master clients should be 1.] +SET GLOBAL rpl_semi_sync_master_enabled = OFF; +include/assert.inc [semi sync master clients should be 1.] +UNINSTALL PLUGIN rpl_semi_sync_master; +ERROR HY000: Plugin 'rpl_semi_sync_master' cannot be uninstalled now. Stop any active semisynchronous slaves of this master first. +include/stop_slave.inc +SET GLOBAL rpl_semi_sync_slave_enabled = OFF; +include/start_slave.inc +UNINSTALL PLUGIN rpl_semi_sync_slave; +include/assert.inc [semi sync master clients should be 0.] +UNINSTALL PLUGIN rpl_semi_sync_master; +CREATE TABLE t1(i int); +INSERT INTO t1 values (3); +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sequential.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sequential.result index 2de2b0c2..1491d6e0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sequential.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sequential.result @@ -10,6 +10,7 @@ zero call mtr.add_suppression('Slave: Error dropping database'); include/stop_slave.inc start slave; +include/sync_slave_sql_with_master.inc stop slave sql_thread; insert into test0.benchmark set state='slave is processing load'; start slave sql_thread; @@ -20,68 +21,85 @@ select ts from test0.benchmark where state like 'master ends load' into @m_1; select ts from test0.benchmark where state like 'slave takes on load' into @s_0; select ts from test0.benchmark where state like 'slave ends load' into @s_1; select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta.out'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test15.tm_nk, slave:test15.tm_nk] include/diff_tables.inc [master:test15.ti_nk, slave:test15.ti_nk] include/diff_tables.inc [master:test15.tm_wk, slave:test15.tm_wk] include/diff_tables.inc [master:test15.ti_wk, slave:test15.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test14.tm_nk, slave:test14.tm_nk] include/diff_tables.inc [master:test14.ti_nk, slave:test14.ti_nk] include/diff_tables.inc [master:test14.tm_wk, slave:test14.tm_wk] include/diff_tables.inc [master:test14.ti_wk, slave:test14.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test13.tm_nk, slave:test13.tm_nk] include/diff_tables.inc [master:test13.ti_nk, slave:test13.ti_nk] include/diff_tables.inc [master:test13.tm_wk, slave:test13.tm_wk] include/diff_tables.inc [master:test13.ti_wk, slave:test13.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test12.tm_nk, slave:test12.tm_nk] include/diff_tables.inc [master:test12.ti_nk, slave:test12.ti_nk] include/diff_tables.inc [master:test12.tm_wk, slave:test12.tm_wk] include/diff_tables.inc [master:test12.ti_wk, slave:test12.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test11.tm_nk, slave:test11.tm_nk] include/diff_tables.inc [master:test11.ti_nk, slave:test11.ti_nk] include/diff_tables.inc [master:test11.tm_wk, slave:test11.tm_wk] include/diff_tables.inc [master:test11.ti_wk, slave:test11.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test10.tm_nk, slave:test10.tm_nk] include/diff_tables.inc [master:test10.ti_nk, slave:test10.ti_nk] include/diff_tables.inc [master:test10.tm_wk, slave:test10.tm_wk] include/diff_tables.inc [master:test10.ti_wk, slave:test10.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test9.tm_nk, slave:test9.tm_nk] include/diff_tables.inc [master:test9.ti_nk, slave:test9.ti_nk] include/diff_tables.inc [master:test9.tm_wk, slave:test9.tm_wk] include/diff_tables.inc [master:test9.ti_wk, slave:test9.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test8.tm_nk, slave:test8.tm_nk] include/diff_tables.inc [master:test8.ti_nk, slave:test8.ti_nk] include/diff_tables.inc [master:test8.tm_wk, slave:test8.tm_wk] include/diff_tables.inc [master:test8.ti_wk, slave:test8.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test7.tm_nk, slave:test7.tm_nk] include/diff_tables.inc [master:test7.ti_nk, slave:test7.ti_nk] include/diff_tables.inc [master:test7.tm_wk, slave:test7.tm_wk] include/diff_tables.inc [master:test7.ti_wk, slave:test7.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test6.tm_nk, slave:test6.tm_nk] include/diff_tables.inc [master:test6.ti_nk, slave:test6.ti_nk] include/diff_tables.inc [master:test6.tm_wk, slave:test6.tm_wk] include/diff_tables.inc [master:test6.ti_wk, slave:test6.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test5.tm_nk, slave:test5.tm_nk] include/diff_tables.inc [master:test5.ti_nk, slave:test5.ti_nk] include/diff_tables.inc [master:test5.tm_wk, slave:test5.tm_wk] include/diff_tables.inc [master:test5.ti_wk, slave:test5.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test4.tm_nk, slave:test4.tm_nk] include/diff_tables.inc [master:test4.ti_nk, slave:test4.ti_nk] include/diff_tables.inc [master:test4.tm_wk, slave:test4.tm_wk] include/diff_tables.inc [master:test4.ti_wk, slave:test4.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test3.tm_nk, slave:test3.tm_nk] include/diff_tables.inc [master:test3.ti_nk, slave:test3.ti_nk] include/diff_tables.inc [master:test3.tm_wk, slave:test3.tm_wk] include/diff_tables.inc [master:test3.ti_wk, slave:test3.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test2.tm_nk, slave:test2.tm_nk] include/diff_tables.inc [master:test2.ti_nk, slave:test2.ti_nk] include/diff_tables.inc [master:test2.tm_wk, slave:test2.tm_wk] include/diff_tables.inc [master:test2.ti_wk, slave:test2.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test1.tm_nk, slave:test1.tm_nk] include/diff_tables.inc [master:test1.ti_nk, slave:test1.ti_nk] include/diff_tables.inc [master:test1.tm_wk, slave:test1.tm_wk] include/diff_tables.inc [master:test1.ti_wk, slave:test1.ti_wk] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test0.tm_nk, slave:test0.tm_nk] include/diff_tables.inc [master:test0.ti_nk, slave:test0.ti_nk] include/diff_tables.inc [master:test0.tm_wk, slave:test0.tm_wk] include/diff_tables.inc [master:test0.ti_wk, slave:test0.ti_wk] +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_id2.result index 0cf0aa3b..a30e4ec5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_id2.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_id2.result @@ -32,4 +32,5 @@ t1 start slave sql_thread; drop table t1; drop table t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_id_ignore.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_id_ignore.result index 97cc3d92..1de2b3fc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_id_ignore.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_id_ignore.result @@ -23,6 +23,7 @@ change master to IGNORE_SERVER_IDS= (5, 1, 4, 3, 1); ignore server id list: 1, 3, 4, 5 *** ignore master (server 1) queries for a while *** start slave; +include/sync_slave_sql_with_master.inc create table t1 (n int); include/wait_for_slave_param.inc [Exec_Master_Log_Pos] *** must be empty as the event is to be filtered out *** @@ -42,10 +43,12 @@ 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. start slave; +include/sync_slave_sql_with_master.inc *** must have caught create table *** show tables; Tables_in_test t1 drop table t1; +include/sync_slave_sql_with_master.inc end of the tests include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_uuid.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_uuid.result index e2080b3f..36bd5144 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_uuid.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_server_uuid.result @@ -6,9 +6,10 @@ Note #### Storing MySQL user name or password information in the master info rep call mtr.add_suppression("Slave I/O thread .* register on master"); call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*"); CALL mtr.add_suppression(".*master and slave have equal MySQL server UUIDs.*"); -CALL mtr.add_suppression("Master's UUID has changed, its old UUID is.*"); +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"); +include/sync_slave_sql_with_master.inc # Case 1: # Master's UUID appears in the result of 'SHOW SLAVE STATUS'. @@ -53,6 +54,7 @@ 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. include/start_slave.inc include/check_slave_no_error.inc +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/rpl_restart_server.inc [server_number=1] @@ -115,4 +117,25 @@ include/check_slave_param.inc [Slave_IO_Running] CHANGE MASTER TO MASTER_LOG_FILE= 'MASTER_LOG_FILE', MASTER_LOG_POS= MASTER_POS; 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) +----------------------------------------------------------------------------- +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 +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_session_var.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_session_var.result index 65cb1410..b96bb237 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_session_var.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_session_var.result @@ -15,6 +15,7 @@ select * from t1 where b<3 order by a; a b 1 2 MySQL 1 +include/sync_slave_sql_with_master.inc select * from t1 where b<3 order by a; a b 1 2 @@ -36,16 +37,19 @@ insert into t2 select 2,a from t1 where a is null; select * from t2 order by b; b a 1 1 +include/sync_slave_sql_with_master.inc select * from t2 order by b; b a 1 1 drop table t1,t2; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 ( `id` int(11) NOT NULL auto_increment, `data` varchar(100), PRIMARY KEY (`id`) ) ENGINE=MyISAM; INSERT INTO t1(data) VALUES(SESSION_USER()); +include/sync_slave_sql_with_master.inc SELECT length(data) < 100 FROM t1; length(data) < 100 1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_charset.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_charset.result index 853ec0ad..d0247646 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_charset.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_charset.result @@ -30,6 +30,7 @@ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0 D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0 E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0 F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0 +include/sync_slave_sql_with_master.inc use mysqltest1; select "--- on slave ---"; --- on slave --- @@ -45,4 +46,5 @@ D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0 E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0 F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0 drop database mysqltest1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_null_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_null_innodb.result index cdd1e410..ada2453d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_null_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_null_innodb.result @@ -7,10 +7,13 @@ include/rpl_reset.inc CREATE TABLE t1 (c1 BIT, c2 INT) Engine=InnoDB; INSERT INTO `t1` VALUES ( 1, 1 ); UPDATE t1 SET c1=NULL where c2=1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DELETE FROM t1 WHERE c2=1 LIMIT 1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t1 (c1 CHAR) Engine=InnoDB; INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; @@ -18,8 +21,11 @@ SELECT * FROM t1; c1 w UPDATE t1 SET c1=NULL WHERE c1='w'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DELETE FROM t1 LIMIT 2; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_null_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_null_myisam.result index f60412a0..1d00f1b4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_null_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_set_null_myisam.result @@ -7,10 +7,13 @@ include/rpl_reset.inc CREATE TABLE t1 (c1 BIT, c2 INT) Engine=MyISAM; INSERT INTO `t1` VALUES ( 1, 1 ); UPDATE t1 SET c1=NULL where c2=1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DELETE FROM t1 WHERE c2=1 LIMIT 1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t1 (c1 CHAR) Engine=MyISAM; INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; @@ -18,8 +21,11 @@ SELECT * FROM t1; c1 w UPDATE t1 SET c1=NULL WHERE c1='w'; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DELETE FROM t1 LIMIT 2; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_errors.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_errors.result index f9896974..fa5b5071 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_errors.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_errors.result @@ -4,6 +4,7 @@ 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 (a INT, b blob, PRIMARY KEY(b(512))); +include/sync_slave_sql_with_master.inc DROP TABLE t1; DROP TABLE t1; call mtr.add_suppression("Slave SQL: .*Error .Unknown table .test.t1.. on query.* Error_code: 1051"); diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_slave_running.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_slave_running.result index 7f5195a3..5dd1a02e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_slave_running.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_slave_running.result @@ -35,6 +35,7 @@ Variable_name Value Slave_running ON Slave_IO_Running= Yes Slave_SQL_Running= Yes +include/sync_slave_sql_with_master.inc set global debug= ''; SET DEBUG_SYNC= 'RESET'; End of tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_slave_status_deadlock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_slave_status_deadlock.result new file mode 100644 index 00000000..11131a87 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_show_slave_status_deadlock.result @@ -0,0 +1,33 @@ +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] +# Let master and slave synced with t1 table created +CREATE TABLE t1 (f INT) ENGINE= INNODB; +include/sync_slave_sql_with_master.inc +# Setup GLOBAL.DEBUG at slave to reach commit +[connection slave] +SET @@GLOBAL.DEBUG= '+d,dbug.reached_commit'; +# Do some DML operation on master so that it will be blocked on +# slave as global read lock is in place. +[connection master] +INSERT INTO t1 VALUES (10); +# Issue FLUSH TABLES WITH READ LOCK after Reached is signaled +[connection slave] +SET DEBUG_SYNC='now WAIT_FOR Reached'; +FLUSH TABLES WITH READ LOCK; +# Let sql thread continue to try to obtain commit lock +SET DEBUG_SYNC= 'now SIGNAL signal.commit_continue'; +# Wait until sql thread enters "Waiting for commit lock" state +[connection slave] +SHOW SLAVE STATUS; +UNLOCK TABLES; +SET @@GLOBAL.DEBUG= '$debug_saved'; +[connection master] +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +[connection master] +DROP TABLE t1; +include/sync_slave_sql_with_master.inc +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_error.result index b5f4f6c3..b079471a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -7,10 +7,12 @@ Note #### Storing MySQL user name or password information in the master info rep [on master] create table t1 (n int not null primary key); [on slave] +include/sync_slave_sql_with_master.inc insert into t1 values (1); [on master] insert into t1 values (1); insert into t1 values (2),(3); +include/sync_slave_sql_with_master.inc [on slave] select * from t1 order by n; n @@ -23,6 +25,7 @@ insert into t1 values (7),(8); set sql_mode=strict_trans_tables; insert into t1 values (7), (8), (9); [on slave] +include/sync_slave_sql_with_master.inc select * from t1 order by n; n 1 @@ -33,6 +36,7 @@ n include/check_slave_is_running.inc ==== Clean Up ==== drop table t1; +include/sync_slave_sql_with_master.inc create table t1(a int primary key); insert into t1 values (1),(2); SET SQL_LOG_BIN=0; @@ -41,6 +45,7 @@ SET SQL_LOG_BIN=1; set sql_mode=strict_trans_tables; insert into t1 values (1), (2), (3); [on slave] +include/sync_slave_sql_with_master.inc select * from t1; a 1 @@ -48,6 +53,7 @@ a include/check_slave_is_running.inc ==== Clean Up ==== drop table t1; +include/sync_slave_sql_with_master.inc ==== Using Innodb ==== SET SQL_LOG_BIN=0; CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB; @@ -76,6 +82,7 @@ SET SQL_LOG_BIN=0; DELETE FROM t1 WHERE id = 4; SET SQL_LOG_BIN=1; UPDATE t1 SET id= id + 3, data = 2; +include/sync_slave_sql_with_master.inc **** We cannot execute a select as there are differences in the **** behavior between STMT and RBR. @@ -106,10 +113,12 @@ SET SQL_LOG_BIN=0; DELETE FROM t2 WHERE id = 5; SET SQL_LOG_BIN=1; UPDATE t2 SET id= id + 3, data = 2; +include/sync_slave_sql_with_master.inc **** We cannot execute a select as there are differences in the **** behavior between STMT and RBR. ==== Clean Up ==== DROP TABLE t1; DROP TABLE t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_incident.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_incident.result index 6da86be7..9269d063 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_incident.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_incident.result @@ -12,6 +12,7 @@ a 2 3 REPLACE INTO t1 VALUES (4); +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a 1 @@ -25,4 +26,5 @@ Log_name File_size master-bin.000001 # master-bin.000002 # DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_slave_err_warnings.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_slave_err_warnings.result new file mode 100644 index 00000000..63b1a0d7 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_skip_slave_err_warnings.result @@ -0,0 +1,13 @@ +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 (c1 INT) ENGINE=InnoDB; +INSERT INTO test.t1 VALUES (100); +DROP TABLE t1; +include/sync_slave_sql_with_master.inc +Matching lines are: +None +Occurrences of the Could not execute Query event. in the input file : 0 +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result index 1e1b0c9b..39537658 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result @@ -21,6 +21,7 @@ END| INSERT INTO t3 VALUES(1, 'AA'); INSERT INTO t2 VALUES(1, 'AA'); INSERT INTO t1 VALUES(1, 'AA'); +include/sync_slave_sql_with_master.inc RENAME TABLE t3 TO t3_bak; UPDATE t1 SET b = 'XX' WHERE a = 1; SELECT * FROM t1 ORDER BY a; @@ -52,11 +53,13 @@ include/start_slave.inc TRUNCATE t1; TRUNCATE t2; TRUNCATE t3; +include/sync_slave_sql_with_master.inc *** Test non-transactional group w/ PK *** ALTER TABLE t1 ADD PRIMARY KEY (a); ALTER TABLE t2 ADD PRIMARY KEY (a); ALTER TABLE t3 ADD PRIMARY KEY (a); +include/sync_slave_sql_with_master.inc RENAME TABLE t3 TO t3_bak; INSERT INTO t3 VALUES(2, 'B'); INSERT INTO t2 VALUES(2, 'B'); @@ -87,11 +90,13 @@ include/start_slave.inc TRUNCATE t1; TRUNCATE t2; TRUNCATE t3; +include/sync_slave_sql_with_master.inc *** Test transactional group w/ PK *** ALTER TABLE t1 ENGINE=InnoDB; ALTER TABLE t2 ENGINE=InnoDB; ALTER TABLE t3 ENGINE=InnoDB; +include/sync_slave_sql_with_master.inc RENAME TABLE t3 TO t3_bak; BEGIN; INSERT INTO t1 VALUES (3, 'C'), (4, 'D'); @@ -125,4 +130,5 @@ RENAME TABLE t3_bak TO t3; include/start_slave.inc *** Clean up *** DROP TABLE t1,t2,t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_load_in.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_load_in.result index a1bce891..ae48e1ca 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_load_in.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_load_in.result @@ -12,8 +12,10 @@ insert into t2(b) values (2); load data infile '../../std_data/rpl_loaddata.dat' into table t2; load data infile '../../std_data/rpl_loaddata.dat' into table t2; commit; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:t2, slave:t2] drop table t1; drop table t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_skip.result index 99a2ce72..84faac0f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_skip.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_skip.result @@ -79,6 +79,7 @@ START SLAVE; include/wait_for_slave_to_start.inc **** On Master **** DROP TABLE t1, t2; +include/sync_slave_sql_with_master.inc SET SESSION BINLOG_FORMAT=ROW; SET AUTOCOMMIT=0; CREATE TABLE t1 (a INT, b VARCHAR(20)) ENGINE=myisam; @@ -97,6 +98,7 @@ BEGIN UPDATE t3 SET a =2, b = 'master only'; END| **** On Slave **** +include/sync_slave_sql_with_master.inc include/stop_slave.inc **** On Master **** UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1; @@ -134,12 +136,14 @@ a b 1 master/slave 3 master/slave DROP TABLE t1, t2, t3; +include/sync_slave_sql_with_master.inc **** Case 2: Row binlog format and transactional tables **** *** On Master *** CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb; CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb; CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb; **** On Slave **** +include/sync_slave_sql_with_master.inc include/stop_slave.inc *** On Master *** BEGIN; @@ -269,10 +273,12 @@ a b 3 master/slave 5 master/slave DROP TABLE t4, t5, t6; +include/sync_slave_sql_with_master.inc **** Case 3: Statement logging format and LOAD DATA with non-transactional table **** *** On Master *** CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam; *** On Slave *** +include/sync_slave_sql_with_master.inc include/stop_slave.inc *** On Master *** SET SESSION BINLOG_FORMAT=STATEMENT; @@ -288,4 +294,5 @@ include/start_slave.inc SELECT * FROM t10 ORDER BY a; a b DROP TABLE t10; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_status.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_status.result index 04201862..001bb182 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_status.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slave_status.result @@ -7,6 +7,7 @@ Note #### Storing MySQL user name or password information in the master info rep [on master] GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl'; [on slave] +include/sync_slave_sql_with_master.inc include/stop_slave.inc CHANGE MASTER TO master_user='rpl', master_password='rpl'; Warnings: @@ -18,6 +19,7 @@ include/start_slave.inc CREATE TABLE t1 (n INT); INSERT INTO t1 VALUES (1); [on slave] +include/sync_slave_sql_with_master.inc SELECT * FROM t1; n 1 @@ -26,6 +28,7 @@ n DROP USER rpl@127.0.0.1; FLUSH PRIVILEGES; [on slave] +include/sync_slave_sql_with_master.inc ==== Restart slave without privileges ===== include/stop_slave.inc START SLAVE; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slow_query_log.result index bea767bc..4790473d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slow_query_log.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_slow_query_log.result @@ -15,6 +15,7 @@ include/start_slave.inc CREATE TABLE t1 (a int, b int); INSERT INTO t1 values(1, 1); INSERT INTO t1 values(1, sleep(3)); +include/sync_slave_sql_with_master.inc TRUNCATE mysql.slow_log; SELECT 1, sleep(3); 1 sleep(3) @@ -42,6 +43,7 @@ SELECT 3; TRUNCATE mysql.slow_log; SET GLOBAL slow_query_log= @old_slow_query_log; DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc SET GLOBAL long_query_time= @old_long_query_time; SET GLOBAL log_output= @old_log_output; @@ -66,6 +68,7 @@ CREATE TABLE t1 (a int, b int); **** Outcome: query ends up in both master and slave slow log ******************************************************************** INSERT INTO t1 values(1, sleep(3)); +include/sync_slave_sql_with_master.inc ### Assertion is good. Both Master and Slave exhibit the ### same number of queries in slow log: 1 TRUNCATE mysql.slow_log; @@ -77,6 +80,7 @@ TRUNCATE mysql.slow_log; ******************************************************************** ALTER TABLE t1 ADD INDEX id1(a); INSERT INTO t1 values(1, sleep(3)); +include/sync_slave_sql_with_master.inc ### Assertion is good. Both Master and Slave exhibit the ### same number of queries in slow log: 1 ******************************************************************** @@ -87,11 +91,14 @@ SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements; SET @@global.log_slow_slave_statements = off; TRUNCATE mysql.slow_log; INSERT INTO t1 values(1, sleep(3));; +include/sync_slave_sql_with_master.inc SET @@global.log_slow_slave_statements = on; INSERT INTO t1 values(1, sleep(3));; +include/sync_slave_sql_with_master.inc SET @@global.log_output= @old_log_output; SET @@global.long_query_time= @old_long_query_time; DROP TABLE t1; +include/sync_slave_sql_with_master.inc SET @@global.log_output= @old_log_output; SET @@global.long_query_time= @old_long_query_time; SET @@global.log_slow_slave_statements= @old_log_slow_slave_statements; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp.result index 936560d7..58865acc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp.result @@ -7,6 +7,7 @@ drop database if exists mysqltest1; create database mysqltest1; use mysqltest1; create table t1 (a varchar(100)); +include/sync_slave_sql_with_master.inc use mysqltest1; create procedure foo() begin @@ -28,6 +29,7 @@ set b = 8; insert into t1 values (b); insert into t1 values (unix_timestamp()); end +include/sync_slave_sql_with_master.inc select * from mysql.proc where name='foo' and db='mysqltest1'; db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin @@ -47,6 +49,7 @@ select * from t1; a 8 1000000000 +include/sync_slave_sql_with_master.inc select * from t1; a 8 @@ -95,6 +98,7 @@ a 3 3 3 +include/sync_slave_sql_with_master.inc select * from t1; a 15 @@ -121,6 +125,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back select * from t2; a 20 +include/sync_slave_sql_with_master.inc select * from t2; a 20 @@ -134,6 +139,7 @@ end drop procedure foo4; select * from mysql.proc where name="foo4" and db='mysqltest1'; db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 +include/sync_slave_sql_with_master.inc select * from mysql.proc where name="foo4" and db='mysqltest1'; db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 drop procedure foo; @@ -165,6 +171,7 @@ a select * from t2; a 23 +include/sync_slave_sql_with_master.inc select * from t1; a 21 @@ -232,6 +239,7 @@ end select * from t1; a 1000000000 +include/sync_slave_sql_with_master.inc use mysqltest1; select * from t1; a @@ -274,6 +282,7 @@ select * from t2; a 20 100 +include/sync_slave_sql_with_master.inc select * from t2; a 20 @@ -286,6 +295,7 @@ insert into t1 values (1); select * from t1; a 10 +include/sync_slave_sql_with_master.inc select * from t1; a 10 @@ -295,6 +305,7 @@ insert into t1 values (1); select * from t1; a 1 +include/sync_slave_sql_with_master.inc select * from t1; a 1 @@ -302,14 +313,17 @@ create procedure foo() not deterministic reads sql data select * from t1; +include/sync_slave_sql_with_master.inc call foo(); a 1 drop procedure foo; +include/sync_slave_sql_with_master.inc drop function fn1; drop database mysqltest1; drop user "zedjzlcsjhd"@127.0.0.1; use test; +include/sync_slave_sql_with_master.inc use test; drop function if exists f1; create function f1() returns int reads sql data @@ -329,6 +343,7 @@ a 1 drop view v1; drop function f1; +include/sync_slave_sql_with_master.inc select * from t1; a 1 @@ -341,6 +356,7 @@ CALL p1('test'); SELECT * FROM t1; col test +include/sync_slave_sql_with_master.inc SELECT * FROM t1; col test @@ -354,6 +370,7 @@ DROP PROCEDURE IF EXISTS p1; DROP FUNCTION IF EXISTS f1; ---> Synchronizing slave with master... +include/sync_slave_sql_with_master.inc ---> connection: master @@ -372,6 +389,7 @@ f1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETU RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci ---> Synchronizing slave with master... +include/sync_slave_sql_with_master.inc ---> connection: master ---> Checking on slave... @@ -389,7 +407,9 @@ RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci ---> Cleaning up... DROP PROCEDURE p1; DROP FUNCTION f1; +include/sync_slave_sql_with_master.inc drop table t1; +include/sync_slave_sql_with_master.inc drop database if exists mysqltest; drop database if exists mysqltest2; create database mysqltest; @@ -405,8 +425,10 @@ begin insert into t values (1); return 0; end| +include/sync_slave_sql_with_master.inc use mysqltest; set @a:= mysqltest2.f1(); +include/sync_slave_sql_with_master.inc include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # drop database if exists mysqltest1 @@ -611,6 +633,7 @@ set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creato set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; drop database mysqltest; drop database mysqltest2; +include/sync_slave_sql_with_master.inc use test; /*!50001 create procedure `mysqltestbug36570_p1`() */ begin @@ -639,6 +662,7 @@ Procedure sql_mode Create Procedure character_set_client collation_connection Da begin select a; end latin1 latin1_swedish_ci latin1_swedish_ci +include/sync_slave_sql_with_master.inc show procedure status like '%mysqltestbug36570%'; Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation test mysqltestbug36570_p2 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci @@ -1232,6 +1256,7 @@ unlock tables; select * from t1; a 1 +include/sync_slave_sql_with_master.inc select * from t1; a 1 @@ -1261,6 +1286,7 @@ c1 8 9 10 +include/sync_slave_sql_with_master.inc select * from t1; c1 7 @@ -1270,6 +1296,7 @@ c1 call p1(-1); select * from t1; c1 +include/sync_slave_sql_with_master.inc select * from t1; c1 # Cleanup @@ -1277,4 +1304,5 @@ set @@session.binlog_format=@save_binlog_format; drop table t1; drop procedure p1; # End of 5.5 tests. +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp004.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp004.result index 12b009fb..0cd71958 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp004.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp004.result @@ -37,6 +37,7 @@ a 2 3 8 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY a; a 1 @@ -54,6 +55,7 @@ USE test; SHOW TABLES; Tables_in_test t3 +include/sync_slave_sql_with_master.inc USE test; SHOW TABLES; Tables_in_test @@ -73,6 +75,7 @@ a 2 3 8 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY a; a 1 @@ -90,4 +93,5 @@ DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp_effects.result index a0bc6f8c..ff1f4f0b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp_effects.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sp_effects.result @@ -15,6 +15,7 @@ set spv=spv+1; end while; end// call p1(); +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a 1 @@ -38,6 +39,7 @@ call p2(); SELECT * FROM t2 ORDER BY a; a 4 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; a 4 @@ -99,6 +101,7 @@ master: 7 master: 8 master: 10 master: 11 +include/sync_slave_sql_with_master.inc SELECT 'slave:',a FROM t1 ORDER BY a; slave: a slave: 1 @@ -129,6 +132,7 @@ SELECT 'master:',a FROM t1 ORDER BY a; master: a master: 1 master: 2 +include/sync_slave_sql_with_master.inc SELECT 'slave:',a FROM t1 ORDER BY a; slave: a slave: 1 @@ -143,6 +147,7 @@ f1(?) SELECT 'master:',a FROM t1 ORDER BY a; master: a master: 123 +include/sync_slave_sql_with_master.inc SELECT 'slave:',a FROM t1 ORDER BY a; slave: a slave: 123 @@ -164,6 +169,7 @@ master: 6 master: 6 master: 15 master: 15 +include/sync_slave_sql_with_master.inc SELECT 'slave:',a FROM t1 ORDER BY a; slave: a slave: 6 @@ -215,6 +221,7 @@ master 100 master 101 master 101 master 102 +include/sync_slave_sql_with_master.inc SELECT 'slave', a FROM t1 ORDER BY a; slave a slave 10 @@ -230,6 +237,7 @@ drop table t1; drop function f1; drop function f2; drop procedure p1; +include/sync_slave_sql_with_master.inc create table t2 (b BIT(7)); create procedure sp_bug26199(bitvalue BIT(7)) begin @@ -260,6 +268,7 @@ E 7F 7F 27 +include/sync_slave_sql_with_master.inc select hex(b) from t2; hex(b) E @@ -271,5 +280,6 @@ drop table t2; drop procedure sp_bug26199; drop function sf_bug26199; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; +include/sync_slave_sql_with_master.inc end of the tests include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_spec_variables.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_spec_variables.result index 92db08fc..c3975946 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_spec_variables.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_spec_variables.result @@ -20,6 +20,7 @@ SELECT * FROM t1 ORDER BY a; a b 2 master 4 master +include/sync_slave_sql_with_master.inc CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; INSERT INTO t1 (b) VALUES ('slave'); INSERT INTO t1 (b) VALUES ('slave'); @@ -68,6 +69,7 @@ t1 CREATE TABLE `t1` ( `b` varchar(10) COLLATE latin1_german1_ci DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci +include/sync_slave_sql_with_master.inc CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; SHOW CREATE TABLE t1; Table Create Table @@ -99,6 +101,7 @@ INSERT INTO t1 VALUES (1, 'master ', WEEK('2008-01-07')); SELECT * FROM t1 ORDER BY a; a b c 1 master 1 +include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES (2, 'slave ', WEEK('2008-01-07')); SELECT * FROM t1 ORDER BY a; a b c @@ -115,6 +118,7 @@ LOAD DATA LOCAL INFILE 'FILE' INTO TABLE t1 (b); SELECT COUNT(*) FROM t1; COUNT(*) 70 +include/sync_slave_sql_with_master.inc LOAD DATA LOCAL INFILE 'FILE2' INTO TABLE t1 (b); ERROR 42000: The used command is not allowed with this MySQL version SELECT COUNT(*) FROM t1; @@ -131,6 +135,7 @@ CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10), c CHA SELECT COUNT(*)=2000 FROM t1; COUNT(*)=2000 1 +include/sync_slave_sql_with_master.inc SELECT COUNT(*)=2000 FROM t1 WHERE b='master' GROUP BY b ORDER BY b; COUNT(*)=2000 1 @@ -151,6 +156,7 @@ SET @@global.default_storage_engine=Memory; SET @@session.default_storage_engine=Memory; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)); CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; +include/sync_slave_sql_with_master.inc CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)); SHOW CREATE TABLE t1; Table Create Table @@ -201,6 +207,7 @@ INSERT INTO t1 VALUES (1, 'master', '0000-00-00'); SELECT * FROM t1 ORDER BY a; a b c 1 master 0000-00-00 +include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES (1, 'slave', '0000-00-00'); ERROR 22007: Incorrect date value: '0000-00-00' for column 'c' at row 1 SELECT * FROM t1 ORDER BY a; @@ -216,6 +223,7 @@ DROP TABLE t1; SET @@global.character_set_database=@restore_master_character_set_database; SET @@global.collation_server=@restore_master_collation_server; SET @@global.default_storage_engine=@restore_master_storage_engine; +include/sync_slave_sql_with_master.inc SET @@global.character_set_database=@restore_slave_character_set_database; SET @@global.collation_server=@restore_slave_collation_server; SET @@global.max_heap_table_size=@restore_slave_max_heap_table_size; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sporadic_master.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sporadic_master.result index b01d22a4..2b3bf8cc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sporadic_master.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sporadic_master.result @@ -8,12 +8,14 @@ create table t1(n int not null auto_increment primary key); insert into t1 values (NULL),(NULL); truncate table t1; insert into t1 values (4),(NULL); +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/start_slave.inc insert into t1 values (NULL),(NULL); flush logs; truncate table t1; insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL); +include/sync_slave_sql_with_master.inc select * from t1 ORDER BY n; n 10 @@ -23,4 +25,5 @@ n 14 15 drop table t1,t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sql_thread_killed_waiting_commit_lock.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sql_thread_killed_waiting_commit_lock.result new file mode 100644 index 00000000..10a27d77 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sql_thread_killed_waiting_commit_lock.result @@ -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] +call mtr.add_suppression("Query execution was interrupted."); +call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); +# Let master and slave synced with t1 table created +CREATE TABLE t1 (f INT) ENGINE= INNODB; +include/sync_slave_sql_with_master.inc +# Setup GLOBAL.DEBUG at slave to reach commit +[connection slave] +SET @@GLOBAL.DEBUG= '+d,dbug.reached_commit'; +# Do some DML operation on master so that it will be blocked on +# slave as global read lock is in place. +[connection master] +INSERT INTO t1 VALUES (10); +# Issue FLUSH TABLES WITH READ LOCK after Reached is signaled +[connection slave] +SET DEBUG_SYNC='now WAIT_FOR Reached'; +FLUSH TABLES WITH READ LOCK; +# Let sql thread continue to try to obtain commit lock +SET DEBUG_SYNC= 'now SIGNAL signal.commit_continue'; +# Wait until sql thread enters "Waiting for commit lock" state +# Kill sql thread +include/wait_for_slave_sql_error.inc [errno=1317, 1756] +# Restart sql thread to let it finish the replication +SET @@GLOBAL.DEBUG= '-d,dbug.reached_commit'; +UNLOCK TABLES; +include/assert.inc [Exec_Master_Log_Pos in SHOW SLAVE STATUS must be equal to mater_log_pos in slave's repository] +include/start_slave_sql.inc +[connection master] +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:t1, slave:t1] +SET @@GLOBAL.DEBUG= '$debug_saved'; +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ssl.result index 9e2ee571..5a687b10 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ssl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ssl.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int auto_increment, KEY(t)); +include/sync_slave_sql_with_master.inc stop slave; change master to master_user='replssl', @@ -18,6 +19,7 @@ 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. start slave; insert into t1 values(1); +include/sync_slave_sql_with_master.inc select * from t1; t 1 @@ -32,6 +34,7 @@ select * from t1; t 1 insert into t1 values (NULL); +include/sync_slave_sql_with_master.inc include/wait_for_slave_to_start.inc Master_SSL_Allowed = 'Yes' Master_SSL_CA_Path = '' @@ -41,13 +44,30 @@ Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem' include/check_slave_is_running.inc drop user replssl@localhost; drop table t1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc CHANGE MASTER TO master_user = 'root', master_ssl = 0, master_ssl_ca = '', master_ssl_cert = '', -master_ssl_key = ''; +master_ssl_key = '', +master_ssl_crl='', +master_ssl_crlpath=''; +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. +CHANGE MASTER TO MASTER_SSL= 1, MASTER_SSL_CRL='MYSQL_TEST_DIR/std_data/crl-client-revoked.crl', MASTER_SSL_CRLPATH='MYSQL_TEST_DIR/std_data/crldir'; +include/start_slave.inc +include/stop_slave.inc +CHANGE MASTER TO +master_user = 'root', +master_ssl = 0, +master_ssl_ca = '', +master_ssl_cert = '', +master_ssl_key = '', +master_ssl_crl='', +master_ssl_crlpath=''; 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. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ssl1.result index 9c0e87c2..d60e2a36 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ssl1.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_ssl1.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int); +include/sync_slave_sql_with_master.inc stop slave; include/wait_for_slave_to_stop.inc change master to master_user='replssl',master_password=''; @@ -20,6 +21,7 @@ include/wait_for_slave_to_stop.inc change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem'; start slave; include/wait_for_slave_to_start.inc +include/sync_slave_sql_with_master.inc select * from t1; t 1 @@ -39,6 +41,7 @@ start slave; include/wait_for_slave_to_start.inc drop user replssl@localhost; drop table t1; +include/sync_slave_sql_with_master.inc Master_SSL_Allowed = 'No' Master_SSL_CA_Path = '' Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem' @@ -58,6 +61,7 @@ start slave; include/wait_for_slave_to_start.inc create table t1 (t int); insert into t1 values (1); +include/sync_slave_sql_with_master.inc on slave select * from t1; t @@ -69,6 +73,7 @@ Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem' Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem' include/check_slave_is_running.inc drop table t1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc CHANGE MASTER TO master_host="127.0.0.1", diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_000001.result index aef5579d..2c5e408b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_000001.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_000001.result @@ -20,12 +20,14 @@ abandoned abandoning abandonment abandons +include/sync_slave_sql_with_master.inc stop slave; set password for root@"localhost" = password('foo'); start slave; set password for root@"localhost" = password(''); create table t3(n int); insert into t3 values(1),(2); +include/sync_slave_sql_with_master.inc select * from t3; n 1 @@ -34,7 +36,9 @@ select sum(length(word)) from t1; sum(length(word)) 1022 drop table t1,t3; +include/sync_slave_sql_with_master.inc create table t1 (n int) engine=myisam; +include/sync_slave_sql_with_master.inc reset master; stop slave; reset slave; @@ -77,6 +81,7 @@ update mysql.user set Select_priv = "Y" where User= _binary"blafasel2"; select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user Y blafasel2 +include/sync_slave_sql_with_master.inc select n from t1; n 3456 @@ -85,4 +90,5 @@ select_priv user Y blafasel2 drop table t1; delete from mysql.user where user="blafasel2"; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result index 92048ff4..4dd94d42 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result @@ -9,6 +9,7 @@ DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p2; DROP TRIGGER IF EXISTS tr1; DROP FUNCTION IF EXISTS f1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY); CREATE TABLE t2 (id INT AUTO_INCREMENT PRIMARY KEY); CREATE PROCEDURE p1() @@ -113,6 +114,7 @@ id 10 SELECT * FROM t2; id +include/sync_slave_sql_with_master.inc # Result on slave SELECT * FROM t1; id @@ -177,6 +179,7 @@ id 17 18 19 +include/sync_slave_sql_with_master.inc # Result on slave SELECT * FROM t1; id @@ -209,4 +212,5 @@ DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p2; DROP FUNCTION IF EXISTS f1; DROP TRIGGER IF EXISTS tr1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_conflicts.result index 23149c97..e45d26ea 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_conflicts.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_conflicts.result @@ -7,6 +7,7 @@ Note #### Storing MySQL user name or password information in the master info rep [on master] CREATE TABLE t1(a INT PRIMARY KEY); [on slave] +include/sync_slave_sql_with_master.inc ==== Test: SQL thread sees 'INSERT' of existing key ==== ---- Prepare slave so that it will get duplicate key error ---- INSERT INTO t1 VALUES (1); @@ -42,6 +43,7 @@ a DELETE FROM t1; INSERT INTO t1 VALUES (1); [on slave] +include/sync_slave_sql_with_master.inc DELETE FROM t1 WHERE a = 1; ---- On master, remove the row that does not exist on slave ---- [on master] @@ -57,4 +59,5 @@ a [on master] DROP TABLE t1; [on slave] +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result index ebc934ee..2d3ef921 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result @@ -129,8 +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` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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'; @@ -441,11 +440,10 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -464,18 +462,16 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- @@ -960,12 +956,8 @@ 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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R'; @@ -986,19 +978,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 # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_2`,`test`.`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` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`nt_tmp_1`,`test`.`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) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt_1` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`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-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- SET @commands= 'B T Drop-Temp-TN-Temp R'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result index 80b94efe..60a5e249 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result @@ -17,6 +17,7 @@ master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; +include/sync_slave_sql_with_master.inc select * from t3; a stop slave; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_found_rows.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_found_rows.result index e6b97cfe..8ffac694 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_found_rows.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_found_rows.result @@ -30,6 +30,7 @@ sect test count 1 1 183 1 2 3 **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; sect test count 1 1 183 @@ -64,6 +65,7 @@ sect test count 2 2 183 2 3 183 **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; sect test count 2 1 3 @@ -89,6 +91,7 @@ sect test count 3 1 183 3 2 183 **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; sect test count 3 1 183 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result index 006e20e9..40265728 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result @@ -589,8 +589,10 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db ################################################################################### # CHECK CONSISTENCY ################################################################################### +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:tt_1,slave:tt_1] ################################################################################### # CLEAN ################################################################################### +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result index 59ee19d5..4bba4dad 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result @@ -13,6 +13,7 @@ FLUSH TABLE t1; SELECT COUNT(*) FROM t1; COUNT(*) 5000 +include/sync_slave_sql_with_master.inc use mysqlslap; SELECT COUNT(*) FROM t1; COUNT(*) @@ -28,6 +29,7 @@ flush table t1; select * from t1; id name 10 my name +include/sync_slave_sql_with_master.inc select * from t1; id name 10 my name @@ -39,12 +41,14 @@ select * from t1; id name 10 my name 20 is Bond +include/sync_slave_sql_with_master.inc select * from t1; id name 10 my name 20 is Bond USE test; DROP SCHEMA mysqlslap; +include/sync_slave_sql_with_master.inc use test; FLUSH LOGS; FLUSH LOGS; @@ -61,6 +65,7 @@ use `test`; INSERT IGNORE INTO t1 VALUES(1) select * from t1; a 1 +include/sync_slave_sql_with_master.inc On slave include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -74,6 +79,7 @@ select * from t1; a 1 drop table t1; +include/sync_slave_sql_with_master.inc FLUSH LOGS; FLUSH LOGS; End of 5.0 tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result index 7a9db9de..908a69be 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result @@ -31,6 +31,7 @@ create temporary table t2 (day date,id int(9),category enum('a','b','c'),name va load data CONCURRENT infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); insert into t3 select * from t2; +include/sync_slave_sql_with_master.inc select * from t1; a b 1 10 @@ -44,6 +45,7 @@ drop table t1; drop table t2; drop table t3; create table t1(a int, b int, unique(b)); +include/sync_slave_sql_with_master.inc insert into t1 values(1,10); load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1; call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); @@ -125,10 +127,12 @@ LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO ### assertion: works without stating the default database LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1; ### disconnect and switch back to master connection +include/sync_slave_sql_with_master.inc use b48297_db1; include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1] DROP DATABASE b48297_db1; DROP DATABASE b42897_db2; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc use test; CREATE TABLE t1 (`key` TEXT, `text` TEXT); @@ -140,5 +144,6 @@ Field 1 'Field 2' Field 3 'Field 4' 'Field 5' 'Field 6' Field 6 'Field 7' +include/sync_slave_sql_with_master.inc DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_loadfile.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_loadfile.result index 02a4b895..3197ed88 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_loadfile.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_loadfile.result @@ -122,6 +122,7 @@ Abernathy aberrant aberration +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY blob_column; a blob_column 1 abase @@ -228,4 +229,5 @@ aberration DROP PROCEDURE IF EXISTS test.p1; DROP TABLE test.t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_log.result index 06ff8142..3c962446 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_log.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_log.result @@ -3,6 +3,7 @@ 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] +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/wait_for_slave_to_stop.inc reset master; @@ -112,6 +113,7 @@ Aberdeen Abernathy aberrant aberration +include/sync_slave_sql_with_master.inc select * from t1 order by 1 asc; word Aarhus @@ -213,6 +215,7 @@ show binary logs; Log_name File_size master-bin.000001 # master-bin.000002 # +include/sync_slave_sql_with_master.inc show binary logs; Log_name File_size slave-bin.000001 # @@ -267,4 +270,5 @@ a b 5 1 6 1 drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result index dbe5d1f3..95e5a7ea 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result @@ -56,12 +56,14 @@ reset slave; start slave; flush logs; create table t1 (a int); +include/sync_slave_sql_with_master.inc include/check_slave_is_running.inc # # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # flush logs; drop table t1; +include/sync_slave_sql_with_master.inc include/check_slave_is_running.inc flush logs; show master status; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_mts_show_relaylog_events.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_mts_show_relaylog_events.result index 8eef3757..711a96dc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_mts_show_relaylog_events.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_mts_show_relaylog_events.result @@ -44,6 +44,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -136,6 +137,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=POS +include/sync_slave_sql_with_master.inc ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result index 68bbafea..1fba020e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result @@ -44,6 +44,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) master-bin.000001 # Query # # COMMIT +include/sync_slave_sql_with_master.inc ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info @@ -136,6 +137,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=POS +include/sync_slave_sql_with_master.inc ******** [slave] SHOW BINLOG EVENTS IN <FILE> ******** include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_crash_safe.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_crash_safe.result index 711ca681..c60d7437 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_crash_safe.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_crash_safe.result @@ -1290,6 +1290,376 @@ master-bin.000001 # Xid # # COMMIT /* XID */ include/rpl_reconnect.inc START SLAVE; include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T] +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 1); +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(trans_id, stmt_id) VALUES (37, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-trig] +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 1); +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_5(trans_id, stmt_id) VALUES (38, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-func] +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (39, 1); +fc_i_tt_5_suc (39, 1) +fc_i_tt_5_suc +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`; SELECT `test`.`fc_i_tt_5_suc`(39,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(39,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=T-proc] +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (40, 1); +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_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-trig C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-func C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (42, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (42, 4); +fc_i_tt_5_suc (42, 4) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (42, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(42,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (42, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(42,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T T-proc C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (43, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (43, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (43, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',43), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',43), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (43, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',43), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',43), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-trig T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (44, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (44, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (44, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-func T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (45, 2); +fc_i_tt_5_suc (45, 2) +fc_i_tt_5_suc +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(45,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(45,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc + + + +STOP SLAVE SQL_THREAD; +include/wait_for_slave_sql_to_stop.inc +SET GLOBAL debug="d,crash_after_commit_before_update_pos";; +FAILURE d,crash_after_commit_before_update_pos and OUTCOME O2 +rpl_mixing_engines.inc [commands=B T-proc T C] +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (46, 2); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (46, 4); +include/show_binlog_events.inc +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +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 # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',46), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',46), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (46, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -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 # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',46), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',46), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (46, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +include/rpl_reconnect.inc +START SLAVE; +include/wait_for_slave_to_start.inc ################################################################################### # EXECUTE CASES CRASHING THE BEGIN/COMMIT ################################################################################### @@ -1302,18 +1672,18 @@ SET GLOBAL debug="d,crash_after_commit_and_update_pos";; FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 rpl_mixing_engines.inc [commands=N] -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1); +INSERT INTO nt_1(trans_id, stmt_id) VALUES (47, 1); 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 nt_1(trans_id, stmt_id) VALUES (37, 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (47, 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -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 # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (47, 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- @@ -1329,18 +1699,18 @@ SET GLOBAL debug="d,crash_after_commit_and_update_pos";; FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 rpl_mixing_engines.inc [commands=N-trig] -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (48, 1); 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 nt_5(trans_id, stmt_id) VALUES (38, 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (48, 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -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 # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (48, 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- @@ -1356,20 +1726,20 @@ SET GLOBAL debug="d,crash_after_commit_and_update_pos";; FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2 rpl_mixing_engines.inc [commands=N-func] -b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- -SELECT fc_i_nt_5_suc (39, 1); -fc_i_nt_5_suc (39, 1) +SELECT fc_i_nt_5_suc (49, 1); +fc_i_nt_5_suc (49, 1) fc_i_nt_5_suc 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`; SELECT `test`.`fc_i_nt_5_suc`(39,1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(49,1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-func << -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 # # BEGIN -master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(49,1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- @@ -1379,6 +1749,7 @@ include/wait_for_slave_to_start.inc ################################################################################### # CHECK CONSISTENCY ################################################################################### +include/sync_slave_sql_with_master.inc ################################################################################### # CLEAN ################################################################################### diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_crash_safe.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_crash_safe.result index 889966f8..f33fc966 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_crash_safe.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_crash_safe.result @@ -471,69 +471,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -580,69 +523,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -706,69 +592,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -798,69 +627,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -907,69 +679,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1033,69 +748,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1142,69 +800,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1285,69 +886,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1462,69 +1006,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1571,69 +1058,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1714,69 +1144,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1891,69 +1264,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2017,69 +1333,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2194,69 +1453,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2422,69 +1624,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2548,69 +1693,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2725,69 +1813,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2953,69 +1984,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3062,69 +2036,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3188,69 +2105,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3297,69 +2157,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3423,69 +2226,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3532,69 +2278,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3658,69 +2347,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3801,69 +2433,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3978,69 +2553,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4121,69 +2639,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4298,69 +2759,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4441,69 +2845,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4618,69 +2965,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4795,69 +3085,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5023,69 +3256,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5200,69 +3376,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5428,69 +3547,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5605,69 +3667,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5833,69 +3838,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5959,69 +3907,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6085,69 +3976,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6211,69 +4045,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6337,69 +4114,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6514,69 +4234,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6691,69 +4354,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6868,69 +4474,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7045,69 +4594,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7273,69 +4765,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7501,69 +4936,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7729,69 +5107,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7957,69 +5278,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8030,6 +5294,7 @@ SET @@global.slave_checkpoint_period= 3; # CHECK CONSISTENCY ######################################################################## include/start_slave.inc +include/sync_slave_sql_with_master.inc ######################################################################## # CLEAN UP ######################################################################## diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe.result index 889966f8..f33fc966 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe.result @@ -471,69 +471,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -580,69 +523,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -706,69 +592,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -798,69 +627,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -907,69 +679,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1033,69 +748,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1142,69 +800,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1285,69 +886,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1462,69 +1006,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1571,69 +1058,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1714,69 +1144,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1891,69 +1264,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2017,69 +1333,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2194,69 +1453,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2422,69 +1624,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2548,69 +1693,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2725,69 +1813,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2953,69 +1984,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3062,69 +2036,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3188,69 +2105,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3297,69 +2157,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3423,69 +2226,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3532,69 +2278,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3658,69 +2347,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3801,69 +2433,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3978,69 +2553,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4121,69 +2639,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4298,69 +2759,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4441,69 +2845,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4618,69 +2965,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4795,69 +3085,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5023,69 +3256,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5200,69 +3376,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5428,69 +3547,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5605,69 +3667,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5833,69 +3838,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5959,69 +3907,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6085,69 +3976,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6211,69 +4045,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6337,69 +4114,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6514,69 +4234,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6691,69 +4354,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6868,69 +4474,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7045,69 +4594,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7273,69 +4765,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7501,69 +4936,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7729,69 +5107,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7957,69 +5278,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8030,6 +5294,7 @@ SET @@global.slave_checkpoint_period= 3; # CHECK CONSISTENCY ######################################################################## include/start_slave.inc +include/sync_slave_sql_with_master.inc ######################################################################## # CLEAN UP ######################################################################## diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe_checksum.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe_checksum.result index 889966f8..f33fc966 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe_checksum.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe_checksum.result @@ -471,69 +471,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -580,69 +523,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -706,69 +592,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -798,69 +627,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -907,69 +679,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1033,69 +748,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1142,69 +800,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1285,69 +886,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1462,69 +1006,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1571,69 +1058,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1714,69 +1144,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1891,69 +1264,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2017,69 +1333,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2194,69 +1453,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2422,69 +1624,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2548,69 +1693,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2725,69 +1813,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2953,69 +1984,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3062,69 +2036,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3188,69 +2105,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3297,69 +2157,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3423,69 +2226,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3532,69 +2278,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3658,69 +2347,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3801,69 +2433,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -3978,69 +2553,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4121,69 +2639,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4298,69 +2759,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4441,69 +2845,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4618,69 +2965,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -4795,69 +3085,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5023,69 +3256,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5200,69 +3376,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5428,69 +3547,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5605,69 +3667,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5833,69 +3838,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -5959,69 +3907,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6085,69 +3976,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6211,69 +4045,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6337,69 +4114,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6514,69 +4234,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6691,69 +4354,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -6868,69 +4474,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7045,69 +4594,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7273,69 +4765,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7501,69 +4936,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7729,69 +5107,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -7957,69 +5278,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -8030,6 +5294,7 @@ SET @@global.slave_checkpoint_period= 3; # CHECK CONSISTENCY ######################################################################## include/start_slave.inc +include/sync_slave_sql_with_master.inc ######################################################################## # CLEAN UP ######################################################################## diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe_small.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe_small.result index e0b25854..751bdd6c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe_small.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixed_mts_rec_crash_safe_small.result @@ -367,69 +367,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -476,69 +419,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -568,69 +454,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -677,69 +506,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -786,69 +558,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -929,69 +644,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1038,69 +696,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1181,69 +782,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1290,69 +834,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1399,69 +886,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1508,69 +938,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1651,69 +1024,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1794,69 +1110,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -1937,69 +1196,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ ==== begin rpl_mts_crash_safe.inc:recovery ==== include/start_slave_io.inc ** fixing gaps ** -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] -==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0' -.==== BEGIN include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -.==== END include/rpl_reconnect.inc ==== -. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --relay-log-recovery=0 --slave-parallel-workers=0] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' START SLAVE UNTIL SQL_AFTER_MTS_GAPS; include/wait_for_slave_param.inc [Until_Condition] include/wait_for_slave_sql_to_stop.inc ** regular restart ** include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] -==== BEGIN include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -.==== BEGIN include/rpl_stop_server.inc ==== -[connection server_2] -[connection slave] -.==== END include/rpl_stop_server.inc [server_number=2] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -# debug: rpl_server_number='2' rpl_start_with_gtids='' rpl_server_parameters='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' _RPL_START_SERVER_PARAMETERS='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -.==== BEGIN include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection server_2] -# debug: params='--skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1' -..==== BEGIN include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' ----- Enable reconnect ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] ----- Wait for reconnect and disable reconnect on all connections ---- -[connection slave] -[connection slave1] -[connection server_2] -[connection server_2_1] -[connection server_2] -..==== END include/rpl_reconnect.inc ==== -.. con='server_2' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -.==== END include/rpl_start_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== -. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -[connection slave] -==== END include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start --slave-transaction-retries=0 --relay-log-info-repository=TABLE --master-info-repository=TABLE --sync-master-info=1] ==== - con='slave' warn='1' qlog='1' rlog='1' aborterr='1' include/start_slave_io.inc include/start_slave_sql.inc include/stop_slave.inc @@ -2010,6 +1212,7 @@ SET @@global.slave_checkpoint_period= 2; # CHECK CONSISTENCY ######################################################################## include/start_slave.inc +include/sync_slave_sql_with_master.inc ######################################################################## # CLEAN UP ######################################################################## diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result index a067d98d..24926cd3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result @@ -12530,12 +12530,15 @@ CREATE TABLE `t1` ( `c4` int(10) unsigned NOT NULL, `c5` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; +include/sync_slave_sql_with_master.inc ALTER TABLE `t1` Engine=InnoDB; SET AUTOCOMMIT=0; INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL); COMMIT; ROLLBACK; SET AUTOCOMMIT=1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE `t1`; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_multi_query.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_multi_query.result index fff13679..dcf5edac 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_multi_query.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_multi_query.result @@ -10,6 +10,7 @@ insert into mysqltest.t1 values(2); insert into mysqltest.t1 values(3); insert into mysqltest.t1 values(4); insert into mysqltest.t1 values(5)/ +include/sync_slave_sql_with_master.inc select * from mysqltest.t1; n 1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_no_op.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_no_op.result index 95e68d29..48616a1d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_no_op.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_no_op.result @@ -7,22 +7,27 @@ create database mysqltest; drop database if exists mysqltest; Warnings: Note 1008 Can't drop database 'mysqltest'; database doesn't exist +include/sync_slave_sql_with_master.inc show tables from mysqltest; ERROR 42000: Unknown database 'mysqltest' create table t1 (a int); drop table if exists t1; Warnings: Note 1051 Unknown table 'test.t1' +include/sync_slave_sql_with_master.inc select * from t1; ERROR 42S02: Table 'test.t1' doesn't exist create table t1 (a int, b int); +include/sync_slave_sql_with_master.inc insert into t1 values(1,1); delete from t1; +include/sync_slave_sql_with_master.inc select * from t1; a b insert into t1 values(1,1); insert into t1 values(2,1); update t1 set a=2; +include/sync_slave_sql_with_master.inc select * from t1; a b 2 1 @@ -31,8 +36,10 @@ create table t2 (a int, b int); delete from t1; insert into t1 values(1,1); insert into t2 values(1,1); +include/sync_slave_sql_with_master.inc update t1 set a=2; UPDATE t1, t2 SET t1.a = t2.a; +include/sync_slave_sql_with_master.inc select * from t1; a b 1 1 @@ -41,12 +48,15 @@ a b 1 1 delete from t1; delete from t2; +include/sync_slave_sql_with_master.inc insert into t1 values(1,1); insert into t2 values(1,1); DELETE t1.*, t2.* from t1, t2; +include/sync_slave_sql_with_master.inc select * from t1; a b select * from t2; a b drop table t1, t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result index 4bf1270c..579fee5a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result @@ -8,6 +8,7 @@ INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +include/sync_slave_sql_with_master.inc LOCK TABLE t1 WRITE; INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); @@ -21,6 +22,8 @@ INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); UNLOCK TABLES; FLUSH LOGS; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1,slave:test.t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result index a95a3610..18a4d43e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result @@ -15,4 +15,5 @@ DROP TABLE t1; # assertion: sync slave with master makes slave not to stop with # duplicate key error (because it has received event # with expected error code). +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_until.result index babb1fc7..7b23a209 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_until.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_until.result @@ -5,6 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); [on slave] +include/sync_slave_sql_with_master.inc include/stop_slave.inc ==== Create some events on master ==== [on master] @@ -48,6 +49,7 @@ include/check_slave_param.inc [Exec_Master_Log_Pos] start slave; [on master] [on slave] +include/sync_slave_sql_with_master.inc include/stop_slave.inc start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS; include/wait_for_slave_io_to_start.inc @@ -71,6 +73,7 @@ Note 1254 Slave is already running include/stop_slave.inc drop table if exists t1; reset slave; +RESET MASTER; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; Warnings: Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_until_pos_middle_gtid.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_until_pos_middle_gtid.result new file mode 100644 index 00000000..715457bd --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_until_pos_middle_gtid.result @@ -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] +[connection slave] +include/stop_slave_sql.inc +# Saving master position to use on UNTIL clause of START SLAVE +[connection master] +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 VALUES (1); +COMMIT; +include/sync_slave_io_with_master.inc +# Start SQL thread until it executed the CREATE TABLE +START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE = "MASTER_FILE", MASTER_LOG_POS = MASTER_POS; +# Wait until SQL thread reaches last master binlog file +include/wait_for_slave_param.inc [Relay_Master_Log_File] +# Wait until SQL thread reaches desired master binlog position +include/wait_for_slave_param.inc [Exec_Master_Log_Pos] +# If the desired position was reached, SQL thread should stop. +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [t1 should be replicated] +include/start_slave_sql.inc +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_user_variables.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_user_variables.result index 3293abd1..2d6b9b91 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_user_variables.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stm_user_variables.result @@ -39,6 +39,7 @@ double 1.8446744073709552e19 float 1.84467e19 real 18446744073709552000.00 decimal 18446744073709551615.00 +include/sync_slave_sql_with_master.inc #### [ on slave ] SELECT * FROM t1; tinyint 127 @@ -91,6 +92,7 @@ double 1.8446744073709552e19 float 1.84467e19 real 18446744073709552000.00 decimal 18446744073709551615.00 +include/sync_slave_sql_with_master.inc #### [ on slave ] SELECT * FROM t1; tinyint 127 @@ -131,6 +133,7 @@ double -9.223372036854776e18 float -9.22337e18 real -9223372036854776000.00 decimal -9223372036854775808.00 +include/sync_slave_sql_with_master.inc #### [ on slave ] SELECT * FROM t1; tinyint -128 @@ -183,6 +186,7 @@ double -9.223372036854776e18 float -9.22337e18 real -9223372036854776000.00 decimal -9223372036854775808.00 +include/sync_slave_sql_with_master.inc #### [ on slave ] SELECT * FROM t1; tinyint -128 @@ -205,6 +209,7 @@ include/diff_tables.inc [master:t1,slave:t1] TRUNCATE t1; ## check: contents of both tables master's and slave's DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t1 ( c INT, PRIMARY KEY (c)) Engine=MyISAM; CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW SET @aux = -1 ; @@ -212,10 +217,12 @@ SET @aux = 10294947273192243200; SET @aux1= @aux; INSERT INTO t1 VALUES (@aux) , (@aux1); ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY' +include/sync_slave_sql_with_master.inc ## assertion: master and slave tables are in sync include/diff_tables.inc [master:t1,slave:t1] DROP TRIGGER tr1; DROP TABLE t1; +include/sync_slave_sql_with_master.inc # The GET DIAGNOSTICS itself is not replicated, but it can set # variables which can be used in statements that are replicated. @@ -233,6 +240,7 @@ GET DIAGNOSTICS count = ROW_COUNT; INSERT INTO t1 VALUES (1, count); END| CALL p1(); +include/sync_slave_sql_with_master.inc # On slave, check if the statement was replicated. SELECT * FROM t1 ORDER BY a; a b @@ -262,4 +270,5 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1, NAME_CONST( master-bin.000001 # Query # # COMMIT 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_stop_slave.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stop_slave.result index 7aeb18aa..0db4a0d1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -11,6 +11,7 @@ Note #### Storing MySQL user name or password information in the master info rep # STOP SLAVE should wait until the transaction has finished. CREATE TABLE t1(c1 INT) ENGINE=InnoDB; CREATE TABLE t2(c1 INT) ENGINE=InnoDB; +include/sync_slave_sql_with_master.inc SET DEBUG_SYNC= 'RESET'; include/stop_slave.inc @@ -97,10 +98,13 @@ DROP TABLE t1, t2; CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES(1, 1); +include/sync_slave_sql_with_master.inc +include/stop_slave.inc [connection master] +include/stop_dump_threads.inc SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; [connection slave] -include/restart_slave.inc +include/start_slave.inc BEGIN; UPDATE t1 SET c2 = 2 WHERE c1 = 1; [connection master] @@ -119,8 +123,11 @@ SET DEBUG_SYNC= 'RESET'; [connection slave] include/wait_for_slave_to_stop.inc [connection slave1] +[connection master] +SET GLOBAL debug= '$debug_save'; +include/stop_dump_threads.inc +[connection slave1] include/start_slave.inc [connection master] DROP TABLE t1, t2; -SET GLOBAL debug= $debug_save; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result index 81778f0f..fe53cc7b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result @@ -266,6 +266,7 @@ set @a=2.345; insert delayed into t2 values(@a); Warnings: Warning 1287 'INSERT DELAYED' is deprecated and will be removed in a future release. Please use INSERT instead +include/sync_slave_sql_with_master.inc create table t20 select * from t1; create table t21 select * from t2; create table t22 select * from t3; @@ -282,12 +283,14 @@ end| select f("try_41_"); f("try_41_") 1 +include/sync_slave_sql_with_master.inc use mysqltest1; insert into t2 values(2,null),(3,null),(4,null); delete from t2 where a>=2; select f("try_42_"); f("try_42_") 1 +include/sync_slave_sql_with_master.inc insert into t2 values(3,null),(4,null); delete from t2 where a>=3; prepare stmt1 from 'select f(?)'; @@ -297,6 +300,7 @@ execute stmt1 using @string; f(?) 1 deallocate prepare stmt1; +include/sync_slave_sql_with_master.inc create table t12 select * from t1; drop table t1; create table t1 (a int, b varchar(100), key(a)); @@ -322,12 +326,14 @@ end| select f1("try_46_"),f2("try_47_"); f1("try_46_") f2("try_47_") 1 1 +include/sync_slave_sql_with_master.inc insert into t2 values(2,null),(3,null),(4,null); delete from t2 where a>=2; select f1("try_48_"),f2("try_49_"); f1("try_48_") f2("try_49_") 1 1 insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_"))); +include/sync_slave_sql_with_master.inc drop function f2; create function f2 (x varchar(100)) returns int deterministic begin @@ -339,6 +345,7 @@ end| select f1("try_53_"),f2("try_54_"); f1("try_53_") f2("try_54_") 1 3 +include/sync_slave_sql_with_master.inc drop function f2; create trigger t1_bi before insert on t1 for each row begin @@ -347,12 +354,14 @@ end| insert into t1 values(null,"try_56_"); alter table t1 modify a int, drop primary key; insert into t1 values(null,"try_57_"); +include/sync_slave_sql_with_master.inc CREATE TEMPORARY TABLE t15 SELECT UUID(); create table t16 like t15; INSERT INTO t16 SELECT * FROM t15; insert into t16 values("try_65_"); drop table t15; insert into t16 values("try_66_"); +include/sync_slave_sql_with_master.inc select count(*) from t1; count(*) 7 @@ -392,6 +401,7 @@ count(*) select count(*) from t16; count(*) 3 +include/sync_slave_sql_with_master.inc DROP TABLE IF EXISTS t11; SET SESSION BINLOG_FORMAT=STATEMENT; CREATE TABLE t11 (song VARCHAR(255)); @@ -404,6 +414,7 @@ UNLOCK TABLES; SELECT * FROM t11; song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict song Careful With That Axe, Eugene +include/sync_slave_sql_with_master.inc USE mysqltest1; SELECT * FROM t11; song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict @@ -414,6 +425,7 @@ CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; +include/sync_slave_sql_with_master.inc CREATE FUNCTION my_user() RETURNS CHAR(64) BEGIN @@ -434,6 +446,8 @@ INSERT INTO t13 VALUES (USER()); INSERT INTO t13 VALUES (my_user()); INSERT INTO t13 VALUES (CURRENT_USER()); INSERT INTO t13 VALUES (my_current_user()); +include/sync_slave_sql_with_master.inc drop database mysqltest1; +include/sync_slave_sql_with_master.inc set global binlog_format =@my_binlog_format; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sync.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sync.result index f3d62609..2ecb880a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sync.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sync.result @@ -12,6 +12,7 @@ insert into t1(a) values(1); insert into t1(a) values(2); insert into t1(a) values(3); =====Inserting data on the master but without the SQL Thread being running=======; +include/sync_slave_sql_with_master.inc include/stop_slave_sql.inc insert into t1(a) values(4); insert into t1(a) values(5); @@ -24,6 +25,7 @@ ERROR HY000: Lost connection to MySQL server during query include/rpl_reconnect.inc =====Dumping and comparing tables=======; include/start_slave.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1,slave:t1] =====Corrupting the master.info=======; include/stop_slave.inc @@ -37,6 +39,7 @@ ERROR HY000: Lost connection to MySQL server during query include/rpl_reconnect.inc =====Dumping and comparing tables=======; include/start_slave.inc +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1,slave:t1] =====Clean up=======; drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table.result index 4c3d7e12..6163cd06 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table.result @@ -45,4 +45,5 @@ Slave_open_temp_tables 0 drop table if exists t1,t2; Warnings: Note 1051 Unknown table 'test.t1' +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result index 99611167..72756014 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result @@ -9,6 +9,7 @@ CREATE TABLE t1 (a CHAR(48)); CREATE TEMPORARY TABLE t1_tmp1(a INT); INSERT INTO t1 VALUES (UUID()); [on slave] +include/sync_slave_sql_with_master.inc ==== Verify results on slave ==== SHOW STATUS LIKE "Slave_open_temp_tables"; Variable_name Value @@ -16,6 +17,7 @@ Slave_open_temp_tables 1 [on master] [on master1] [on slave] +include/sync_slave_sql_with_master.inc ==== Verify results on slave ==== SHOW STATUS LIKE "Slave_open_temp_tables"; Variable_name Value @@ -25,6 +27,7 @@ Slave_open_temp_tables 0 include/rpl_connect.inc [creating master] DROP TABLE t1; [on slave] +include/sync_slave_sql_with_master.inc include/rpl_reset.inc CREATE TABLE t1 (a int); CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); @@ -36,6 +39,7 @@ DELETE FROM t2; CREATE TEMPORARY TABLE t2_tmp (a int); ALTER TABLE t1_tmp ADD COLUMN c INT; ### assertion: assert that there is one open temp table on slave +include/sync_slave_sql_with_master.inc SHOW STATUS LIKE 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 @@ -43,11 +47,13 @@ DROP TABLE t1_tmp, t2; INSERT INTO t1 VALUES (1); DROP TEMPORARY TABLE t2_tmp; INSERT INTO t1 VALUES (2); +include/sync_slave_sql_with_master.inc ### assertion: assert that slave has no temporary tables opened SHOW STATUS LIKE 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 DROP TABLE t3, 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 # # use `test`; CREATE TABLE t1 (a int) @@ -107,8 +113,10 @@ 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 # # COMMIT +include/sync_slave_sql_with_master.inc # Compare the base table. include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporal_fractional.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporal_fractional.result index bce65feb..8dbf883e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporal_fractional.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporal_fractional.result @@ -41,6 +41,7 @@ ts3 1970-01-01 07:10:10.123 ts4 1970-01-01 07:10:10.1235 ts5 1970-01-01 07:10:10.12346 ts6 1970-01-01 07:10:10.123456 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; ts0 2001-01-01 13:10:10 ts1 2001-01-01 13:10:10.1 @@ -64,6 +65,7 @@ ts4 1970-01-01 10:10:10.1235 ts5 1970-01-01 10:10:10.12346 ts6 1970-01-01 10:10:10.123456 DROP TABLE t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 ( dt0 DATETIME(0), @@ -100,6 +102,7 @@ dt3 1970-01-01 07:10:10.123 dt4 1970-01-01 07:10:10.1235 dt5 1970-01-01 07:10:10.12346 dt6 1970-01-01 07:10:10.123456 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; dt0 2001-01-01 10:10:10 dt1 2001-01-01 10:10:10.1 @@ -123,6 +126,7 @@ dt4 1970-01-01 07:10:10.1235 dt5 1970-01-01 07:10:10.12346 dt6 1970-01-01 07:10:10.123456 DROP TABLE t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 ( t0 TIME(0), @@ -159,6 +163,7 @@ t3 07:10:10.123 t4 07:10:10.1235 t5 07:10:10.12346 t6 07:10:10.123456 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; t0 10:10:10 t1 10:10:10.1 @@ -182,4 +187,5 @@ t4 07:10:10.1235 t5 07:10:10.12346 t6 07:10:10.123456 DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary.result index 0af13471..b3305cfe 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary.result @@ -8,22 +8,27 @@ reset master; DROP TABLE IF EXISTS t1; CREATE TEMPORARY TABLE t1 (a char(1)); INSERT INTO t1 VALUES ('a'); +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/start_slave.inc INSERT INTO t1 VALUES ('b'); +include/sync_slave_sql_with_master.inc DROP TABLE IF EXISTS t1; CREATE TEMPORARY TABLE `t1`(`a` tinyint,`b` char(1))engine=myisam; INSERT INTO `t1` set `a`=128,`b`='128'; Warnings: Warning 1264 Out of range value for column 'a' at row 1 Warning 1265 Data truncated for column 'b' at row 1 +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/start_slave.inc INSERT INTO `t1` set `a`=128,`b`='128'; Warnings: Warning 1264 Out of range value for column 'a' at row 1 Warning 1265 Data truncated for column 'b' at row 1 +include/sync_slave_sql_with_master.inc DROP TABLE t1; +include/sync_slave_sql_with_master.inc SET @save_select_limit=@@session.sql_select_limit; SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100; ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation @@ -98,8 +103,10 @@ f 7 drop table t1,t2; create temporary table t3 (f int); +include/sync_slave_sql_with_master.inc create temporary table t4 (f int); create table t5 (f int); +include/sync_slave_sql_with_master.inc stop slave; insert into t5 select * from t4; start slave; @@ -120,14 +127,17 @@ create temporary table t302 (id int); create temporary table `#sql_not_user_table303` (id int); create table t1(f int); insert into t1 values (1); +include/sync_slave_sql_with_master.inc select * from t1 /* must be 1 */; f 1 drop table t1; +include/sync_slave_sql_with_master.inc select * from t1; a 1 drop table t1; +include/sync_slave_sql_with_master.inc include/stop_slave.inc include/rpl_reset.inc -- Bug#43748 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary_errors.result index 8da611b6..567ff2d3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary_errors.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_temporary_errors.result @@ -8,6 +8,7 @@ call mtr.add_suppression("Deadlock found"); CREATE TABLE t1 (a INT PRIMARY KEY, b INT); INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); **** On Slave **** +include/sync_slave_sql_with_master.inc SHOW STATUS LIKE 'Slave_retried_transactions'; Variable_name Value Slave_retried_transactions 0 @@ -28,6 +29,7 @@ a b 3 3 4 4 **** On Slave **** +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; SHOW STATUS LIKE 'Slave_retried_transactions'; Variable_name Value diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_timestamp_upgrage_55.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_timestamp_upgrage_55.result new file mode 100644 index 00000000..dd08cde2 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_timestamp_upgrage_55.result @@ -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] +[connection slave] +include/stop_slave.inc +include/start_slave.inc +[connection master] +CREATE TABLE bug17532932(a TIMESTAMP, +b DATETIME, +c TIME)ENGINE=MYISAM; +include/sync_slave_sql_with_master.inc +DROP TABLE bug17532932; +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2] +include/rpl_start_slaves.inc +[connection master] +INSERT INTO bug17532932 VALUES ("2014-04-16 12:35:51", +"2010-08-26 12:15:52", +"-38:59:59"); +include/sync_slave_sql_with_master.inc +include/diff_tables.inc [master:bug17532932, slave:bug17532932] +[connection master] +DROP TABLE bug17532932; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_timezone.result index 0e07e496..5121a531 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_timezone.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_timezone.result @@ -21,6 +21,7 @@ t n 2005-06-11 09:39:02 2 2004-01-01 00:00:00 3 2004-06-11 09:39:02 4 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY n; t n 2005-01-01 06:00:00 1 @@ -34,6 +35,7 @@ SELECT * FROM t1 ORDER BY n; t n 2004-01-01 00:00:00 5 2004-06-11 09:39:02 6 +include/sync_slave_sql_with_master.inc set time_zone='Europe/Moscow'; SELECT * FROM t1 ORDER BY n; t n @@ -51,6 +53,7 @@ SELECT * FROM t1 ORDER BY n; t n 0000-00-00 00:00:00 7 0000-00-00 00:00:00 8 +include/sync_slave_sql_with_master.inc set time_zone='UTC'; SELECT * FROM t1 ORDER BY n; t n @@ -66,6 +69,7 @@ SELECT * FROM t1 ORDER BY n; t n 2003-12-31 22:00:00 9 2004-06-11 07:39:02 10 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY n; t n 2003-12-31 22:00:00 9 @@ -73,6 +77,7 @@ t n delete from t2; set timestamp=1000072000; insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL); +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY n; t n 2001-09-09 23:46:40 11 @@ -85,6 +90,7 @@ SELECT * FROM t2 ORDER BY n; t n 2001-09-09 03:46:40 14 1000000000 15 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY n; t n 2001-09-09 03:46:40 14 @@ -98,11 +104,13 @@ SELECT * FROM t2 ORDER BY n; t n 2003-12-31 23:00:00 16 2005-01-01 08:00:00 17 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY n; t n 2003-12-31 23:00:00 16 2005-01-01 08:00:00 17 drop table t1, t2; +include/sync_slave_sql_with_master.inc set global time_zone= @my_time_zone; End of 4.1 tests CREATE TABLE t1 (a INT, b TIMESTAMP); @@ -114,6 +122,7 @@ Warning 1264 Out of range value for column 'b' at row 1 SELECT * FROM t1 ORDER BY a; a b 1 0000-00-00 00:00:00 +include/sync_slave_sql_with_master.inc SET @@session.time_zone='Japan'; SELECT * FROM t1 ORDER BY a; a b @@ -121,6 +130,7 @@ a b SET @@session.time_zone = default; DROP TABLE t1; SET @@session.time_zone = default; +include/sync_slave_sql_with_master.inc include/stop_slave.inc reset master; CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL); diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result index 68ed9e81..71ae70a2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result @@ -93,6 +93,7 @@ INSERT INTO t1 VALUES (1); DROP TABLE t2; INSERT INTO t1 VALUES (1); DROP TEMPORARY TABLE t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a CHAR(30)); CREATE TEMPORARY TABLE t2 (b CHAR(60)); LOCK TABLE t1 WRITE; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_trigger.result index e7be31d8..2da4c855 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_trigger.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_trigger.result @@ -44,6 +44,7 @@ a name old_a old_b truncate(rand_value,4) 105 t2 4 0 0.6635 106 t2 6 0 0.6699 107 t2 500 0 0.3593 +include/sync_slave_sql_with_master.inc --- On slave -- select a,b, truncate(rand_value,4) from t1; @@ -99,6 +100,7 @@ FROM information_schema.triggers WHERE trigger_name = 't1_first'; trigger_name definer t1_first root@localhost +include/sync_slave_sql_with_master.inc --- On slave -- SELECT routine_name, definer @@ -135,6 +137,7 @@ end| create database other; use other; insert into test.t1 values (1); +include/sync_slave_sql_with_master.inc use test; drop table t1,t2; drop database other; @@ -150,6 +153,7 @@ insert into t110 values (-4); insert into t110 values (-3); insert into t110 values (-2); insert into t110 values (-1); +include/sync_slave_sql_with_master.inc select * from t110; f1 -5 @@ -194,6 +198,7 @@ UPDATE t110 SET f1=4 where f1=-4; UPDATE t110 SET f1=3 where f1=-3; UPDATE t110 SET f1=2 where f1=-2; UPDATE t110 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t110 /* must be f1 5 ... 1 */; f1 5 @@ -211,6 +216,7 @@ f3 drop trigger trg110; drop table t210,t310; drop table t110; +include/sync_slave_sql_with_master.inc ------------------- 9 ------------------- @@ -222,6 +228,7 @@ insert into t19 values (-4); insert into t19 values (-3); insert into t19 values (-2); insert into t19 values (-1); +include/sync_slave_sql_with_master.inc select * from t19; f1 -5 @@ -266,6 +273,7 @@ UPDATE t19 SET f1=4 where f1=-4; UPDATE t19 SET f1=3 where f1=-3; UPDATE t19 SET f1=2 where f1=-2; UPDATE t19 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t19 /* must be f1 5 ... 1 */; f1 5 @@ -283,6 +291,7 @@ f3 drop trigger trg19; drop table t29,t39; drop table t19; +include/sync_slave_sql_with_master.inc ------------------- 8 ------------------- @@ -294,6 +303,7 @@ insert into t18 values (-4); insert into t18 values (-3); insert into t18 values (-2); insert into t18 values (-1); +include/sync_slave_sql_with_master.inc select * from t18; f1 -5 @@ -338,6 +348,7 @@ UPDATE t18 SET f1=4 where f1=-4; UPDATE t18 SET f1=3 where f1=-3; UPDATE t18 SET f1=2 where f1=-2; UPDATE t18 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t18 /* must be f1 5 ... 1 */; f1 5 @@ -355,6 +366,7 @@ f3 drop trigger trg18; drop table t28,t38; drop table t18; +include/sync_slave_sql_with_master.inc ------------------- 7 ------------------- @@ -366,6 +378,7 @@ insert into t17 values (-4); insert into t17 values (-3); insert into t17 values (-2); insert into t17 values (-1); +include/sync_slave_sql_with_master.inc select * from t17; f1 -5 @@ -410,6 +423,7 @@ UPDATE t17 SET f1=4 where f1=-4; UPDATE t17 SET f1=3 where f1=-3; UPDATE t17 SET f1=2 where f1=-2; UPDATE t17 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t17 /* must be f1 5 ... 1 */; f1 5 @@ -427,6 +441,7 @@ f3 drop trigger trg17; drop table t27,t37; drop table t17; +include/sync_slave_sql_with_master.inc ------------------- 6 ------------------- @@ -438,6 +453,7 @@ insert into t16 values (-4); insert into t16 values (-3); insert into t16 values (-2); insert into t16 values (-1); +include/sync_slave_sql_with_master.inc select * from t16; f1 -5 @@ -482,6 +498,7 @@ UPDATE t16 SET f1=4 where f1=-4; UPDATE t16 SET f1=3 where f1=-3; UPDATE t16 SET f1=2 where f1=-2; UPDATE t16 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t16 /* must be f1 5 ... 1 */; f1 5 @@ -499,6 +516,7 @@ f3 drop trigger trg16; drop table t26,t36; drop table t16; +include/sync_slave_sql_with_master.inc ------------------- 5 ------------------- @@ -510,6 +528,7 @@ insert into t15 values (-4); insert into t15 values (-3); insert into t15 values (-2); insert into t15 values (-1); +include/sync_slave_sql_with_master.inc select * from t15; f1 -5 @@ -554,6 +573,7 @@ UPDATE t15 SET f1=4 where f1=-4; UPDATE t15 SET f1=3 where f1=-3; UPDATE t15 SET f1=2 where f1=-2; UPDATE t15 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t15 /* must be f1 5 ... 1 */; f1 5 @@ -571,6 +591,7 @@ f3 drop trigger trg15; drop table t25,t35; drop table t15; +include/sync_slave_sql_with_master.inc ------------------- 4 ------------------- @@ -582,6 +603,7 @@ insert into t14 values (-4); insert into t14 values (-3); insert into t14 values (-2); insert into t14 values (-1); +include/sync_slave_sql_with_master.inc select * from t14; f1 -5 @@ -626,6 +648,7 @@ UPDATE t14 SET f1=4 where f1=-4; UPDATE t14 SET f1=3 where f1=-3; UPDATE t14 SET f1=2 where f1=-2; UPDATE t14 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t14 /* must be f1 5 ... 1 */; f1 5 @@ -643,6 +666,7 @@ f3 drop trigger trg14; drop table t24,t34; drop table t14; +include/sync_slave_sql_with_master.inc ------------------- 3 ------------------- @@ -654,6 +678,7 @@ insert into t13 values (-4); insert into t13 values (-3); insert into t13 values (-2); insert into t13 values (-1); +include/sync_slave_sql_with_master.inc select * from t13; f1 -5 @@ -698,6 +723,7 @@ UPDATE t13 SET f1=4 where f1=-4; UPDATE t13 SET f1=3 where f1=-3; UPDATE t13 SET f1=2 where f1=-2; UPDATE t13 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t13 /* must be f1 5 ... 1 */; f1 5 @@ -715,6 +741,7 @@ f3 drop trigger trg13; drop table t23,t33; drop table t13; +include/sync_slave_sql_with_master.inc ------------------- 2 ------------------- @@ -726,6 +753,7 @@ insert into t12 values (-4); insert into t12 values (-3); insert into t12 values (-2); insert into t12 values (-1); +include/sync_slave_sql_with_master.inc select * from t12; f1 -5 @@ -770,6 +798,7 @@ UPDATE t12 SET f1=4 where f1=-4; UPDATE t12 SET f1=3 where f1=-3; UPDATE t12 SET f1=2 where f1=-2; UPDATE t12 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t12 /* must be f1 5 ... 1 */; f1 5 @@ -787,6 +816,7 @@ f3 drop trigger trg12; drop table t22,t32; drop table t12; +include/sync_slave_sql_with_master.inc ------------------- 1 ------------------- @@ -798,6 +828,7 @@ insert into t11 values (-4); insert into t11 values (-3); insert into t11 values (-2); insert into t11 values (-1); +include/sync_slave_sql_with_master.inc select * from t11; f1 -5 @@ -842,6 +873,7 @@ UPDATE t11 SET f1=4 where f1=-4; UPDATE t11 SET f1=3 where f1=-3; UPDATE t11 SET f1=2 where f1=-2; UPDATE t11 SET f1=1 where f1=-1; +include/sync_slave_sql_with_master.inc SELECT * from t11 /* must be f1 5 ... 1 */; f1 5 @@ -859,6 +891,7 @@ f3 drop trigger trg11; drop table t21,t31; drop table t11; +include/sync_slave_sql_with_master.inc STOP SLAVE; FLUSH LOGS; include/rpl_stop_server.inc [server_number=1] @@ -912,6 +945,7 @@ DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; ---> Synchronizing slave with master... +include/sync_slave_sql_with_master.inc ---> connection: master @@ -934,6 +968,7 @@ c 10 ---> Synchronizing slave with master... +include/sync_slave_sql_with_master.inc ---> connection: master ---> Checking on slave... @@ -949,6 +984,7 @@ c ---> Cleaning up... DROP TABLE t1; DROP TABLE t2; +include/sync_slave_sql_with_master.inc drop table if exists t1; create table t1(a int, b varchar(50)); drop trigger not_a_trigger; @@ -970,12 +1006,14 @@ a b 1 In trigger t1_bi 2 b 3 c +include/sync_slave_sql_with_master.inc select * from t1; a b 1 In trigger t1_bi 2 b 3 c drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc create table t1 ( f int ) engine = innodb; create table log ( r int ) engine = myisam; @@ -987,7 +1025,9 @@ insert into t1 values ( 1 ); rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:log, slave:log] drop table t1, log; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_trunc_temp.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_trunc_temp.result index 4c2ec745..25d28546 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_trunc_temp.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_trunc_temp.result @@ -5,14 +5,17 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] create temporary table t1 (n int); insert into t1 values(1); +include/sync_slave_sql_with_master.inc show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 delete from t1; +include/sync_slave_sql_with_master.inc show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 truncate t1; +include/sync_slave_sql_with_master.inc show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result index a800b758..24cd9ced 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result @@ -7,32 +7,42 @@ include/rpl_reset.inc **** On Master **** CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,1), (2,2); +include/sync_slave_sql_with_master.inc **** On Master **** TRUNCATE TABLE t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] ==== Test using a table with delete triggers ==== **** On Master **** SET @count := 1; CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM; CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1; +include/sync_slave_sql_with_master.inc **** On Master **** TRUNCATE TABLE t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1,t2; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc **** On Master **** CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,1), (2,2); +include/sync_slave_sql_with_master.inc **** On Master **** DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] ==== Test using a table with delete triggers ==== **** On Master **** SET @count := 1; CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM; CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1; +include/sync_slave_sql_with_master.inc **** On Master **** DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1,t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result index c80b7389..ba3f405b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result @@ -7,32 +7,42 @@ include/rpl_reset.inc **** On Master **** CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB; INSERT INTO t1 VALUES (1,1), (2,2); +include/sync_slave_sql_with_master.inc **** On Master **** TRUNCATE TABLE t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] ==== Test using a table with delete triggers ==== **** On Master **** SET @count := 1; CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB; CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1; +include/sync_slave_sql_with_master.inc **** On Master **** TRUNCATE TABLE t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1,t2; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc **** On Master **** CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB; INSERT INTO t1 VALUES (1,1), (2,2); +include/sync_slave_sql_with_master.inc **** On Master **** DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] ==== Test using a table with delete triggers ==== **** On Master **** SET @count := 1; CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB; CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1; +include/sync_slave_sql_with_master.inc **** On Master **** DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] DROP TABLE t1,t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_typeconv.result index 58674f91..2eadb479 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_typeconv.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_typeconv.result @@ -540,5 +540,6 @@ DROP TABLE type_conversions; call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677"); call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); DROP TABLE t1; +include/sync_slave_sql_with_master.inc set global slave_type_conversions = @saved_slave_type_conversions; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result index d98db701..399eafa9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result @@ -7,7 +7,9 @@ SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS; SET GLOBAL SLAVE_TYPE_CONVERSIONS = ''; CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB; INSERT INTO t1 VALUES (b'0', b'01', b'101'); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] DROP TABLE t1; +include/sync_slave_sql_with_master.inc SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_unknown_ignorable_event.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_unknown_ignorable_event.result new file mode 100644 index 00000000..615bee79 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_unknown_ignorable_event.result @@ -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 (c1 INT) ENGINE=InnoDB; +include/sync_slave_sql_with_master.inc +# Set a debug point on slave to simulate unknown ignorable log events. +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,simulate_unknown_ignorable_log_event'; +[connection master] +# Write a previous_gtids log event to binlog +# on master if gtid mode is on. +FLUSH LOGS; +# Write a write_rows log event to binlog on master. +INSERT INTO t1 VALUES (1); +# The slave receiver thread simulates an unknown ignorable +# log event by rewriting the write_rows log event and +# previous_gtids log event if gtid mode is on before +# writing it(them) in relay log. +include/sync_slave_sql_with_master.inc +# Verify that the slave applier thread skips these unknown ignorable +# log event. +include/assert.inc [Table t1 must not contain 1] +SET GLOBAL DEBUG= @save_debug; +[connection master] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_user.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_user.result index 849faccd..5f5ca83e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_user.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_user.result @@ -17,6 +17,7 @@ ERROR HY000: Operation CREATE USER failed for 'foo'@'fakehost','bar'@'fakehost' create user 'foo1'@'fakehost' IDENTIFIED BY 'foo1', 'foo2'@'fakehost' IDENTIFIED BY PASSWORD'*1111111111111111111111111111111111111111', 'foo3'@'fakehost'; +include/sync_slave_sql_with_master.inc select Host,User from mysql.user where Host='fakehost'; Host User fakehost bar @@ -30,6 +31,7 @@ rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost ERROR HY000: Operation RENAME USER failed for 'not_exist_user1'@'fakehost' rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user2'@'fakehost' to 'barfoo'@'fakehost'; ERROR HY000: Operation RENAME USER failed for 'not_exist_user1'@'fakehost','not_exist_user2'@'fakehost' +include/sync_slave_sql_with_master.inc select Host,User from mysql.user where Host='fakehost'; Host User fakehost barbar @@ -43,6 +45,7 @@ drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost'; ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost' drop user 'not_exist_user1'@'fakehost', 'not_exist_user2'@'fakehost'; ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost','not_exist_user2'@'fakehost' +include/sync_slave_sql_with_master.inc select Host,User from mysql.user where Host='fakehost'; Host User # @@ -50,6 +53,7 @@ Host User # CREATE USER must_change2@localhost IDENTIFIED BY 'aha'; ALTER USER must_change2@localhost PASSWORD EXPIRE; +include/sync_slave_sql_with_master.inc select Host,User,password_expired from mysql.user where user='must_change2'; Host User password_expired localhost must_change2 Y @@ -58,11 +62,13 @@ SELECT USER(); ERROR HY000: You must SET PASSWORD before executing this statement # setting a password unlocks it SET PASSWORD = PASSWORD('aha2'); +include/sync_slave_sql_with_master.inc # must not throw an error SELECT USER(); USER() must_change2@localhost DROP USER must_change2@localhost; +include/sync_slave_sql_with_master.inc include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create user 'foo'@'fakehost' diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_user_variables.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_user_variables.result index 4dd5c6d0..3ef29c82 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_user_variables.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_user_variables.result @@ -3,7 +3,11 @@ 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] +include/sync_slave_sql_with_master.inc reset master; +include/stop_slave.inc +RESET MASTER; +include/start_slave.inc create table t1(n char(30)); set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1; set @s1:='This is a test', @r1:=12.5, @r2:=-12.5; @@ -50,6 +54,7 @@ abcn1 abcn1n2 abc\def This is a test +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY n; n NULL @@ -104,6 +109,7 @@ ELSE INSERT INTO test.t21 VALUES ('TRIG_FALSE'); END IF; END| +include/sync_slave_sql_with_master.inc SET @VAR=0; CALL test.insert(); SET @VAR=1; @@ -117,6 +123,7 @@ SELECT * FROM t21; a TRIG_FALSE TRIG_TRUE +include/sync_slave_sql_with_master.inc On slave: Check the tables for correct data and it matches master SELECT * FROM t20; a @@ -152,6 +159,7 @@ i 9 16 25 +include/sync_slave_sql_with_master.inc On slave: Retrieve the values from the table and verify they are the same as on master SELECT * FROM t1; i @@ -177,12 +185,14 @@ SET @c = (@a - 1); END if; return @c; END | +include/sync_slave_sql_with_master.inc SET @a=500; INSERT INTO t1 values(f1()); SET @b = 125; SET @c = 1; INSERT INTO t1 values(f2()); On master: Retrieve the values from the table +include/sync_slave_sql_with_master.inc SELECT * from t1; a 500 @@ -204,6 +214,7 @@ INSERT INTO t2 values (@a); SET @a:=42; INSERT INTO t2 values (@a); END | +include/sync_slave_sql_with_master.inc SET @a:=100; INSERT INTO t1 values (5); On master: Check to see that data was inserted correctly in both tables @@ -214,6 +225,7 @@ SELECT * from t2; k 100 42 +include/sync_slave_sql_with_master.inc On slave: Check the tables for correct data and it matches master SELECT * from t1; i @@ -230,6 +242,7 @@ execute s1 using @x; select * from t1; a b 2 1 +include/sync_slave_sql_with_master.inc select * from t1; a b 2 1 @@ -244,6 +257,7 @@ a 1 2 1 +include/sync_slave_sql_with_master.inc select * from t1; a 1 @@ -260,6 +274,7 @@ FUNCTION f2() RETURNS INT BEGIN INSERT INTO t1 VALUES (10 + @a); RETURN 0; END| +include/sync_slave_sql_with_master.inc SET @a:=123; SELECT f1(), f2(); f1() f2() @@ -270,6 +285,7 @@ SELECT * FROM t1; i 133 123 +include/sync_slave_sql_with_master.inc On slave: Check the table for correct data and it matches master SELECT * FROM t1; i @@ -278,4 +294,5 @@ i DROP FUNCTION f1; DROP FUNCTION f2; DROP TABLE t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_variables.result index 4e99b54e..9337b081 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_variables.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_variables.result @@ -35,6 +35,8 @@ SET @@global.lc_time_names = 'zh_HK'; SET @@local.lc_time_names = 'zh_TW'; SET @@global.sql_mode = 'ALLOW_INVALID_DATES'; SET @@local.sql_mode = 'ANSI_QUOTES,ERROR_FOR_DIVISION_BY_ZERO,HIGH_NOT_PRECEDENCE'; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. SET @user_num = 10; SET @user_text = 'Alunda'; include/stop_slave.inc @@ -537,6 +539,7 @@ EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64; +include/sync_slave_sql_with_master.inc ==== Results ==== SELECT * FROM tstmt ORDER BY id; id truth num text @@ -572,6 +575,7 @@ id truth num text 30 NULL 30 NULL 31 NULL NULL Bergsbrunna 32 NULL NULL Centrum +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep] ==== Clean up ==== [on master] @@ -596,4 +600,5 @@ SET @@global.relay_log_purge= @s_relay_log_purge; SET @@global.slave_exec_mode= @s_slave_exec_mode; SET @@global.sql_mode= @s_sql_mode; SET @@global.sync_binlog= @s_sync_binlog; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_variables_stm.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_variables_stm.result index 442b3e49..0516adf2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_variables_stm.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_variables_stm.result @@ -450,6 +450,7 @@ EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64; +include/sync_slave_sql_with_master.inc ==== Results ==== SELECT * FROM tstmt ORDER BY id; id num text @@ -487,6 +488,7 @@ id num text 56 NULL 47124712 57 NULL 1616 58 NULL 1717 +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep] ==== Clean up ==== [on master] @@ -511,4 +513,5 @@ SET @@global.collation_server= @s_collation_server; SET @@global.time_zone= @s_time_zone; SET @@global.lc_time_names= @s_lc_time_names; SET @@global.collation_database= @s_collation_database; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_view.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_view.result index c2bb0bcb..6f78afb9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_view.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_view.result @@ -5,7 +5,7 @@ Note #### Storing MySQL user name or password information in the master info rep [connection master] drop table if exists t1,v1; drop view if exists t1,v1; -reset master; +include/sync_slave_sql_with_master.inc create table t1 (a int); insert into t1 values (1); create view v1 as select a from t1; @@ -14,6 +14,7 @@ select * from v1 order by a; a 1 2 +include/sync_slave_sql_with_master.inc select * from v1 order by a; a 1 @@ -23,6 +24,7 @@ select * from v1 order by a; a 2 3 +include/sync_slave_sql_with_master.inc select * from v1 order by a; a 2 @@ -31,17 +33,21 @@ delete from v1 where a=2; select * from v1 order by a; a 3 +include/sync_slave_sql_with_master.inc select * from v1 order by a; a 3 alter view v1 as select a as b from t1; +include/sync_slave_sql_with_master.inc select * from v1 order by 1; b 3 drop view v1; +include/sync_slave_sql_with_master.inc select * from v1 order by a; ERROR 42S02: Table 'test.v1' doesn't exist drop table t1; +include/sync_slave_sql_with_master.inc ---> Test for BUG#20438 @@ -51,6 +57,7 @@ DROP TABLE IF EXISTS t1; DROP VIEW IF EXISTS v1; ---> Synchronizing slave with master... +include/sync_slave_sql_with_master.inc ---> connection: master @@ -67,6 +74,7 @@ c 1 ---> Synchronizing slave with master... +include/sync_slave_sql_with_master.inc ---> connection: master ---> Checking on slave... @@ -79,9 +87,11 @@ c ---> Cleaning up... DROP VIEW v1; DROP TABLE t1; +include/sync_slave_sql_with_master.inc create table t1(a int, b int); insert into t1 values (1, 1), (1, 2), (1, 3); create view v1(a, b) as select a, sum(b) from t1 group by a; +include/sync_slave_sql_with_master.inc explain v1; Field Type Null Key Default Extra a int(11) YES NULL @@ -94,12 +104,14 @@ a b 1 6 drop table t1; drop view v1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1(a INT); CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1; ERROR 42S01: Table 'v1' already exists DROP VIEW v1; DROP TABLE t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a INT); # create view as output from mysqldump 10.11 (5.0.62) /*!50001 CREATE ALGORITHM=UNDEFINED */ @@ -109,10 +121,12 @@ CREATE TABLE t1 (a INT); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci +include/sync_slave_sql_with_master.inc SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci DROP VIEW v1; DROP TABLE t1; +include/sync_slave_sql_with_master.inc End of 5.0 tests include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_view_multi.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_view_multi.result index 041a23d6..21054255 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_view_multi.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_view_multi.result @@ -12,6 +12,7 @@ Note #### Storing MySQL user name or password information in the master info rep drop tables if exists t1, t2; drop view if exists v1; # Syncing slave with master and switching to connection 'slave' +include/sync_slave_sql_with_master.inc # Switching to connection 'master' create table t1 (i int); create table t2 (i int); @@ -41,6 +42,7 @@ select * from t1; i 1 # Syncing slave with master and switching to connection 'slave' +include/sync_slave_sql_with_master.inc # Check that slave was able to replicate this sequence # which means that we got correct binlog order. select * from t1; @@ -75,6 +77,7 @@ i select * from t2; i # Syncing slave with master and switching to connection 'slave' +include/sync_slave_sql_with_master.inc # Now let us check that statements were logged in proper order # So we have same result on slave. select * from t1; @@ -87,4 +90,5 @@ i drop table t1, t2; drop view v1; # Syncing slave with master and switching to connection 'slave' +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000010.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000010.test index de6337dd..58a05904 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000010.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000010.test @@ -1,16 +1,17 @@ # This tests the offset off by 22 mystery bug # Must run slave with --disconnect-slave-event-count=1 --master-connect-retry=1 +source include/not_gtid_enabled.inc; source include/master-slave.inc; create table t1 (n int not null auto_increment primary key); insert into t1 values(NULL); insert into t1 values(2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select n from t1; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000011.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000011.test index 625b0c22..4b4a5858 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000011.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000011.test @@ -2,7 +2,7 @@ source include/master-slave.inc; create table t1 (n int); insert into t1 values(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc stop slave; --source include/wait_for_slave_to_stop.inc start slave; @@ -10,11 +10,11 @@ start slave; connection master; insert into t1 values(2); #let slave catch up -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000017.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000017.test index 9e4a3223..242147e1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000017.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_000017.test @@ -37,7 +37,7 @@ connection slave; connection master; create table t1(n int); insert into t1 values(24); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_4threads_deadlock.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_4threads_deadlock.test new file mode 100644 index 00000000..cfbaa6dc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_4threads_deadlock.test @@ -0,0 +1,120 @@ +############################################################################### +# Bug#17283409 4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS, SHOW PROCESSLIST, +# SHOW BINLOGS +# Problem: A deadlock was occuring when 4 threads were involved in acquiring +# locks +# Thread 1: Dump thread ( Slave is reconnecting, so on Master, a new dump +# thread is trying kill zombie dump threads. It acquired +# thread's LOCK_thd_data and it is about to acquire +# mysys_var->current_mutex ( which LOCK_log) +# Thread 2: Application thread is executing show binlogs and acquired +# LOCK_log and it is about to acquire LOCK_index. +# Thread 3: Applicaiton thread is executing Purge binary logs and acquired +# LOCK_index and it is about to acquire LOCK_thread_count. +# Thread 4: Application thread is executing show processlist and acquired +# LOCK_thread_count and it is about to acquire zombie dump +# thread's LOCK_thd_data. +# Deadlock : Thread 1 -> Thread 2 -> Thread 3-> Thread 4 -> Thread 1 +# The same above deadlock was observed when thread 4 is replaced with another +# thread which is executing 'SELECT * FROM information_schema.processlist' +# command and acquired LOCK_thread_count and it is about to acquire zombie +# dump thread's LOCK_thd_data. +# Fix: Introuced a new lock (Lock_thread_remove) which will guard the thread +# deletion (exit process) and the same lock is used in show processlist +# execution instead of LOCK_thread_count. i.e., After the patch, Server allows +# new threads to join the system but it will not allow any threads to execute +# its 'cleanup' process. Now the new lock order is: LOCK_thread_remove -> +# LOCK_thd_data -> LOCK_log -> LOCK_index -> LOCK_thread_count Both the above +# scenarios are tested with the below test code and it proves that there is no +# deadlock after the fix. +############################################################################### +--source include/have_debug_sync.inc +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc + +connect(master2,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect(master3,127.0.0.1,root,,test,$MASTER_MYPORT,); +--connection master +# Create atleast one binary log, otherwise purge logs command, show binary +# logs command do not hit the DEBUG_SYNC points. +FLUSH LOGS; +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='+d,before_dump_thread_acquires_current_mutex,processlist_acquiring_dump_threads_LOCK_thd_data'; + +# Iteration 1 with "SHOW PROCESSLIST command" +# Iteration 2 with "SELECT * FROM information_schema.processlist" +--let $iter=2 +while ($iter) +{ + --connection slave + --source include/stop_slave.inc + --source include/start_slave.inc + # Thread 1 + --connection master + --echo "Wait_for dump_thread_signal" + SET DEBUG_SYNC='now WAIT_FOR dump_thread_signal'; + + # Thread 2 + --connection master1 + SET DEBUG_SYNC='show_binlogs_after_lock_log_before_lock_index SIGNAL parked1 WAIT_FOR go_parked1'; + --send SHOW BINARY LOGS + + --connection master + echo "Wait_for parked1"; + SET DEBUG_SYNC='now WAIT_FOR parked1'; + + # Thread 3 + --connection master2 + SET DEBUG_SYNC='purge_logs_after_lock_index_before_thread_count SIGNAL parked2 WAIT_FOR go_parked2'; + --send PURGE BINARY LOGS BEFORE '9999-12-31' + + --connection master + echo "Wait_for parked2"; + SET DEBUG_SYNC='now WAIT_FOR parked2'; + + # Thread 4 + --connection master3 + SET DEBUG_SYNC='processlist_after_LOCK_thd_count_before_LOCK_thd_data SIGNAL parked3 WAIT_FOR go_parked3'; + if ($iter == 1) + { + --let $query=SHOW PROCESSLIST + } + if ($iter == 2) + { + --let $query=SELECT * FROM information_schema.processlist + } + --send_eval $query + + --connection master + echo "Wait_for parked3"; + SET DEBUG_SYNC='now WAIT_FOR parked3'; + + echo "now signal go to all 4 waiting threads"; + SET DEBUG_SYNC='now SIGNAL go_dump_thread'; + SET DEBUG_SYNC='now SIGNAL go_parked1'; + SET DEBUG_SYNC='now SIGNAL go_parked2'; + SET DEBUG_SYNC='now SIGNAL go_parked3'; + + # Output of each command vary depends on other tests ran in suite(output vary + # in Pb2 runs), so lets ignore output. Anyways, we are interested in seeing + # that there is no deadlock. + --disable_result_log + --connection master1 + --reap + --connection master2 + --reap + --connection master3 + --reap + --enable_result_log + + --dec $iter +} + +--echo "Cleanup" +--disconnect master2 +--disconnect master3 + +--connection master +SET DEBUG_SYNC='RESET'; +SET GLOBAL DEBUG=@save_debug; +source include/rpl_end.inc; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_DML_error.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_DML_error.test index 208600d0..30b48a74 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_DML_error.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_DML_error.test @@ -19,7 +19,7 @@ source include/show_binlog_events.inc; --echo # A row is inserted. --error 1062 INSERT INTO t1 VALUES(2),(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:test.t1, slave:test.t1; source include/diff_tables.inc; @@ -35,7 +35,7 @@ source include/show_binlog_events.inc; --echo # A row is inserted. --error 1062 INSERT INTO t1 SELECT 3 UNION SELECT 2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/diff_tables.inc; @@ -45,7 +45,7 @@ connection master; let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); --error 1062 UPDATE t1 SET c1=4; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/diff_tables.inc; --echo # Nothing is updated. @@ -60,7 +60,7 @@ source include/show_binlog_events.inc; connection master; --error 1062 UPDATE t1, t2 SET t1.c1= 5, t2.c1=5; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/diff_tables.inc; --echo diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_LD_INFILE.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_LD_INFILE.test index 0f02bdcc..4e817ad9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_LD_INFILE.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_LD_INFILE.test @@ -23,8 +23,7 @@ LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1; SELECT * FROM test.t1 ORDER BY a DESC; -save_master_pos; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT * FROM test.t1 ORDER BY a DESC; @@ -32,7 +31,7 @@ SELECT * FROM test.t1 ORDER BY a DESC; #show binlog events; connection master; DROP TABLE test.t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter.test index 630197f8..f8a602da 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter.test @@ -7,12 +7,12 @@ insert into mysqltest.t1 values (1,2); create table mysqltest.t2 (n int); insert into mysqltest.t2 values (45); rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from mysqltest.t2; select * from mysqltest.t3; connection master; drop database mysqltest; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_db.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_db.test index f6f07825..abc273bd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_db.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_db.test @@ -6,10 +6,10 @@ create database temp_db; use temp_db; # to be different from initial `test' db of mysqltest client alter database collate latin1_bin; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo ==== Clean up ==== connection master; drop database temp_db; -sync_slave_with_master; +--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_alter_repository.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_repository.test index 4255e5f1..2c4ee24a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_repository.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_repository.test @@ -4,6 +4,7 @@ # can run without a problem. ############################################################################### +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/have_innodb.inc --source include/not_mts_slave_parallel_workers.inc @@ -57,7 +58,7 @@ call mtr.add_suppression("Error creating.*: Error checking repositories"); # --connection master INSERT INTO t_innodb VALUES (1), (2), (3); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ALTER TABLE mysql.slave_relay_log_info DROP COLUMN Number_of_workers; --connection master INSERT INTO t_innodb VALUES (1), (2), (3); @@ -97,7 +98,7 @@ UPDATE mysql.slave_relay_log_info SET Number_of_workers= 0; # --connection master INSERT INTO t_innodb VALUES (1), (2), (3); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ALTER TABLE mysql.slave_relay_log_info DROP COLUMN Number_of_workers; --connection master INSERT INTO t_innodb VALUES (1), (2), (3); @@ -129,7 +130,7 @@ RESET SLAVE ALL; --eval CHANGE MASTER TO MASTER_HOST= '$_slave_master_host', MASTER_USER= '$_slave_master_user', MASTER_PORT= $_slave_master_port, MASTER_LOG_FILE= '$_slave_master_log_file', MASTER_LOG_POS= $_slave_master_log_pos --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ############################################################################### # Checking if replication can fail safely (I/O Thread) @@ -220,7 +221,7 @@ RESET SLAVE ALL; --eval CHANGE MASTER TO MASTER_HOST= '$_slave_master_host', MASTER_USER= '$_slave_master_user', MASTER_PORT= $_slave_master_port, MASTER_LOG_FILE= '$_slave_master_log_file', MASTER_LOG_POS= $_slave_master_log_pos --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ############################################################################### # Checking ANALYZE TABLE, CHECK TABLE, CHECKSUM TABLE, OPTIMIZE TABLE, @@ -267,7 +268,7 @@ EOF ############################################################################### --connection master DROP TABLE t_innodb; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test index 1e5f9e53..a59c14b6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test @@ -56,7 +56,7 @@ CALL simpleproc3(); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use test1; select * from t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test index 6f7e0d80..896b5b52 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test @@ -15,6 +15,7 @@ # rpl_auto_increment_bug33029.test with clean up statements at the end # of the test case removed on a buggy 5.0 server +--source include/not_gtid_enabled.inc --let $rpl_skip_start_slave= 1 --source include/master-slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_bug45679.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_bug45679.test index 6996e1c7..836f549c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_bug45679.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_bug45679.test @@ -41,7 +41,7 @@ show warnings; set @@binlog_format=mixed; insert into tm set b=null, a=2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc if (`select count(*) <> 3 from tm`) { @@ -57,6 +57,6 @@ if (`select count(*) <> 3 from tm`) drop table tm, ti; drop function multi_part_pk_with_autoinc; -sync_slave_with_master; +--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_auto_increment_update_failure.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test index b5eb3c54..36ca0d88 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test @@ -87,7 +87,7 @@ connection master; --echo #Test result for INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES on master select * from t2 ORDER BY i1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; --echo #Test result for INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES on slave select * from t2 ORDER BY i1; @@ -96,7 +96,7 @@ connection master; drop table t1; drop table t2; drop function f1_two_inserts; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # Test case12: INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES OF A TABLE WITH AUTOINC COLUMN connection master; @@ -130,7 +130,7 @@ connection master; --echo #Test result for INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES on master select * from t2 ORDER BY i1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; --echo #Test result for INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES on slave select * from t2 ORDER BY i1; @@ -139,7 +139,7 @@ connection master; drop table t1; drop table t2; drop function f1_two_updates; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # Test case13: UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT connection master; @@ -156,7 +156,7 @@ commit; --echo # To verify if it works fine when these statements are not be marked as unsafe source include/show_binlog_events.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo #Test if the results are consistent on master and slave --echo #for 'UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT' let $diff_tables= master:t1, slave:t1; @@ -167,7 +167,7 @@ source include/diff_tables.inc; connection master; drop table t1; drop table t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # Test case14: INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES connection master; @@ -194,7 +194,7 @@ commit; --echo # To verify if it works fine when these statements are not be marked as unsafe source include/show_binlog_events.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo #Test if the results are consistent on master and slave --echo #for 'INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES' let $diff_tables= master:t1, slave:t1; @@ -206,6 +206,6 @@ connection master; drop table t1; drop table t2; drop view v15; -sync_slave_with_master; +--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_begin_commit_rollback.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test index fb6a7b2e..e5f2208c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test @@ -26,7 +26,7 @@ use db1; CREATE TABLE db1.t1 (a INT) ENGINE=InnoDB; CREATE TABLE db1.t2 (s CHAR(255)) ENGINE=MyISAM; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; connection master; echo [on master]; @@ -163,7 +163,7 @@ INSERT INTO db1.t1 VALUES(50); USE db2; COMMIT; source include/show_binlog_events.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo [on slave] --echo # @@ -193,7 +193,7 @@ INSERT INTO t1 VALUES(1, "master"); SET @@session.binlog_direct_non_transactional_updates= FALSE; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # [ on slave ] USE db1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_corruption.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_corruption.test index 8d9b3b46..b392487e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_corruption.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_corruption.test @@ -15,6 +15,7 @@ # BUG#31793: log event corruption causes crash # BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event +--source include/not_gtid_enabled.inc --source include/master-slave.inc # BUG#40482 only manifested itself in debug-compiled binaries. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_errors.test index 2ee30462..3b606d0f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_errors.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_errors.test @@ -1,483 +1,5 @@ # BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error # when generating new name. -# -# WHY -# === -# -# We want to check whether error is reported or not when -# new_file_impl fails (this may happen when rotation is not -# possible because there is some problem finding an -# unique filename). -# -# HOW -# === -# -# Test cases are documented inline. -# -# The size of the data is tuned to match file sizes and rotations, so -# it is only executed in statement-based replication. --- source include/have_innodb.inc --- source include/have_debug.inc --- source include/master-slave.inc --- source include/have_binlog_format_statement.inc - --- echo ####################################################################### --- echo ####################### PART 1: MASTER TESTS ########################## --- echo ####################################################################### - - -### ACTION: stopping slave as it is not needed for the first part of -### the test - --- connection slave --- source include/stop_slave.inc --- connection master - ---disable_query_log -call mtr.add_suppression("Can't generate a unique log-filename"); -call mtr.add_suppression("Writing one row to the row-based binary log failed.*"); -call mtr.add_suppression("Warning: [+-]?\d+ files and [+-]?\d+ streams is left open"); -call mtr.add_suppression("Error writing file .*"); -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."); ---enable_query_log - ---let $old_debug = `select @@global.debug` - -### ACTION: create a large file (> 4096 bytes) that will be later used -### in LOAD DATA INFILE to check binlog errors in its vacinity --- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data --- let $MYSQLD_DATADIR= `select @@datadir` --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file' - -### ACTION: create a small file (< 4096 bytes) that will be later used -### in LOAD DATA INFILE to check for absence of binlog errors -### when file loading this file does not force flushing and -### rotating the binary log --- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data --- let $MYSQLD_DATADIR= `select @@datadir` --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2' - -RESET MASTER; - --- echo ###################### TEST #1 - -### ASSERTION: no problem flushing logs (should show two binlogs) -FLUSH LOGS; --- echo # assert: must show two binlogs --- source include/show_binary_logs.inc - --- echo ###################### TEST #2 - -### ASSERTION: check that FLUSH LOGS actually fails and reports -### failure back to the user if find_uniq_filename fails -### (should show just one binlog) - -RESET MASTER; ---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 --- error ER_NO_UNIQUE_LOGFILE -FLUSH LOGS; --- echo # assert: must show one binlog --- source include/show_binary_logs.inc - -### ACTION: clean up and move to next test ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log -RESET MASTER; - --- echo ###################### TEST #3 - -### ACTION: create some tables (t1, t2, t4) and insert some values in -### table t1 -CREATE TABLE t1 (a INT); -CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB; -CREATE TABLE t4 (a VARCHAR(16384)) Engine=MyISAM; -INSERT INTO t1 VALUES (1); -RESET MASTER; - -### ASSERTION: we force rotation of the binary log because it exceeds -### the max_binlog_size option (should show three binary -### logs) - --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 - -# shows two binary logs --- echo # assert: must show three binlog --- source include/show_binary_logs.inc - -# clean up the table and the binlog to be used in next part of test ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log -DELETE FROM t2; -RESET MASTER; - --- echo ###################### TEST #4 - -# Loading a row using LOAD DATA INFILE causing a binary log error -# should be rolled back. - ---disable_query_log -eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,info,debug,enter,return,query,error_unique_log_filename"), 'd,info,debug,enter,return,query,error_unique_log_filename'); ---enable_query_log - -# Table should be empty to start with -SELECT count(*) FROM t2; - --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- error ER_NO_UNIQUE_LOGFILE --- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 - -# show table --- echo # assert: must still be empty since the LOAD DATA INFILE failed -SELECT count(*) FROM t2; - -# clean up the table and the binlog to be used in next part of test ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log -DELETE FROM t2; -RESET MASTER; - --- echo ###################### TEST #5 - -### ASSERTION: load the small file into a transactional table and -### check that it succeeds - ---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 --- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2 - -# show table --- echo # assert: must show one entry -SELECT count(*) FROM t2; - -# clean up the table and the binlog to be used in next part of test ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log -DELETE FROM t2; -RESET MASTER; - --- echo ###################### TEST #6 - -# A failing LOAD DATA INFILE inside a transaction cause the commit to -# fail, rolling back the entire statement. - ---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 - --- echo # Table should be empty -SELECT count(*) FROM t2; - -SET AUTOCOMMIT=0; -INSERT INTO t2 VALUES ('muse'); --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 -INSERT INTO t2 VALUES ('muse'); --- error ER_NO_UNIQUE_LOGFILE -COMMIT; - -### ACTION: Show the contents of the table after the test --- echo # Table should still be empty since the commit failed. -SELECT count(*) FROM t2; - -### ACTION: clean up and move to the next test -SET AUTOCOMMIT= 1; ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log -DELETE FROM t2; -RESET MASTER; - --- echo ###################### TEST #7 - -### ASSERTION: check that on a non-transactional table, if rotation -### fails then an error is reported and an incident event -### is written to the current binary log. - ---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 -SELECT count(*) FROM t4; --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- error ER_NO_UNIQUE_LOGFILE --- eval LOAD DATA INFILE '$load_file' INTO TABLE 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; -RESET MASTER; - --- echo ###################### TEST #8 - -### ASSERTION: check that statements end up in error but they succeed -### on changing the data. - -# Insert some rows into t2, we will both try to insert and delete from -# it. - -SET @xxx = REPEAT('xxx', 1000); -SET @yyy = REPEAT('yyy', 1000); -INSERT INTO t2 VALUES (@xxx),(@yyy); - ---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 --- echo # must show 0 entries -SELECT count(*) FROM t4; --- echo # must show 2 entries -SELECT count(*) FROM t2; - --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- error ER_NO_UNIQUE_LOGFILE --- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- error ER_NO_UNIQUE_LOGFILE --- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 -set @aaa = repeat('aaa',1000); -set @bbb = repeat('bbb',1000); -set @ccc = repeat('ccc',1000); --- error ER_NO_UNIQUE_LOGFILE -INSERT INTO t2 VALUES (@aaa), (@bbb), (@ccc); - --- echo # INFO: Count(*) Before Offending DELETEs --- echo # assert: must show 1 entry -SELECT count(*) FROM t4; --- echo # assert: must show 2 entries since the LOAD DATA INFILE and --- echo # INSERT INTO above was rolled back due to error. Only the --- echo # original rows remain -SELECT count(*) FROM t2; - --- error ER_NO_UNIQUE_LOGFILE -DELETE FROM t4 WHERE a IN (@xxx, @yyy) OR 1; --- error ER_NO_UNIQUE_LOGFILE -DELETE FROM t2 WHERE a IN (@aaa, @bbb, @ccc) OR 1; - --- echo # INFO: Count(*) After Offending DELETEs --- echo # assert: must show zero entries -SELECT count(*) FROM t4; --- echo # assert: must show 2 entries: the original two rows -SELECT count(*) FROM t2; - -# remove fault injection ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log - -# Empty t2 for following testing -DELETE FROM t2; - --- echo ###################### TEST #9 - -### ASSERTION: check that if we disable binlogging, then statements -### succeed. ---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 SQL_LOG_BIN=0; -INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd'); -INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh'); --- echo # assert: must show four entries -SELECT count(*) FROM t2; -SELECT count(*) FROM t4; -DELETE FROM t2; -DELETE FROM t4; --- echo # assert: must show zero entries -SELECT count(*) FROM t2; -SELECT count(*) FROM t4; -SET SQL_LOG_BIN=1; ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log - --- echo ###################### TEST #10 - -### ASSERTION: check that error is reported if there is a failure -### while registering the index file and the binary log -### file or failure to write the rotate event. - -call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); -call mtr.add_suppression("Could not open .*"); - -RESET MASTER; -SHOW WARNINGS; - -# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open -# normalize strerror message for solaris10-sparc-64bit as long as errno is OK ---disable_query_log -eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,fault_injection_registering_index"), 'd,fault_injection_registering_index'); ---enable_query_log --- replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/ --- error ER_CANT_OPEN_FILE -FLUSH LOGS; ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log - --- error ER_NO_BINARY_LOGGING -SHOW BINARY LOGS; - -# issue some statements and check that they don't fail -CREATE TABLE t5 (a INT); -INSERT INTO t4 VALUES ('bbbbb'); -INSERT INTO t2 VALUES ('aaaaa'); -DELETE FROM t4; -DELETE FROM t2; -DROP TABLE t5; - --- echo ###################### TEST #11 - -### ASSERTION: check that error is reported if there is a failure -### while opening the index file and the binary log file or -### failure to write the rotate event. - -# restart the server so that we have binlog again ---let $rpl_server_number= 1 ---source include/rpl_restart_server.inc - -# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file ---disable_query_log -eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,fault_injection_openning_index"), 'd,fault_injection_openning_index'); ---enable_query_log -# normalize strerror message for solaris10-sparc-64bit as long as errno is OK --- replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/ --- error ER_CANT_OPEN_FILE -FLUSH LOGS; ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log - --- error ER_FLUSH_MASTER_BINLOG_CLOSED -RESET MASTER; - -# issue some statements and check that they don't fail -CREATE TABLE t5 (a INT); -INSERT INTO t4 VALUES ('bbbbb'); -INSERT INTO t2 VALUES ('aaaaa'); -DELETE FROM t4; -DELETE FROM t2; -DROP TABLE t5; - -# restart the server so that we have binlog again ---let $rpl_server_number= 1 ---source include/rpl_restart_server.inc - --- echo ###################### TEST #12 - -### ASSERTION: check that error is reported if there is a failure -### while writing the rotate event when creating a new log -### file. - -# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl ---disable_query_log -eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,fault_injection_new_file_rotate_event"), 'd,fault_injection_new_file_rotate_event'); ---enable_query_log --- error ER_ERROR_ON_WRITE -FLUSH LOGS; ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log - --- error ER_FLUSH_MASTER_BINLOG_CLOSED -RESET MASTER; -# issue some statements and check that they don't fail -CREATE TABLE t5 (a INT); -INSERT INTO t4 VALUES ('bbbbb'); -INSERT INTO t2 VALUES ('aaaaa'); -DELETE FROM t4; -DELETE FROM t2; -DROP TABLE t5; - -# restart the server so that we have binlog again ---let $rpl_server_number= 1 ---source include/rpl_restart_server.inc - -## clean up ---disable_query_log -eval SET GLOBAL debug= '$old_debug'; ---enable_query_log -DROP TABLE t1, t2, t4; -RESET MASTER; - -# restart slave again --- connection slave --- source include/start_slave.inc --- connection master - --- echo ####################################################################### --- echo ####################### PART 2: SLAVE TESTS ########################### --- echo ####################################################################### - -### setup ---source include/rpl_reset.inc --- connection slave - -# slave suppressions - -call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); -call mtr.add_suppression("Error writing file .*"); -call mtr.add_suppression("Could not open .*"); -call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); -call mtr.add_suppression("Can't generate a unique log-filename .*"); --- echo ###################### TEST #13 - -#### ASSERTION: check against unique log filename error --- let $io_thd_injection_fault_flag= error_unique_log_filename --- let $slave_io_errno= 1595 --- let $show_slave_io_error= 1 --- source include/io_thd_fault_injection.inc - --- echo ###################### TEST #14 - -#### ASSERTION: check against rotate failing --- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event --- let $slave_io_errno= 1595 --- let $show_slave_io_error= 1 --- source include/io_thd_fault_injection.inc - --- echo ###################### TEST #15 - -#### ASSERTION: check against relay log open failure --- let $io_thd_injection_fault_flag= fault_injection_registering_index --- let $slave_io_errno= 1595 --- let $show_slave_io_error= 1 --- source include/io_thd_fault_injection.inc - --- echo ###################### TEST #16 - -#### ASSERTION: check against relay log index open failure --- let $io_thd_injection_fault_flag= fault_injection_openning_index --- let $slave_io_errno= 1595 --- let $show_slave_io_error= 1 --- source include/io_thd_fault_injection.inc - -### clean up --- source include/stop_slave_sql.inc ---disable_query_log -eval SET GLOBAL debug='$old_debug'; ---enable_query_log -RESET SLAVE; -RESET MASTER; ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_binlog_error.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_gcommit_options.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_gcommit_options.test index 5d24671f..3aed7d64 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_gcommit_options.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_gcommit_options.test @@ -8,6 +8,7 @@ # that there is no crash/assertion when # that code executed. ############################################################ +source include/not_gtid_enabled.inc; source include/have_innodb.inc; source include/have_log_bin.inc; source include/master-slave.inc; @@ -47,7 +48,7 @@ enable_query_log; echo # Master results; connection master; SELECT COUNT(a) FROM t; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo # Slave results; SELECT COUNT(a) FROM t; @@ -55,6 +56,6 @@ SELECT COUNT(a) FROM t; echo # Clean up; connection master; DROP TABLE t; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; echo # End of tests; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_index.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_index.test index be936106..053eee4e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_index.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_binlog_index.test @@ -17,6 +17,7 @@ # BUG#12133 master.index file keeps mysqld from starting if bin log has been moved # BUG#42576 Relay logs in relay-log.info&localhost-relay-bin.index not processed after move +source include/not_gtid_enabled.inc; source include/master-slave.inc; # There is no need to run this test case on all binlog format source include/have_binlog_format_row.inc; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bit.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bit.test index 67606e5d..8029a7db 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bit.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bit.test @@ -78,7 +78,7 @@ SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; SELECT hex(bit1) FROM test.t1 ORDER BY bit1; SELECT hex(bit2) from test.t1 ORDER BY bit2; SELECT hex(bit3) from test.t1 ORDER BY bit3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; SELECT hex(bit1) FROM test.t1 ORDER BY bit1; @@ -87,7 +87,7 @@ SELECT hex(bit3) from test.t1 ORDER BY bit3; connection master; DROP TABLE IF EXISTS test.t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bit_npk.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bit_npk.test index d65ef66a..44deeafd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bit_npk.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bit_npk.test @@ -76,7 +76,7 @@ SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 SELECT hex(bit1) from test.t1 ORDER BY bit1; SELECT hex(bit2) from test.t1 ORDER BY bit2; SELECT hex(bit3) from test.t1 ORDER BY bit3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1 @@ -98,7 +98,7 @@ UPDATE test.t3 SET a = 2 WHERE b = 0; SELECT a, hex(b) FROM test.t2 ORDER BY a,b; SELECT * FROM test.t3 ORDER BY a,b; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT a, hex(b) FROM test.t2 ORDER BY a,b; SELECT * FROM test.t3 ORDER BY a,b; @@ -107,7 +107,7 @@ connection master; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_blackhole.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_blackhole.test index b1537171..83877157 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_blackhole.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_blackhole.test @@ -24,12 +24,12 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state CREATE TABLE t1 (a INT, b INT, c INT); CREATE TABLE t2 (a INT, b INT, c INT); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc ALTER TABLE t1 ENGINE=BLACKHOLE; connection master; INSERT INTO t2 VALUES (1,9,1), (2,9,2), (3,9,3), (4,9,4); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Test insert, no primary key let $statement = INSERT INTO t1 VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4); diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug31076.test index 4e9517fb..b8a5122b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug31076.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug31076.test @@ -140,7 +140,7 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; # Cleanup DROP DATABASE track; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo End of 5.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug37426.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug37426.test index d0a60524..8338adff 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug37426.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug37426.test @@ -11,12 +11,12 @@ CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT N INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ); SELECT * FROM char128_utf8; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM char128_utf8; # Clean up connection master; DROP TABLE char128_utf8; -sync_slave_with_master; +--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_bug41902.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug41902.test index 680d79a3..ae6bf5d8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug41902.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_bug41902.test @@ -9,7 +9,7 @@ source include/master-slave.inc; CALL mtr.add_suppression("Failed to locate old binlog or relay log files"); CALL mtr.add_suppression('MYSQL_BIN_LOG::purge_logs was called with file ..master-bin.000001 not listed in the index.'); -- enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # test checks that diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_charset_sjis.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_charset_sjis.test index a3a3de8c..d1bfd390 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_charset_sjis.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_charset_sjis.test @@ -12,14 +12,14 @@ SET NAMES binary; CALL p1 ('\\'); select "--- on master ---"; select hex(a) from t1 ; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select "--- on slave ---"; select hex(a) from t1; connection master; drop table t1; drop procedure p1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # End of 5.0 tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_check_gtid.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_check_gtid.test index 56b0a768..5974b334 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_check_gtid.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_check_gtid.test @@ -137,7 +137,7 @@ while ($i != 5) --source extra/rpl_tests/rpl_check_gtid.inc # 1.2 - Makes the slave to retrieve and apply these transactions. - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc --connection slave # Check property 1.2 and 2.1. @@ -250,7 +250,7 @@ while ($i != 5) # 2.2 - Makes the slave to retrieve these transactions and # spread their events into two relay logs. Then apply # the events. - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc # Check property 2.2. --let $binlog= relaylog @@ -307,7 +307,7 @@ while ($i != 5) COMMIT; # 3.2 - Makes the slave to retrieve and apply these transactions. - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc # Check property 1.2 and 2.1. --connection slave @@ -418,7 +418,7 @@ while ($i != 5) --source extra/rpl_tests/rpl_check_gtid.inc # 4.2 - Makes the slave to retrieve and apply these transactions. - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc # Check property 1.2 and 2.1. --connection slave @@ -504,6 +504,7 @@ while ($i != 5) --connection slave --source include/stop_slave.inc RESET SLAVE; + RESET MASTER; --connection master RESET MASTER; --connection slave @@ -524,15 +525,14 @@ while ($i != 5) COMMIT; # 5.3 - Makes the slave to retrieve and apply these transactions. - --sync_slave_with_master - + --source include/sync_slave_sql_with_master.inc # Check property 1.2, 2.1, 3.1 and 3.2 --let $binlog= binlog --let $server_uuid= $master_uuid - --let $gtid_set_ini= 1 - --let $gtid_set_end= 4 - --let $gtid_ini= - --let $gtid_end= + --let $gtid_set_ini= + --let $gtid_set_end= + --let $gtid_ini= 1 + --let $gtid_end= 2 --source extra/rpl_tests/rpl_check_gtid.inc # 5.4 - Rotates both the binary logs on the slave and master. @@ -756,7 +756,7 @@ while ($i != 5) COMMIT; # 8.2 - Makes the slave to retrieve and apply these transactions. - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc # Check property 1.2 and 2.1. --connection slave @@ -854,7 +854,7 @@ while ($i != 5) COMMIT; # 9.2 - Makes the slave to retrieve and apply these transactions. - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc # Check property 1.2 and 2.1. --connection slave diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_checksum.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_checksum.test index 2ee55ec7..071c0f89 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_checksum.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_checksum.test @@ -1,6 +1,7 @@ # WL2540 replication events checksum # Testing configuration parameters +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/have_debug.inc --source include/have_binlog_format_mixed.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_checksum_cache.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_checksum_cache.test index adbf456a..92a00074 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_checksum_cache.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_checksum_cache.test @@ -83,7 +83,7 @@ show status like "binlog_cache_use"; --echo *** binlog_cache_disk_use must be non-zero *** show status like "binlog_cache_disk_use"; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; @@ -95,8 +95,7 @@ begin; delete from t1; commit; -sync_slave_with_master; - +--source include/sync_slave_sql_with_master.inc # # 2. the event size is bigger than the cache's buffer @@ -125,8 +124,7 @@ show status like "binlog_cache_use"; --echo *** binlog_cache_disk_use must be non-zero *** show status like "binlog_cache_disk_use"; -sync_slave_with_master; - +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:t2, slave:t2 source include/diff_tables.inc; @@ -137,8 +135,7 @@ begin; delete from t2; commit; -sync_slave_with_master; - +--source include/sync_slave_sql_with_master.inc # # 3. the event size if approximately the same as the cache's buffer # @@ -167,8 +164,7 @@ show status like "binlog_cache_use"; --echo *** binlog_cache_disk_use must be non-zero *** show status like "binlog_cache_disk_use"; -sync_slave_with_master; - +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:t3, slave:t3 source include/diff_tables.inc; @@ -179,8 +175,7 @@ begin; delete from t3; commit; -sync_slave_with_master; - +--source include/sync_slave_sql_with_master.inc # # 4. all in above @@ -226,7 +221,7 @@ show status like "binlog_cache_use"; --echo *** binlog_cache_disk_use must be non-zero *** show status like "binlog_cache_disk_use"; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:t1, slave:t1 source include/diff_tables.inc; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index 59a83d7c..497633ff 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -13,6 +13,7 @@ # BUG#49978 --source include/have_innodb.inc +--source include/not_gtid_enabled.inc # Use wait_for_slave_to_(start|stop) for current connections let $keep_connection= 1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_colSize.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_colSize.test index 93185fcd..fe5197e7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_colSize.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_colSize.test @@ -14,7 +14,7 @@ DROP TABLE IF EXISTS t1; --echo **** Testing WL#3228 changes. **** --echo *** Create "wider" table on slave *** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc STOP SLAVE; --source include/wait_for_slave_to_stop.inc RESET SLAVE; @@ -105,7 +105,7 @@ INSERT INTO t1 () VALUES ( SELECT * FROM t1 ORDER BY a; --echo *** Select data from slave to compare *** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Replace values in columns that display differently between SBR & RBR --replace_column 5 # 8 # @@ -136,7 +136,8 @@ CREATE TABLE t1 ( d CHAR(5) ); -sync_slave_with_master slave; +--let $sync_slave_connection= slave +--source include/sync_slave_sql_with_master.inc --echo Alter varchar table on slave ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100); @@ -155,7 +156,8 @@ SELECT * FROM t1; --replace_result default DEFAULT SHOW CREATE TABLE t1; -sync_slave_with_master slave; +--let $sync_slave_connection= slave +--source include/sync_slave_sql_with_master.inc --echo Insert some values and select them on slave SELECT * FROM t1; @@ -183,9 +185,9 @@ CREATE TABLE t1 ( e BIT(11) ); -sync_slave_with_master slave; - --echo Create bit table on slave +--source include/sync_slave_sql_with_master.inc + DROP TABLE t1; CREATE TABLE t1 ( a BIT(16), @@ -210,17 +212,67 @@ SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1; --replace_result default DEFAULT SHOW CREATE TABLE t1; -sync_slave_with_master slave; +--let $sync_slave_connection= slave +--source include/sync_slave_sql_with_master.inc --echo Insert some values and select them on master SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1; --replace_result default DEFAULT SHOW CREATE TABLE t1; +############################################################################### +# Bug#19704825 TEMPORARY SLAVE TYPE CONVERSION TABLES RELEASED TO EARLY +# Problem: Memory used in preparing slave type conversion +# temporary table is getting released early and causing unexpected results +# in case of nested events. +# Eg: If a insert statement is calling a trigger which contains another +# insert statement. +# Steps to reproduce: +# 1) Create a table t1 +# 2) Change it's definition on slave, so that insert will create conversion +# temporary table on slave (set SLAVE_TYPE_CONVERSIONS appropriately to +# allow the scenario) +# 3) Create a table t2 +# 4) Create a trigger on top of table t1. Inside the trigger, insert a tuple +# into table t2 +# 5) Insert a tuple into table t1 on Master +# 6) Make sure this insert is replicated without any issues. +############################################################################### + +# Step 1, 2 are already done by above test code. + +# Step 3: Create a table t2 +connection master; +CREATE TABLE t2(i INTEGER); + +# Step 4: Create a trigger on top of table t1. Inside the trigger, insert a +# tuple into table t2 +--delimiter $$ +CREATE TRIGGER t1_tr BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +INSERT INTO t2 VALUES(1); +END $$ +--delimiter ; + +# Step 5: Insert a tuple into table t1 on Master +INSERT INTO t1 VALUES ( + b'1010101', + b'10101011', + b'101010110101010101111', + b'10101010101', + b'10101011111' + ); + +# Step 6) Make sure this insert is replicated without any issues. +--source include/sync_slave_sql_with_master.inc + +# End of test for Bug#19704825 + --echo *** Cleanup *** connection master; DROP TABLE t1; -sync_slave_with_master; +DROP TABLE t2; +--source include/sync_slave_sql_with_master.inc SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_concurrency_error.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_concurrency_error.test index 82cbac31..1c59223c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_concurrency_error.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_concurrency_error.test @@ -126,7 +126,7 @@ while ($type) } connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $rpl_diff_statement= SELECT * FROM t order by i; source include/rpl_diff.inc; @@ -143,7 +143,7 @@ DROP TRIGGER tr; DROP TABLE t; DROP TABLE n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; disconnect conn1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_conditional_comments.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_conditional_comments.test index 4451ae85..6fa9006d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_conditional_comments.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_conditional_comments.test @@ -25,7 +25,7 @@ let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); source include/show_binlog_events.inc; let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:t1,slave:t1 --source include/diff_tables.inc @@ -41,7 +41,7 @@ DROP TABLE t1; CREATE TABLE t1(c1 INT); EXECUTE stmt; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:t1,slave:t1 --source include/diff_tables.inc @@ -57,7 +57,7 @@ EXECUTE stmt USING @value; source include/show_binlog_events.inc; let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:t1,slave:t1 --source include/diff_tables.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_corruption.test index a749eceb..8f6ff52d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_corruption.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_corruption.test @@ -54,7 +54,7 @@ while ($i) { } if (!$pos) { let $pos= query_get_value(SHOW MASTER STATUS, Position, 1); - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --disable_query_log --connection master @@ -119,7 +119,7 @@ let $slave_sql_errno= 1593; # ER_SLAVE_FATAL_ERROR SET GLOBAL debug= ""; --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:t1, slave:t1 --source include/diff_tables.inc @@ -128,6 +128,6 @@ SET GLOBAL debug= ""; --connection master SET GLOBAL master_verify_checksum = @old_master_verify_checksum; DROP TABLE t1; ---sync_slave_with_master +--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_crash_safe_master.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crash_safe_master.test index 8b950b0c..ebc2a1fb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crash_safe_master.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_crash_safe_master.test @@ -60,7 +60,7 @@ CREATE TABLE t1(a LONGBLOB) ENGINE=INNODB; -- echo # Lets stop the slave IO thread first, so that it does not timeout on -- echo # reconnection while the master is down (it happened before on some -- echo # slow hosts). ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave_io.inc --connection master @@ -100,7 +100,7 @@ COMMIT; --source include/start_slave_io.inc --connection master -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc -- echo # On slave, test replication will work fine, and the data -- echo # is not replicated --let $diff_tables= master:test.t1, slave:test.t1 @@ -115,7 +115,7 @@ connection master; -- echo # Lets stop the slave IO thread first, so that it does not timeout on -- echo # reconnection while the master is down (it happened before on some -- echo # slow hosts). ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave_io.inc --connection master @@ -155,14 +155,14 @@ COMMIT; --source include/start_slave_io.inc --connection master -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc -- echo # On slave, test replication will work fine, and the data is replicated --let $diff_tables= master:test.t1, slave:test.t1 --source include/diff_tables.inc connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc -- source include/stop_slave.inc connection master; @@ -233,4 +233,5 @@ INSERT INTO t2 (a) VALUES (REPEAT('a',16384)); SELECT COUNT(*) FROM t2; DROP TABLE t1, t2; - +connection slave; +CHANGE MASTER TO MASTER_AUTO_POSITION= 0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_database.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_database.test index 5eac3de0..ba0ce951 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_database.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_database.test @@ -14,7 +14,7 @@ source include/master-slave.inc; DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_bob; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # This database is not replicated DROP DATABASE IF EXISTS mysqltest_bob; --enable_warnings @@ -43,7 +43,7 @@ USE mysqltest_sisyfos; ALTER DATABASE mysqltest_bob CHARACTER SET latin1; SHOW DATABASES LIKE 'mysql%'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW DATABASES LIKE 'mysql%'; connection master; @@ -56,7 +56,7 @@ USE mysqltest_sisyfos; CREATE TABLE t2 (a INT); let $VERSION=`select version()`; SHOW DATABASES LIKE 'mysql%'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW DATABASES LIKE 'mysql%'; USE mysqltest_prometheus; SHOW TABLES; @@ -67,7 +67,7 @@ connection master; DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_bob; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_drop_temp_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_drop_temp_table.test new file mode 100644 index 00000000..908de84e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_drop_temp_table.test @@ -0,0 +1,74 @@ +############################################################################### +# Bug#18364070 BACKPORT BUG#18236612 TO MYSQL-5.6 +# Problem & Analysis : When Slave SQL thread detects that Master was restarted +# with the help of information sent by Master through 'FormatDescription' +# event, slave SQL drops all the opened temporary tables in order to have +# proper cleanup. While slave SQL thread is dropping the temporary tables, it +# is not decrementing Slave_open_temp_tables count. +# Fix: Decrement Slave_open_temp_tables count in this case. +# Steps to test: +# 1) Create a temporary table +# 2) Sync it with slave +# 3) Stop slave io thread +# 4) Kill Master which generates Format Description event +# 5) Restart Master again +# 6) Start slave io thread +# 7) Wait till SQL thread applies all events +# (which includes newly generated Format Description event) +# 8) Now verify that Slave_open_temp_tables has '0' value + +# This same test steps with gtid enabled mode, works to test the following +# bug as well. +# Bug#18069107 SLAVE CRASHES WITH GTIDS,TEMP TABLE, STOP IO_THREAD, START SLAVE +# Problem & Analysis : When Slave SQL thread detects that Master was restarted +# with the help of information sent by Master through 'FormatDescription' +# event, slave SQL drops all the opened temporary tables in order to have +# proper cleanup. When Gtid mode is on and while slave SQL thread is +# generating DROP TEMPORARY statement for all these temporary tables, +# server is hitting an assert DEBUG_ASSERT(gtid.spec_type != UNDEF_GROUP) +############################################################################### + +# Statement mode is enough (row based temporary +# tables are not replicated) +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc + +# 1. Create a temporary table +CREATE TEMPORARY TABLE temp (i INT); + +# 2. Sync it with slave +--sync_slave_with_master + +# 3. Stop slave io thread +--source include/stop_slave_io.inc + +# 4. Kill Master so that it does not go through THD::cleanup logic. Hence it does +# not generate "drop temporary" query for 'temp' table. +--let $rpl_server_number= 1 +--let $rpl_force_stop=1 +--source include/rpl_stop_server.inc + +# 5. Restart Master (generates Format Description event which tells slave to +# drop all temporary tables) +--source include/rpl_start_server.inc + +# 6. Start slave io_thread +--connection slave +--source include/start_slave_io.inc +--connection master +--source include/sync_slave_io_with_master.inc + +# 7. Wait for slave thread to apply all events (including the newly generated +# FormatDescription event which tells slave SQL thread to drop all temporary +--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 + +# 8.Now if we verify slave_open_temp_tables, it should be '0' +--let $var_value= query_get_value(SHOW STATUS LIKE 'Slave_open_temp_tables', Value, 1) +--let $assert_text= Slave_open_temp_tables should be 0 +--let $assert_cond= $var_value = 0 +--source include/assert.inc + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test index ad89d788..53ae74dd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test @@ -41,7 +41,7 @@ CREATE TABLE IF NOT EXISTS t2 SELECT * FROM t; CREATE EVENT IF NOT EXISTS e ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT now(); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; #DROP database from slave. @@ -58,7 +58,7 @@ CREATE TABLE IF NOT EXISTS t2 SELECT * FROM t; CREATE EVENT IF NOT EXISTS e ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT now(); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SHOW TABLES in mysqltest; @@ -104,7 +104,7 @@ CREATE TABLE t2(c1 INTEGER) SELECT c1 FROM t3; # value '1' in them. The records of t2 are not inserted into them. SELECT * FROM t1; SELECT * FROM t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # In these two statements, t1 and t2 are the base table. The recoreds of t2 # are inserted into it when CREATE TABLE ... SELECT was executed. @@ -168,7 +168,7 @@ CREATE VIEW v1 AS SELECT 1 as a; --let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1) CREATE TABLE IF NOT EXISTS v1 SELECT 2 as a; --source include/show_binlog_events.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; DROP VIEW v1; @@ -188,7 +188,7 @@ CREATE TABLE IF NOT EXISTS t2 LIKE t1; CREATE TABLE IF NOT EXISTS t2 LIKE t1; --echo # Clean-up. DROP TABLE t1, t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_critical_errors.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_critical_errors.test index bc0d7096..2258fa11 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_critical_errors.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_critical_errors.test @@ -25,7 +25,7 @@ INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; send INSERT INTO t2 SELECT * FROM t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_current_user.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_current_user.test index ac2af1af..3587c9d8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_current_user.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_current_user.test @@ -11,6 +11,7 @@ # ############################################################################## +source include/have_gtid.inc; source include/have_binlog_format_statement.inc; --let $rpl_topology= 1->2->3 @@ -170,21 +171,23 @@ connection master; --echo # [On master] INSERT INTO t1 VALUES(CURRENT_USER()), ('1234'); SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # [On slave] SELECT * FROM t1; --echo # [On server_3] -sync_slave_with_master server_3; +--let $sync_slave_connection= server_3 +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; connection master; --echo # [On master] UPDATE t1 SET c1=CURRENT_USER() WHERE c1='1234'; SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # [On slave] SELECT * FROM t1; -sync_slave_with_master server_3; +--let $sync_slave_connection= server_3 +--source include/sync_slave_sql_with_master.inc --echo # [On server_3] SELECT * FROM t1; @@ -192,10 +195,11 @@ connection master; --echo # [On master] DELETE FROM t1 WHERE c1=CURRENT_USER(); SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # [On slave] SELECT * FROM t1; -sync_slave_with_master server_3; +--let $sync_slave_connection= server_3 +--source include/sync_slave_sql_with_master.inc --echo # [On server_3] SELECT * FROM t1; @@ -215,11 +219,12 @@ DELIMITER ;| INSERT INTO t1 VALUES(my_user()); SELECT * FROM t1; SELECT * FROM t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # [On slave] SELECT * FROM t1; SELECT * FROM t2; -sync_slave_with_master server_3; +--let $sync_slave_connection= server_3 +--source include/sync_slave_sql_with_master.inc --echo # [On server_3] SELECT * FROM t1; SELECT * FROM t2; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test index 012b1b38..e380efcc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test @@ -1,3 +1,4 @@ +-- source include/not_gtid_enabled.inc -- source include/not_ndb_default.inc -- source include/have_innodb.inc -- source include/not_mts_slave_parallel_workers.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_delayed_slave.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_delayed_slave.test index 9aa04005..d8713531 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_delayed_slave.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_delayed_slave.test @@ -87,7 +87,7 @@ INSERT INTO t1 VALUES ("zero", 0); --echo ==== Normal setup ==== --echo [on slave] ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc @@ -174,7 +174,7 @@ CHANGE MASTER TO MASTER_DELAY = 0; --connection master INSERT INTO t1 VALUES ('Syncing slave', 5); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --echo # CHANGE MASTER TO MASTER_DELAY = 2*T @@ -411,6 +411,6 @@ DROP TABLE t1, t_check_dml_not_executed_prematurely; DROP FUNCTION delay_on_slave; --echo [on slave] ---sync_slave_with_master +--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_do_db_filter.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_db_filter.test index 35f8d31d..6f57cf85 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_db_filter.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_db_filter.test @@ -5,9 +5,9 @@ # sensitive when setting lower_case_table_name = 0 # +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc -- source include/have_binlog_format_statement.inc -- source extra/rpl_tests/rpl_filters.test - --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_grant.test index 02251cd4..4b3702bd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -1,6 +1,7 @@ # Works in statement-based and row-based binlogging. # Test that GRANT and other user management commands are replicated to the slave +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc # do not be influenced by other tests. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_insensitive.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_insensitive.test index 02d4254d..41884cbb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_insensitive.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_insensitive.test @@ -6,11 +6,5 @@ # lower_case_table_name > 0 # --- source include/master-slave.inc --- source include/have_binlog_format_statement.inc - --- source extra/rpl_tests/rpl_filters.test -let $replicate_do_table= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Table, 1); ---echo Replicate_Do_Table: $replicate_do_table - ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_do_table_filter_insensitive.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive.test index b04e2848..c35a15df 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_do_table_filter_sensitive.test @@ -5,12 +5,5 @@ # sensitive and accent sensitive when setting # lower_case_table_name == 0 # - --- source include/master-slave.inc --- source include/have_binlog_format_statement.inc - --- source extra/rpl_tests/rpl_filters.test -let $replicate_do_table= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Table, 1); ---echo Replicate_Do_Table: $replicate_do_table - ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_do_table_filter_sensitive.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop.test index 7b887334..d3118184 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop.test @@ -5,7 +5,7 @@ source include/master-slave.inc; create table t1 (a int); --error 1051 drop table t1, t2; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db.test index c3194f08..64eb241a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db.test @@ -1,6 +1,7 @@ # test case for BUG#4680 -- if there are extra files in the db directory # dropping the db on the master causes replication problems +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc connection master; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db_fail.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db_fail.test new file mode 100644 index 00000000..fcb38d65 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_db_fail.test @@ -0,0 +1,31 @@ +############################################################################### +# Bug#20041860: SLAVE ERROR WHEN DROP DATABASE +# +# Test: +# ===== +# Create two databases such that one database has a dependency over the other +# database and try to drop the database which has a dependency. This should +# not cause slave to break. +############################################################################### +--source include/master-slave.inc + +connection master; +CREATE DATABASE IF NOT EXISTS db1; +CREATE DATABASE IF NOT EXISTS db2; + +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; + +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); + +--error ER_ROW_IS_REFERENCED +DROP DATABASE db1; +DROP DATABASE db2; +--source include/sync_slave_sql_with_master.inc +--connection master +DROP DATABASE db1; +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp.test index 64181307..af4d8c37 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp.test @@ -5,6 +5,7 @@ # Purpose: According to TU in 16552 This is how # to work around NDB's issue with temp tables ############################################## +--source include/not_gtid_enabled.inc source include/master-slave.inc; source include/have_binlog_format_mixed_or_statement.inc; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_gtid.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_gtid.test new file mode 100644 index 00000000..ecf3ee0c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_temp_gtid.test @@ -0,0 +1,53 @@ +# ==== Purpose ==== +# +# Verify if the temporary tables will still be present on the slave after +# restarting only the IO thread when using the GTID AUTO_POSITION protocol. +# +# ==== Related Bugs and Worklogs ==== +# +# Bug#18472603 SQL THREAD COMMITS PARTIAL TRANSACTION WITH GTID AND AUTO +# POSITIONING ENABLED +# +--source include/have_binlog_format_statement.inc +--source include/have_innodb.inc +--source include/have_gtid.inc +--let $use_gtids= 1 +--source include/master-slave.inc + +--echo # Initial setup +--source include/rpl_connection_master.inc +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=InnoDB; + +--echo # Insert the data in the master +BEGIN; +INSERT INTO temp_t1 VALUES (1); +COMMIT; + +BEGIN; +INSERT INTO t1 VALUES ((SELECT COUNT(*) FROM temp_t1)); +COMMIT; +--source include/sync_slave_sql_with_master.inc + +--source include/rpl_connection_slave.inc +--echo # Stop the IO thread +--source include/stop_slave_io.inc +--echo # Restart IO thread +--source include/start_slave_io.inc + +--echo # Do one more insert on master and then sync slave with master +--source include/rpl_connection_master.inc +BEGIN; +INSERT INTO t1 VALUES ((SELECT COUNT(*) FROM temp_t1)); +COMMIT; +--source include/sync_slave_sql_with_master.inc + +--echo # Now compare master and slave's t1 table data +--source include/rpl_connection_master.inc +--let diff_tables= master:t1, slave:t1 +--source include/diff_tables.inc + +--echo # Cleanup +--source include/rpl_connection_master.inc +DROP TABLE t1, temp_t1; +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_view.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_view.test index 55a0ea10..4b72ba50 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_view.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_drop_view.test @@ -20,7 +20,7 @@ drop view v1, not_exist_view; --error 1146 select * from v1; drop view v2, v3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --error 1146 select * from v1; --error 1146 @@ -31,5 +31,5 @@ select * from v3; --echo ==== clean up ==== connection master; drop table t1, t2, t3; -sync_slave_with_master; +--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_dual_pos_advance.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test index 0ba82c7c..1be20e9a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test @@ -22,7 +22,8 @@ let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1); let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1); let $master_log_pos_1= `SELECT $master_log_pos_1 + 3`; ---sync_slave_with_master server_1 +--let $sync_slave_connection= server_1 +--source include/sync_slave_sql_with_master.inc # # BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if @@ -32,17 +33,28 @@ source include/stop_slave.inc; create table t2 (n int); # create one ignored event ---sync_slave_with_master server_2 +--let $sync_slave_connection= server_2 +--source include/sync_slave_sql_with_master.inc show tables; create table t3 (n int) engine=innodb; let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1); let $master_log_pos_2= `SELECT $master_log_pos_2 + 5`; +if (!`SELECT COUNT(*) = 0 OR VARIABLE_VALUE != 'ON' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'GTID_MODE'`) +{ + # if GTID_MODE=ON, there is the extra event entry the binary log:# Gtid_log_event + --let $master_log_pos_2= `SELECT $master_log_pos_2 + 57` +} set @a=1; insert into t3 values(@a); let $master_log_pos_3= query_get_value(SHOW MASTER STATUS, Position, 1); let $master_log_pos_3= `SELECT $master_log_pos_3 + 5`; +if (!`SELECT COUNT(*) = 0 OR VARIABLE_VALUE != 'ON' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'GTID_MODE'`) +{ + # if GTID_MODE=ON, there is the extra event entry the binary log:# Gtid_log_event + --let $master_log_pos_3= `SELECT $master_log_pos_3 + 57` +} begin; insert into t3 values(2); insert into t3 values(3); @@ -86,11 +98,13 @@ create table t4 (n int); # create 3 ignored events create table t5 (n int); create table t6 (n int); ---sync_slave_with_master server_2 +--let $sync_slave_connection= server_2 +--source include/sync_slave_sql_with_master.inc # then BUG#13023 caused hang below ("master" looks behind, while it's # not in terms of updates done). ---sync_slave_with_master server_1 +--let $sync_slave_connection= server_1 +--source include/sync_slave_sql_with_master.inc show tables; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test index 9ebed299..bafe6d76 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test @@ -19,14 +19,14 @@ create table t4 (a int primary key); insert into t1 values (1),(1); insert into t4 values (1),(2); # as the t1 table is ignored on the slave, the slave should be able to sync -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # check that the table has been ignored, because otherwise the test is nonsense show tables like 't1'; show tables like 't4'; SELECT * FROM test.t4 ORDER BY a; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Now test that even critical errors (connection killed) # are ignored if rules allow it. @@ -56,12 +56,12 @@ connection master; reap; --enable_warnings connection master1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t4 ORDER BY a; connection master1; DROP TABLE test.t4; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests # Adding comment for force manual merge 5.0 -> wl1012. delete me if needed diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_events.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_events.test index 1de5006f..08908c70 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_events.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_events.test @@ -30,7 +30,7 @@ DELIMITER ;| ALTER EVENT event1 RENAME TO event2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -80,7 +80,7 @@ select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events where EVENT_NAME='event44331_4'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; --echo #on slave select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events @@ -100,5 +100,5 @@ DROP EVENT event44331_1; DROP EVENT event44331_2; DROP EVENT event44331_3; DROP EVENT event44331_4; -sync_slave_with_master; +--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_extra_col_master_innodb.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test index f48880b5..ab4b0673 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test @@ -2,6 +2,7 @@ # Purpose: To test having extra columns on the master WL#3915 ############################################################# -- source include/have_binlog_format_row.inc +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc -- source include/have_innodb.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test index 4f344cfa..626b781f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test @@ -2,6 +2,7 @@ # Purpose: To test having extra columns on the master WL#3915 ############################################################# -- source include/have_binlog_format_row.inc +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc let $engine_type = 'MyISAM'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test index f4b04468..e3dcb663 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test @@ -1,5 +1,6 @@ -- source include/have_binlog_format_row.inc -- source include/have_innodb.inc +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc let $engine_type = 'InnoDB'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test index d8d64aed..96b70b83 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test @@ -1,4 +1,5 @@ -- source include/have_binlog_format_row.inc +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc let $engine_type = 'MyISAM'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_row_data.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_row_data.test index 0e169d8e..8c62291c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_row_data.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_extra_row_data.test @@ -49,7 +49,7 @@ DELETE FROM t1 WHERE a > 390; #--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/master-bin.000001 --echo **** On Slave **** ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc connection slave; --echo Check row count and that slave is running ok @@ -58,5 +58,5 @@ source include/check_slave_is_running.inc; connection master; DROP TABLE t1; ---sync_slave_with_master +--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_failed_optimize.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_failed_optimize.test index 798b3ef8..d2327329 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_failed_optimize.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_failed_optimize.test @@ -1,3 +1,7 @@ +# TODO: Waiting for the fix of the BUG#17803141. Till then +# this test continues to fail. + +-- source include/not_gtid_enabled.inc -- source include/not_ndb_default.inc -- source include/have_innodb.inc let $engine_type=InnoDB; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_database.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_database.test index dbba44de..55b15fc6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_database.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_database.test @@ -41,7 +41,7 @@ if (!`SELECT count(*) = 1 FROM information_schema.SCHEMATA WHERE schema_name = ' -- die } --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc if (!`SELECT count(*) = 1 FROM information_schema.SCHEMATA WHERE schema_name = 'dbx'`) { @@ -65,7 +65,7 @@ if (!`SELECT DEFAULT_CHARACTER_SET_NAME='latin5' FROM information_schema.SCHEMAT -- die } --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc if (!`SELECT DEFAULT_CHARACTER_SET_NAME='latin5' FROM information_schema.SCHEMATA WHERE schema_name = 'dbx'`) { @@ -88,7 +88,7 @@ if (!`SELECT count(*) = 0 FROM information_schema.SCHEMATA WHERE schema_name = ' -- die } --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc if (!`SELECT count(*) = 0 FROM information_schema.SCHEMATA WHERE schema_name = 'dbx'`) { diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test index 8e53684c..84661ceb 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test @@ -49,6 +49,7 @@ source include/have_binlog_format_statement.inc; +source include/not_gtid_enabled.inc; source include/master-slave.inc; # These tables are mentioned in do-table rules @@ -79,7 +80,7 @@ INSERT INTO t8 VALUES (1, 1), (2, 2), (3, 3); INSERT INTO t9 VALUES (1, 1), (2, 2), (3, 3); # Only t1, t2, t3 should be replicated to slave -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo [on slave]; SHOW TABLES LIKE 't%'; @@ -121,7 +122,7 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id # Sync slave to make sure all above statements are correctly ignored, # if any of the above statement are not ignored, it would cause error # and stop slave sql thread. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); @@ -187,7 +188,7 @@ source include/wait_for_slave_sql_error_and_skip.inc; UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1; source include/wait_for_slave_sql_error_and_skip.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo [on slave]; # We should only have tables t1, t2, t3 on slave @@ -203,7 +204,7 @@ connection master; echo [on master]; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # # BUG#11754117 - 45670: INTVAR_EVENTS FOR FILTERED-OUT QUERY_LOG_EVENTS ARE EXECUTED @@ -217,7 +218,7 @@ CREATE TABLE test.t1 (a INT); # accepted on slave INSERT INTO test.t1 VALUES(1); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); # Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D. CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); @@ -233,7 +234,7 @@ SELECT b into @b FROM test.t5; --let $b_master=`select @b` UPDATE test.t1 SET a=2; # to run trigger on slave ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # The proof: SELECT a AS 'ONE' into @a FROM test.t_slave; @@ -261,7 +262,7 @@ connection master; drop table test.t5; drop table test.t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc drop table test.t_slave; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings-slave.opt new file mode 100644 index 00000000..38042a74 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings-slave.opt @@ -0,0 +1 @@ +--no-console --log-warnings=2 --replicate-do-table=test.t1 --log_error=$MYSQLTEST_VARDIR/tmp/slave.err diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings.test new file mode 100644 index 00000000..94670be7 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_filter_warnings.test @@ -0,0 +1,49 @@ +############################################################################### +# Bug#17986385:LOG-WARNINGS=2 UNUSABLE ON SLAVE WITH FILTERS +# +# Problem: +# ======== +# If a slave is configured with replication filters and log-warnings=2, every +# statement which is filtered writes an entry to the error log: +# +# [Warning] Slave SQL: Could not execute Query event. Detailed error: Slave +# SQL thread ignored the query because of replicate-*-table rules +# For busy servers which generate a lot of statements that get filtered, the +# result is an error log which can quickly grow into the GB range. +# +# Test: +# ===== +# 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. +############################################################################### +--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 + +CREATE TABLE t2 (c1 INT) ENGINE=InnoDB; +--source 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); +# Error log throttle is checked once per minute hence the sleep has been +# added. +SLEEP 60; +DROP TABLE t2; +--source include/sync_slave_sql_with_master.inc + +--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 +--source extra/rpl_tests/grep_pattern.inc + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_flush_logs.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_flush_logs.test index 6e9de634..a8d5dcd1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_flush_logs.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_flush_logs.test @@ -20,7 +20,7 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; --error 1 file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # Make sure relay logs was not be flushed --echo # after execute 'flush error logs' statement. --error 1 @@ -30,7 +30,7 @@ connection master; --echo # Test if support 'flush relay logs' statement. flush relay logs; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # Check the 'slave-relay-bin.000003' file is created --echo # after executed 'flush relay logs' statement. file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003; @@ -88,7 +88,7 @@ file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000001; # Test 'flush error logs, relay logs' statement -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # Make sure the 'slave-relay-bin.000006' file does not exist --echo # exist before execute 'flush error logs, relay logs' statement. --error 1 @@ -106,7 +106,7 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; --error 1 file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # Check the 'slave-relay-bin.000006' file is created after --echo # execute 'flush error logs, relay logs' statement. file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006; @@ -121,6 +121,8 @@ file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007; --error 1 file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008; +--source include/stop_slave_sql.inc + connection master; --echo # Test if 'flush logs' statement works fine and flush all the logs. @@ -132,10 +134,11 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; --echo # after execute 'flush logs' statement. file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003; -sync_slave_with_master; +--source include/sync_slave_io_with_master.inc --echo # Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008' --echo # files are created after execute 'flush logs' statement. file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007; file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008; +--source include/start_slave_sql.inc --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_flushlog_loop.test index 68566f66..6e1a82c4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_flushlog_loop.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_flushlog_loop.test @@ -19,16 +19,19 @@ show variables like 'relay_log%'; CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM; let $wait_binlog_event= CREATE TABLE t1; --source include/wait_for_binlog_event.inc -sync_slave_with_master server_2; +--let $sync_slave_connection= server_2 +--source include/sync_slave_sql_with_master.inc connection server_1; INSERT INTO t1 VALUE(1); FLUSH LOGS; -sync_slave_with_master server_2; +--let $sync_slave_connection= server_2 +--source include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUE(2); let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1); -sync_slave_with_master server_1; +--let $sync_slave_connection= server_1 +--source include/sync_slave_sql_with_master.inc # # Check that the master server's slave threads are still running and show @@ -41,7 +44,8 @@ sync_slave_with_master server_1; --disable_query_log connection server_1; DROP TABLE t1; -sync_slave_with_master server_2; +--let $sync_slave_connection= server_2 +--source include/sync_slave_sql_with_master.inc --enable_query_log --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_free_items.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_free_items.test index 581409cf..c42e7042 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_free_items.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_free_items.test @@ -13,11 +13,11 @@ let $1=`select @query`; eval $1; enable_query_log; # I have seen the slave crash either now or at shutdown -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; drop table t1; drop table t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_function_defaults.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_function_defaults.test index 24bec10d..79720de6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_function_defaults.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_function_defaults.test @@ -59,7 +59,7 @@ CREATE TABLE t2 ( INSERT INTO t2 ( o ) VALUES ( 1 ); --echo sync_slave_with_master -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo connection slave connection slave; @@ -77,7 +77,7 @@ UPDATE t1 SET o = 2; UPDATE t2 SET o = 2; --echo sync_slave_with_master -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo connection slave connection slave; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_general_log.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_general_log.test index 915b4d78..f1dcdd50 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_general_log.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_general_log.test @@ -17,7 +17,7 @@ TRUNCATE mysql.general_log; --connection master CREATE TABLE t1 (i int NOT NULL PRIMARY KEY); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $assert_cond= [SELECT count(*) as N FROM mysql.general_log WHERE argument="CREATE TABLE t1 (i int NOT NULL PRIMARY KEY)", N, 1] = 1 --let $assert_text= The slave thread does not write the same statement twice to the general log @@ -25,7 +25,7 @@ CREATE TABLE t1 (i int NOT NULL PRIMARY KEY); --connection master DROP TABLE t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_geometry.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_geometry.test index 769c49c9..e2a92572 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_geometry.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_geometry.test @@ -19,7 +19,7 @@ create table t2 (a int(11) not null auto_increment primary key, insert into t2(c) values (null); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; drop table t1, t2; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_get_lock.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_get_lock.test index b5c08858..57d20e4b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_get_lock.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_get_lock.test @@ -22,7 +22,7 @@ while ($1) dec $1; } enable_query_log; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select get_lock("lock",3); select * from t1; # There is no point in testing REPLICATIION of the IS_*_LOCK @@ -39,7 +39,7 @@ select is_free_lock("lock2"); select is_free_lock(NULL); connection master1; drop table t1; -sync_slave_with_master; +--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_grant.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_grant.test index 55b52d45..0793457d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_grant.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_grant.test @@ -1,5 +1,6 @@ # Tests of grants and users +source include/not_gtid_enabled.inc; source include/master-slave.inc; source include/not_embedded.inc; @@ -11,7 +12,7 @@ CREATE USER dummy1@localhost, dummy2@localhost; SELECT user, host FROM mysql.user WHERE user like 'dummy%'; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** SELECT user,host FROM mysql.user WHERE user like 'dummy%'; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%'; @@ -32,7 +33,7 @@ DROP USER dummy1@localhost, dummy2@localhost; SELECT user, host FROM mysql.user WHERE user like 'dummy%'; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** SELECT user,host FROM mysql.user WHERE user like 'dummy%'; SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%'; @@ -80,7 +81,7 @@ call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the mas SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; --source include/start_slave_sql.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ## assert that grants are the same on master and on slave for $dbuser --connection master @@ -88,7 +89,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; --eval SHOW GRANTS FOR '$dbuser'@'localhost' --echo ************************************************************* ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ****** Checking grants on the slave for user: $dbuser ******* --eval SHOW GRANTS FOR '$dbuser'@'localhost' --echo ************************************************************* @@ -103,7 +104,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; --eval SHOW GRANTS FOR '$dbuser'@'localhost' --echo ************************************************************* ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ****** Checking grants on the slave for user: $dbuser ******* --eval SHOW GRANTS FOR '$dbuser'@'localhost' --echo ************************************************************* @@ -126,7 +127,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; --source include/start_slave_sql.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ****** Checking grants on the slave for user: $dbuser ******* --eval SHOW GRANTS FOR '$dbuser'@'localhost' @@ -149,7 +150,7 @@ DELIMITER ;| --eval SHOW GRANTS FOR '$dbuser'@'localhost' --echo ************************************************************* ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ****** Checking grants on the slave for user: $dbuser ******* --eval SHOW GRANTS FOR '$dbuser'@'localhost' --echo ************************************************************* @@ -175,7 +176,7 @@ DELIMITER ;| SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; --source include/start_slave_sql.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ****** Checking grants on the slave for user: $dbuser ******* --eval SHOW GRANTS FOR '$dbuser'@'localhost' @@ -201,7 +202,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; --source include/start_slave_sql.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ****** Checking grants on the slave for user: $dbuser ******* --eval SHOW GRANTS FOR '$dbuser'@'localhost' @@ -221,7 +222,7 @@ REVOKE EXECUTE ON PROCEDURE b54866_p FROM 'fake_user'@'localhost'; REVOKE EXECUTE ON FUNCTION b54866_f FROM 'fake_user'@'localhost'; -- error ER_REVOKE_GRANTS REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'fake_user'@'localhost'; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ########## --echo ########## Cleanup @@ -231,7 +232,7 @@ DROP PROCEDURE b54866_p; DROP FUNCTION b54866_f; --eval DROP USER '$dbuser'@'localhost' --eval DROP DATABASE $dbname ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # # BUG#11827392: 60082: EVEN THOUGH IT FAILS, 'CREATE USER' STATEMENT SI STILL BINLOGGED. @@ -256,7 +257,7 @@ DROP FUNCTION b54866_f; --error ER_PLUGIN_IS_NOT_LOADED CREATE USER foo IDENTIFIED WITH 'my_plugin'; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_grant_plugin.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_grant_plugin.test index 6aa6c60f..afcd27c2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_grant_plugin.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_grant_plugin.test @@ -32,7 +32,7 @@ if (`SELECT @@GLOBAL.GTID_MODE != 'OFF'`) --let $assert_cond= `SELECT "$logged_query" LIKE "%$query"` --source include/assert.inc --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master --let $query= GRANT ALL PRIVILEGES ON `test`.* TO 'b59708_user2'@'%' IDENTIFIED WITH 'test_plugin_server' AS 'CN=analyst, OU=division1, O=oracle, C=US' @@ -43,7 +43,7 @@ if (`SELECT @@GLOBAL.GTID_MODE != 'OFF'`) --let $assert_text= Logged query must match the one issued. --source include/assert.inc --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master ## testing with escaped characters @@ -55,14 +55,14 @@ if (`SELECT @@GLOBAL.GTID_MODE != 'OFF'`) --let $assert_text= Logged query must match the one issued but properly escaped. --source include/assert.inc --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master DROP USER b59708_user1; DROP USER b59708_user2; DROP USER 'b59708_user\''@'localhost\''; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master --enable_query_log diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binary_log_as_relay_log.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binary_log_as_relay_log.test new file mode 100644 index 00000000..34c50157 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binary_log_as_relay_log.test @@ -0,0 +1,57 @@ +############################################################################### +# Bug#17812024 MTS IS NOT ABLE TO REPRODUCE BINLOGS AS RELAY LOGS +# Problem: When a binarylog is used as a relaylog (transfer binarylogs to +# Slave machine to avoid I/O thread reading delay), MTS is unable to operate +# on that kind of relaylog. + +# Steps to Reproduce: +# 1) Prepare a binary log with some 3 sample GTIDs +# 2) Make that binary log as relay log +# 3) Set slave_parallel_workers to 1 and start worker thread +# 4) Make sure everything is replicated +############################################################################### + +--source include/have_gtid.inc +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc +# Initial setup +--let $MYSQLD_MASTER_DATADIR= `select @@datadir` +--connection slave +--let $MYSQLD_SLAVE_DATADIR= `select @@datadir` +--source include/stop_slave_sql.inc + +# Step-1: Prepare a binary log with 3 sample GTIDs +--connection master +CREATE TABLE t1(i INT); +INSERT INTO t1 values (1); +INSERT INTO t1 values (2); +--source include/sync_slave_io_with_master.inc + +# Step-2: Make that binary log as relay log +--remove_file $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001 +--copy_file $MYSQLD_MASTER_DATADIR/master-bin.000001 $MYSQLD_SLAVE_DATADIR/slave-relay-bin.000001 + +# Step-3: Now start worker thread with that relay log(binary log as relay log) +# and see that worker thread does not have issues in completing it. +SET @save.slave_parallel_workers=@@global.slave_parallel_workers; +SET @@global.slave_parallel_workers=1; + +SET @save.slave_transaction_retries=@@global.slave_transaction_retries; +SET @@global.slave_transaction_retries=0; +--source include/start_slave_sql.inc + +# Step-4: Make sure everything is replicated +--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; +--connection slave +--source include/stop_slave_sql.inc +SET @@global.slave_parallel_workers=@save.slave_parallel_workers; +SET @@global.slave_transaction_retries=@save.slave_transaction_retries; +--source include/start_slave_sql.inc +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binlog_errors-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binlog_errors-master.opt new file mode 100644 index 00000000..f8e46a44 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binlog_errors-master.opt @@ -0,0 +1 @@ +--max_binlog_size=4096 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binlog_errors.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binlog_errors.test new file mode 100644 index 00000000..2c11c151 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_binlog_errors.test @@ -0,0 +1,6 @@ +# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error +# when generating new name. +# +--source include/have_gtid.inc + +--source extra/rpl_tests/rpl_binlog_error.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive-master.opt new file mode 100644 index 00000000..62ab6dad --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive-slave.opt new file mode 100644 index 00000000..9c0a73eb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive-slave.opt @@ -0,0 +1 @@ +--replicate-do-db=MYDB --replicate-do-table=mýdb.ţ1 --replicate-do-table=mydb.T2 --lower_case_table_names=1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive.test new file mode 100644 index 00000000..4bfcf664 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_insensitive.test @@ -0,0 +1,9 @@ +# +# Bug #51639 +# This test verifies that 'do table'filters will follow +# the setting of lower_case_table_name to be case +# insensitive but accent sensitive when setting +# lower_case_table_name > 0 +# +--source include/have_gtid.inc +--source extra/rpl_tests/rpl_do_table_filter_insensitive.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 new file mode 100644 index 00000000..9b27aef9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-slave.opt new file mode 100644 index 00000000..a513fb57 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive-slave.opt @@ -0,0 +1 @@ +--replicate-do-db=mydb --replicate-do-table=mydb.Ţ1 --replicate-do-table=mydb.t2 --lower_case_table_names=0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive.test new file mode 100644 index 00000000..93e7ca11 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_do_table_filter_sensitive.test @@ -0,0 +1,9 @@ +# +# Bug #51639 +# This test verifies that 'do table'filters will follow +# the setting of lower_case_table_name to be case +# sensitive and accent sensitive when setting +# lower_case_table_name == 0 +# +--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_drop_table.cnf b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_drop_table.cnf new file mode 100644 index 00000000..2175b117 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_drop_table.cnf @@ -0,0 +1,11 @@ +!include ../my.cnf + +[mysqld.2] + +replicate-ignore-table=test.temp_ignore + +[mysqld.3] + +[ENV] +SERVER_MYPORT_3= @mysqld.3.port +SERVER_MYSOCK_3= @mysqld.3.socket diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_drop_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_drop_table.test new file mode 100644 index 00000000..02d68511 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_drop_table.test @@ -0,0 +1,338 @@ +# ==== Purpose ==== +# +# In order to avoid problems with GTIDs, MySQL server should refuse to execute +# any statements that will be split before sending to binlog if +# @@SESSION.GTID_NEXT is set to 'UUID:NUMBER'. +# +# In MySQL server, DROP TABLE statements can be split into up to three +# distinct binlog events: one containing the regular tables, one containing +# transactional temporary tables and one containing non-transactional +# temporary tables. +# +# In the first part, this test will verify if a splittable DROP TABLE +# statement is being refused to execute throwing the correct error to the +# client session. +# +# In the second part, this test will verify an issue with inexistent temporary +# tables being assumed as transactional on the slave side. This was making +# the slave to split a DROP statement that the master logged as a single DROP +# statement. +# +# In the third part, this test will verify that a slave having to drop +# temporary tables because of the master have restarted will split the DROP +# TABLE statement also based on table types (transactional or not). +# +# The details about the implementation of this test is in the beginning of +# each part. +# +# ==== Related Bugs and Worklogs ==== +# +# BUG#17620053: SET GTID_NEXT AND DROP TABLE WITH BOTH REGULAR AND TEMPORARY +# TABLES +# +--let $rpl_topology= 1->2->3 +--source include/have_gtid.inc +--source include/rpl_init.inc +--source include/rpl_default_connections.inc +--source include/have_innodb.inc + +--echo # +--echo # First part +--echo # +# +# This part verifies the splittable DROP TABLE behavior in client sessions by +# creating three tables (one regular and two temporary), setting session +# GTID_NEXT to an specific GTID and then trying to issue an DROP TABLE +# statement containing the combinations of at least two tables. +# +# As DROP statements with both regular and temporary tables or with +# transactional and non transactional temporary tables are split before +# sending to binlog, the following DROP statements must return an error to the +# client session because of being considered unsafe for GTID enforcement as it +# would be split into two (or three) statements to be sent to binlog. +# +# In order to improve the test coverage, we will verify DROP TABLE statements +# with all combinations of the following: +# 1) Regular transactional table; +# 2) Regular non-transactional table; +# 3) Temporary transactional table; +# 4) Temporary non-transactional table; +# 5) Nonexistent table. +# +# With the above set we could make up to 32 possibilities (including none of +# above). But we will test the behavior only for the following combinations: +# - 18 error cases (ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP): +# (1 | 2 | 1+2) + (3 | 4 | 3+4) + (nothing | 5) +# (3+4) | (3+4+5) +# (3 | 4) + 5 /* as this it not DROP TEMPORARY, nonexistent tables will be +# assumed as regular tables, so the DROP will be split */ +# - 3 error cases (ER_BAD_TABLE_ERROR): +# (1 | 2 | 1+2) + 5 +# - 1 non-error case: +# 1+2 +# Note: for ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP cases, the +# statement will not be executed and no DROP will be performed. For +# ER_BAD_TABLE_ERROR cases, the existent tables will be dropped regardless the +# error. + +# Create two regular tables and two temporary tables with distinct storage engines +--source include/rpl_connection_master.inc +CREATE TABLE trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TABLE non_trans_t1 (c1 INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; + +--echo # Error cases ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP +--let $next_gtid= '11111111-1111-1111-1111-111111111111:1' +--let $expected_error= ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP + +# reg trans + reg non trans + temp trans +--let $statement= DROP TABLE trans_t1, non_trans_t1, temp_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + reg non trans + temp trans + temp non trans +--let $statement= DROP TABLE trans_t1, non_trans_t1, temp_trans_t1, temp_non_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + reg non trans + temp trans + temp non trans + inexistent +--let $statement= DROP TABLE trans_t1, non_trans_t1, temp_trans_t1, temp_non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + reg non trans + temp trans + inexistent +--let $statement= DROP TABLE trans_t1, non_trans_t1, temp_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + reg non trans + temp non trans +--let $statement= DROP TABLE trans_t1, non_trans_t1, temp_non_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + reg non trans + temp non trans + inexistent +--let $statement= DROP TABLE trans_t1, non_trans_t1, temp_non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + temp trans +--let $statement= DROP TABLE trans_t1, temp_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + temp trans + temp non trans +--let $statement= DROP TABLE trans_t1, temp_trans_t1, temp_non_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + temp trans + temp non trans + inexistent +--let $statement= DROP TABLE trans_t1, temp_trans_t1, temp_non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + temp trans + inexistent +--let $statement= DROP TABLE trans_t1, temp_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + temp non trans +--let $statement= DROP TABLE trans_t1, temp_non_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg trans + temp non trans + inexistent +--let $statement= DROP TABLE trans_t1, temp_non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg non trans + temp trans +--let $statement= DROP TABLE non_trans_t1, temp_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg non trans + temp trans + temp non trans +--let $statement= DROP TABLE non_trans_t1, temp_trans_t1, temp_non_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg non trans + temp trans + temp non trans + inexistent +--let $statement= DROP TABLE non_trans_t1, temp_trans_t1, temp_non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg non trans + temp trans + inexistent +--let $statement= DROP TABLE non_trans_t1, temp_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg non trans + temp non trans +--let $statement= DROP TABLE non_trans_t1, temp_non_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# reg non trans + temp non trans + inexistent +--let $statement= DROP TABLE non_trans_t1, temp_non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# temp trans + temp non trans +--let $statement= DROP TABLE temp_trans_t1, temp_non_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# temp trans + temp non trans + inexistent +--let $statement= DROP TABLE temp_trans_t1, temp_non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# temp trans + inexistent +--let $statement= DROP TABLE temp_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# temp non trans + inexistent +--let $statement= DROP TABLE temp_non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc + +--echo # Error cases ER_BAD_TABLE_ERROR +--let $expected_error= ER_BAD_TABLE_ERROR + +# reg trans + reg non trans + inexistent +--let $next_gtid= '11111111-1111-1111-1111-111111111111:1' +--let $statement= DROP TABLE trans_t1, non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# recreate the trans table +SET GTID_NEXT= AUTOMATIC; +CREATE TABLE trans_t1 (c1 INT) ENGINE=InnoDB; +# reg trans + inexistent +--let $next_gtid= '11111111-1111-1111-1111-111111111111:2' +--let $statement= DROP TABLE trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc +# recreate the non trans table +SET GTID_NEXT= AUTOMATIC; +CREATE TABLE non_trans_t1 (c1 INT) ENGINE=MyISAM; +# reg non trans + inexistent +--let $next_gtid= '11111111-1111-1111-1111-111111111111:3' +--let $statement= DROP TABLE non_trans_t1, non_existent +--source extra/rpl_tests/rpl_gtid_drop_table.inc + +SET GTID_NEXT= AUTOMATIC; +CREATE TABLE trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TABLE non_trans_t1 (c1 INT) ENGINE=MyISAM; + +--echo # Non-error cases +--let $expected_error= + +# reg trans + reg non trans +--let $next_gtid= '11111111-1111-1111-1111-111111111111:4' +--let $statement= DROP TABLE trans_t1, non_trans_t1 +--source extra/rpl_tests/rpl_gtid_drop_table.inc + +SET GTID_NEXT= AUTOMATIC; +CREATE TABLE trans_t1 (c1 INT) ENGINE=InnoDB; + + +--echo # +--echo # Second part +--echo # +# +# The MySQL server cannot evaluate if an inexistent temporary table is +# transactional or not. Before the fix for BUG#17620053, the inexistent +# temporary tables were assumed to be transactional. +# +# This assumption could lead to a split if, for example, you issue a DROP +# TEMPORARY TABLE for two existent non-transactional temporary tables in the +# master (will binlog only one statement) but a filter made one of the +# temporary tables inexistent on the slave side (will binlog two statements: +# one with the existent non-transactional table and other with the inexistent +# table assumed to be transactional). +# +# As this test has a filter in its slave configuration like this: +# '--replicate-ignore-table=test.temp_ignore', all statements containing the +# 'test.temp_ignore' temporary table alone wont be executed by the SQL slave +# thread. So, the CREATE TABLE statements for 'temp_ignore' table will be +# executed only on the master. +# +# Issuing a DROP TEMPORARY TABLE statement in the master containing the two +# non-transaction temporary tables would result in a single binlog statement, +# as the two tables are non-transactional ones. +# +# In the slave, because of the filter, the non-replicated table will be +# assumed unknown. With the fix for BUG#17620053, the unknown tables will +# be assumed as transactional only if at least one transactional table is +# dropped. If the DROP recognizes only non-transactional tables, the unknown +# temporary tables will be assumed non-transactional, avoiding splitting the +# statement. + +# Create an additional non-transactional temporary table that will not be +# replicated due to the replication filter, only t1 will be replicated. +CREATE TEMPORARY TABLE temp_ignore (c1 INT) ENGINE=MyISAM; +# Drop the two non-transactional temp tables +DROP TEMPORARY TABLE IF EXISTS temp_ignore, temp_non_trans_t1; +# Sync to know that everything was replicated +--source include/sync_slave_sql_with_master.inc +# Back to the 'master' connection +--source include/rpl_connection_master.inc +# Create temp_ignore table again, but with InnoDB storage engine +CREATE TEMPORARY TABLE temp_ignore (c1 INT) ENGINE=InnoDB; +# Drop the two transactional temp tables +DROP TEMPORARY TABLE IF EXISTS temp_ignore, temp_trans_t1; +# Sync to know that everything was replicated +--source include/sync_slave_sql_with_master.inc + +--echo # +--echo # Third part +--echo # +# +# This part was adapted from rpl_create_drop_temp_table.test +# +# As we use three server topology, when the slave (mysqld 2) detects the +# master (mysqld 1) has restarted it will drop the temporary tables and +# will binlog the DROP TABLE statements that will be replicated to +# the third server (mysqld 3). +# +# As the DROP of temporary table in the slave side groups the tables +# by pseudo-threadid and by database, we will use two sessions on master, +# creating three sets of temporary tables, each set on a distinct database. +# +# The first set contains two tables with distinct storage engines, the +# second set contains a single table and the third set contains two tables +# with the same storage engine. +# +--source include/rpl_connection_master.inc +call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal"); +CREATE DATABASE test2; +CREATE DATABASE test3; + +# Create two temporary tables with distinct storage engines in 'test' +# This should generate two DROP statements +use test; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +# Create one temporary table with transactional storage engine in 'test2' +# This should generate only one DROP statement +USE test2; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +# Create two temporary tables with transactional storage engine in 'test3' +# This should generate only one DROP statement with the two tables +USE test3; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_trans_t2 (c1 INT) ENGINE=InnoDB; + +# Create two temporary tables with distinct storage engines in 'test' +# in another client session. This should generate two DROP statements +--source include/rpl_connection_master1.inc +use test; +CREATE TEMPORARY TABLE temp_trans_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +# Create one temporary table with non-transactional storage engine in 'test2' +# This should generate only one DROP statement +USE test2; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +# Create two temporary tables with non-transactional storage engine in 'test3' +# This should generate only one DROP statement with the two tables +USE test3; +CREATE TEMPORARY TABLE temp_non_trans_t1 (c1 INT) ENGINE=MyISAM; +CREATE TEMPORARY TABLE temp_non_trans_t2 (c1 INT) ENGINE=MyISAM; + +# Sync to know that everything was replicated +--source include/sync_slave_sql_with_master.inc + +# Stop slave io thread +--source include/stop_slave_io.inc + +# Kill Master so that it does not go through THD::cleanup logic. Hence it does +# not generate "drop temporary" query for 'temp' tables. +--let $rpl_server_number= 1 +--let $rpl_force_stop=1 +--source include/rpl_stop_server.inc + +# Restart Master (generates Format Description event which tells slave to +# drop all temporary tables) +--source include/rpl_start_server.inc + +# Start and sync slave IO thread +--source include/rpl_connection_slave.inc +--source include/start_slave_io.inc +--source include/rpl_connection_master.inc +--source include/sync_slave_io_with_master.inc + +# Wait for slave thread to apply all events (including the newly generated +# FormatDescription event which tells slave SQL thread to drop all temporary +--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 + +# Now we verify slave_open_temp_tables, it should be '0' +--let $var_value= query_get_value(SHOW STATUS LIKE 'Slave_open_temp_tables', Value, 1) +--let $assert_text= Slave_open_temp_tables should be 0 +--let $assert_cond= $var_value = 0 +--source include/assert.inc + +# Cleanup replication +--source include/rpl_connection_master.inc +USE test; +DROP TABLE trans_t1; +DROP DATABASE test2; +DROP DATABASE test3; +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.cnf b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.cnf new file mode 100644 index 00000000..6ea5535e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.cnf @@ -0,0 +1,25 @@ +!include ../my.cnf + +[mysqld.1] +gtid-mode=on +log-slave-updates=on +enforce-gtid-consistency=on + +[mysqld.2] +gtid-mode=on +log-slave-updates=on +enforce-gtid-consistency=on + +replicate-ignore-table=test.t_ignore +replicate-wild-ignore-table=test.t_wild_ignore +replicate-ignore-db=db_ignore +binlog-ignore-db=db_binlog_ignore + +[mysqld.3] +gtid-mode=on +log-slave-updates=on +enforce-gtid-consistency=on + +[ENV] +SERVER_MYPORT_3= @mysqld.3.port +SERVER_MYSOCK_3= @mysqld.3.socket diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test new file mode 100644 index 00000000..7663e0bb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_empty_transaction.test @@ -0,0 +1,301 @@ +# ==== Purpose ==== +# +# Verifies that empty transactions are generated when they are +# supposed to. There are three cases: +# +# 1. Transaction is filtered out on slave +# +# 2. Transaction does not have any effect, gets logged and assigned a +# GTID on master because master uses binlog_format=statement, but +# does not get logged on slave because slave uses binlog_format=row. +# +# 3. Transaction is explicitly made empty on master by setting +# gtid_next and executing a COMMIT. +# +# Moreover, verify that no empty transaction is generated for rolled +# back transactions. +# +# ==== Implementation ==== +# +# For case 1, we use a filter (specified in the .cnf file) to filter +# out table t_ignore, and verify that empty transaction is generated +# on slave. Do this both for (1A) base tables and for (1B) temporary +# tables. +# +# For case 2, we use binlog_format=statement on master and +# binlog_format=row on the first slave. We test two cases of +# transactions that are not logged in row format: (2A) temporary table +# DDL and DML and (2B) an UPDATE statement that matches no row. We +# use a second slave where the effect of the statement would be seen, +# if it was not logged as an empty statement. In case (2A) we check +# that slave_open_temp_tables is still 0 on the second slave. In case +# (2B) we do an UPDATE on master that matches no rows on master, but +# that would match a row on the second slave. +# +# For case 3, we just execute an explicit empty transaction on master +# and verify that it gets assigned a GTID and gets replicated to the +# slaves. +# +# To verify nothing is logged for rollback transactions, we execute a +# DDL statement that generates an error, a DML statement that +# generates an error, and an explicit ROLLBACK transaction, and verify +# that nothing got logged for the three statements. +# +# ==== References ==== +# +# WL#3584 - Global Transaction Identifiers (GTIDs) +# - The base worklog implementing empty transactions. +# BUG#18145032 - NO EMPTY TRANSACTION IS CREATED FOR A FILTERED CREATE TEMPORARY TABLE WITH GTIDS +# - Addressing the special cases for CREATE/ALTER/DROP TEMPORARY. +# BUG#18095502 - RESTART OF SLAVE INSTANCE FAIL IN GTID REPLICATION IF WE USE REPLICATE-IGNORE-DB +# - Addressing database filters in the applier thread. + +--let $rpl_topology= 1->2->3 +--let $rpl_gtid_utils= 1 +--source include/rpl_init.inc +--source include/rpl_default_connections.inc +--source include/not_embedded.inc +--source include/have_binlog_format_mixed.inc +--source include/have_gtid.inc + +--source include/rpl_reset.inc + +--echo ==== Case 1A: Transaction filtered out ==== + +--source include/gtid_step_reset.inc + +CREATE TABLE t_ignore(id INT); +INSERT INTO t_ignore VALUES (1); +DROP TABLE t_ignore; + +CREATE TABLE t_ignore_wild(id INT); +INSERT INTO t_ignore_wild VALUES (1); +DROP TABLE t_ignore_wild; + +# Verify that 6 GTIDs were generated. +--let $gtid_step_count= 6 +--source include/gtid_step_assert.inc + +# Verify that the GTIDs make it to every slave +--source include/rpl_sync.inc + +--echo ==== Case 1B: CREATE/ALTER/DROP TEMPORARY filtered out ==== + +CREATE TEMPORARY TABLE t_ignore(a INT); +ALTER TABLE t_ignore ADD COLUMN b INT; +INSERT INTO t_ignore VALUES (1, 2); +DROP TEMPORARY TABLE t_ignore; + +CREATE TEMPORARY TABLE t_ignore_wild(a INT); +ALTER TABLE t_ignore_wild ADD COLUMN b INT; +INSERT INTO t_ignore_wild VALUES (1, 2); +DROP TEMPORARY TABLE t_ignore_wild; + +# Verify that 8 GTIDs were generated. +--let $gtid_step_count= 8 +--source include/gtid_step_assert.inc + +# Verify that the GTIDs make it to every slave. +--source include/rpl_sync.inc + +--echo ==== Case 1C: database filters on slave applier ==== + +--source include/gtid_step_reset.inc + +# These two will be ignored on first slave. +CREATE DATABASE db_ignore; +USE db_ignore; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +USE test; + +# Verify 2 GTIDs were generated +--let $gtid_step_count= 3 +--source include/gtid_step_assert.inc + +--source include/rpl_sync.inc + +--let $assert_text= db_ignore should not be created on slave +--let $assert_cond= "[slave:SHOW DATABASES LIKE "db_ignore"]" = "" +--source include/assert.inc + +--let $assert_text= db_ignore should not be created on second slave +--let $assert_cond= "[server_3:SHOW DATABASES LIKE "db_ignore"]" = "" +--source include/assert.inc + +DROP DATABASE db_ignore; +--source include/rpl_sync.inc + +--echo ==== Case 1D: database filters on slave binary log ==== + +--source include/gtid_step_reset.inc + +# These two will be ignored on first slave. +CREATE DATABASE db_binlog_ignore; +USE db_binlog_ignore; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +USE test; + +# Verify 2 GTIDs were generated +--let $gtid_step_count= 3 +--source include/gtid_step_assert.inc + +--source include/rpl_sync.inc + +--let $assert_text= db_binlog_ignore should not be created on slave +--let $assert_cond= "[slave:SHOW DATABASES LIKE "db_binlog_ignore"]" = "db_binlog_ignore" +--source include/assert.inc + +--let $assert_text= db_binlog_ignore should not be created on second slave +--let $assert_cond= "[server_3:SHOW DATABASES LIKE "db_binlog_ignore"]" = "" +--source include/assert.inc + +DROP DATABASE db_binlog_ignore; +--source include/rpl_sync.inc + +--echo ==== Case 2A: temp table transaction not logged in row format ==== + +--echo ---- Initialize ---- + +--connection slave +SET @save.binlog_format= @@global.binlog_format; +SET @@global.binlog_format= row; +source include/restart_slave_sql.inc; + +--echo ---- Test ---- + +--source include/gtid_step_reset.inc + + +# - Master will log these statements and assign them GTIDs, since +# master uses binlog_format=statement. +# +# - First slave will not log any change since it uses row format, but +# it should log empty transactions with GTIDs. +# +# - Second slave should also not log any change, since it receives an +# empty transaction from the first slave. Thus +# Slave_open_temp_tables should remain 0 on the second slave. +CREATE TEMPORARY TABLE t2 (a INT); +ALTER TABLE t2 ADD COLUMN b INT; +INSERT INTO t2 VALUES (1, 2); + +# assert exactly 3 GTIDs were generated +--let $gtid_step_count= 3 +--source include/gtid_step_assert.inc + +# Verify that the GTID gets replicated everywhere. +--let $use_gtids= 1 +--source include/rpl_sync.inc + +# Verify temp tables on first slave but not on second slave +--let $assert_text= First slave should not have created any temp table +--let $assert_cond= [slave:SHOW GLOBAL STATUS LIKE 'Slave_open_temp_tables'] = 1 + +--let $assert_text= Second slave should not have created any temp table +--let $assert_cond= [server_3:SHOW GLOBAL STATUS LIKE 'Slave_open_temp_tables'] = 0 + +--echo ---- Clean up ---- + +DROP TEMPORARY TABLE t2; +--source include/rpl_sync.inc + +--connection slave +SET @@global.binlog_format= @save.binlog_format; +--connection master + +--echo ==== Case 2B: transaction with no effect not logged in row format ==== + +--echo ---- Initialize ---- + +--connection slave +SET @save.binlog_format= @@global.binlog_format; +SET @@global.binlog_format= row; +source include/restart_slave_sql.inc; + +--connection master +SET @@session.binlog_format= statement; +CREATE TABLE t1(id INT) ENGINE = InnoDB; +--source include/rpl_sync.inc +--connection server_3 +INSERT INTO t1 VALUES (0); +--connection master + +--echo ---- Test ---- + +# - Master will log this and assign it a GTID despite it has no +# effect, since master uses binlog_format=statement. +# +# - First slave will not log any change since it uses row format, but +# it should log an empty transaction with a GTID. +# +# - Second slave should also not log any change, since it receives an +# empty transaction from the first slave. It should also not update +# the table despite the original SQL statement would match a row on +# the second slave, since it only receives the empty transaction +# from the first slave. +UPDATE t1 SET id= 1 WHERE id = 0; + +# Verify that the GTID gets replicated everywhere. +--let $use_gtids= 1 +--source include/rpl_sync.inc + +--let $assert_text= Second slave should not have done any update +--let $assert_cond= [server_3:SELECT * FROM t1] = 0 + +-- echo ---- Clean up ---- + +DROP TABLE t1; +--source include/rpl_sync.inc + +--connection slave +SET @@global.binlog_format= @save.binlog_format; +--connection master + +--echo ==== Case 3: explicit empty transaction on master ==== + +--source include/gtid_step_reset.inc +eval SET @@SESSION.GTID_NEXT = '$uuida:1'; +COMMIT; +SET @@SESSION.GTID_NEXT = 'AUTOMATIC'; + +# Verify exactly one GTID was generated +--let $gtid_step_count= 1 +--let $gtid_step_only_count= 1 +--source include/gtid_step_assert.inc +--let $gtid_step_only_count= 0 + +# Verify the GTID makes it to every slave. +--source include/rpl_sync.inc + +--echo ==== Case 4: Nothing logged for ROLLBACK transactions ==== + +# Test that ROLLBACK does not generate any GTID + +--echo ---- Initialize ---- + +CREATE TABLE t1 (a INT) ENGINE = InnoDB; + +--echo ---- Test ---- + +--source include/gtid_step_reset.inc + +--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; + +--let $gtid_step_count= 0 +--source include/gtid_step_assert.inc + +--echo ---- Clean Up ---- + +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution-master.opt index 39815e6d..59511cea 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution-master.opt +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution-master.opt @@ -1 +1 @@ ---gtid-mode=on --enforce-gtid-consistency --log-slave-updates --default-storage-engine=innodb --debug=d,+allow_gtid_unsafe_non_transactional_updates +--default-storage-engine=innodb --debug=d,+allow_gtid_unsafe_non_transactional_updates diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution-slave.opt index 39815e6d..59511cea 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution-slave.opt +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution-slave.opt @@ -1 +1 @@ ---gtid-mode=on --enforce-gtid-consistency --log-slave-updates --default-storage-engine=innodb --debug=d,+allow_gtid_unsafe_non_transactional_updates +--default-storage-engine=innodb --debug=d,+allow_gtid_unsafe_non_transactional_updates diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution.test index 771c3ced..c678d4dc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_execution.test @@ -50,13 +50,12 @@ --source include/have_gtid.inc --source include/not_valgrind.inc --let $rpl_extra_connections_per_server= 3 +--let $rpl_gtid_utils= 1 --source include/master-slave.inc --source include/have_debug.inc --echo #### Initialize #### ---source include/gtid_utils.inc - CREATE table t (a INT PRIMARY KEY) ENGINE = InnoDB; INSERT INTO t VALUES (1); @@ -482,7 +481,7 @@ while ($id <= $max_id) { if ($send_reap != 'running') { - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc --connection master # Concurrent tests require two or more connections and at least one connection sends # the statements in async mode (via send/reap command). We need to make sure that @@ -636,6 +635,4 @@ if (!$fixed_bug13687542) DROP TABLE stmts; DROP TABLE t; ---source include/gtid_utils_end.inc - --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_failover.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_failover.test index 62288a1a..fbb4abb3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_failover.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_failover.test @@ -28,10 +28,12 @@ create table t1 (a int not null auto_increment, b int not null, primary key(a)) --connection server_1 insert into t1 values (NULL, 1); ---sync_slave_with_master server_2 +--let $sync_slave_connection= server_2 +--source include/sync_slave_sql_with_master.inc --connection server_1 ---sync_slave_with_master server_3 +--let $sync_slave_connection= server_3 +--source include/sync_slave_sql_with_master.inc --let $diff_tables= server_1:test.t1, server_2:test.t1, server_3:test.t1 --source include/diff_tables.inc @@ -47,7 +49,8 @@ insert into t1 values (NULL, 1); --connection server_1 insert into t1 values (NULL, 2); # won't be seen by S3 until it connects to S2 ---sync_slave_with_master server_2 +--let $sync_slave_connection= server_2 +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --connection server_3 @@ -56,7 +59,8 @@ insert into t1 values (NULL, 2); # won't be seen by S3 until it connects to S2 --source include/start_slave.inc --connection server_2 ---sync_slave_with_master server_3 +--let $sync_slave_connection= server_3 +--source include/sync_slave_sql_with_master.inc --let $diff_tables= server_1:test.t1, server_2:test.t1, server_3:test.t1 --source include/diff_tables.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_heartbeat_2slave.cnf b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_heartbeat_2slave.cnf new file mode 100644 index 00000000..f24de9ab --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_heartbeat_2slave.cnf @@ -0,0 +1,12 @@ +!include ../my.cnf + +[mysqld.1] +log-slave-updates + +[mysqld.2] +log-slave-updates + +[mysqld.3] + +[ENV] +SERVER_MYPORT_3= @mysqld.3.port diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_heartbeat_2slave.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_heartbeat_2slave.test new file mode 100644 index 00000000..27814a9b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_heartbeat_2slave.test @@ -0,0 +1,10 @@ +############################################################# +# Author: Serge Kozlov <Serge.Kozlov@Sun.COM> +# Date: 02/19/2009 +# Purpose: Testing heartbeat for schema +# 1 master and 2 slaves +############################################################# + +--source include/have_gtid.inc + +--source extra/rpl_tests/rpl_heartbeat_2slaves.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive-master.opt new file mode 100644 index 00000000..62ab6dad --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive-slave.opt new file mode 100644 index 00000000..ed79c3f8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive-slave.opt @@ -0,0 +1 @@ +--replicate-do-db=mydb --replicate-wild-ignore-table=my%.T1 --replicate-ignore-table=mydb.ţ2 --replicate-ignore-table=mydb.t3 --lower_case_table_names=1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive.test new file mode 100644 index 00000000..f5d37f82 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_insensitive.test @@ -0,0 +1,8 @@ +# +# Bug #51639 +# This test verifies that 'ignore table' filter will follow +# the setting of lower_case_table_name to be case insensitive +# but accent sensitive when setting lower_case_table_name>0 +# +--source include/have_gtid.inc +--source extra/rpl_tests/rpl_ignore_table_filter_insensitive.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 new file mode 100644 index 00000000..9b27aef9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-slave.opt new file mode 100644 index 00000000..044bdb4b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive-slave.opt @@ -0,0 +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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive.test new file mode 100644 index 00000000..e769fa3d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_ignore_table_filter_sensitive.test @@ -0,0 +1,9 @@ +# +# Bug #51639 +# This test verifies that 'ignore table' filter will follow +# the setting of lower_case_table_name to be case sensitive +# and accent sensitive when setting lower_case_table_name=0 +# +--source include/have_gtid.inc +--source extra/rpl_tests/rpl_ignore_table_filter_sensitive.inc + diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_loaddata_s-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_loaddata_s-slave.opt new file mode 100644 index 00000000..9d4a8f0b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_loaddata_s-slave.opt @@ -0,0 +1 @@ +--binlog_ignore_db=test diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_loaddata_s.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_loaddata_s.test new file mode 100644 index 00000000..8b1771cb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_loaddata_s.test @@ -0,0 +1,7 @@ +# See if the slave logs (in its own binlog, with --log-slave-updates) a +# replicated LOAD DATA INFILE correctly when it has binlog_*_db rules. +# This is for BUG#1100 (LOAD DATA INFILE was half-logged). + +--source include/have_gtid.inc + +--source ./extra/rpl_tests/rpl_loaddata_s.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode.test index 6523f48a..bfbd94e3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_mode.test @@ -48,6 +48,7 @@ # # Added in WL#3584 - Global Transaction Identifiers --source include/not_windows.inc +--source include/not_gtid_enabled.inc --disable_warnings --source include/master-slave.inc --enable_warnings @@ -60,7 +61,7 @@ call mtr.add_suppression("Aborting"); call mtr.add_suppression(".* Found a Gtid_log_event or Previous_gtids_log_event when @@GLOBAL.GTID_MODE = OFF."); call mtr.add_suppression("MASTER_AUTO_POSITION in the master info file was 1 but server is started with @@GLOBAL.GTID_MODE = OFF. Forcing MASTER_AUTO_POSITION to 0."); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --connection master @@ -131,7 +132,7 @@ INSERT INTO t1 VALUES (1); --let $keep_gtid_events= 1 --source include/show_binlog_events.inc ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/show_binlog_events.inc --source include/show_relaylog_events.inc @@ -251,7 +252,7 @@ INSERT INTO t1 VALUES (2); --let $keep_gtid_events= 1 --source include/show_binlog_events.inc ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/show_binlog_events.inc --source include/show_relaylog_events.inc @@ -265,7 +266,7 @@ CHANGE MASTER TO MASTER_AUTO_POSITION = 1; --connection master INSERT INTO t1 VALUES (3); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $datadir= `SELECT @@datadir` --source include/stop_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_parallel.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_parallel.test index 1d998c89..608b16f4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_parallel.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_parallel.test @@ -183,3 +183,4 @@ eval DROP TABLE t1_$t, t2_$t; DROP TABLE t_end; DROP PROCEDURE show_slave_status; DROP PROCEDURE read_gtid_executed; +CHANGE MASTER TO MASTER_AUTO_POSITION= 0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect-master.opt index 021d611e..fc33faee 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect-master.opt +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect-master.opt @@ -1 +1 @@ ---gtid-mode=on --enforce-gtid-consistency --log-slave-updates --default-storage-engine=innodb --debug=d,allow_gtid_unsafe_non_transactional_updates +--default-storage-engine=innodb --debug=d,allow_gtid_unsafe_non_transactional_updates diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect-slave.opt index 021d611e..fc33faee 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect-slave.opt +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect-slave.opt @@ -1 +1 @@ ---gtid-mode=on --enforce-gtid-consistency --log-slave-updates --default-storage-engine=innodb --debug=d,allow_gtid_unsafe_non_transactional_updates +--default-storage-engine=innodb --debug=d,allow_gtid_unsafe_non_transactional_updates diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect.test index a60bb100..46cce3aa 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_fail_to_connect.test @@ -18,16 +18,16 @@ --source include/have_debug.inc --source include/have_gtid.inc +--let $rpl_gtid_utils= 1 --source include/master-slave.inc call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires."); ---source include/gtid_utils.inc --echo ######## Initialize ######## --let $master_uuid= `SELECT @@SERVER_UUID` CREATE TABLE t1 (a INT) ENGINE = InnoDB; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --connection master @@ -90,8 +90,7 @@ RESET MASTER; --echo === Sync slave with master (connection master/slave) ==== --connection master DROP TABLE t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master ---source include/gtid_utils_end.inc --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_maintained.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_maintained.test index 8e8e5edc..fe2054db 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_maintained.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_purged_maintained.test @@ -45,16 +45,16 @@ # # Added in WL#3584 - Global Transaction Identifiers +--let $rpl_gtid_utils= 1 --source include/master-slave.inc --source include/rpl_set_gtid_mode.inc ---source include/gtid_utils.inc --source include/have_debug.inc --echo ######## Initialize ######## --let $master_uuid= `SELECT @@SERVER_UUID` CREATE TABLE t1 (a INT) ENGINE = InnoDB; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $corruption_mode_count= 2 --let $restart_count= 2 @@ -109,7 +109,7 @@ while ($corruption_mode <= $corruption_mode_count) FLUSH LOGS; --echo [on slave] - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc --let $assert_text= no gtids lost yet on slave --let $assert_cond= @@GTID_PURGED = "" @@ -137,7 +137,7 @@ while ($corruption_mode <= $corruption_mode_count) } FLUSH LOGS; - --sync_slave_with_master + --source include/sync_slave_sql_with_master.inc --connection master --echo ######## corruption_mode = $corruption_mode ######## @@ -196,5 +196,4 @@ while ($corruption_mode <= $corruption_mode_count) --echo ######## Clean up ######## --connection master DROP TABLE t1; ---source include/gtid_utils_end.inc --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size-master.opt new file mode 100644 index 00000000..c5230890 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size-master.opt @@ -0,0 +1 @@ +--binlog-row-event-max-size=2097152 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size-slave.opt new file mode 100644 index 00000000..c5230890 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size-slave.opt @@ -0,0 +1 @@ +--binlog-row-event-max-size=2097152 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size.test new file mode 100644 index 00000000..4002d36a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_event_max_size.test @@ -0,0 +1,10 @@ +# +# Bug #49931 and Bug #49932 +# This test verifies if the slave I/O thread and slave SQL thread +# will check the bigger one of the values of 'max_allowed_packet' +# and 'binlog-row-event-max-size' when reading log event from +# binlog, and the added 'binlog-row-event-max-size' mysqlbinlog +# option works fine. +# +--source include/have_gtid.inc +--source extra/rpl_tests/rpl_row_event_max_size.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_show_relaylog_events.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_show_relaylog_events.test new file mode 100644 index 00000000..3af5e3df --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_row_show_relaylog_events.test @@ -0,0 +1,15 @@ +# BUG#28777 SHOW BINLOG EVENTS does not work on relay log files +# +# GOAL +# ==== +# +# Test that SHOW BINLOG EVENTS and the new SHOW RELAYLOG EVENTS works after +# the patch, both on master and slave. +# +# HOW +# === +# +# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after +# some statements have been issued. +--source include/have_gtid.inc +--source extra/rpl_tests/rpl_row_show_relaylog_events.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_server_sighup.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_server_sighup.test new file mode 100644 index 00000000..6bbf6094 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_server_sighup.test @@ -0,0 +1,135 @@ +############################################################################### +# Bug #17026898 PREVIOUS GTID EVENT IS NOT WRITTEN WHEN BINLOG IS ROTATED VIA +# SIGHUP + +# Problem: When Bin(Relay)log is rotated via SIGHUP signal, the newly generated +# binlog does not contain previous gtid event which is very important +# for processing that bin(relay)log's gtid events later. + +# Fix: If reload_acl_and_cache() (which does rotation of Bin(Relay) log) +# is called from SIGHUP handler, then allocate temporary THD for +# execution of rotate bin(relay)log. + +# Steps to reproduce the issue: +# 1) Get the server pid +# 2) Send Kill -1 signal (SIGHUP) signal to server pid +# 3) Wait until rotation is done +# 4) Verify the newly generated log contains prev_gtid_event +# 5) Restart the server to see the processing of the new log is not an issue. +# 6) Verify that Replication works fine at the end of the scenario + +# Execute the same steps on both Master and Slave do prove that +# a) no problem in binary log rotation (i.e., prev_gtids_event exists) +# b) no problem in relay log rotation (i.e., prev_gtids event exists) +# c) no problem in restarting master +# d) no problem in restarting slave +# e) Replication works fine after receiving SIGHUP. +############################################################################### + +# Test involves sending SIGHUP signal using kill linux cmd +--source include/linux.inc + +# Problem appears only with gtid +--source include/have_gtid.inc + +# Testing SIGHUP behaviour with one mode is enough +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc +CREATE TABLE pid_table(pid_no INT); + + +# Execute above mentioned steps in two iterations +# Iteration 1 : Master and Iteration 2: Slave +--let $_rpl_server= 1 +while ($_rpl_server <= 2) +{ + --let $rpl_connection_name= server_$_rpl_server + --source include/rpl_connection.inc + --let $pid_file=`SELECT @@pid_file` + --replace_result $pid_file pid_file + --eval LOAD DATA LOCAL INFILE '$pid_file' INTO TABLE pid_table + # Step1: Get server pid + --let $server_pid=`SELECT pid_no FROM pid_table` + + # Get current master binlog name + if ($_rpl_server == 1) + { + --let $before_sighup_log_name=query_get_value(SHOW MASTER STATUS, File, 1) + } + if ($_rpl_server == 2) + { + --let $before_sighup_log_name=query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1) + } + + # Step2: send SIGHUP(signal 1) to server which will rotate bin(relay)log + --exec kill -1 $server_pid + + # Step3: Wait until signal handler does required work + # (i.e., completes rotation of binary/relay log) after receiving SIGHUP signal. + if ($_rpl_server == 1) + { + --let $show_statement=SHOW MASTER STATUS + --let $field=File + } + if ($_rpl_server == 2) + { + --let $show_statement=SHOW SLAVE STATUS + --let $field=Relay_Log_File + } + --let $condition= <> '$before_sighup_log_name' + --source include/wait_show_condition.inc + + # Write something to newly generated binary log/relay log + if ($_rpl_server == 2) + { + --let $rpl_connection_name= server_1 + --source include/rpl_connection.inc + } + DELETE FROM pid_table; + --source include/sync_slave_sql_with_master.inc + if ($_rpl_server == 1) + { + --let $rpl_connection_name= server_1 + --source include/rpl_connection.inc + } + # Step 4:Show that newly generated binary/relaylog has previous gtid event as well + --let $keep_gtid_events= 1 + --let $binlog_file= LAST + if ($_rpl_server == 1) + { + --source include/show_binlog_events.inc + } + if ($_rpl_server == 2) + { + --source include/show_relaylog_events.inc + } + # Step5: Restart server to make sure that + # newly generated binary log/relay log does not cause any issues + --let $rpl_server_number= $_rpl_server + --source include/rpl_stop_server.inc + --let $rpl_start_with_gtids= 1 + --source include/rpl_start_server.inc + if ($_rpl_server == 2) + { + --source include/rpl_start_slaves.inc + } + if ($_rpl_server == 1) + { + # We must be sure that the IO thread has connected again with the master + # that has just restarted, or else the results of the test case may vary. + # As no new GTID was generated since last sync, we will force the use of + # positions on the sync. + --let $ignore_gtids_on_sync= 1 + --source include/sync_slave_sql_with_master.inc + --let $ignore_gtids_on_sync= 0 + } + --inc $_rpl_server +} + +# Now just make sure replication works fine +--let $rpl_connection_name= server_1 +--source include/rpl_connection.inc +DROP TABLE pid_table; +--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_gtid_sql_until_before_after.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_sql_until_before_after.test index af9e3a47..c1d21242 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_sql_until_before_after.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_sql_until_before_after.test @@ -15,7 +15,7 @@ --connection master --let $master_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1) CREATE TABLE t1(c1 INTEGER) ENGINE= Innodb; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo [connection slave] --source include/stop_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stm_insert_delayed.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stm_insert_delayed.test new file mode 100644 index 00000000..e7f48f88 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stm_insert_delayed.test @@ -0,0 +1,2 @@ +--source include/have_gtid.inc +--source extra/rpl_tests/rpl_stm_insert_delayed.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stm_mix_show_relaylog_events.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stm_mix_show_relaylog_events.test new file mode 100644 index 00000000..43a70a75 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stm_mix_show_relaylog_events.test @@ -0,0 +1,15 @@ +# BUG#28777 SHOW BINLOG EVENTS does not work on relay log files +# +# GOAL +# ==== +# +# Test that SHOW BINLOG EVENTS and the new SHOW RELAYLOG EVENTS works after +# the patch, both on master and slave. +# +# HOW +# === +# +# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after +# some statements have been issued. +--source include/have_gtid.inc +--source extra/rpl_tests/rpl_stm_mix_show_relaylog_events.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stress_failover.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stress_failover.test index ccc5ccb2..a2839201 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stress_failover.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_stress_failover.test @@ -1,5 +1,3 @@ -#Want to skip this test from daily Valgrind execution ---source include/no_valgrind_without_big.inc # ==== Purpose ==== # # Test that it is possible to change the topology completely randomly, @@ -79,8 +77,13 @@ # # ==== References ==== # -# Created as part of WL#3584: Global Transaction Identifiers +# WL#3584: Global Transaction Identifiers +# - Created as part of this worklog +# BUG#18385953: RPL_GTID_STRESS_FAILOVER FAILS WITH "ERROR IN SYNC_WITH_MASTER.INC" +# - fixed bug in cleanup code +#Want to skip this test from daily Valgrind execution +--source include/no_valgrind_without_big.inc --source include/big_test.inc --source include/have_gtid.inc @@ -97,7 +100,10 @@ --echo ==== Configure ==== ---let $max_seconds= 300 +if ($max_seconds == '') +{ + --let $max_seconds= 300 +} if ($max_iterations == '') { --let $max_iterations= 10000 @@ -394,7 +400,7 @@ while ($server <= $n_servers) { --source include/show_rpl_debug_info.inc --echo ERROR: GTID_EXECUTED differs between server 1 and server $server - --echo ERROR: GTID_EXECUTED on server 1: '$saved_gtid_executed' + --echo ERROR: GTID_EXECUTED on server 1: '$last_gtid_executed' --echo ERROR: GTID_EXECUTED on server $server: '$gtid_executed' --die GTID_EXECUTED differs between two servers } @@ -410,15 +416,22 @@ while ($server <= $n_servers) --echo ==== Clean up ==== +# drop database --connection default --let $server= 1 while ($server <= $n_servers) { - --connection default eval DROP DATABASE db_$server; + --inc $server +} +--source include/rpl_sync.inc - # restoring the AUTO_POSITION +# restore AUTO_POSITION +--let $server= 1 +while ($server <= $n_servers) +{ --connection server_$server + --let $include_silent=1 --source include/stop_slave.inc CHANGE MASTER TO MASTER_AUTO_POSITION=0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_validate_slave_gtids.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_validate_slave_gtids.test new file mode 100644 index 00000000..91d567a6 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_validate_slave_gtids.test @@ -0,0 +1,128 @@ +############################################################################### +#Bug#19012085 SETTING GTID_PURGED MAY BREAK AUTO_POSITION AND THUS SLAVES +# Problem: +# When slave asks for GTIDs which were purged by Master, Master is silently +# ignoring it and sending the GTIDs whatever is available. +# Fix: +# Slave's I/O thread, when connecting to Master, should be aborted with an +# error "Master has purged binary logs containing GTIDs that the slave +# requires." +# Steps to reproduce: +# 1) Set GTID_PURGED=UUID:1-2 on Master +# 2) Execute some dummy transactions (GTID:3-4) +# 3) A new slave request Master to send GTIDs +# 4) Master should throw error instead of silently sending GTIDs 3 and 4. +############################################################################### + +--source include/have_gtid.inc +--source include/have_binlog_format_statement.inc +--let $rpl_skip_start_slave= 1 +--source include/master-slave.inc + +# Step-1) Master wants to set 1 and 2 GTIDs in GTID_PURGED +--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` +--replace_result $master_uuid master_uuid +--eval SET GLOBAL GTID_PURGED= "$master_uuid:1-2" + +# Step-2) Do some dummy transactions +CREATE TABLE t1(i INT); # GTID-3 +DROP TABLE t1; # GTID-4 + +# Step-3) Start Slave IO thread which will request Master to send all +# transactions. +--connection slave +START SLAVE IO_THREAD; + +# Step-4)since Master has already purged binary logs containing GTID 1 and 2, +# it should throw error and I/O thread should not be started. +#1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG +--let $slave_io_errno= 1236 +--let $show_slave_io_error= 1 +--source include/wait_for_slave_io_error.inc + +# Fix the problem by setting GTID_PURGED on Slave as well. +--replace_result $master_uuid master_uuid +--eval SET GLOBAL GTID_PURGED= "$master_uuid:1-2" + +# Now start slave threads. Slave will ask Master to send all GTIDs +# except GTID:1-2 which should not be a problem and should not throw +# any errors. +--source include/start_slave.inc +--connection master +--source include/sync_slave_sql_with_master.inc + +--let $assert_text= Slave should be able to get GTID-3 and 4 now. +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-4" +--source include/assert.inc + +call mtr.add_suppression(".*Master has purged binary logs containing GTIDs that the slave requires.*"); + +############################################################################### +#Bug #18789758 DATA INCONSISTENCIES WHEN MASTER HAS TRUNCATED BINARY LOG WITH +# GTID AFTER CRASH +# Problem: +# Master's dump thread is not detecting the case where Slave's gtid executed +# set is having more gtids than Master's gtid executed set with respective +# to Master's UUID. +# Fix: +# If it happens, dump thread will be stopped during the handshake +# with Slave(thus the Slave's I/O thread will be stopped with the +# error). Otherwise, it can lead to data inconsistency +# between Master and Slave. +# +# Steps to reproduce: +# 1) Execute some sample gtid transactions on Master +# 2) Let it reach Slave +# 3) Fake raid failure( by manually deleting binary log file) +# 4) Restart Master, thus removing those gtids from executed gtid set. +# 5) Restart slave's I/O thread, Slave sends its gtids which are purged on +# Master +# 6) Make sure I/O thread gets error and informs the situation to the Slave. +# 7) Verify that situation is recovered back normal after setting GTID_PURGED +# value to those purged gtids. +############################################################################### + +# Cleanup from the next test script +--connection master +--source include/rpl_reset.inc + +# Step-1) Execute some sample gtid transactions on Master +CREATE TABLE t1(i INT); +DROP TABLE t1; + +# Step-2) Let it reach Slave. +--sync_slave_with_master +--source include/stop_slave.inc + +# Step-3) Fake raid failure( by manually deleting binary log file) +--connection master +--let $master_datadir= `SELECT @@datadir;` +--remove_file $master_datadir/master-bin.000001 +--remove_file $master_datadir/master-bin.index + +# Step-4) Restart Master, thus removing those gtids from executed gtid set. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +# Step-5) Restart slave's I/O thread, Slave sends its gtids which are purged on Master +--connection slave +START SLAVE IO_THREAD; + +# Step-6) Make sure I/O thread gets error and informs the situation to the Slave. +--let $slave_io_errno= convert_error(ER_MASTER_FATAL_ERROR_READING_BINLOG) +--let $show_slave_io_error= 1 +--source include/wait_for_slave_io_error.inc +call mtr.add_suppression(".*Slave has more GTIDs than the master has.*"); + +# Step-7) Verify that situation is recovered back normal after setting GTID_PURGED +# value to those purged gtids. +--connection master +--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` +--replace_result $master_uuid master_uuid +--eval SET GLOBAL GTID_PURGED= "$master_uuid:1-2" + +--connection slave +--source include/start_slave.inc + +# Cleanup +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtids_restart_slave_io_lost_trx.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtids_restart_slave_io_lost_trx.test new file mode 100644 index 00000000..cf4df391 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtids_restart_slave_io_lost_trx.test @@ -0,0 +1,12 @@ +############################################################################### +# +# Bug#17280176 TRANSACTIONS SKIPPED ON SLAVE AFTER "STOP/START SLAVE" USING +# GTID REPLICATION +# +############################################################################### +# +# This test will verify if the slave SQL thread and the slave IO thread behave +# correctly when the IO thread is restarted in the middle of a transaction. +# + +--source extra/rpl_tests/rpl_gtids_restart_slave_io_lost_trx.test diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat.test index 65cdbeff..99eb97a0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat.test @@ -124,7 +124,7 @@ connection master; create table t1 (f1 int); #connection slave; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $slave_param= Relay_Log_File; let $slave_param_value= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1); @@ -181,7 +181,7 @@ connection master; drop table t1; #connection slave; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_net_timeout= @restore_slave_net_timeout; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test index e4a9f62d..af519033 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test @@ -1,131 +1,2 @@ -############################################################# -# Author: Serge Kozlov <Serge.Kozlov@Sun.COM> -# Date: 02/19/2009 -# Purpose: Testing heartbeat for schema -# 1 master and 2 slaves -############################################################# ---let $rpl_topology= 1->2,1->3 ---source include/rpl_init.inc - ---let $rpl_connection_name= master ---let $rpl_server_number= 1 ---source include/rpl_connect.inc - ---let $rpl_connection_name= slave_1 ---let $rpl_server_number= 2 ---source include/rpl_connect.inc - ---let $rpl_connection_name= slave_2 ---let $rpl_server_number= 3 ---source include/rpl_connect.inc - -# -# Set different heartbeat periods for slaves -# ---connection slave_1 ---source include/stop_slave.inc -CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1; ---source include/start_slave.inc ---connection slave_2 ---source include/stop_slave.inc ---replace_column 2 #### -CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1; ---source include/start_slave.inc - -# -# Testing heartbeat for one master and two slaves -# - -# Check that heartbeat events sent to both slaves with correct periods ---connection slave_1 -let $status_var= slave_received_heartbeats; -let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); -let $status_var_comparsion= >; ---source include/wait_for_status_var.inc ---echo Slave has received heartbeat event ---connection slave_2 -let $status_var= slave_received_heartbeats; -let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); -let $status_var_comparsion= >; ---source include/wait_for_status_var.inc ---let $assert_cond= [slave_1:SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > [slave_2:SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] ---let $assert_text= slave_1 should have received more heartbeats than slave_2 ---source include/assert.inc ---echo - -# Create topology master->slave_2->slave_1 and check that slave_1 -# receives heartbeat while slave_2 gets data. - -# slave_2 was started w/o --log-slave-updates because slave_2 should -# not send data from master to slave_1 - ---source include/rpl_stop_slaves.inc ---let $rpl_topology= 1->3->2 ---source include/rpl_change_topology.inc ---source include/rpl_start_slaves.inc ---connection slave_1 ---source include/stop_slave.inc ---replace_column 2 #### -CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1; ---source include/start_slave.inc - -# Check heartbeat for new replication channel slave_2->slave -let $status_var= slave_received_heartbeats; -let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); -let $status_var_comparsion= >; ---source include/wait_for_status_var.inc ---echo slave_1 has received heartbeat event ---connection master ---echo [on master] -CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); -INSERT INTO t1 VALUES (1, 'on master', ''); -SHOW TABLES; ---echo [on slave_2] ---sync_slave_with_master slave_2 -SHOW TABLES; -let $slave_2_pos_before= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); ---echo [on slave_1] ---sync_slave_with_master slave_1 -SHOW TABLES; ---connection master ---echo [on master] ---echo creating updates on master and send to slave_2 during 5 second -# Generate events on master and send to slave_2 during 5 second -let $i= 1; -let $j= 1; -let $k= 1; ---disable_query_log -while ($i) { - eval SET @c_text=REPEAT('1234567890', $j); - eval UPDATE t1 SET a=$j, c=@c_text; - --connection slave_2 - let $slave_2_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); - if (`SELECT ($k*($slave_2_pos - $slave_2_pos_before)) > 0`) { - --connection slave_1 - let $slave_1_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); - let $k= 0; - let $time_before = `SELECT NOW()`; - } - if (`SELECT ((1-$k)*TIMESTAMPDIFF(SECOND,'$time_before',NOW())) > 5`) { - let $i= 0; - } - --connection master - inc $j; - sleep 0.1; -} ---enable_query_log ---connection slave_1 ---echo [on slave_1] ---let $assert_cond= [SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > $slave_1_rcvd_heartbeats_before ---let $assert_text= slave_1 should have received heartbeats ---source include/assert.inc ---echo - -# -# Clean up -# ---echo *** Clean up *** ---connection master -DROP TABLE t1; - ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_heartbeat_2slaves.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index 1aec0ec5..91d7178f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -26,7 +26,7 @@ call mtr.add_suppression("The slave coordinator and worker threads are stopped, let $connect_retry= 20; --echo *** Preparing *** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --disable_query_log call mtr.add_suppression("The master's UUID has changed, although this should not happen unless you have changed it manually."); @@ -147,7 +147,7 @@ RESET MASTER; eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry; --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SHOW VARIABLES LIKE 'slave_net_timeout'; SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SET @@global.slave_net_timeout=@restore_slave_net_timeout; @@ -169,7 +169,7 @@ SET @@global.slave_net_timeout=100; eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=20; --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; --source include/stop_slave.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; @@ -199,7 +199,7 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SHOW STATUS LIKE 'slave_received_heartbeats'; --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --sleep 2 SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; SHOW STATUS LIKE 'slave_received_heartbeats'; @@ -297,7 +297,7 @@ SELECT unix_timestamp() into @time_0; --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); let $status_var= slave_received_heartbeats; let $status_var_comparsion= >; @@ -375,7 +375,7 @@ let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbea --echo *** Stopped SQL thread by error *** --connection master CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES (1, 'on slave', NULL); --connection master INSERT INTO t1 VALUES (1, 'on master', NULL); @@ -393,13 +393,13 @@ let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_b DELETE FROM t1; --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master DROP TABLE t1; --echo # Check received heartbeat events while logs flushed on slave ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo *** Flush logs on slave *** --let $rpl_no_start_slave= 1 --source include/rpl_reset.inc @@ -463,7 +463,7 @@ let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_he --connection master RESET MASTER; --enable_query_log ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --sleep 2 let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1); @@ -534,7 +534,8 @@ CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1; --source include/start_slave.inc --sync_with_master INSERT INTO t1 VALUES(2, 'on slave'); ---sync_slave_with_master master +--let $sync_slave_connection= master +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; let $master_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); --connection slave @@ -564,7 +565,7 @@ let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_hea --connection master #--source include/stop_slave.inc DROP TABLE t1; ---sync_slave_with_master +--connection slave SET @@global.slave_net_timeout=@restore_slave_net_timeout; #--let $rpl_only_running_threads= 1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test index 2f7a35d1..28e712fc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test @@ -3,6 +3,7 @@ # Date: 02/19/2009 # Purpose: Testing basic functionality of heartbeat over SSL ############################################################# +--source include/not_gtid_enabled.inc --source include/have_ssl_communication.inc --source include/master-slave.inc --echo diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_idempotency.test index c229711e..85d85eb9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_idempotency.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -14,7 +14,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (-1),(-2),(-3); INSERT INTO t2 VALUES (-1),(-2),(-3); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SET @old_slave_exec_mode= @@global.slave_exec_mode; SET @@global.slave_exec_mode= IDEMPOTENT; @@ -32,7 +32,7 @@ DELETE FROM t1 WHERE a = -2; DELETE FROM t2 WHERE a = -2; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; --source include/check_slave_no_error.inc @@ -46,7 +46,7 @@ INSERT IGNORE INTO t1 VALUES (-2); connection master; INSERT IGNORE INTO t1 VALUES (-2); SELECT * FROM t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; --source include/check_slave_no_error.inc @@ -70,14 +70,14 @@ UPDATE t1 SET a = 1 WHERE a = -1; UPDATE t2 SET a = 1 WHERE a = -1; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; --source include/check_slave_no_error.inc connection master; DROP TABLE t1, t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SET @@global.slave_exec_mode= @old_slave_exec_mode; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_db_filter.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_db_filter.test index 2128d041..14a8727f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_db_filter.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_db_filter.test @@ -5,9 +5,9 @@ # when setting lower_case_table_name > 0 # +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc -- source include/have_binlog_format_statement.inc -- source extra/rpl_tests/rpl_filters.test - --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_revoke.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_revoke.test index db20e807..49cd0ba7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_revoke.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_revoke.test @@ -14,7 +14,7 @@ grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; revoke select on *.* from 'user_foo'@'%'; select select_priv from mysql.user where user='user_foo' /* master:must be N */; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; revoke select on *.* from 'user_foo'@'%'; @@ -31,7 +31,7 @@ connection master; revoke select on *.* from 'user_foo'; select select_priv from mysql.user where user='user_foo' /* master:must be N */; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; select select_priv from mysql.user where user='user_foo' /* slave:must get Y */; @@ -44,7 +44,7 @@ revoke select on *.* FROM 'user_foo'; connection master; delete from mysql.user where user="user_foo"; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Since changes to mysql.* are ignored, the revoke need to # be done on slave as well diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table.test index 4c0659da..5efe7013 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -1,3 +1,4 @@ +source include/not_gtid_enabled.inc; source include/master-slave.inc; # diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_insensitive.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_insensitive.test index 63daed8b..9018bc8f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_insensitive.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_insensitive.test @@ -4,12 +4,5 @@ # the setting of lower_case_table_name to be case insensitive # but accent sensitive when setting lower_case_table_name>0 # - --- source include/master-slave.inc --- source include/have_binlog_format_statement.inc - --- source extra/rpl_tests/rpl_filters.test -let $replicate_ignore_table= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Table, 1); ---echo Replicate_Ignore_Table: $replicate_ignore_table - ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_ignore_table_filter_insensitive.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive.test index 2e7dfe89..284f28cf 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ignore_table_filter_sensitive.test @@ -4,12 +4,5 @@ # the setting of lower_case_table_name to be case sensitive # and accent sensitive when setting lower_case_table_name=0 # - --- source include/master-slave.inc --- source include/have_binlog_format_statement.inc - --- source extra/rpl_tests/rpl_filters.test -let $replicate_ignore_table= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Table, 1); ---echo Replicate_Ignore_Table: $replicate_ignore_table - ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_ignore_table_filter_sensitive.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_incident.test index d6034009..5c212914 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_incident.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_incident.test @@ -1,3 +1,4 @@ +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/have_debug.inc @@ -37,5 +38,5 @@ source include/check_slave_is_running.inc; connection master; DROP TABLE t1; ---sync_slave_with_master +--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_init_slave.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_init_slave.test index 1803b146..ff57581e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_init_slave.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_init_slave.test @@ -11,20 +11,20 @@ source include/stop_slave.inc; source include/start_slave.inc; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc show variables like 'init_slave'; show variables like 'max_connections'; reset master; connection master; show variables like 'init_slave'; show variables like 'max_connections'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Save variable value set @my_global_init_connect= @@global.init_connect; set global init_connect="set @c=1"; show variables like 'init_connect'; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Restore changed global variable set global init_connect= @my_global_init_connect; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test index d4b2520a..554c46c5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test @@ -139,7 +139,7 @@ SELECT count(*) as "Master bykey" FROM test.bykey_tbl; CALL test.proc_byrange(); SELECT count(*) as "Master byrange" FROM test.byrange_tbl; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc connection slave; show create table test.byrange_tbl; SELECT count(*) "Slave norm" FROM test.regular_tbl; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test index 9bfce618..1c391e39 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test @@ -54,7 +54,7 @@ delimiter ;| CALL test.proc_norm(); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ###### CLEAN UP SECTION ############## diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_insert.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_insert.test index 83334232..583756db 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_insert.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_insert.test @@ -2,6 +2,7 @@ --echo # Bug#20821: INSERT DELAYED fails to write some rows to binlog --echo # +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/not_embedded.inc --source include/not_windows.inc @@ -17,7 +18,7 @@ USE mysqlslap; CREATE TABLE t1 (id INT, name VARCHAR(64)); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; let $query = "INSERT DELAYED INTO t1 VALUES (1, 'Dr. No'), (2, 'From Russia With Love'), (3, 'Goldfinger'), (4, 'Thunderball'), (5, 'You Only Live Twice')"; @@ -41,5 +42,5 @@ SELECT COUNT(*) FROM mysqlslap.t1; connection master; USE test; DROP SCHEMA mysqlslap; -sync_slave_with_master; +--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_insert_on_update.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_insert_on_update.test new file mode 100644 index 00000000..31f661d2 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_insert_on_update.test @@ -0,0 +1,40 @@ +############################################################################### +# Bug#17588419: INSERT ON DUPLICATE KEY UPDATE FAILING AFTER MYSQL 5.6 +# UPGRADE. +# +# Problem: +# ======== +# After upgrading a MySQL 5.5.23 slave to 5.6.14 (the master still runs 5.5.23) +# on executing INSERT ON DUPLICATE KEY following error is reported in SBR. +# +# [ERROR] Slave SQL: Error 'Auto-increment value in UPDATE conflicts with +# internally generated values' on query. +# +# Test: +# ===== +# Execute INSERT ON DUPLICATE KEY UPDATE statements on master and try to sync +# master with slave. With the bug sync operation will fail with +# ER_AUTO_INCREMENT_CONFLICT. Post fix sync operation should succeed. +# Note: +# As part of the bug fix the issue is fixed only with innodb storage engine. +############################################################################### +--source include/master-slave.inc + +--disable_query_log +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format*"); +--enable_query_log + +--connection master +CREATE TABLE t(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,k INT,UNIQUE KEY(k)) ENGINE=InnoDB; +--disable_warnings +INSERT INTO t(k) VALUES (1), (2), (3); +INSERT INTO t(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE id=10; +--enable_warnings +--source include/sync_slave_sql_with_master.inc + +--connection master +-- let $diff_tables=master:t,slave:t +-- source include/diff_tables.inc + +DROP TABLE t; +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_invoked_features.test index 479ab56a..89bb0867 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_invoked_features.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_invoked_features.test @@ -228,7 +228,8 @@ SELECT COUNT(*) FROM t13; SELECT a,b FROM t13 ORDER BY a; SELECT a,b FROM v11 ORDER BY a; ---sync_slave_with_master slave +--let $sync_slave_connection= slave +--source include/sync_slave_sql_with_master.inc # Check replicated objects --echo @@ -276,7 +277,8 @@ UPDATE t13 SET c=''; ALTER TABLE t3 ORDER BY a; ALTER TABLE t13 ORDER BY a; ---sync_slave_with_master slave +--let $sync_slave_connection= slave +--source include/sync_slave_sql_with_master.inc # Compare a data from master and slave --echo @@ -306,7 +308,8 @@ DROP FUNCTION IF EXISTS f2; DROP EVENT IF EXISTS e1; DROP EVENT IF EXISTS e11; ---sync_slave_with_master slave +--let $sync_slave_connection= slave +--source include/sync_slave_sql_with_master.inc # End 5.1 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_kill_query-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_kill_query-slave.opt new file mode 100644 index 00000000..a2353230 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_kill_query-slave.opt @@ -0,0 +1,2 @@ +--replicate-ignore-db=ignored_db +--replicate-ignore-table=db1.ignored_table diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_kill_query.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_kill_query.test new file mode 100644 index 00000000..81d19645 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_kill_query.test @@ -0,0 +1,93 @@ +# ==== Purpose ==== +# +# Test the behavior of slave when binlog_format=statement and a query +# that updates a non-transactional table is killed on the master, +# after being only half-way completed. +# +# The following should hold: +# - The statement should be logged with error code ER_QUERY_INTERRUPTED. +# - The slave should normally stop with an error. +# - If the table or database is filtered out, the slave should not stop. +# +# To test this, we test three cases: +# 1. Killed query on master generates error on slave. +# 2. Killed query on master, on a filtered-out table, does not +# generate error on slave. +# 3. Killed query on master, on a table in a filtered-out database, +# does not generate error on slave. +# +# ==== Implemenation ==== +# +# For case 1, we extecute a statement and kill it in the middle, then +# verify that the slave stops with the correct error. +# +# For cases 2 and 3, we execute a statement and kill it in the middle, +# then verify that the slave replicates without problems. In case 2, +# the statement is executed when the current database is filtered-out. +# In case 3, the statement modifies a table that is filtered-out. +# +# Slave filters are specified in rpl_kill_query.cnf +# +# The procedure to generate a killed statement is similar in all three +# cases. See extra/rpl_tests/rpl_kill_query.inc for details. +# +# ==== References ==== +# +# BUG#18145032: NO EMPTY TRANSACTION IS CREATED FOR A FILTERED CREATE TEMPORARY TABLE WITH GTIDS +# - Test created as part of this fix, since it touches the code for +# filtering. + +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +CALL mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); +--sync_slave_with_master +--connection master + +--echo ==== Case 1: Killed query on master -> error on slave ==== + +--let $database= db1 +--let $table= t1 +--source extra/rpl_tests/rpl_kill_query.inc + +--echo ---- Verify there is an error on slave ---- +--source include/sync_slave_io_with_master.inc +--let $slave_sql_errno= 1317 # ER_QUERY_INTERRUPTED +--source include/wait_for_slave_sql_error.inc + +--echo ---- Verify that nothing was inserted on slave ----- +--let $assert_text= Nothing should be inserted on slave +--let $assert_cond= [slave:SELECT COUNT(*) FROM $database.t1] = 0 +--source include/assert.inc + +--echo ---- Clean up ---- +--source include/stop_slave_io.inc +RESET SLAVE; +RESET MASTER; +DROP DATABASE db1; +--source include/rpl_connection_master.inc +RESET MASTER; +--source include/rpl_connection_slave.inc +--source include/start_slave.inc +--source include/rpl_connection_master.inc + +--echo ==== Case 2: Master kills query -> no error if slave filters by db ==== + +--let $database= ignored_db +--let $table= t1 +--source extra/rpl_tests/rpl_kill_query.inc + +--echo ---- Verify all was replicated ok ---- +--source include/sync_slave_sql_with_master.inc +--source include/rpl_connection_master.inc + +--echo ==== Case 3: Master kills query -> no error if slave filters by table ==== + +--let $database= db1 +--let $table= ignored_table +--source extra/rpl_tests/rpl_kill_query.inc + +--echo ---- Verify all was replicated ok ---- +--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_killed_ddl.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_killed_ddl.test index a56a39a2..6b6ff81a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_killed_ddl.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_killed_ddl.test @@ -108,7 +108,7 @@ CREATE INDEX i1 ON t1 (a); CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master1; let $connection_name= master1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index 68e1b190..5e5ecd60 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -25,7 +25,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state # testcase with INSERT VALUES CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, UNIQUE(b)); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; SELECT * FROM t1; @@ -64,7 +64,7 @@ INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b'); INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c'); INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d'); INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e'); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # Updating table t1 based on values from table t2 INSERT INTO t1 (field_1, field_2, field_3) diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test index 5d518f6a..f71afc36 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test @@ -38,7 +38,7 @@ INSERT INTO T1 VALUES (1); --replace_result Tables_in_b37656 Tables_in_B37656 SHOW TABLES; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc use bug37656; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata.test index 9f4ca1aa..0dab8477 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata.test @@ -1,5 +1,6 @@ -- source include/not_ndb_default.inc -- source include/have_binlog_format_statement.inc +-- source include/not_gtid_enabled.inc let $engine_type=MyISAM; -- source extra/rpl_tests/rpl_loaddata.test diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_charset.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_charset.test index bb87ee95..760bec64 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_charset.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_charset.test @@ -23,12 +23,12 @@ load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8 select hex(a) from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select hex(a) from t1; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug#45516 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test index b6fe5044..45946055 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test @@ -1,5 +1,6 @@ source include/have_binlog_format_statement.inc; source include/have_debug.inc; +source include/not_gtid_enabled.inc; source include/master-slave.inc; # We do this little stunt to make sure that the slave has started @@ -7,7 +8,7 @@ source include/master-slave.inc; connection master; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Now we feed it a load data infile, which should make it stop with a # fatal error. @@ -23,6 +24,6 @@ source include/wait_for_slave_sql_error_and_skip.inc; connection master; DROP TABLE t1; -sync_slave_with_master; +--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_loaddata_m.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_m.test index b9dffa3f..e7083d9a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_m.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_m.test @@ -28,7 +28,7 @@ LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1; SELECT COUNT(*) FROM mysqltest.t1; # Now lets check the slave to see what we have :-) -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW DATABASES; @@ -45,7 +45,7 @@ SELECT COUNT(*) FROM mysqltest.t1; connection master; DROP DATABASE mysqltest; DROP TABLE IF EXISTS test.t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of test --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_map.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_map.test index 24c8221c..3a738dad 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_map.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_map.test @@ -60,7 +60,7 @@ source include/show_binlog_events.inc; --echo ==== Verify results on slave ==== --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select count(*) from t2 /* 5 000 */; @@ -69,6 +69,6 @@ select count(*) from t2 /* 5 000 */; --echo [on master] connection master; drop table t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_s.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_s.test index 7bd1a8a2..f1a81ed7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_s.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_s.test @@ -2,25 +2,5 @@ # replicated LOAD DATA INFILE correctly when it has binlog_*_db rules. # This is for BUG#1100 (LOAD DATA INFILE was half-logged). --- source include/have_binlog_format_mixed_or_statement.inc --- source include/master-slave.inc - -connection slave; -# Not sure why we connect to slave and then try to reset master, but I will leave it [JBM] -reset master; - -connection master; -# 'test' is the current database -create table test.t1(a int, b int, unique(b)); -load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; - -# Test logging on slave; -sync_slave_with_master; -select count(*) from test.t1; # check that LOAD was replicated -source include/show_binlog_events.inc; - -# Cleanup -connection master; -drop table test.t1; -sync_slave_with_master; ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_loaddata_s.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_simple.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_simple.test index a09d3fee..ab16b212 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_simple.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_simple.test @@ -3,7 +3,7 @@ CREATE TABLE t1 (word CHAR(20) NOT NULL); LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; SELECT * FROM t1 ORDER BY word; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Check SELECT * FROM t1 ORDER BY word; @@ -11,5 +11,5 @@ SELECT * FROM t1 ORDER BY word; # Cleanup connection master; drop table t1; -sync_slave_with_master; +--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_loaddata_symlink-master.sh b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh old mode 100644 new mode 100755 index e5bb3e61..d1c10ab4 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh @@ -1,2 +1,4 @@ +#! /bin/bash +# rm -f $MYSQLTEST_VARDIR/std_data_master_link ln -s $MYSQLTEST_VARDIR/std_data $MYSQLTEST_VARDIR/std_data_master_link diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh old mode 100644 new mode 100755 index 7a0c0bb3..88df6b15 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh @@ -1,2 +1,4 @@ +#! /bin/bash +# rm -f $MYSQLTEST_VARDIR/std_data_slave_link ln -s $MYSQLTEST_VARDIR/std_data $MYSQLTEST_VARDIR/std_data_slave_link diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test index d6bc0ba2..ebc5d462 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test @@ -11,12 +11,12 @@ create table t1(a int not null auto_increment, b int, primary key(a) ); load data infile '../../std_data/rpl_loaddata.dat' into table t1; select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; connection master; drop table t1; -sync_slave_with_master; +--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_loaddatalocal.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddatalocal.test index 781d001c..cd58af4b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddatalocal.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loaddatalocal.test @@ -28,11 +28,11 @@ truncate table t1; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1; --remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select a,count(*) from t1 group by a; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests @@ -83,7 +83,7 @@ eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' i SELECT * FROM t1 ORDER BY a; --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; --echo ==== Clean up ==== @@ -93,7 +93,7 @@ connection master; DROP TABLE t1; --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --echo Bug #43746: @@ -150,7 +150,7 @@ SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIE eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1; --echo [slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --echo Bug #59267: @@ -170,7 +170,7 @@ eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1; SELECT 'Master', COUNT(*) FROM t1; --echo [slave] ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SELECT 'Slave', COUNT(*) FROM t1; # cleanup @@ -184,7 +184,7 @@ DROP TABLE t1; SET SESSION sql_mode=@old_mode; --echo [slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -220,7 +220,7 @@ SELECT * FROM t1; sleep 1; --echo [slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; @@ -233,7 +233,7 @@ DROP VIEW v1; DROP TABLE t1, t2, t3; --echo [slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loadfile.test index ced0054c..e08dc133 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loadfile.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_loadfile.test @@ -98,7 +98,7 @@ connection slave; source include/start_slave.inc; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # assertion: assert that the slave got the updates even # if the file was removed before the slave started, diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_locale.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_locale.test index 0d6692dd..488c00f6 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_locale.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_locale.test @@ -12,12 +12,12 @@ insert into t1 values (date_format('2001-01-01','%W')); set lc_time_names= 'en_US'; insert into t1 values (date_format('2001-01-01','%W')); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_log_pos.test index 1043a80b..436f3904 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -10,10 +10,11 @@ # Passes with rbr no problem, removed statement include [jbm] +source include/not_gtid_enabled.inc; source include/master-slave.inc; call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); source include/show_master_status.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; --replace_result 75 MASTER_LOG_POS @@ -43,7 +44,7 @@ sync_with_master; select * from t1 ORDER BY n; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo End of 5.0 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test index 08884ee8..48ea8e50 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test @@ -35,7 +35,7 @@ FLUSH LOGS; SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # All the rows should be sent to the slave. --let $diff_tables=master:t,slave:t diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test index 86869b15..ff7e9369 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test @@ -1,4 +1,5 @@ source include/not_windows.inc; +source include/not_gtid_enabled.inc; source include/master-slave.inc; # @@ -18,7 +19,7 @@ FLUSH LOGS; CREATE TABLE t1(c1 INT); # Now, the current dump file(master-bin.000002) is the second line of index # file -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Now, all events has been replicate to slave. As current dump file # (master-bin.000002) is the last binlog file, so master is waiting for new # events. @@ -101,12 +102,12 @@ START SLAVE IO_THREAD; source include/wait_for_slave_io_to_start.inc; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW TABLES; connection master; DROP TABLE t1, t2, t3, t4; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo --echo # BUG#21437 server_errno=29 error message flood mysqld error log @@ -127,7 +128,7 @@ FLUSH LOGS; CREATE TABLE t2(c1 int); DROP TABLE t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo [ on slave ] source include/stop_slave.inc; @@ -160,7 +161,7 @@ source include/start_slave.inc; connection master; --echo [ on master ] CREATE TABLE t1(c1 INT); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo [ on slave ] SELECT * FROM t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_many_optimize.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_many_optimize.test index d5e9f69b..04f552e5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_many_optimize.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_many_optimize.test @@ -17,7 +17,7 @@ enable_result_log; enable_query_log; drop table t1; # Bug was that slave segfaulted after ~ a hundred of OPTIMIZE (or ANALYZE) -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_master_pos_wait.test index 31b24e58..be6d9986 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_master_pos_wait.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_master_pos_wait.test @@ -3,7 +3,7 @@ # to MASTER_POS_WAIT and when it timeouts. # source include/master-slave.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # MASTER_POS_WAIT: Check if time-out is correctly handled. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_migration_crash_safe.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_migration_crash_safe.test index c0011f87..cbc6e16f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_migration_crash_safe.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_migration_crash_safe.test @@ -180,7 +180,7 @@ SET @@GLOBAL.relay_log_info_repository= "TABLE"; ######################################################################################## --connection master -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-migration-master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-migration-slave.sql --diff_files $MYSQLD_DATADIR/test-migration-master.sql $MYSQLD_DATADIR/test-migration-slave.sql @@ -188,4 +188,4 @@ sync_slave_with_master; --connection master DROP TABLE test; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh old mode 100644 new mode 100755 index 8ce79797..44d295be --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh @@ -1 +1,3 @@ +#! /bin/bash +# rm -f $MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions.test index a81c352b..c0b5bf6c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_misc_functions.test @@ -29,7 +29,7 @@ insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('do --enable_warnings select * into outfile 'rpl_misc_functions.outfile' from t1; let $MYSQLD_DATADIR= `select @@datadir`; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc create temporary table t2 like t1; # read the values from the master table --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR @@ -88,7 +88,7 @@ INSERT INTO t1 (col_a) VALUES (test_replication_sf()); INSERT INTO t1 (col_a) VALUES (test_replication_sf()); --enable_warnings ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # Dump table on slave select * from t1 into outfile "../../tmp/t1_slave.txt"; @@ -122,7 +122,7 @@ DROP PROCEDURE test_replication_sp1; DROP PROCEDURE test_replication_sp2; DROP FUNCTION test_replication_sf; --remove_file $MYSQLD_DATADIR/test/rpl_misc_functions.outfile ---sync_slave_with_master +--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_mix_found_rows.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_found_rows.test index ed932eb5..31bb1c1b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_found_rows.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_found_rows.test @@ -38,7 +38,7 @@ CREATE PROCEDURE just_log(sect INT, test INT) BEGIN INSERT INTO logtbl VALUES (sect,test,FOUND_ROWS()); END $$ --delimiter ; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Master 1 **** connection master1; @@ -55,18 +55,18 @@ CALL just_log(1,2); connection master1; SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; CALL just_log(1,3); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Master **** connection master; SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; CALL just_log(1,4); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; --echo ==== Checking a stored function ==== @@ -145,7 +145,7 @@ SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; INSERT INTO t2 VALUES (2,5), (2,6); SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; connection master; @@ -154,6 +154,6 @@ DROP PROCEDURE just_log; DROP PROCEDURE log_me; DROP PROCEDURE log_me_inner; DROP FUNCTION log_rows; -sync_slave_with_master; +--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_mix_insert_delayed.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test index a310fa25..818f5734 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test @@ -1,3 +1,4 @@ +--source include/not_gtid_enabled.inc --source include/have_binlog_format_mixed.inc --source include/master-slave.inc --source include/not_embedded.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test index 226a82de..ebb14ee1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test @@ -74,10 +74,10 @@ DELETE FROM `t8` WHERE `bit` < 2 LIMIT 4; --enable_warnings -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # clean up connection master; DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8; -sync_slave_with_master; +--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_mixed_ddl_dml.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test index cad0f213..b7c0bc81 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test @@ -11,12 +11,12 @@ source include/master-slave.inc; create table t1 (n int auto_increment primary key); set insert_id = 2000; insert into t1 values (NULL),(NULL),(NULL); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; --source include/show_slave_hosts.inc drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc stop slave; --source include/wait_for_slave_to_stop.inc connection master; @@ -44,7 +44,7 @@ show create table t5; connection master; drop table t2,t3,t5; drop temporary table if exists t4; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_debug.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_debug.test index 02b9e3eb..36db5735 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_debug.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_debug.test @@ -7,6 +7,7 @@ # tables but before releasing locks and committing the current transaction. ################################################################################ +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/have_debug.inc --source include/have_innodb.inc @@ -21,7 +22,7 @@ CREATE TABLE db_1.test_1 (id INTEGER) engine=Innodb; CREATE TABLE db_2.test_1 (id INTEGER) engine=Innodb; --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection slave --source include/stop_slave.inc @@ -33,7 +34,7 @@ ALTER TABLE mysql.slave_worker_info ENGINE= Innodb; --source include/start_slave.inc --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SET GLOBAL debug="d,mts_debug_concurrent_access"; --connection master @@ -41,7 +42,7 @@ INSERT INTO db_1.test_1 VALUES(1); INSERT INTO db_2.test_1 VALUES(1); DROP DATABASE db_1; DROP DATABASE db_2; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc SET @@global.slave_parallel_workers= @save.slave_parallel_workers; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_off-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_off-slave.opt new file mode 100644 index 00000000..0367a273 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_off-slave.opt @@ -0,0 +1 @@ +--slave-transaction-retries=0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_off.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_off.test new file mode 100644 index 00000000..3a63fab2 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_off.test @@ -0,0 +1,21 @@ +# ==== Purpose ==== +# +# Bug#19545298 REPLICATION FAILS WITH ERRNO 1755 +# +# Verify that the replication does not fail with MTS enabled even if +# slave IO thread left a partial group in relay log, when auto position +# is disabled and GTID mode is enabled. +# + +--source include/have_gtid.inc +--source include/have_binlog_format_row.inc +--source include/master-slave.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc + +--source include/rpl_connection_slave.inc +--source include/stop_slave.inc +change master to master_auto_position=0; +--source include/start_slave.inc + +--source extra/rpl_tests/rpl_mts_execute_partial_trx_in_relay_log.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_on-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_on-slave.opt new file mode 100644 index 00000000..0367a273 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_on-slave.opt @@ -0,0 +1 @@ +--slave-transaction-retries=0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_on.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_on.test new file mode 100644 index 00000000..d75e840c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_execute_partial_trx_with_auto_pos_on.test @@ -0,0 +1,21 @@ +# ==== Purpose ==== +# +# Bug#19545298 REPLICATION FAILS WITH ERRNO 1755 +# +# Verify that the replication does not fail with MTS enabled even if +# slave IO thread left a partial group in relay log, when both auto +# position and GTID mode are enabled. +# + +--source include/have_gtid.inc +--source include/have_binlog_format_row.inc +--source include/master-slave.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc + +--source include/rpl_connection_slave.inc +--source include/stop_slave.inc +change master to master_auto_position=1; +--source include/start_slave.inc + +--source extra/rpl_tests/rpl_mts_execute_partial_trx_in_relay_log.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_gtids_restart_slave_io_lost_trx-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_gtids_restart_slave_io_lost_trx-slave.opt new file mode 100644 index 00000000..378129c9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_gtids_restart_slave_io_lost_trx-slave.opt @@ -0,0 +1 @@ +--slave-parallel-workers=2 --slave-transaction-retries=0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_gtids_restart_slave_io_lost_trx.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_gtids_restart_slave_io_lost_trx.test new file mode 100644 index 00000000..f8a28358 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_gtids_restart_slave_io_lost_trx.test @@ -0,0 +1,13 @@ +############################################################################### +# +# BUG#17326020 ASSERTION ON SLAVE AFTER STOP/START SLAVE USING MTS+GTID +# REPLICATION +# +############################################################################### +# +# This test will verify if the slave SQL thread and the slave IO thread behave +# correctly when the IO thread is restarted in the middle of a transaction +# using MTS slave configuration. +# + +--source extra/rpl_tests/rpl_gtids_restart_slave_io_lost_trx.test diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_slave_hang_with_partial_trx-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_slave_hang_with_partial_trx-slave.opt new file mode 100644 index 00000000..378129c9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_slave_hang_with_partial_trx-slave.opt @@ -0,0 +1 @@ +--slave-parallel-workers=2 --slave-transaction-retries=0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_slave_hang_with_partial_trx.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_slave_hang_with_partial_trx.test new file mode 100644 index 00000000..196485b2 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_slave_hang_with_partial_trx.test @@ -0,0 +1,77 @@ +# ==== Purpose ==== +# +# Verify if the MTS SQL thread will became unresponsive after the slave +# applied a partial transaction (without the XID event) followed by a +# ROTATE event caused by IO thread reconnection when GTIDs and auto +# positioning are enabled. +# +# ==== Related Bugs and Worklogs ==== +# +# BUG#17326020 ASSERTION ON SLAVE AFTER STOP/START SLAVE USING MTS+GTID +# REPLICATION +# BUG#18885916 RELAY LOG WITHOUT XID_LOG_EVENT MAY CASE PARALLEL +# REPLICATION HANG +# +# ==== Implementation ==== +# +# This test uses debug points on the slave to make the +# IO thread to stop right after queuing a WRITE_ROWS log event. +# +# By doing this, the relay log file with the partial transaction +# will contain: [GTID,] QUERY(BEGIN), TABLE_MAP and WRITE_ROWS, but +# won't have the XID for the transaction. +# +# After reconnecting to the master, if the slave is configured with +# GTID and auto positioning, the IO thread will request the whole +# transaction again. +# +# The test case will then sync the slave with the master and verify +# that all data was correctly applied on slave. +# + +# This test case uses a debug point based on RBR +--source include/have_binlog_format_row.inc +--source include/have_debug.inc +--source include/master-slave.inc + +--source include/rpl_connection_slave.inc +# Prepare the slave IO thread to stop after queuing a WRITE_ROWS event +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG= "d,stop_io_after_reading_write_rows_log_event"; + +# Put some data in to the master +--source include/rpl_connection_master.inc +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +# This transaction will be split +BEGIN; +INSERT INTO t1 (c1) VALUES (1); +COMMIT; +# This transaction will not be split +BEGIN; +INSERT INTO t1 (c1) VALUES (2); +COMMIT; + +# Wait the slave IO thread to reach the debug point +--source include/rpl_connection_slave.inc +--source include/wait_for_slave_io_to_stop.inc +# Remove the debug point, so the IO thread will not stop after +# queuing a WRITE_ROWS event anymore +SET GLOBAL DEBUG= @save_debug; + +# Restart slave I/O thread +--source include/start_slave_io.inc + +# Sync the slave with the master +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.inc + +# Final data verification +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.inc +--let diff_tables= master:t1, slave:t1 +--source include/diff_tables.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_multi_delete.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_delete.test index 80acf9c8..51e72277 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_delete.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_delete.test @@ -19,7 +19,7 @@ select * from t2; connection master; drop table t1,t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_delete2.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_delete2.test index 7dc7ca41..3be7cb61 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_delete2.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_delete2.test @@ -27,7 +27,7 @@ SELECT * FROM a; insert into a values(2),(3); delete alias FROM a alias where alias.i=2; select * from a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use mysqltest_to; select * from a; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_engine.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_engine.test index 978db88f..4f4e4c26 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_engine.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_engine.test @@ -20,14 +20,14 @@ VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,PRIMARY KEY(id)); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # MyISAM to MyISAM then InnoDB then MEMORY connection master; alter table t1 engine=myisam; show create table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; alter table t1 engine=myisam; @@ -52,7 +52,7 @@ show create table t1; connection master; alter table t1 engine=memory; show create table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; alter table t1 engine=myisam; @@ -77,7 +77,7 @@ show create table t1; connection master; alter table t1 engine=innodb; show create table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; alter table t1 engine=myisam; @@ -100,7 +100,7 @@ show create table t1; # cleanup connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.1 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_update2.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_update2.test index 138c1455..0c61578e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_update2.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_update2.test @@ -4,6 +4,7 @@ # Added comments section and to skip when ndb is # # Default engine. # ####################################################### +--source include/not_gtid_enabled.inc --source include/not_ndb_default.inc --source include/master-slave.inc call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT'); diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_update4.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_update4.test index 8f069b9c..5c378b6b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_update4.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_multi_update4.test @@ -2,6 +2,7 @@ # some replicate-* rules exist. # (BUG#15699) +source include/not_gtid_enabled.inc; source include/master-slave.inc; ### Clean-up @@ -32,7 +33,7 @@ insert into d1.t0 values (0); # replication works ### Check on slave -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use d1; select * from t0 where id=0; # must find @@ -40,7 +41,7 @@ select * from t0 where id=0; # must find connection master; drop database d1; drop database d2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of test --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test index 948b14a2..c0f77842 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test @@ -17,7 +17,7 @@ connection master; DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`; CREATE DATABASE `#mysql50#mysqltest-1`; --enable_warnings -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; let $before_position= query_get_value(SHOW MASTER STATUS, Position, 1); @@ -25,7 +25,7 @@ let $before_position= query_get_value(SHOW MASTER STATUS, Position, 1); #With '--force' option, mysql_upgrade always executes all sql statements for upgrading. #binlog is disabled by default. --exec $MYSQL_UPGRADE --skip-verbose --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1 -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1); diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test index 1413a1d0..ef61a5f9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mysqlbinlog_gtid_on.test @@ -2,8 +2,8 @@ # WL#3584 GTID # The test verifies how mysqlbinlog handles GTID related options. # ---source include/master-slave.inc --source include/have_gtid.inc +--source include/master-slave.inc --source include/have_innodb.inc --source include/have_binlog_format_mixed.inc @@ -181,3 +181,5 @@ FLUSH LOGS; DROP TABLE t1; --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) --exec $MYSQL_BINLOG $datadir/$binlog_file | $MYSQL --user=root --host=127.0.0.1 --port=$SLAVE_MYPORT +connection slave; +CHANGE MASTER TO MASTER_AUTO_POSITION=0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_name_const.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_name_const.test index 4cacafa0..f7fe610d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_name_const.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_name_const.test @@ -36,7 +36,7 @@ call test_procedure(1234); --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 order by id; --echo ==== Clean up ==== diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test index a174445f..60db7aa4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test @@ -49,7 +49,7 @@ INSERT INTO t1 VALUES (RAND()); # We replicate the last_insert_id in an intvar_log_event INSERT INTO t1 VALUES (LAST_INSERT_ID()); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:t1, slave:t1 --source include/diff_tables.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_optimize.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_optimize.test index 8b33a17e..12f70396 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_optimize.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_optimize.test @@ -55,7 +55,7 @@ sync_with_master; # won't work if slave SQL thread stopped connection master; # cleanup drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # If the machine is so fast that slave syncs before OPTIMIZE # starts, this test wil demonstrate nothing but will pass. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_packet.test index 5bcfa306..a8fe3492 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_packet.test @@ -33,7 +33,7 @@ let $old_slave_max_allowed_packet_temp= `SELECT @@global.slave_max_allowed_packe SET @@global.max_allowed_packet=10240; SET @@global.net_buffer_length=1024; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Restart slave for setting to take effect source include/stop_slave.inc; source include/start_slave.inc; @@ -50,7 +50,7 @@ select @@net_buffer_length, @@max_allowed_packet; create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc eval select count(*) from `$db`.`t1` /* must be 1 */; @@ -58,7 +58,7 @@ SHOW STATUS LIKE 'Slave_running'; select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING'; connection master; eval drop database $db; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits @@ -98,7 +98,7 @@ connection master; CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -131,12 +131,12 @@ connection slave; --source include/rpl_reset.inc --connection master DROP TABLE t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc connection master; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); @@ -151,6 +151,7 @@ connection slave; # Remove the bad binlog and clear error status on slave. STOP SLAVE; RESET SLAVE; +RESET MASTER; --connection master RESET MASTER; @@ -197,13 +198,13 @@ connection master; DROP TABLE t1; select @@global.max_allowed_packet; select @@global.net_buffer_length; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select @@global.max_allowed_packet; select @@global.net_buffer_length; --connection master CREATE TABLE t1 (a TEXT) ENGINE=MyISAM; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # Create big row event. --connection master diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_change_master.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_change_master.test index c76c9500..9f1d3599 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_change_master.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_change_master.test @@ -5,6 +5,7 @@ # Related bugs: # Bug 12995174 - MTS: UNEXPECTED RECOVERY ATTEMPT ENDS WITH ER_MASTER_INFO OR ASSERTION +--source include/not_gtid_enabled.inc --source include/master-slave.inc # The test for bug#12995174 is not format-specific but uses sleep # so it made to be run in ROW format that is the way the bug is reported. @@ -29,7 +30,7 @@ CREATE TABLE d2.t1 (a int unique) ENGINE=INNODB; INSERT INTO d1.t1 VALUES (1); FLUSH LOGS; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc CHANGE MASTER TO MASTER_DELAY=5; @@ -129,6 +130,6 @@ DELETE FROM d1.t1 WHERE a = 13; --connection master DROP DATABASE d1; DROP DATABASE d2; ---sync_slave_with_master +--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_parallel_conf_limits.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test index 58d970fa..2ab85f0c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_conf_limits.test @@ -60,7 +60,7 @@ connection master; create database d0; create table d0.t0 (a int auto_increment primary key, b text null) engine=innodb; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc begin; @@ -118,7 +118,7 @@ connection master; drop database d0; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; drop view coord_wait_list; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_conflicts.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_conflicts.test index 022dc659..834af2ce 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_conflicts.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_conflicts.test @@ -67,7 +67,7 @@ create table d3.t1 (a int auto_increment primary key) engine=innodb; # # two conflicting jobs to follow -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # To be really conflicting slave needs to block commit of the first. #connection slave; @@ -205,7 +205,7 @@ drop database d1; drop database d2; drop database d3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; drop view coord_wait_list; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_ddl.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_ddl.test index e8ae7a93..f13c61ee 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_ddl.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_ddl.test @@ -155,7 +155,7 @@ connection slave; source include/start_slave.inc; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Consistency check @@ -236,7 +236,7 @@ eval rename table $tables_2_rename d$n.t$m to d$n1.t$m; # Hunting after bug#13033076. # Let's see if rename leaves any garbage after its run # -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $MYSQLD_DATADIR= `SELECT @@datadir`; while ($n) { @@ -320,7 +320,7 @@ while ($n) --disconnect con4 connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_parallel_workers= @save.slave_parallel_workers; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test index 86ab66c7..833ee313 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test @@ -95,7 +95,7 @@ while ($k) --enable_warnings --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # 2. Case of invoked routines @@ -161,7 +161,7 @@ while ($k) --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # B. Triggers @@ -205,7 +205,7 @@ while ($k) --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Consistency check @@ -241,7 +241,7 @@ while ($n) --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Over MAX_DBS_IN_QUERY_MTS @@ -302,7 +302,7 @@ while ($k) --enable_warnings --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Todo: to impelement a stress test for sync_slave_with_master # specifically in parallel mode. @@ -344,7 +344,7 @@ while ($n) --enable_query_log -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_parallel_workers= @save.slave_parallel_workers; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test index 51e84fb1..7630ff90 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_seconds_behind_master.test @@ -40,9 +40,7 @@ set @save.slave_transaction_retries= @@global.slave_transaction_retries; # Resetting of SBM is a possibility whenever Coordinator # notices no more groups left neither to read nor to process (demo 2). # - -start slave io_thread; -source include/wait_for_slave_io_to_start.inc; +--source include/start_slave.inc connection master; @@ -53,10 +51,12 @@ call mtr.add_suppression('.*Unsafe statement written to the binary log using sta create table t1 (f1 int) engine=innodb; create table t2 (f1 int) engine=innodb; -save_master_pos; +--source include/sync_slave_sql_with_master.inc +--source include/stop_slave_sql.inc # 1st transaction that will be used to compute SBM. # It will hang $idle time at least in processing to get min estimate for SBM +connection master; let $idle= 3; begin; @@ -68,25 +68,16 @@ begin; insert into t2 values (1); commit; -connection slave; -source include/start_slave.inc; - # # all events are in relay-log # -connection master; - source include/sync_slave_io_with_master.inc; -# tables are created on slave -connection slave; -sync_with_master; - connection slave1; lock table t2 write; # to block 2nd trans connection slave; - +--source include/start_slave_sql.inc let $count= 1; let $table= t1; source include/wait_until_rows_count.inc; @@ -102,16 +93,6 @@ let $slave_param_comparison= >=; let $slave_param_value= $idle; source include/wait_for_slave_param.inc; -# checking sanity of SBM value -let $sbm= query_get_value("SHOW SLAVE STATUS", Seconds_Behind_Master, 1); -let $lower_bound= $idle; -if (`SELECT $sbm < $idle`) -{ - -- echo *** Seconds behind master is $sbm less than minimum expected $idle *** - -- source include/show_rpl_debug_info.inc - -- die -} - --echo Seconds_Behind_Master after first transaction is as expected. connection slave1; @@ -133,7 +114,7 @@ source include/wait_for_slave_param.inc; connection master; drop tables t1, t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_checkpoint_period= @save.slave_checkpoint_period; set @@global.slave_parallel_workers= @save.slave_parallel_workers; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test index ddf2b5ce..e04e91e7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test @@ -88,7 +88,7 @@ CREATE TABLE t1 (a int primary key) engine=innodb; insert into t1 values (1),(2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; let $count= 2; @@ -116,7 +116,7 @@ source include/start_slave.inc; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; if (`select count(*) != 3 from t1`) @@ -130,7 +130,7 @@ if (`select count(*) != 3 from t1`) connection master; delete from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; # @@ -142,7 +142,7 @@ insert into t1 values (1),(2),(3); create table t2m (a int) engine=myisam; # non-trans engine to detect deadlock insert into t2m values (1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; begin; @@ -186,7 +186,7 @@ source include/start_slave.inc; connection master; # recovery is proved -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; @@ -227,7 +227,7 @@ start slave sql_thread; connection master; let $a=`select max(a) from t1`; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; if (`select $a - max(a) from t1`) @@ -275,7 +275,7 @@ drop table t1; drop table t2m; drop table t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; drop view worker_proc_list; @@ -328,7 +328,7 @@ insert into d1.t1 values (1),(2),(3); insert into d2.t1 values (1),(2),(3); insert into d1.t2m values (1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; begin; # the blocker # set up a deadlock at the 1st job @@ -412,7 +412,7 @@ connection master; drop database d1; drop database d2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_parallel_workers= @save.slave_parallel_workers; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_switch_sequential.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_switch_sequential.test index efa9e073..4edc7b62 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_switch_sequential.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_switch_sequential.test @@ -1,4 +1,5 @@ --source include/big_test.inc +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/have_binlog_format_mixed_or_row.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test index e98732d6..e78fd239 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test @@ -95,7 +95,7 @@ while ($n) dec $n1; } -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc if (`select variable_value - $workers*$temp_tables as must_be_zero from information_schema.global_status where variable_name like 'Slave_open_temp_tables'`) { @@ -171,7 +171,7 @@ while ($n) dec $n1; } -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; connection master1; @@ -192,9 +192,9 @@ while ($n) dec $n1; } -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; set @@global.slave_parallel_workers= @save.slave_parallel_workers; - +CHANGE MASTER TO MASTER_AUTO_POSITION= 0; ### TODO: --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_worker_error.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_worker_error.test new file mode 100644 index 00000000..d797d468 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_parallel_worker_error.test @@ -0,0 +1,58 @@ +--source include/master-slave.inc +--source include/have_binlog_format_statement.inc +--source include/only_mts_slave_parallel_workers.inc + +# +# Proving correct error reporting by Worker in condition of the failing query +# size is close to that of internal buffer MAX_SLAVE_ERRMSG. +# bug#18563480 MTS: CRASH WHEN SLAVE WORKER TRY TO EXECUTE A BIG STATEMENT doomed to fail +# + +# Create a table on the slave to set up future error on its creation +# via replication + +--connection slave +call mtr.add_suppression("Slave SQL: Worker.*failed executing transaction"); +call mtr.add_suppression("Slave SQL:.*The slave coordinator and worker threads are stopped"); + +--eval CREATE TABLE t (a TEXT) select "a" as a + +# Create a query size of over MAX_SLAVE_ERRMSG = 1024 + +--connection master + +--let i=0 +--let select_arg=a + +while ($i < 1024) +{ + --inc $i + --let $select_arg=a$select_arg +} + +--eval CREATE TABLE t (a TEXT) select "$select_arg" as a + +--connection slave + +# Error is found as expected. +--let $slave_sql_errno= convert_error(ER_TABLE_EXISTS_ERROR) +--source include/wait_for_slave_sql_error.inc + +# Remove slave side table, recover slave to catch up +DROP TABLE t; +--source include/start_slave_sql.inc + +--connection master +--source include/sync_slave_sql_with_master.inc + + +# +# Cleanup +# + +--connection master +DROP TABLE t; +--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_plugin_load.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_plugin_load.test index 5f9725a8..02a4d857 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_plugin_load.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_plugin_load.test @@ -32,7 +32,7 @@ eval SELECT $after_pos - $before_pos AS Delta; --echo Verify that example engine is installed. SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE'; # Wait for slave to catch up with master. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # --echo connection slave: Verify that example engine is not installed. connection slave; @@ -53,7 +53,7 @@ eval SELECT $after_pos - $before_pos AS Delta; --echo Verify that example engine is not installed. SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE'; # Wait for slave to catch up with master. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Cleanup --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ps.test index b3d07dd1..0e332f9b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ps.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ps.test @@ -6,7 +6,7 @@ ########################################################### source include/master-slave.inc; -#sync_slave_with_master; +#--source include/sync_slave_sql_with_master.inc #reset master; #connection master; @@ -28,14 +28,14 @@ prepare stmt2 from @var2; set @var1='from-master-3'; execute stmt2 using @var1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY n; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc stop slave; source include/wait_for_slave_to_stop.inc; # End of 4.1 tests @@ -86,7 +86,7 @@ use mysqltest1; EXECUTE stmt_d_1; --echo # Connection: slave ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test index 30cc5649..bf71321a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test @@ -10,7 +10,7 @@ CREATE TABLE t1 (a INT, b LONG); INSERT INTO t1 VALUES (1,1), (2,2); INSERT INTO t1 VALUES (3,UUID()), (4,UUID()); source include/show_binlog_events.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** source include/show_binlog_events.inc; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test index ce345445..9c09553b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_old_relay_log_info.test @@ -3,12 +3,13 @@ # - Verify that the pre-WL#344 format of relay_log.info can still be # parsed. +--source include/not_gtid_enabled.inc --source include/master-slave.inc CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); DROP TABLE t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ==== Check that we still understand the old format of relay-log.info ==== --source include/stop_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_only.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_only.test index 07d91c87..d5090369 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_only.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_read_only.test @@ -8,7 +8,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state # Create a test and replicate it to slave connection master; create user test; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Setting the master readonly : # - the variable @@readonly is not replicated on the slave @@ -31,7 +31,7 @@ select @@read_only; select * from t1; select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select @@read_only; select * from t1; select * from t2; @@ -84,7 +84,7 @@ insert into t2 values(2004); select * from t1; select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t2; @@ -106,7 +106,7 @@ insert into t2 values(2005); select * from t1; select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; select * from t2; @@ -123,7 +123,7 @@ connection master; drop user test; drop table t1; drop table t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set global read_only=0; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_empty_sqlthd_pos-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_empty_sqlthd_pos-slave.opt new file mode 100644 index 00000000..01111d69 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_empty_sqlthd_pos-slave.opt @@ -0,0 +1 @@ +--master-info-repository=TABLE --relay-log-info-repository=TABLE --relay-log-recovery=1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_empty_sqlthd_pos.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_empty_sqlthd_pos.test new file mode 100644 index 00000000..eea6aa66 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_empty_sqlthd_pos.test @@ -0,0 +1,64 @@ +############################################################################### +# Bug#19021091: RELAY_LOG_RECOVERY KO WHEN CHANGE MASTER WITHOUT FILE AND +# SQL_THREAD NOT STARTED +# +# Problem: +# ======== +# If, on an empty database: +# - CHANGE MASTER TO without a MASTER_FILE and MASTER_POS is used, +# - the IO_THREAD is started WITHOUT starting the SQL_THREAD, +# - MySQL crashed, +# - MySQL is restarted with relay_log_recovery = 1. +# +# Crash recovery will not work as expected: +# - The IO_THREAD position will NOT be initialized to the SQL_THREAD position, +# - SQL_THREAD position will NOT be initialized to the new relay log. +# +# It looks like, when the SQL_THREAD does not have a Relay_Master_Log_File, +# relay_log_recovery does not work. +# +# Test: +# ===== +# Use master and slave info repositories to be tables and set +# relay-log-recovery=1. Stop the slave, execute a CREATE DATABASE statement on +# the master. Execute a CHANGE MASTER statement on slave without a MASTER_FILE +# and MASTER_POS. Start IO thread alone. Crash the slave and restart it. When +# slave is restarted with bug, sql thread will not be able to start. It will fail +# with an error saying the database already exists. Post fix sql thread will +# read positions from the first rotate event that is received from the master. +# Sql thread will start without any error. +############################################################################### +--source include/master-slave.inc +--source include/force_restart.inc +--source include/rpl_connection_slave.inc +call mtr.add_suppression("Recovery from master pos .*"); + +--source include/rpl_connection_slave.inc +--source include/stop_slave.inc + +--source include/rpl_connection_master.inc +CREATE DATABASE test_jfg; + +--source include/rpl_connection_slave.inc +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 2 #### +--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root' +START SLAVE IO_THREAD; +source include/wait_for_slave_io_to_start.inc; + +--source include/rpl_connection_master.inc +source include/sync_slave_io_with_master.inc; + +# Restart the slave server +--let $rpl_server_number= 2 +--let $rpl_force_stop= 1 +--let $rpl_server_parameters=--skip_slave_start=FALSE --master-info-repository=TABLE --relay-log-info-repository=TABLE --relay-log-recovery=1 +--source include/rpl_restart_server.inc + +# With bug sql thread will not be able to start it will fail with error 1007 +# Slave: Can't create database 'test_jfg'; database exists Error_code: 1007 +source include/wait_for_slave_sql_to_start.inc; + +--source include/rpl_connection_master.inc +DROP DATABASE test_jfg; +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_replicate_same_server_id-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_replicate_same_server_id-slave.opt new file mode 100644 index 00000000..8b7b061f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_replicate_same_server_id-slave.opt @@ -0,0 +1 @@ +--no-console --disable-log-slave-updates --replicate-same-server-id --gtid-mode=off --master-info-repository=TABLE --relay-log-info-repository=TABLE --relay-log-recovery=1 --log_error=$MYSQLTEST_VARDIR/tmp/slave.err diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_replicate_same_server_id.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_replicate_same_server_id.test new file mode 100644 index 00000000..ad5d15fd --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_recovery_replicate_same_server_id.test @@ -0,0 +1,84 @@ +############################################################################### +# Bug#19021091: RELAY_LOG_RECOVERY KO WHEN CHANGE MASTER WITHOUT FILE AND +# SQL_THREAD NOT STARTED +# +# Problem: +# ======== +# If, on an empty database: +# - CHANGE MASTER TO without a MASTER_FILE and MASTER_POS is used, +# - the IO_THREAD is started WITHOUT starting the SQL_THREAD, +# - MySQL crashed, +# - MySQL is restarted with relay_log_recovery = 1. +# +# Crash recovery will not work as expected: +# - The IO_THREAD position will NOT be initialized to the SQL_THREAD position, +# - SQL_THREAD position will NOT be initialized to the new relay log. +# +# It looks like, when the SQL_THREAD does not have a Relay_Master_Log_File, +# relay_log_recovery does not work. +# +# Test: +# ===== +# If SQL_THREAD does not have a Relay_Master_Log_File set recovery process +# will try to extract the first rotate event from the master and try to +# extract master_log_file and master_log_pos from the rotate event. But when +# replicate-same-server-id is set master and slave will have same server_id +# and it will not be possible to identify the rotate event from master. Hence +# if recovery is happening with empty Relay_Master_Log_File and +# replicate-same-server-id is set we generate an error saying recovery is not +# possible. +# +# Enable replicate-same-server-id. Set slave's info repository to be tables +# and set relay-log-recovery=1. Start slave io_thread to ensure that +# Relay_Master_Log_File is not initialized. Stop and restart the slave server. +# Relay log recovery will not happen slave will generate an error in error log +# as shown below. +# +# Error during --relay-log-recovery, replicate_same_server_id is in use and +# sql thread's positions are not initialized, hence relay log recovery cannot +# happen. +############################################################################### +# If replicate-same-serverid is used log-slave-updates cannot be set and gtid +# mode will not work. Hence disabling the test script in gtid mode. +--source include/not_gtid_enabled.inc +--source include/force_restart.inc +--source include/master-slave.inc + +--source include/rpl_connection_slave.inc +call mtr.add_suppression("Failed to initialize the master info structure"); +call mtr.add_suppression("Error during --relay-log-recovery *"); +CREATE TABLE t1 ( n INT); +RESET MASTER; + +# replicate ourselves +--source include/stop_slave.inc +--source include/wait_for_slave_to_stop.inc +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CHANGE MASTER TO MASTER_PORT=$SLAVE_MYPORT; +START SLAVE IO_THREAD; +--source include/wait_for_slave_io_to_start.inc + +# Restart the slave server +--let $rpl_server_number= 2 +--source include/rpl_stop_server.inc + +--let $rpl_server_number= 2 +--let $rpl_server_parameters=--skip_slave_start=FALSE --master-info-repository=TABLE --relay-log-info-repository=TABLE --relay-log-recovery=1 +--source include/rpl_start_server.inc + +--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=Error during --relay-log-recovery +--source extra/rpl_tests/grep_pattern.inc + +# Clean up Server needs to be restarted with relay-log-recovery=0 +--let $rpl_server_number= 2 +--let $rpl_server_parameters=--master-info-repository=TABLE --relay-log-info-repository=TABLE --relay-log-recovery=0 +--source include/rpl_restart_server.inc + +DROP TABLE t1; +--replace_result $MASTER_MYPORT MASTER_PORT +eval change master to master_port=$MASTER_MYPORT; +--source include/start_slave.inc + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_do.test index e929c643..155d2379 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_do.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_do.test @@ -20,14 +20,14 @@ insert into t1 values(15),(16),(17); update t1 set m=20 where m=16; delete from t1 where m=17; create table t11 select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 ORDER BY m; select * from t2; --error 1146 select * from t11; connection master; drop table if exists t1,t2,t11; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # show slave status, just to see of it prints replicate-do-table let $status_items= Replicate_Do_Table; source include/show_slave_status.inc; @@ -45,7 +45,7 @@ create table t2 (a int, b int); create trigger trg2 before insert on t2 for each row set new.b=2; show tables; show triggers; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo *** slave *** connection slave; show tables; @@ -55,7 +55,7 @@ connection master; drop trigger trg1; drop trigger trg2; show triggers; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo *** slave *** connection slave; show tables; @@ -64,5 +64,5 @@ show triggers; connection master; drop table t1; drop table t2; -sync_slave_with_master; +--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_replicate_event_after_sync_stage.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_event_after_sync_stage.test new file mode 100644 index 00000000..1cb64c1b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_event_after_sync_stage.test @@ -0,0 +1,66 @@ +################################################################################ +# BUG#17632285 SLAVE CAN'T CONTINUE REPLICATION AFTER MASTER'S CRASH RECOVERY +# +# Verify that events can not be replicated before they are synced to disk, if +# sync_binlog is set to 1, otherwise they can be replicated before they are +# synced to disk. +################################################################################ +--source include/have_debug_sync.inc +--source include/master-slave.inc +# Testing it in one mode is enough +--source include/have_binlog_format_row.inc + +--echo # +--echo # Case 1: The events cannot be replicated before they are synced to disk +--echo # when sync_binlog is 1. +--echo # +--source include/rpl_connection_master.inc +SET @save_sync_binlog = @@GLOBAL.sync_binlog; +SET GLOBAL sync_binlog = 1; + +# Block the session before its events are synced to disk +SET DEBUG_SYNC = 'before_sync_binlog_file WAIT_FOR continue'; + +--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1) +send CREATE TABLE t1(c1 INT); + +# Wait enough time. So the events were replicated if they could be replicated +--source include/rpl_connection_slave.inc +--sleep 3 +--let $assert_text= "CREATE TABLE t1 is not be replicated" +--let $assert_cond= [SHOW SLAVE STATUS, Read_Master_Log_Pos, 1] = $master_pos +--source include/assert.inc + +--let $rpl_connection_name= default +--source include/rpl_connection.inc +SET DEBUG_SYNC = "now SIGNAL continue"; + +--source include/rpl_connection_master.inc +--reap + +--sync_slave_with_master +--source include/rpl_connection_master.inc + +--echo # +--echo # Case 2: The events are able to be replicated before they are synced to +--echo # disk when sync_binlog is 1. +--echo # + +SET GLOBAL sync_binlog = 0; +send DROP TABLE t1; + +--connection default +--let $wait_binlog_event= DROP +--source include/wait_for_binlog_event.inc + +--sync_slave_with_master + +--connection default +SET DEBUG_SYNC = "now SIGNAL continue"; + +--source include/rpl_connection_master.inc +--reap + +SET DEBUG_SYNC = 'RESET'; +SET GLOBAL sync_binlog = @save_sync_binlog; +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test index f1907456..4419b18a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test @@ -1,5 +1,6 @@ # see if --replicate-ignore-db works +--source include/not_gtid_enabled.inc --source include/master-slave.inc --disable_warnings @@ -12,7 +13,7 @@ create database mysqltest2; use mysqltest1; create table t1 (a int); insert into t1 values(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --error 1146 select * from mysqltest1.t1; @@ -20,12 +21,12 @@ connection master; use mysqltest2; create table t1 (a int); insert into t1 values(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from mysqltest2.t1; # cleanup connection master; drop database mysqltest1; drop database mysqltest2; -sync_slave_with_master; +--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_report_port.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_report_port.test index 6e728a67..18e3e9d3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_report_port.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_report_port.test @@ -60,7 +60,7 @@ connection slave; --source include/wait_for_slave_param.inc connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo [Slave restarted with the report-port set to the value of slave's port number] connection master; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rewrt_db.test index d88db3e1..092bbcfe 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rewrt_db.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rewrt_db.test @@ -11,14 +11,14 @@ use mysqltest1; create table t1 (a int); insert into t1 values(9); select * from mysqltest1.t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc show databases like 'mysqltest1'; # should be empty select * from test.t1; # cleanup connection master; drop table t1; drop database mysqltest1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#6353: @@ -36,7 +36,7 @@ use test; create table t1 (a date, b date, c date not null, d date); load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from rewrite.t1; @@ -44,7 +44,7 @@ select * from rewrite.t1; connection master; truncate table t1; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from rewrite.t1; @@ -53,7 +53,7 @@ connection master; drop table t1; create table t1 (a text, b text); load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; @@ -62,7 +62,7 @@ connection master; drop table t1; create table t1 (a int, b char(10)); load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from rewrite.t1; @@ -70,7 +70,7 @@ select * from rewrite.t1; connection master; truncate table t1; load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; # The empty line last comes from the end line field in the file @@ -181,7 +181,7 @@ INSERT INTO t_03_03_temp VALUES(1); --echo **** zero. If not,the test will time out. --echo connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; show status like 'Slave_open_temp_tables'; @@ -251,7 +251,7 @@ DROP DATABASE database_slave_temp_03; SET sql_log_bin= 1; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # end of 5.0 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_gtid.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_gtid.test new file mode 100644 index 00000000..14988f1b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_gtid.test @@ -0,0 +1,95 @@ +# ==== Purpose ==== +# +# When the slave SQL thread processes transactions, it internally keeps +# track of the starting position of the current transaction. This position +# is used to rewind the position in case the SQL thread is stopped in the +# middle of a transaction, or in case the transaction is re-executed due to +# slave_transaction_retries > 0. +# +# This test verifies that the start of the transaction is correctly updated +# even if the transaction spans multiple relay logs, such that a Gtid_log_event +# is immediately followed by a Rotate_log_event. +# +# ==== Related Bugs and Worklogs ==== +# +# Bug #18652178 STOP SQL_THREAD, START SQL_THREAD +# CAUSES A TRX TO LOG WITH A DIFFERENT GTID +# +--source include/have_binlog_format_statement.inc +--source include/have_innodb.inc +--source include/have_gtid.inc +--source include/master-slave.inc +# Test should run only on debug build +source include/have_debug.inc; +source include/have_debug_sync.inc; + + +--echo # Preparing the relaylog +# +# Create a relaylog on slave containing a relaylog file that finishes with +# an Gtig_log_event and the rest of the group (transaction) is in the +# next relaylog file. +# +# The better way of doing this is disabling slave's auto positioning +# and using a debug point to stop the IO thread right after queuing +# the Gtid_log_event. Because auto positioning is disabled, the IO thread +# will not ask the Gtid_log_event again. +# +--source include/rpl_connection_slave.inc +--source include/stop_slave.inc +# Disabling auto positioning +CHANGE MASTER TO MASTER_AUTO_POSITION=0; +# Make sync includes to rely on position instead of GTIDs +--let $use_gtids= 0 +--source include/start_slave_io.inc + +# Setting the debug point to stop IO thread after queuing Gtid_log_event +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_gtid_log_event'; + +--echo # Create a transaction on the master +--echo # that will have it's GTID and other events in separated relay log files +--source include/rpl_connection_master.inc +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; + +# Wait for IO thread to stop and restarts it to get the rest of the transaction +--source include/rpl_connection_slave.inc +--source include/wait_for_slave_io_to_stop.inc +SET GLOBAL DEBUG=@save_debug; +--source include/start_slave_io.inc + +--echo # Create other transaction on the master +--source include/rpl_connection_master.inc +CREATE TABLE t2 (c1 INT) ENGINE=InnoDB; + +--source include/sync_slave_io_with_master.inc + +--echo # Restart the SQL thread until the beginning of the last relay log file +--source include/rpl_connection_slave.inc +# Disable warnings to avoid logging "UNTIL condtion is not supported ..." on MTS +--disable_warnings +START SLAVE SQL_THREAD UNTIL + RELAY_LOG_FILE= 'slave-relay-bin.000003', + RELAY_LOG_POS= 4; +--enable_warnings +--source include/wait_for_slave_sql_to_stop.inc + +--echo # Restart the SQL thread +--source include/start_slave_sql.inc + +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.inc +# If t1 was replicated to the slave and it's original GTID was skipped +# this test will fail in the rpl_end.inc because the GTID_EXECUTED of the +# master contains a GTID that was sent to the slave (it is in +# Retrieved_Gtid_Set), but wasn't applied by the SQL thread. +--let $assert_cond= "[SHOW TABLES LIKE "t1"]" = "t1" +--let $assert_text= t1 should be replicated +--source include/assert.inc + +--echo # Cleanup +--source include/rpl_connection_master.inc +DROP TABLE t1, t2; +# Make rpl_end.inc to verify GTID_EXECUTED +--let $use_gtids= 1 +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_logs.test index 2fa30d4a..725b68dd 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -77,7 +77,7 @@ create temporary table temp_table (a char(80) not null); insert into temp_table values ("testing temporary tables"); create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $status_items= Master_Log_File, Relay_Master_Log_File; source include/show_slave_status.inc; source include/check_slave_is_running.inc; @@ -100,7 +100,7 @@ flush logs; source include/show_binary_logs.inc; create table t3 select * from temp_table; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --let $query_result= query_get_value(select * from t3, "a", 1) --let $assert_text= Data in t3 should be equal to temp_table @@ -131,7 +131,7 @@ call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIM connection master; #let slave catch up -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; purge master logs to 'master-bin.000002'; source include/show_master_logs.inc; @@ -163,7 +163,7 @@ replace_regex /\.[\\\/]master/master/; purge master logs before (@time_for_purge); source include/show_binary_logs.inc; insert into t2 values (65); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/show_slave_status.inc; source include/check_slave_is_running.inc; @@ -219,7 +219,7 @@ if (`select '$first' like '$last'`) { --die No expected logs rotation } -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --let $query_result= query_get_value(select * from t4, "a", 1) --let $assert_text= Data in t4 should be equal to temp_table @@ -240,7 +240,7 @@ unlock tables; connection master; drop table if exists t1,t2,t3,t4; drop temporary table temp_table; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo End of 4.1 tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test index 7a9568ef..f0925389 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test @@ -40,6 +40,8 @@ insert into t1 set f=repeat('b', 4096); source include/show_binary_logs.inc; SET DEBUG_SYNC = 'now SIGNAL rotated'; +--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE state LIKE 'debug sync point: at_purge_logs_before_date%' +--source include/wait_condition.inc SET DEBUG_SYNC = 'RESET'; # the first connection finally completes its INSERT @@ -47,7 +49,7 @@ connection master; reap; SET DEBUG_SYNC = 'RESET'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # @@ -82,6 +84,8 @@ let $wait_condition= --source include/wait_condition.inc SET DEBUG_SYNC = 'now SIGNAL rotated'; +--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE state LIKE 'debug sync point: at_purge_logs_before_date%' +--source include/wait_condition.inc SET DEBUG_SYNC = 'RESET'; connection master; @@ -89,6 +93,6 @@ reap; SET DEBUG_SYNC = 'RESET'; drop table t1; -sync_slave_with_master; +--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_rotate_row_trans.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_row_trans.test new file mode 100644 index 00000000..fd240a8d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_rotate_row_trans.test @@ -0,0 +1,94 @@ +# ==== Purpose ==== +# +# Verify if the slave SQL thread is avoiding to update position when a Rotate +# event is applied in the middle of a group. +# +# This test will execute two INSERT statements in the master and will use +# a debug sync point in the slave to rotate the relay log (restarting the IO +# thread) after each Write_rows event be queued into the relay log. +# +# The slave SQL thread should not update its position while in the middle of +# the transaction. +# +# After the last stop of the IO thread, the SQL thread will also be stopped. +# +# Both threads will be started to finish the test. +# +# A problematic SQL thread will restart in the middle of the transaction and +# will skip the first INSERT statement. +# +# ==== Related Bugs and Worklogs ==== +# +# Bug #18482854 RPL : ROTATE_LOG_EVENT INCORRECTLY ADVANCES GROUP_RELAY_LOG_POS +# IN A GROUP +# +--source include/have_binlog_format_row.inc +--source include/have_innodb.inc +--source include/not_gtid_enabled.inc +--source include/master-slave.inc +# Test should run only on debug build +source include/have_debug.inc; +source include/have_debug_sync.inc; + +--disable_query_log +call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); +--enable_query_log + +--echo # Initial setup +--source include/rpl_connection_master.inc +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; + +--echo # Sync slave with master and setup debug sync point +--source include/sync_slave_sql_with_master.inc +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,stop_io_after_reading_write_rows_log_event'; + +--echo # Insert the data in the master +--source include/rpl_connection_master.inc + +--let iterations= 2 +--let $inserts= 0 +BEGIN; +while ($inserts < $iterations) +{ + --eval INSERT INTO t1 (c1) VALUES ($inserts) + --inc $inserts +} +COMMIT; + +--echo # Restart the IO thread keeping SQL thread running until last relay log split + +--source include/rpl_connection_slave.inc +--let $restarts= $iterations + +while ($restarts) +{ + --source include/wait_for_slave_io_to_stop.inc + --dec $restarts + if ($restarts) + { + START SLAVE IO_THREAD; + } +} + +--echo # Stop the SQL thread (it should be in the middle of the transaction/group) +--source include/stop_slave_sql.inc + +--echo # Remove the debug point and restart the both threads +SET GLOBAL DEBUG= @save_debug; +--source include/start_slave.inc + +--echo # Do one more insert on master and then sync slave with master +--source include/rpl_connection_master.inc +--eval INSERT INTO t1 (c1) VALUES ($inserts) +--source include/sync_slave_sql_with_master.inc + +--echo # Now compare master and slave's t1 table data +--source include/rpl_connection_master.inc +--let diff_tables= master:t1, slave:t1 +--source include/diff_tables.inc + +--echo # 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_row_4_bytes.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_4_bytes.test index 6130f749..46f12a9f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_4_bytes.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_4_bytes.test @@ -23,12 +23,12 @@ insert into t1 values("GUI"); insert into t2 values("LIL"); insert into t2 values("ABE"); insert into t2 values("ANG"); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use mysqltest1; select * from t1 order by a; select * from t2 order by a; connection master; DROP DATABASE mysqltest1; -sync_slave_with_master; +--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_row_NOW.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_NOW.test index d732c6e6..b733fb93 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_NOW.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_NOW.test @@ -46,7 +46,7 @@ delimiter ;| INSERT INTO mysqltest1.t1 SET n = NULL, a = now(); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -70,6 +70,6 @@ diff_files $MYSQLTEST_VARDIR/tmp/NOW_master.sql $MYSQLTEST_VARDIR/tmp/NOW_slave. --remove_file $MYSQLTEST_VARDIR/tmp/NOW_master.sql --remove_file $MYSQLTEST_VARDIR/tmp/NOW_slave.sql -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.1 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_USER.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_USER.test index 010e0e6e..c3aa0a0e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_USER.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_USER.test @@ -42,7 +42,7 @@ delimiter ;| CALL mysqltest1.p1(); connection master; SELECT * FROM mysqltest1.t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM mysqltest1.t1 ORDER BY a; connection master; @@ -55,7 +55,7 @@ REVOKE ALL ON mysqltest1.* FROM ''@'localhost%'; DROP USER tester@'%'; DROP USER ''@'localhost%'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index 48692960..62a0472d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -25,7 +25,7 @@ CREATE TABLE t2 (a INT, b INT); SHOW TABLES; INSERT INTO t2 VALUES (3,3), (4,4); source include/show_binlog_events.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** SHOW DATABASES; USE test; @@ -37,7 +37,7 @@ connection master; DROP DATABASE test_ignore; USE test; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc USE test; @@ -71,7 +71,7 @@ CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3); --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024; --echo **** On Master **** @@ -79,7 +79,7 @@ connection master; INSERT INTO t1 VALUES (4),(5),(6); --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; --echo **** On Master **** @@ -87,7 +87,7 @@ connection master; INSERT INTO t1 VALUES (7),(8),(9); --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; SET GLOBAL QUERY_CACHE_SIZE=DEFAULT; @@ -101,23 +101,23 @@ DROP TABLE t1; connection master; CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; INSERT INTO t1 VALUES(1,2); SELECT HEX(a),b FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT HEX(a),b FROM t1; connection master; UPDATE t1 SET a=0 WHERE b=2; SELECT HEX(a),b FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT HEX(a),b FROM t1; connection master; DROP TABLE IF EXISTS t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # BUG#22583: RBR between MyISAM and non-MyISAM tables containing a BIT # field does not work @@ -134,7 +134,7 @@ CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB; CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM; CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc ALTER TABLE t1_myisam ENGINE=INNODB; ALTER TABLE t1_innodb ENGINE=MYISAM; ALTER TABLE t2_myisam ENGINE=INNODB; @@ -156,7 +156,7 @@ INSERT INTO t2_innodb VALUES(2, b'1', 8); SELECT k, HEX(a),HEX(b) FROM t2_myisam; SELECT k, HEX(a),HEX(b) FROM t2_innodb; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT k, HEX(a),HEX(b) FROM t1_myisam; SELECT k, HEX(a),HEX(b) FROM t1_innodb; SELECT k, HEX(a),HEX(b) FROM t2_myisam; @@ -173,7 +173,7 @@ SELECT k, HEX(a),HEX(b) FROM t2_myisam; UPDATE t2_innodb SET a=0 WHERE k=2; SELECT k, HEX(a),HEX(b) FROM t2_innodb; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT k, HEX(a),HEX(b) FROM t1_myisam; SELECT k, HEX(a),HEX(b) FROM t1_innodb; SELECT k, HEX(a),HEX(b) FROM t2_myisam; @@ -182,7 +182,7 @@ SELECT k, HEX(a),HEX(b) FROM t2_innodb; --echo **** On Master **** connection master; DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug#27716 multi-update did partially and has not binlogged @@ -213,7 +213,7 @@ connection master; error ER_DUP_ENTRY; UPDATE t2,t1 SET t2.a=t1.a+2; select * from t2 /* must be (3,1), (4,4) */; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t2 /* must be (3,1), (4,4) */; @@ -221,7 +221,7 @@ select * from t2 /* must be (3,1), (4,4) */; connection master; drop table t1,t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#31702: Missing row on slave causes assertion failure under @@ -235,7 +235,7 @@ connection master; CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave')); INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave'); --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc 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 @@ -247,7 +247,7 @@ connection master; UPDATE t1 SET a = 5, b = 'master' WHERE a = 1; SELECT * FROM t1 ORDER BY a; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); disable_query_log; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test index 3ec79ec8..d6f6a478 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test @@ -44,7 +44,7 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), SHOW CREATE TABLE t1; --echo --- On slave -- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; --source include/rpl_multi_engine3.inc @@ -57,7 +57,7 @@ ALTER TABLE t1 MODIFY vc TEXT; SHOW CREATE TABLE t1; --echo --- On slave --- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; # Perform basic operation on master and ensure replicated correctly @@ -90,7 +90,7 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), SHOW CREATE TABLE t1; --echo --- On slave --- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; # Perform basic operation on master and ensure replicated correctly @@ -104,7 +104,7 @@ ALTER TABLE t1 MODIFY vc TEXT; SHOW CREATE TABLE t1; --echo --- On slave --- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; # Perform basic operation on master and ensure replicated correctly @@ -133,7 +133,7 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), SHOW CREATE TABLE t1; --echo --- On slave --- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; --source include/rpl_multi_engine3.inc @@ -145,7 +145,7 @@ ALTER TABLE t1 MODIFY vc TEXT; SHOW CREATE TABLE t1; --echo --- On slave --- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; --source include/rpl_multi_engine3.inc @@ -174,7 +174,7 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), SHOW CREATE TABLE t1; --echo --- On slave --- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; --source include/rpl_multi_engine3.inc @@ -187,7 +187,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); SHOW CREATE TABLE t1; --echo --- On slave --- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; --source include/rpl_multi_engine3.inc @@ -200,7 +200,7 @@ ALTER TABLE t1 MODIFY vc TEXT; SHOW CREATE TABLE t1; --echo --- On slave --- -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE TABLE t1; --source include/rpl_multi_engine3.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_colSize.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_colSize.test index 0442702d..e60cf6d5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_colSize.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_colSize.test @@ -12,7 +12,7 @@ --echo **** Testing WL#3228 changes. **** --echo *** Create "wider" table on slave *** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Check each column type to verify error 1532 fires (BUG#22086) @@ -164,7 +164,7 @@ call mtr.add_suppression("The slave coordinator and worker threads are stopped, --echo *** Cleanup *** connection master; DROP TABLE IF EXISTS t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # END 5.1 Test Case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt-master.opt new file mode 100644 index 00000000..05b781db --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt-master.opt @@ -0,0 +1 @@ +--log-slave-updates --enforce-gtid-consistency=true --gtid-mode=on diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt-slave.opt new file mode 100644 index 00000000..05b781db --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt-slave.opt @@ -0,0 +1 @@ +--log-slave-updates --enforce-gtid-consistency=true --gtid-mode=on diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt.test new file mode 100644 index 00000000..55cb5c6e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corrupt.test @@ -0,0 +1,36 @@ +############################################################################### +# Bug#18542111:ADD A TEST CASE TO TEST THE BINLOG TRANSACTION CACHE SIZE TO +# 32768 +# +# Problem: +# ======== +# When the binlog's IO_CACHE grows up to exact 32768 bytes it +# causes binlog events to get corrupt, if this transaction +# precedes with a transaction whose IO_CACHE size is >32768. +# +# Test: +# ===== +# Create a transaction whose size is 37000 so that the event's size exceeds +# 32768 and its contents are flushed to a file. Following this transaction +# add a second transaction whose cache size is exactly 32768. +# +# During execution of third replace statement no assert should be caused. +# Slave should be in sync with master. +############################################################################### +--source include/have_binlog_format_row.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +--connection master +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a varchar(40000))ENGINE=INNODB; +INSERT INTO t1 VALUES (REPEAT('a',37000)); +INSERT INTO t1 VALUES (REPEAT('b',32552)); +--sync_slave_with_master + +--connection master +--let $diff_tables=master:t1,slave:t1 +--source include/diff_tables.inc +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corruption.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corruption.test index ad3dc39d..e370e950 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corruption.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_corruption.test @@ -22,7 +22,7 @@ --eval INSERT INTO $t1 VALUES (1) --eval INSERT INTO $t2 VALUES (2) ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*"); call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); @@ -48,7 +48,7 @@ SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table"; --connection master --source include/rpl_reset.inc --eval DROP TABLE $t1, $t2 ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ## test #2: assert that ignored tables that may have been mapped ## with the same identifier are skipped, thus no error @@ -67,7 +67,7 @@ SET GLOBAL debug="+d,inject_tblmap_same_id_maps_diff_table"; --eval UPDATE $t1, $t2_ign SET $t1.c1=3, $t2_ign.c1=4 WHERE $t1.c1=1 OR $t2_ign.c1=2 # must not raise error as second table is filtered ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ## test #3: check that BINLOG statements will also raise an @@ -110,7 +110,7 @@ SET GLOBAL debug="-d,inject_tblmap_same_id_maps_diff_table"; --connection master --eval DROP TABLE $t1 --eval DROP TABLE $t2_ign ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SET GLOBAL debug= @save_debug; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_create_select.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_create_select.test new file mode 100644 index 00000000..937b132d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_create_select.test @@ -0,0 +1,29 @@ +# Testing table creations for row-based replication. + +--source include/have_binlog_format_row.inc +--source include/not_gtid_enabled.inc +--source include/master-slave.inc + +--echo # +--echo # BUG#17994219: CREATE TABLE .. SELECT PRODUCES INVALID STRUCTURE, +--echo # BREAKS RBR +--echo # + +connection master; +--echo #After the patch, the display width is set to a default +--echo #value of 21. +CREATE TABLE t1 AS SELECT REPEAT('A', 1000) DIV 1 AS a; +SHOW CREATE TABLE t1; + +CREATE TABLE t2 AS SELECT CONVERT(REPEAT('A', 255) USING UCS2) DIV 1 AS a; +SHOW CREATE TABLE t2; + +--echo #After the patch, no error is reported. +sync_slave_with_master; + +connection master; +DROP TABLE t1; +DROP TABLE t2; + +--source include/rpl_end.inc + diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_create_table.test index ef3c0758..97ca410e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_create_table.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_create_table.test @@ -15,7 +15,7 @@ connection master; # Set the default storage engine to different values on master and # slave. We need to stop the slave for the server variable to take # effect, since the variable is only read on start-up. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --disable_query_log set @storage_engine = @@global.storage_engine; STOP SLAVE; @@ -37,7 +37,7 @@ CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8; --query_vertical SHOW CREATE TABLE t1 --query_vertical SHOW CREATE TABLE t2 --query_vertical SHOW CREATE TABLE t3 -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** --query_vertical SHOW CREATE TABLE t1 --query_vertical SHOW CREATE TABLE t2 @@ -54,7 +54,7 @@ CREATE TABLE t6 (b INT, c INT) SELECT * FROM tt3; SELECT * FROM t5 ORDER BY a,b,c; --query_vertical SHOW CREATE TABLE t6 SELECT * FROM t6 ORDER BY a,b,c; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** --query_vertical SHOW CREATE TABLE t5 SELECT * FROM t5 ORDER BY a,b,c; @@ -77,7 +77,7 @@ INSERT INTO t7 SELECT a,b FROM tt3; SELECT * FROM t7 ORDER BY a,b; # Should be written to the binary log --source include/show_binlog_events.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t7 ORDER BY a,b; --source include/rpl_reset.inc @@ -90,7 +90,7 @@ INSERT INTO t7 SELECT a,b FROM tt4; ROLLBACK; --source include/show_binlog_events.inc SELECT * FROM t7 ORDER BY a,b; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t7 ORDER BY a,b; --source include/rpl_reset.inc @@ -105,14 +105,14 @@ CREATE TEMPORARY TABLE tt7 SELECT 1; --query_vertical SHOW CREATE TABLE t8 --query_vertical SHOW CREATE TABLE t9 --source include/show_binlog_events.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** --query_vertical SHOW CREATE TABLE t8 --query_vertical SHOW CREATE TABLE t9 connection master; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Here we reset the value of the default storage engine STOP SLAVE; --source include/wait_for_slave_to_stop.inc @@ -149,7 +149,7 @@ SELECT * FROM t2 ORDER BY a; SELECT * FROM t3 ORDER BY a; SELECT * FROM t4 ORDER BY a; --source include/show_binlog_events.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW TABLES; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; @@ -159,7 +159,7 @@ SELECT * FROM t4 ORDER BY a; connection master; DROP TABLE IF EXISTS t1,t2,t3,t4; SET AUTOCOMMIT=1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Some tests with temporary tables --source include/rpl_reset.inc @@ -181,12 +181,12 @@ COMMIT; SELECT * FROM t2 ORDER BY a; --source include/show_binlog_events.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; connection master; TRUNCATE TABLE t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/rpl_reset.inc @@ -202,12 +202,12 @@ ROLLBACK; SELECT * FROM t2 ORDER BY a; source include/show_binlog_events.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; connection master; DROP TABLE t1,t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # bug#35762 Failing CREATE-SELECT produces bad binlog in row mode @@ -222,7 +222,7 @@ INSERT INTO t1 VALUES (1),(1); CREATE TABLE t2 (a INT UNIQUE) ENGINE=INNODB SELECT * FROM t1; INSERT INTO t1 VALUES (2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # connection slave; --echo *** the proof of the fix: @@ -231,7 +231,7 @@ SELECT * FROM t1; connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#34707: Row based replication: slave creates table within wrong database @@ -248,11 +248,11 @@ CREATE DATABASE mysqltest1; CREATE TABLE mysqltest1.without_select (f1 BIGINT); CREATE TABLE mysqltest1.with_select AS SELECT 1 AS f1; source include/show_binlog_events.inc; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; DROP DATABASE mysqltest1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#48506: crash in CREATE TABLE <existing_view> IF NOT EXISTS LIKE @@ -270,7 +270,7 @@ CREATE VIEW bug48506_t2 AS SELECT * FROM t4; CREATE VIEW bug48506_t3 AS SELECT t5.c1 AS A, t4.c1 AS B FROM t5, t4; CREATE TABLE bug48506_t4(c1 INT); --disable_warnings -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc DROP VIEW bug48506_t1, bug48506_t2, bug48506_t3; DROP TABLE bug48506_t4; @@ -280,7 +280,7 @@ CREATE TABLE IF NOT EXISTS bug48506_t2 LIKE t7; CREATE TABLE IF NOT EXISTS bug48506_t3 LIKE t7; CREATE TABLE IF NOT EXISTS bug48506_t4 LIKE t7; --enable_warnings -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW TABLES LIKE 'bug48506%'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_drop.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_drop.test index eca2ae0f..69893afc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_drop.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_drop.test @@ -8,14 +8,14 @@ CREATE TABLE t1 (a int); CREATE TABLE t2 (a int); CREATE TEMPORARY TABLE t2 (a int, b int); SHOW TABLES; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** SHOW TABLES; connection master; --echo **** On Master **** DROP TABLE t2; # Dropping the temporary table SHOW TABLES; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** SHOW TABLES; # There should be two tables on the slave @@ -23,7 +23,7 @@ connection master; --echo **** On Master **** CREATE TEMPORARY TABLE t2 (a int, b int); SHOW TABLES; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** SHOW TABLES; connection master; @@ -32,7 +32,7 @@ connection master; DROP TABLE t1,t2; source include/show_binlog_events.inc; SHOW TABLES; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** On Slave **** SHOW TABLES; @@ -40,7 +40,7 @@ SHOW TABLES; --disable_warnings connection master; DROP TABLE IF EXISTS t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --enable_warnings --enable_query_log --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_event_max_size.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_event_max_size.test index 1d2045af..e288abe7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_event_max_size.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_event_max_size.test @@ -1,95 +1,11 @@ # # Bug #49931 and Bug #49932 # This test verifies if the slave I/O thread and slave SQL thread -# will check the bigger one of the values of 'max_allowed_packet' +# will check the bigger one of the values of 'max_allowed_packet' # and 'binlog-row-event-max-size' when reading log event from -# binlog, and the added 'binlog-row-event-max-size' mysqlbinlog +# binlog, and the added 'binlog-row-event-max-size' mysqlbinlog # option works fine. -# - -source include/master-slave.inc; -source include/have_binlog_format_row.inc; - ---let $binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1) ---let $MYSQLD_DATADIR= `select @@datadir` - -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, - data2 LONGBLOB, PRIMARY KEY(a)); - -let $start_pos= query_get_value("SHOW MASTER STATUS", Position, 1); -INSERT INTO t1 (data1, data2) VALUES (repeat('a',1000000), repeat('a', 1000000)); -let $end_pos= query_get_value("SHOW MASTER STATUS", Position, 1); -#FLUSH LOGS; -DELETE FROM t1 WHERE a = 1; ---echo # On master, test the inserted data is deleted -SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; - -let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`; -SET @@global.max_allowed_packet=4194304; -FLUSH LOGS; ---let $prefix=`SELECT UUID()` ---let $binlog_uuid_filename= $MYSQLTEST_VARDIR/tmp/$prefix-bin.log ---copy_file $MYSQLD_DATADIR/$binlog_filename $binlog_uuid_filename ---source include/rpl_reset.inc - ---echo # On master, test the added 'binlog-row-event-max-size' mysqlbinlog option ---echo # works fine and the data is inserted by executing the dumped ROW event ---exec $MYSQL_BINLOG --binlog-row-event-max-size=2097152 --start-position=$start_pos --stop-position=$end_pos $binlog_uuid_filename | $MYSQL test 2>&1 -SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; -eval set @@global.max_allowed_packet= $old_max_allowed_packet; - -INSERT INTO t1 (data1, data2) VALUES (repeat('a',1048576), repeat('a',1048576)); - ---source include/show_binlog_events2.inc - -sync_slave_with_master; ---echo # On slave, test the row event data is replicated when the value of ---echo # the bigger one of max_allowed_packet and binlog_row_event_max_size ---echo # is larger than the required size. -SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 1; - ---echo # On slave, test the row event data is replicated when the value of ---echo # the bigger one of max_allowed_packet and binlog_row_event_max_size ---echo # is equal to the required size. -SELECT LENGTH(data1), LENGTH(data2) FROM t1 WHERE a = 2; - -connection master; -DROP TABLE t1; - -sync_slave_with_master; ---source include/rpl_reset.inc - ---echo # Test it will cause ER_MASTER_FATAL_ERROR_READING_BINLOG when the value ---echo # of the bigger one of max_allowed_packet and binlog_row_event_max_size ---echo # is lower than the the required size. -connection master; - -CREATE TABLE t1 (a int not null auto_increment, data1 LONGBLOB, - data2 LONGBLOB, data3 LONGBLOB, PRIMARY KEY(a)); - ---sync_slave_with_master ---connection master - -INSERT INTO t1 (data1, data2, data3) VALUES (repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet), repeat('a', @@global.max_allowed_packet)); - -SELECT LENGTH(data1), LENGTH(data2), LENGTH(data3) FROM t1 WHERE a = 1; - -drop table t1; -sync_slave_with_master; - -connection slave; -call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log: .*"); -call mtr.add_suppression("Found invalid event in binary log"); -call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); - ---echo ==== clean up ==== - -# clear errno ---source include/stop_slave.inc -RESET SLAVE; -RESET MASTER; +# ---remove_file $binlog_uuid_filename ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_row_event_max_size.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_find_row.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_find_row.test index a3bf31eb..c7c2f56c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_find_row.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_find_row.test @@ -38,12 +38,12 @@ INSERT INTO t VALUES (1,2,4); INSERT INTO t VALUES (4,3,4); DELETE FROM t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # # Case #2: master has key, slave also has one, @@ -55,7 +55,7 @@ DROP TABLE t; CREATE TABLE t (a int, b int, c int, key(b)); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ALTER TABLE t DISABLE KEYS; @@ -65,12 +65,12 @@ INSERT INTO t VALUES (1,2,4); INSERT INTO t VALUES (4,3,4); DELETE FROM t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # # BUG#53889: slaves stops with 1032; handler error HA_ERR_KEY_NOT_FOUND @@ -87,14 +87,14 @@ CREATE TABLE t2 (col4 CHAR(25) DEFAULT NULL, ALTER TABLE t2 ADD INDEX idx1 ( col4 ) , ADD UNIQUE INDEX idx2 ( col5 ); INSERT INTO t2 ( col4 , col2 ) VALUES ( 'Hello', -77 ) ; UPDATE t2 SET col1 = 13 WHERE col2 = -77; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t2, slave:t2 -- source include/diff_tables.inc -- connection master DROP TABLE t2; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # # BUG#53893: RBR: nullable unique key can lead to out-of-sync slave @@ -115,7 +115,7 @@ CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KE INSERT INTO t1(c1,c2) VALUES(1,1); INSERT INTO t1(c1,c2) VALUES(1,2); UPDATE t1 SET c1=1000 WHERE c2=2; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_func001.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_func001.test index 6ff97388..8b0c013e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_func001.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_func001.test @@ -38,7 +38,7 @@ select test.f1(2); select * from test.t1; save_master_pos; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; #show create table test.t1; select * from test.t1; @@ -52,7 +52,7 @@ connection master; DROP FUNCTION test.f1; DROP TABLE test.t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_func002.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_func002.test index 2f4e3fdd..de55e6a7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_func002.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_func002.test @@ -45,7 +45,7 @@ delimiter ;// INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP); #select * from test.t1; #save_master_pos; -#sync_slave_with_master; +#--source include/sync_slave_sql_with_master.inc #connection slave; #select * from test.t1; #connection master; @@ -55,7 +55,7 @@ SET TIMESTAMP=2; INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP); #select * from test.t1; #save_master_pos; -#sync_slave_with_master; +#--source include/sync_slave_sql_with_master.inc #connection slave; #select * from test.t1; #connection master; @@ -65,7 +65,7 @@ SET TIMESTAMP=1; INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP); #select * from test.t1; #save_master_pos; -#sync_slave_with_master; +#--source include/sync_slave_sql_with_master.inc #connection slave; #select * from test.t1; #connection master; @@ -76,7 +76,7 @@ INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP); # We need a sync to ensure that the slave has caught up before # dumping the database. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; #Used for debugging @@ -91,7 +91,7 @@ connection master; DROP FUNCTION test.f1; DROP TABLE test.t1; DROP TABLE test.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # the test will show that the diff statement failed and no reject file # will be created. You will need to go to the mysql-test dir and diff diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan.test index 6c7fad41..83ac6433 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan.test @@ -25,6 +25,7 @@ # -- source include/have_binlog_format_row.inc +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc call mtr.add_suppression("Slave SQL: .*Could not execute Update_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log master-bin.[0-9]*, end_log_pos [0-9]*, Error_code: 1032"); @@ -48,7 +49,7 @@ SET GLOBAL slave_rows_search_algorithms= 'INDEX_SCAN,HASH_SCAN'; -- connection master CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1), (1), (2), (3); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc DELETE FROM t1; # try to change the order of the rows in the engine. @@ -56,7 +57,7 @@ INSERT INTO t1 VALUES (2), (1), (3), (1); -- connection master UPDATE t1 SET a=1000 WHERE a=1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc @@ -64,7 +65,7 @@ UPDATE t1 SET a=1000 WHERE a=1; -- connection master DELETE FROM t1 WHERE a=1000; DELETE FROM t1 WHERE a=2 OR a=3; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc @@ -72,7 +73,7 @@ DELETE FROM t1 WHERE a=2 OR a=3; #cleanup for case#1 --connection master DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- source include/rpl_reset.inc @@ -96,20 +97,20 @@ INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1 SET a=1000 WHERE a=1; SELECT * FROM t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; -- connection master DELETE FROM t1 WHERE a=1000; DELETE FROM t1 WHERE a=2; SELECT * FROM t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; #cleanup for case#2 --connection master DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- source include/rpl_reset.inc @@ -124,7 +125,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1), (1), (2), (3); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc DELETE FROM t1 WHERE a=1; DELETE FROM t1 WHERE a=2; @@ -138,7 +139,7 @@ DELETE FROM t1 WHERE a=2; -- let $slave_sql_errno= 1032 -- source include/wait_for_slave_sql_error_and_skip.inc DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- source include/rpl_reset.inc @@ -153,14 +154,14 @@ CREATE TABLE t1 (a INT, b TINYBLOB); INSERT INTO t1 VALUES (1,'a'), (1, 'b'), (2,'aa'), (2, 'aa'); UPDATE t1 SET b='c' WHERE a=1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc -- connection master UPDATE t1 SET a=10000 WHERE b='aa'; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc @@ -168,7 +169,7 @@ UPDATE t1 SET a=10000 WHERE b='aa'; -- connection master UPDATE t1 SET b='c' WHERE b='aa'; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc @@ -176,7 +177,7 @@ UPDATE t1 SET b='c' WHERE b='aa'; -- connection master DELETE FROM t1 WHERE b='c'; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc @@ -184,7 +185,7 @@ DELETE FROM t1 WHERE b='c'; #cleanup for case#4 --connection master DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- source include/rpl_reset.inc @@ -201,7 +202,7 @@ CREATE TABLE t1 (a TINYBLOB, b TINYBLOB); INSERT INTO t1 VALUES ('a','a'), ('b', 'b'), ('a','aa'), ('a', 'aa'); UPDATE t1 SET b='c' WHERE b='aa'; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc @@ -209,7 +210,7 @@ UPDATE t1 SET b='c' WHERE b='aa'; -- connection master DELETE FROM t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc @@ -218,13 +219,13 @@ DELETE FROM t1; INSERT INTO t1 VALUES (NULL,NULL), (NULL, NULL); DELETE FROM t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables= master:test.t1, slave:test.t1 -- source include/diff_tables.inc #cleanup for case#5 --connection master DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan_sanity.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan_sanity.test index 7a2e0bc4..63b61788 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan_sanity.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan_sanity.test @@ -28,7 +28,7 @@ INSERT INTO t2 VALUES (1); INSERT INTO t3 VALUES (1); INSERT INTO t4 VALUES (1); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SET @saved_slave_rows_search_algorithms= @@global.slave_rows_search_algorithms; ###################### TABLE_SCAN assertions @@ -163,6 +163,44 @@ UPDATE t4 SET c1= 7; -- let $expected_alg= 'INDEX_SCAN' -- source include/rpl_hash_scan_assertion.inc +# Begin of Test cases for Bug#18860225 +# HASH_SCAN SEEMS BROKEN: CAN'T FIND RECORD IN 'T1' ERROR_CODE: 1032 +# Test Case 1: Key type is <Int> +--connection slave +SET @@global.slave_rows_search_algorithms= 'HASH_SCAN'; +--connection master +CREATE TABLE t5(c1 INT, c2 INT, KEY(c2)); +INSERT INTO t5 VALUES (1,1),(2,2),(3,1),(4,NULL),(5,2),(6,3); +DELETE FROM t5 ORDER BY c1; +DROP TABLE t5; +--source include/sync_slave_sql_with_master.inc + +# Test Case 2: Key type is <BigInt> +--connection master +CREATE TABLE t5(c1 BIGINT, c2 BIGINT, KEY(c2)); +INSERT INTO t5 VALUES (1,1),(2,2),(3,1),(4,NULL),(5,2),(6,3); +DELETE FROM t5 ORDER BY c1; +DROP TABLE t5; +--source include/sync_slave_sql_with_master.inc + +# Test Case 3: Key type is <Varchar> +--connection master +CREATE TABLE t5(c1 INT, c2 VARCHAR(20), KEY(c2)); +INSERT INTO t5 VALUES (1,"value1"),(2,"value2"),(3,"value1"),(4,NULL),(5,"value2"),(6,"value3"); +DELETE FROM t5 ORDER BY c1; +DROP TABLE t5; +--source include/sync_slave_sql_with_master.inc + +# Test Case 4: Key is composite key and type is <Int,Varchar> +# and Varchar key having different length values +--connection master +CREATE TABLE t5(c1 INT, c2 INT, c3 VARCHAR(20), KEY(c2,c3)); +INSERT INTO t5 VALUES (1,1,"ab"),(2,2,"cde"),(3,1,"12345"),(4,4,"random"),(5,NULL,NULL),(6,5,NULL),(7,NULL,"lmnopqr"); +DELETE FROM t5 ORDER BY c1; +DROP TABLE t5; +--source include/sync_slave_sql_with_master.inc +# End of Test cases for Bug#18860225 + -- connection slave SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms; @@ -170,7 +208,7 @@ SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms; #clean Up --connection master DROP TABLE IF EXISTS t1, t2, t3, t4; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- source include/rpl_reset.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_ignorable_event.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_ignorable_event.test index 50f164d8..4c43aa7f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_ignorable_event.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_ignorable_event.test @@ -149,7 +149,7 @@ source include/show_binlog_events.inc; --connection slave --source include/start_slave.inc --connection master -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --let $binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1) --echo # Test The Rows_query log event can be relayed. --echo # SHOW BINLOG EVENTS ON SLAVE diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_eng_full.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_eng_full.test index cda5d20c..86086ab8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_eng_full.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_eng_full.test @@ -5,6 +5,7 @@ # -- source include/have_binlog_format_row.inc +-- source include/not_gtid_enabled.inc --let $rpl_topology= 1->2->3 --source include/rpl_init.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_misc.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_misc.test index dace7eed..5dd4e157 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_misc.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_misc.test @@ -9,7 +9,7 @@ CREATE TABLE t0 ( col1 INT NOT NULL, col2 INT ) ENGINE=InnoDB; INSERT INTO t0 (col1,col2) VALUES (4,7),(4,8); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master CREATE TABLE t1 (col3 DECIMAL(35,0) DEFAULT NULL, @@ -23,7 +23,7 @@ SET SESSION BINLOG_ROW_IMAGE = minimal; # This statement would lead to an assert on slave REPLACE INTO t1 ( col1,col2) SELECT col1,col2 FROM t0; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master -- let $diff_tables= master:t0, slave:t0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_sanity.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_sanity.test index d058d510..af60b0fa 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_sanity.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_img_sanity.test @@ -66,7 +66,7 @@ CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1)); -- source include/rpl_row_img_parts_master_slave.inc DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # # Assertions: combines img_types with different index types. @@ -123,7 +123,7 @@ while (`SELECT HEX(@img_types) != HEX('')`) CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1)); } - -- sync_slave_with_master + --source include/sync_slave_sql_with_master.inc -- connection master # Issue some statements @@ -251,7 +251,7 @@ while (`SELECT HEX(@img_types) != HEX('')`) DROP TABLE t; - -- sync_slave_with_master + --source include/sync_slave_sql_with_master.inc -- disable_query_log -- connection master @@ -301,7 +301,7 @@ while (`SELECT HEX(@img_types) != HEX('')`) -- connection master INSERT INTO t VALUES (1); - -- sync_slave_with_master + --source include/sync_slave_sql_with_master.inc -- connection master -- let $row_img_query= UPDATE t SET a=2 WHERE a=1; @@ -319,7 +319,7 @@ while (`SELECT HEX(@img_types) != HEX('')`) -- connection master DROP TABLE IF EXISTS t; - -- sync_slave_with_master + --source include/sync_slave_sql_with_master.inc -- source include/rpl_reset.inc @@ -376,7 +376,7 @@ while (`SELECT HEX(@img_types) != HEX('')`) -- connection master DROP TABLE t; - -- sync_slave_with_master + --source include/sync_slave_sql_with_master.inc -- echo ####### MINIMAL OTHER PARTICULAR SCENARIO ###### @@ -407,7 +407,7 @@ while (`SELECT HEX(@img_types) != HEX('')`) -- connection master DROP TABLE t; - -- sync_slave_with_master + --source include/sync_slave_sql_with_master.inc } if (`SELECT @@binlog_row_image = "NOBLOB"`) @@ -477,7 +477,7 @@ while (`SELECT HEX(@img_types) != HEX('')`) -- connection master DROP TABLE t; - -- sync_slave_with_master + --source include/sync_slave_sql_with_master.inc } @@ -539,7 +539,7 @@ CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1,c3(512))); DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ################################### -- echo # PK (does not contain blob, but blob is updated) @@ -586,7 +586,7 @@ CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1,c2)); -- source include/rpl_row_img_parts_master_slave.inc DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ################################### -- echo # AUTOINC columns @@ -605,7 +605,7 @@ CREATE TABLE t (c1 int NOT NULL AUTO_INCREMENT, c2 int, c3 blob, primary key(c1, -- source include/rpl_row_img_parts_master_slave.inc DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ################################################################## -- echo # Test that slave does not write more columns than the ones it has @@ -636,7 +636,7 @@ CREATE TABLE t (c1 int, c2 int, primary key(c1)); -- source include/rpl_row_img_parts_master_slave.inc DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ################################################################## -- echo # Test that slave fills default columns in its own columns @@ -672,7 +672,7 @@ SELECT * FROM t; SELECT * FROM t; DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ################################################################## -- echo # Test that slave uses partial BI when master contains more columns @@ -709,7 +709,7 @@ SELECT * FROM t; SELECT * FROM t; DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ################################################################## -- echo # Test that if master has binlog_row_image=MINIMAL and slave has @@ -745,7 +745,7 @@ CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, c4 blob, unique key(c1)); -- source include/rpl_row_img_parts_master_slave.inc DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- source include/rpl_reset.inc -- connection master @@ -776,7 +776,7 @@ CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, c4 blob, unique key(c1)); -- source include/rpl_row_img_parts_master_slave.inc DROP TABLE t; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ################################################################ -- echo # Test that the slave stop with error if no usable data is on BI diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test index 53265b49..c95dce08 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test @@ -17,7 +17,7 @@ source include/master-slave.inc; CREATE TABLE t1 (a INT); --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc DROP TABLE t1; --echo ==== Modify table on master ==== diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test index a6c38117..ce579e5e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test @@ -1,4 +1,5 @@ --source include/have_binlog_format_row.inc +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/not_embedded.inc --source include/not_windows.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test index 83a39c90..634bc919 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test @@ -3,6 +3,7 @@ # For details look into extra/rpl_tests/rpl_lower_case_table_names.test # +-- source include/not_gtid_enabled.inc -- source include/have_innodb.inc -- source include/not_windows.inc -- source include/have_binlog_format_row.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_merge_engine.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_merge_engine.test index 5add8dc1..18f93400 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_merge_engine.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_merge_engine.test @@ -23,7 +23,7 @@ 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); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let diff_tables=master:test.t1, slave:test.t1 --source include/diff_tables.inc @@ -35,7 +35,7 @@ ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1); UPDATE t1_merge SET a=10 WHERE a=1; DELETE FROM t1_merge WHERE a=10; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master --let diff_tables=master:test.t1, slave:test.t1 @@ -45,6 +45,6 @@ DELETE FROM t1_merge WHERE a=10; --source include/diff_tables.inc DROP TABLE t1_merge, t1, t2; ---sync_slave_with_master +--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_row_mts_crash_safe.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_mts_crash_safe.test index 2b85b5ed..d2d2fe9f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_mts_crash_safe.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_mts_crash_safe.test @@ -1,4 +1,5 @@ --source include/big_test.inc +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/have_binlog_format_row.inc --source include/have_innodb.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test index 28523472..27442c10 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test @@ -4,6 +4,7 @@ # Purpose: To test changes to mysqlbinlog for row based bin logs # # We are using .opt file since we need small binlog size # ################################################################## +--source include/not_gtid_enabled.inc --source include/big_test.inc # Include Section # Make sure that we have row based bin log diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test index f96603f6..581dcaed 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test @@ -19,14 +19,14 @@ INSERT INTO t1(c1,c2) VALUES (10, b'1'); INSERT INTO t1(c1,c2) VALUES (NULL, b'1'); UPDATE t1 SET c1= 0; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc -- connection master DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- source extra/rpl_tests/rpl_record_compare.test diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test index 654af0a1..29d7482c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test @@ -10,7 +10,7 @@ CREATE TABLE t1 ( i1 int, c1 char(1), key ( i1 )); INSERT IGNORE INTO t1 VALUES (1, 'a'); UPDATE t1 SET c1 = 'b' WHERE i1 = 1; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#40007: Replication failure with RBR + no PK + 2 indexed fields diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test index 7d37c0bb..1911ea87 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test @@ -1,20 +1,5 @@ # BUG#28777 SHOW BINLOG EVENTS does not work on relay log files # -# GOAL -# ==== -# -# Test that SHOW BINLOG EVENTS and the new SHOW RELAYLOG EVENTS works after -# the patch, both on master and slave. -# -# HOW -# === -# -# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after -# some statements have been issued. - --- source include/master-slave.inc --- source include/have_binlog_format_row.inc --- source include/not_mts_slave_parallel_workers.inc --- source extra/rpl_tests/rpl_show_relaylog_events.inc ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_row_show_relaylog_events.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp001.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp001.test index 99db5e7f..dd40a2be 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp001.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp001.test @@ -63,7 +63,7 @@ while ($1) ## Used for debugging #show binlog events; #select * from test.t1; -#sync_slave_with_master; +#--source include/sync_slave_sql_with_master.inc #select * from test.t1; #connection master; @@ -90,26 +90,26 @@ delimiter ;// INSERT INTO test.t2 VALUES(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'); SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; connection master; call test.p2(1); SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; connection master; call test.p2(2); SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; connection master; call test.p2(3); SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY a; ##Used for debugging @@ -127,7 +127,7 @@ DROP PROCEDURE test.p1; DROP PROCEDURE test.p2; DROP TABLE test.t1; DROP TABLE test.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Lets compare. Note: If they match test will pass, if they do not match # the test will show that the diff statement failed and not reject file diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp005.test index bbe4ce47..c03b76a4 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp005.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp005.test @@ -74,7 +74,7 @@ SELECT * FROM test.t2 ORDER BY id2; let $message=< ---- Slave selects-- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY id; SELECT * FROM test.t2 ORDER BY id2; @@ -90,7 +90,7 @@ SELECT * FROM test.t3 ORDER BY id3; let $message=< ---- Slave selects-- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t3 ORDER BY id3; connection master; @@ -106,7 +106,7 @@ DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp008.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp008.test index 8af3c88a..4b9d8939 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp008.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp008.test @@ -41,7 +41,7 @@ SELECT * FROM test.t2; let $message=< ---- Slave selects-- >; --source include/show_msg.inc -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t2; # Cleanup @@ -50,7 +50,7 @@ connection master; DROP PROCEDURE IF EXISTS test.p1; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp009.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp009.test index 6e722659..b575f440 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp009.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp009.test @@ -71,7 +71,7 @@ delimiter ;| CALL test.p1('a'); SELECT * FROM test.t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t2 ORDER BY a; connection master; truncate test.t2; @@ -79,13 +79,13 @@ truncate test.t2; # this next call fails, but should not call test.p1('b'); select * from test.t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t2 ORDER BY a; connection master; truncate test.t2; SELECT * FROM test.t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t2 ORDER BY a; # Cleanup @@ -94,7 +94,7 @@ connection master; DROP PROCEDURE test.p1; DROP TABLE test.t1; DROP TABLE test.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp010.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp010.test index aad7edcd..679942a3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp010.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp010.test @@ -39,7 +39,7 @@ delimiter ;| CALL test.p2(); SELECT * FROM test.t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc show tables; connection master; @@ -59,7 +59,7 @@ delimiter ;| CALL test.p4(); SELECT * FROM test.t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t2 ORDER BY a; # Cleanup @@ -71,7 +71,7 @@ DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p4; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp011.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp011.test index d2a323fa..c5027c79 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp011.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp011.test @@ -76,7 +76,7 @@ delimiter ;| CALL test.p1(); #SELECT * FROM test.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #SELECT * FROM test.t2; --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp011_master.sql @@ -94,7 +94,7 @@ DROP PROCEDURE IF EXISTS test.p6; DROP PROCEDURE IF EXISTS test.p7; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Lets compare. Note: If they match test will pass, if they do not match # the test will show that the diff statement failed and not reject file diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp012.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp012.test index 23bc92b5..e85c5610 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp012.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_sp012.test @@ -36,7 +36,7 @@ GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost; # Need to wait for the rights to be applied at the slave -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $message=<******** Master user1 p3 & p2 calls *******>; --source include/show_msg.inc @@ -69,7 +69,7 @@ DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP USER user1@localhost; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test index 030ec7d6..50aecf4d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test @@ -1,4 +1,4 @@ - +-- source include/not_gtid_enabled.inc -- source include/have_binlog_format_row.inc -- source include/master-slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test index 35eddfc3..4406c04c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test @@ -1,4 +1,4 @@ - +-- source include/not_gtid_enabled.inc -- source include/have_binlog_format_row.inc -- source include/have_innodb.inc -- source include/master-slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test index 688c6ba8..0bd0bd20 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test @@ -32,8 +32,10 @@ -- disable_warnings DROP TABLE IF EXISTS `t1`; --- enable_warnings +# This CREATE TABLE statement issues the warning "Row size too large" when +# the InnoDB page size is 4K. No such warning will come for InnoDB page size +# 16K. Hence disabling the warning for this CREATE TABLE statement. -- echo ### TABLE with field_metadata_size == 290 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, @@ -185,11 +187,13 @@ CREATE TABLE `t1` ( PRIMARY KEY (`c1`) ) ENGINE=InnoDB; +-- enable_warnings + LOCK TABLES `t1` WRITE; INSERT INTO `t1`(c2) VALUES ('1'); FLUSH LOGS; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master -- echo ### assertion: the slave replicated event successfully and tables match @@ -198,7 +202,7 @@ FLUSH LOGS; -- connection master DROP TABLE `t1`; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master -- echo === Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail. @@ -298,11 +302,19 @@ EOF ## we don't need this in the result file ## however, for debugging purposes you ## may want to reactivate query logging + +# The CREATE TABLE statements in 'generated_sql' issues the warning "Row size +# too large" when the InnoDB page size is 4K. No such warning will come for +# InnoDB page size 16K. Hence disabling the warning while executing these +# statement. + +-- disable_warnings -- disable_query_log -- source $generated_sql -- enable_query_log +-- enable_warnings --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master FLUSH LOGS; @@ -318,7 +330,7 @@ while($ntables) -- disable_query_log -- eval DROP TABLE t$ntables -- enable_query_log - -- sync_slave_with_master + --source include/sync_slave_sql_with_master.inc -- connection master -- dec $ntables diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig001.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig001.test index 39f2662b..8f28e56f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig001.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig001.test @@ -52,7 +52,7 @@ END// delimiter ;// # Make sure that all definition have propagated to the slave -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; -- disable_query_log @@ -76,7 +76,7 @@ while ($1) connection master; let $count = `select count(*) from t1`; eval INSERT INTO test.t1 VALUES ($count+1, NOW()); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #show binlog events; #select * from test.t2; @@ -102,7 +102,7 @@ DROP TRIGGER test.t3_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Lets compare. Note: If they match test will pass, if they do not match # the test will show that the diff statement failed and not reject file diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig002.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig002.test index 46f9ad91..5917ead5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig002.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig002.test @@ -39,7 +39,7 @@ INSERT INTO test.t1 VALUES (1, 'example.com'),(2, 'mysql.com'),(3, 'earthmotherw SELECT * FROM test.t1 ORDER BY id; #show binlog events; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY id; connection master; @@ -49,7 +49,7 @@ INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); select * from test.t2; select * from test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from test.t2; select * from test.t3; connection master; @@ -59,7 +59,7 @@ DELETE FROM test.t1 WHERE id = 1; SELECT * FROM test.t1 ORDER BY id; connection master; SELECT * FROM test.t1 ORDER BY id; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY id; # Cleanup @@ -69,7 +69,7 @@ DROP TRIGGER test.t2_ai; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 test case --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig003.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig003.test index 75e6c415..473ebd2e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig003.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trig003.test @@ -120,7 +120,7 @@ DELETE FROM test.t1 WHERE id = 1; DELETE FROM test.t2 WHERE id = 1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # time to dump the databases and so we can see if they match diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test index 394bf949..15141585 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test @@ -12,7 +12,7 @@ #This statement is not binlogged in RBR. CREATE TEMPORARY TABLE t1(c1 INTEGER); CREATE TABLE t2(c1 INTEGER); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc CREATE TABLE t1(c1 INTEGER); INSERT INTO t1 VALUES(1), (2); @@ -23,7 +23,7 @@ SELECT * FROM t2; connection master; TRUNCATE t1; TRUNCATE t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # t1 will have nothing, if 'TRUNCATE t1' has been replicate from master to # slave. SELECT * FROM t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test index 9e6485d6..f071ffbe 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test @@ -24,13 +24,13 @@ INSERT INTO t2 SELECT 2, ROW_COUNT(); #must return 1 and 3 SELECT b FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #must return 1 and 3 SELECT b FROM t2 ORDER BY a; connection master; DROP TABLE t1, t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_until.test index 35936f64..fd2a39ec 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_until.test @@ -1,5 +1,6 @@ -- source include/not_ndb_default.inc -- source include/have_binlog_format_row.inc +--source include/not_gtid_enabled.inc -- source include/master-slave.inc --source include/not_mts_slave_parallel_workers.inc @@ -35,7 +36,7 @@ INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; # Save master log position for query DROP TABLE t2; let $master_pos_drop_t2= query_get_value(SHOW MASTER STATUS, Position, 1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #show binlog events; --source include/stop_slave.inc @@ -76,7 +77,7 @@ SELECT * FROM t1; START SLAVE; --source include/wait_for_slave_to_start.inc connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc # This should stop immediately as we are already there @@ -131,7 +132,7 @@ RESET SLAVE; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave_sql.inc --connection master @@ -157,5 +158,5 @@ INSERT INTO t1 VALUES (3); --source include/start_slave.inc --connection master DROP TABLE t1; ---sync_slave_with_master +--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_row_utf16.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_utf16.test index e3e7a51c..ab327d2b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_utf16.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_utf16.test @@ -13,7 +13,7 @@ INSERT INTO t1 VALUES (); # default value is inserted and encoded correctl -- echo #### ON MASTER --query_vertical SELECT c1, hex(c1) from t1 --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo #### ON SLAVE --query_vertical SELECT c1, hex(c1) FROM t1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_utf32.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_utf32.test index 936d62b0..f9006f2c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_utf32.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_utf32.test @@ -32,7 +32,7 @@ SET SQL_LOG_BIN=1; INSERT INTO t1(c1) VALUES ('insert into t1'); DROP TABLE t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # assertion: the slave woul hit an/several assertions: # before and during slave conversion procedure diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_view01.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_view01.test index cc60ab99..7d39aca3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_view01.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_view01.test @@ -54,7 +54,7 @@ SELECT * FROM mysqltest1.v1; CREATE TABLE mysqltest1.t10 (a INT, PRIMARY KEY(a)); let $wait_binlog_event= CREATE TABLE mysqltest1.t10; -- source include/wait_for_binlog_event.inc ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SELECT * FROM mysqltest1.v2; SELECT * FROM mysqltest1.v1; @@ -65,7 +65,7 @@ INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1; SELECT * FROM mysqltest1.t5 ORDER BY qty; SELECT * FROM mysqltest1.t3 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM mysqltest1.t5 ORDER BY qty; SELECT * FROM mysqltest1.t3 ORDER BY a; connection master; @@ -74,7 +74,7 @@ INSERT INTO mysqltest1.v4 VALUES (4,'TEST'); SELECT * FROM mysqltest1.t1 ORDER BY a; SELECT * FROM mysqltest1.v4 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM mysqltest1.t1 ORDER BY a; SELECT * FROM mysqltest1.v4 ORDER BY a; @@ -91,7 +91,7 @@ DROP TABLE IF EXISTS mysqltest1.t2; DROP TABLE IF EXISTS mysqltest1.t4; DROP TABLE IF EXISTS mysqltest1.t10; DROP DATABASE mysqltest1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.1 test case diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_wide_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_wide_table.test index b1d16133..adfb4e33 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_wide_table.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_wide_table.test @@ -322,7 +322,7 @@ f300 int, insert into t300 set f1= 1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # prove that slave processed the create as well as the insert @@ -333,7 +333,7 @@ select count(*) as one from t300; --echo *** Cleanup *** connection master; DROP TABLE t300; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # END of Test Case diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_previous_gtid_event-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_previous_gtid_event-slave.opt new file mode 100644 index 00000000..ecdb427f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_previous_gtid_event-slave.opt @@ -0,0 +1 @@ +--max_relay_log_size=4096 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_previous_gtid_event.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_previous_gtid_event.test new file mode 100644 index 00000000..359fa7c9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_previous_gtid_event.test @@ -0,0 +1,111 @@ +############################################################################### +# Bug #18622657 SECONDS_BEHIND_MASTER DISTORTED BECAUSE OF +# PREVIOUS_GTID EVENT +# Problem: Previous gtid log event in relay log should not be contributed to +# seconds behind master calculation. +# Steps to reproduce: +# 1) Try all 6 different possible rotations (new relay log files) +# 2) Execute SBM after every previous_gtid_log_event execution from each +# log file and make sure that timestamp is not considered for SBM +# calculation. +############################################################################### +--source include/have_debug_sync.inc +--source include/have_gtid.inc +--let $rpl_skip_start_slave= 1 +--source include/master-slave.inc +--source include/have_binlog_format_statement.inc + +# Set sync debug point to calculate sbm exactly after every +# previous_gtid_log_event. +--connection slave +SET @save_global_debug=@@GLOBAL.DEBUG; +SET @@GLOBAL.DEBUG= '+d,dbug.calculate_sbm_after_previous_gtid_log_event'; + +# To avoid warning MTS +SET @saved_slave_transaction_retries=@@global.slave_transaction_retries; +SET @@global.slave_transaction_retries=0; +# Previous gtid log events are generated at the time of +# relay log is rotated and will be written at the top +# of the relay log. There are few ways in which +# relay log gets rotated. Lets find out SBM after +# Previous_gtid_log_event execution in all those +# of relay logs + +# Case-1 :At the time of server started, a new relaylog +# slave-relay-bin.000001 +--connection slave +--let $slave_datadir=`select @@datadir` + +# Case-2 : Start IO thread , relay log will be rotated to +# slave-relay-bin.000002 +--source include/start_slave_io.inc + +# Case-3 : Restart IO thread, relay log will be rotated to +# slave-relay-bin.000003 +--source include/stop_slave_io.inc +--source include/start_slave_io.inc + +# Case-4 Lets put (more than) 4096 data in binary log and when it +# reaches slave, relaylog will be rotated (please relay-log-file-size +# is set to in .opt file) to slave-relay-bin.000004/ +--connection master +CREATE TABLE t1(i INT); +--let $i=20 +while ($i > 1) +{ +eval INSERT INTO t1 VALUES ($i); +dec $i; +} +DROP TABLE t1; + +# Case-5 (FLUSH LOGS on slave will rotate to relaylog +# slave-relay-bin.000005) +--connection slave +FLUSH LOGS; + +# Case-6 (FLUSH LOGS on master will reach slave and relaylog will be rotated +# at slave, generating two new slave bins slave-relay-bin.000006, +# slave-relay-bin.000007) +--connection master +FLUSH LOGS; +--source include/sync_slave_io_with_master.inc + +##################################### +# # +# Actual testing starts here. # +# # +##################################### + +# Let SQL thread read and execute all 7 slave-relay-bin's +# previous_gtid_log_events and SBM cannot be greater or equal to +# $idle seconds. +--source include/start_slave_sql.inc + +# Just to fake that I/O thread started 3 mints ago, +# the server changes the I/O thread start time to +# now() - 180 seconds (3 mints ago) instead of now() +# using debug point 'calculate_sbm_after_previous_gtid_log_event'. +# But that 3 mints delay should not be seen when +# some one asks for SBM after Previous_gtid_log_event and +# this test script try to test that below. +--let $idle=180 + +--let $i=0 +while ($i < 7) +{ +SET DEBUG_SYNC="now wait_for signal.reached"; + +# Calcualte SBM +let $sbm= query_get_value("SHOW SLAVE STATUS", Seconds_Behind_Master, 1); +--let $assert_text= Seconds Behind Master should be less than $idle seconds. +--let $assert_cond= $sbm < $idle +--source include/assert.inc + +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +--inc $i +} + +# Cleanup +SET @@GLOBAL.DEBUG=@save_global_debug; +SET @@global.slave_transaction_retries=@saved_slave_transaction_retries; +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_seconds_behind_master.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_seconds_behind_master.test index 5d882faa..b787abf5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_seconds_behind_master.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_seconds_behind_master.test @@ -34,7 +34,7 @@ call mtr.add_suppression('Unsafe statement binlogged in statement format since B connection master; create table t1 (f1 int); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; connection master; let $start= `SELECT UNIX_TIMESTAMP()`; @@ -73,7 +73,7 @@ source include/assert.inc; unlock tables; connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc lock table t1 write; connection master; let $start= `SELECT UNIX_TIMESTAMP()`; @@ -112,7 +112,7 @@ source include/assert.inc; unlock tables; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#52166 test case @@ -145,7 +145,7 @@ sync_slave_with_master; # clear at the slave that it must show 0 and not 3600 SET GLOBAL DEBUG= '+d,dec_event_time_by_1_hour'; CREATE TABLE t1 (a INT); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # ok, now wait for the SQL thread to sleep let $wait_timeout= 60; # Override default of 30 seconds with 60. @@ -202,7 +202,7 @@ UNLOCK TABLES; -- connection master DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection master SET @@global.debug= @old_debug; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync.test index 8896b4c8..786eeefa 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -22,7 +22,7 @@ call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); enable_query_log; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # After fix of BUG#45848, semi-sync slave should not create any extra # connections on master, save the count of connections before start @@ -205,7 +205,7 @@ show status like 'Rpl_semi_sync_master_status'; show status like 'Rpl_semi_sync_master_no_tx'; show status like 'Rpl_semi_sync_master_yes_tx'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo [ on slave ]; echo [ slave status after replicated inserts ]; @@ -224,7 +224,7 @@ connection master; echo [ on master ]; SET SESSION AUTOCOMMIT= 0; CREATE TABLE t2(c1 INT) ENGINE=innodb; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; BEGIN; @@ -242,7 +242,7 @@ COMMIT; DROP TABLE t2, t3; SET SESSION AUTOCOMMIT= 1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo # @@ -338,7 +338,7 @@ show status like 'Rpl_semi_sync_master_clients'; --echo # drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo [ on slave ]; source include/stop_slave.inc; @@ -391,7 +391,7 @@ drop table t1; ##show status like 'Rpl_semi_sync_master_status'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --replace_column 2 # show status like 'Rpl_relay%'; @@ -445,7 +445,7 @@ eval create table t1 (a int) engine = $engine_type; insert into t1 values (1); insert into t1 values (2), (3); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo [ on slave ]; select * from t1; @@ -528,7 +528,7 @@ show status like 'Rpl_semi_sync_master_yes_tx'; --echo # # Disable semi-sync on master -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo [ on slave ]; source include/stop_slave.inc; SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; @@ -568,7 +568,7 @@ source include/wait_for_status_var.inc; echo [ master semi-sync clients should be 1, status should be OFF ]; show status like 'Rpl_semi_sync_master_clients'; show status like 'Rpl_semi_sync_master_status'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo [ on slave ]; show status like 'Rpl_semi_sync_slave_status'; @@ -577,6 +577,7 @@ connection slave; source include/stop_slave.inc; connection master; echo [ on master ]; +--source include/stop_dump_threads.inc UNINSTALL PLUGIN rpl_semi_sync_master; enable_query_log; SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled'; @@ -589,7 +590,7 @@ source include/start_slave.inc; connection master; echo [ on master ]; insert into t1 values (10); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo [ on slave ]; SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; @@ -627,26 +628,17 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; --echo # --echo # Clean up --echo # +--source include/uninstall_semisync.inc connection slave; -source include/stop_slave.inc; -UNINSTALL PLUGIN rpl_semi_sync_slave; - -connection master; -# The dump thread may still be running on the master, and so the following -# UNINSTALL could generate a warning about the plugin is busy. -disable_warnings; -UNINSTALL PLUGIN rpl_semi_sync_master; -enable_warnings; - -connection slave; +--source include/stop_slave.inc --replace_column 2 #### change master to master_user='root',master_password=''; source include/start_slave.inc; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; drop user rpl@127.0.0.1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_deadlock.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_deadlock.test index d4577d3a..6fa5823d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_deadlock.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_deadlock.test @@ -23,11 +23,11 @@ while ($i < $n) --enable_result_log --enable_query_log ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master SET GLOBAL debug= 'd,semi_sync_3-way_deadlock'; -SET DEBUG_SYNC= "before_process_commit_stage_queue WAIT_FOR signal.rotate_finished"; +SET DEBUG_SYNC= "before_process_commit_stage_queue WAIT_FOR signal.rotate_finished no_clear_event"; --echo # Build 10 connections to master server --disable_query_log @@ -96,7 +96,7 @@ while ($i < $n) --enable_query_log SET DEBUG_SYNC= 'RESET'; SET @@GLOBAL.DEBUG= @debug_save; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/uninstall_semisync.inc --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_event.test index bf622790..0e322ee9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_event.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_event.test @@ -108,5 +108,5 @@ connection master; DROP EVENT ev1; DROP EVENT ev2; DROP TABLE t1; -sync_slave_with_master; +--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_semi_sync_future_logpos-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos-master.opt new file mode 100644 index 00000000..58029d28 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos-slave.opt new file mode 100644 index 00000000..58029d28 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos-slave.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos.test new file mode 100644 index 00000000..d489c77f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_future_logpos.test @@ -0,0 +1,66 @@ +############################################################################### +# Bug#17453826:ASSERSION ERROR WHEN SETTING FUTURE BINLOG FILE/POS WITH +# SEMISYNC +# +# Problem: +# ======== +# When DMLs are in progress on the master, stopping a slave and setting ahead +# binlog name/pos will cause an asssert on the master. +# +# Test: +# ===== +# Do DMLs on the master and on the slave do a stop slave. Execute change master +# to a future binlog file name and position which doesn't exist. Master should +# not assert. +############################################################################### +--source include/have_semisync_plugin.inc +--source include/master-slave.inc +--source include/install_semisync.inc + +call mtr.add_suppression("Timeout waiting for reply of binlog*"); +call mtr.add_suppression("Read semi-sync reply network error"); + +--source include/rpl_connection_master.inc +CREATE TABLE t1 (a INT); +--let $binlog_pos= query_get_value("SHOW MASTER STATUS", Position, 1) +--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1) +--source include/sync_slave_sql_with_master.inc +--source include/stop_slave.inc + +--source include/rpl_connection_master.inc +--send INSERT INTO t1 VALUES(0) + +--source include/rpl_connection_master1.inc +--let $status_var= rpl_semi_sync_master_wait_sessions +--let $status_var_value= 1 +--source include/wait_for_status_var.inc + +--source include/rpl_connection_slave.inc +CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000002', MASTER_LOG_POS=4, MASTER_AUTO_POSITION=0; +START SLAVE; +--let $slave_io_errno=1236 +--source include/wait_for_slave_io_error.inc + +--source include/rpl_connection_master.inc +--reap +INSERT INTO t1 VALUES (20); + +# Since dump thread has exited and no slaves are connected, master_clients +# must be zero. +--source include/rpl_connection_master.inc +--let $master_clients=[show status like "Rpl_semi_sync_master_clients", Value, 1] +--let assert_cond= $master_clients = 0 +--let assert_text= semi sync master clients should be 0. +--source include/assert.inc + +--source include/rpl_connection_slave.inc +--source include/stop_slave.inc +--replace_regex /MASTER_LOG_FILE=[^,]+/MASTER_LOG_FILE=FILE/ /MASTER_LOG_POS=[0-9]+/ MASTER_LOG_POS= POS/ +eval CHANGE MASTER TO MASTER_LOG_FILE='$master_binlog', MASTER_LOG_POS=$binlog_pos, MASTER_AUTO_POSITION=0; +--source include/start_slave.inc + +--source include/rpl_connection_master.inc +DROP TABLE t1; +--source include/sync_slave_sql_with_master.inc +--source include/uninstall_semisync.inc +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang-master.opt new file mode 100644 index 00000000..58029d28 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang-slave.opt new file mode 100644 index 00000000..58029d28 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang-slave.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang.test new file mode 100644 index 00000000..c632ee1b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_shutdown_hang.test @@ -0,0 +1,64 @@ +############################################################################### +# Bug#17879675:SHUTDOWN HANG IF SEMISYNC IS ENABLED AND SLAVE ABORT +# +# Problem: +# ======== +# Step 1. enable semisync and set a big value for +# rpl_semi_sync_master_timeout. +# +# Step 2. kill io thread of slave, so the threads on master will keep on +# WAITING ACK FROM SLAVE. +# +# Step 3.shutdown the master ---hang +# +# Test: +# ===== +# Stop IO thread and execute a transaction on master. The transaction thread +# will wait for an ack as IO thread is stopped. Now shutdown the master the +# shutdown should not hang. Shutdown should stop the dump thread and the +# dump thread should wakeup the waiting transaction thread and switch off +# semisync as there are no active slaves connected to the server. +############################################################################### +--source include/have_semisync_plugin.inc +--source include/master-slave.inc +--source include/install_semisync.inc +# Test script is independent of binlog format. +--source include/have_binlog_format_mixed.inc + +call mtr.add_suppression("Read semi-sync reply network error"); +call mtr.add_suppression("SEMISYNC: Forced shutdown. Some updates might not be replicated."); + +--source include/rpl_connection_master.inc +SET GLOBAL rpl_semi_sync_master_timeout = 10000000; + +--source include/rpl_connection_slave.inc +--source include/stop_slave_io.inc + +--source include/rpl_connection_master.inc +--send CREATE TABLE t(f INT) ENGINE=INNODB; + +--source include/rpl_connection_master1.inc +--let $status_var= rpl_semi_sync_master_wait_sessions +--let $status_var_value= 1 +--source include/wait_for_status_var.inc + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--disable_result_log +--replace_regex /.*mysqladmin.*: /mysqladmin: / +--exec $MYSQLADMIN -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT shutdown 2>&1 +--enable_result_log + +--source include/rpl_connection_master.inc +--reap +--let $rpl_server_number=1 +--source include/rpl_start_server.inc + +--source include/rpl_connection_slave.inc +--source include/start_slave_io.inc + +--source include/rpl_connection_master.inc +DROP TABLE t; +--source include/sync_slave_sql_with_master.inc + +--source include/uninstall_semisync.inc +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin-master.opt new file mode 100644 index 00000000..58029d28 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin-master.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin-slave.opt new file mode 100644 index 00000000..58029d28 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin-slave.opt @@ -0,0 +1 @@ +$SEMISYNC_PLUGIN_OPT diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test new file mode 100644 index 00000000..8fff6747 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test @@ -0,0 +1,145 @@ +############################################################################### +# Bug#17638477 UNINSTALL AND INSTALL SEMI-SYNC PLUGIN CAUSES SLAVES TO BREAK +# Problem: Uninstallation of Semi sync plugin should be blocked when it is +# in use. +# Test case: Uninstallation of semi sync should be allowed +# On Master: +# 1) When there is no dump thread +# 2) When there are no semi sync slaves (i.e., async replication). +# On Slave: +# 1) When there is no I/O thread +# 2) When there are no semi sync enabled I/O thread (i.e.,async replication). +############################################################################### + +--source include/have_semisync_plugin.inc +--source include/not_embedded.inc +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc + +############################################################################### +# Case 1: Uninstallation of semi sync plugins should be allowed when it is +# not in use i.e., when asynchronous replication is active. +############################################################################### +# Step 1.1: Install semi sync master plugin on master +--replace_result $SEMISYNC_MASTER_PLUGIN SEMISYNC_MASTER_PLUGIN +eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; + +# Step 1.2: Install semi sync slave plugin on slave +--connection slave +--replace_result $SEMISYNC_SLAVE_PLUGIN SEMISYNC_SLAVE_PLUGIN +eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; + +# Step 1.3: Uninstallation of semisync plugin on master and slave should be +# allowed at this state as there is no semi sync replication enabled between +# master and slave. +UNINSTALL PLUGIN rpl_semi_sync_slave; +--connection master +UNINSTALL PLUGIN rpl_semi_sync_master; + +# Step 1.4: Check that replication is working fine at the end of the test case. +CREATE TABLE t1(i int); +INSERT INTO t1 values (1); +DROP TABLE t1; +--sync_slave_with_master + +############################################################################### +# Case 2: Uninstallation of semi sync plugins should be disallowed +# when it is in use i.e., when semi sync replication is active +############################################################################### +# Step 2.1: Install and enable semi sync replication between master and slave +--source include/install_semisync.inc + +# Step 2.2: Check that rpl_semi_sync_slave uninstallation on Slave is not +# possible at this state +--connection slave +call mtr.add_suppression("Plugin 'rpl_semi_sync_slave' cannot be uninstalled now"); +--error ER_PLUGIN_CANNOT_BE_UNINSTALLED +UNINSTALL PLUGIN rpl_semi_sync_slave; + +# Step 2.3: Check that rpl_semi_sync_master uninstallation on Master is not +# possible at this state +--connection master +call mtr.add_suppression("Plugin 'rpl_semi_sync_master' cannot be uninstalled now"); +--error ER_PLUGIN_CANNOT_BE_UNINSTALLED +UNINSTALL PLUGIN rpl_semi_sync_master; + +# Step 2.4: Check that replication is working fine at the end of the test case. +CREATE TABLE t1(i int); +INSERT INTO t1 values (2); +DROP TABLE t1; +--sync_slave_with_master + +# Step 2.5: Make sure rpl_semi_sync_master_status on Master and +# rpl_semi_sync_slave_staus on Slave are ON +--let $slave_status=[show status like "Rpl_semi_sync_slave_status", Value, 1] +--let assert_cond= "$slave_status" = "ON" +--let assert_text= semi sync slave status should be ON. +--source include/assert.inc + +--connection master +--let $master_status=[show status like "Rpl_semi_sync_master_status", Value, 1] +--let assert_cond= "$master_status" = "ON" +--let assert_text= semi sync master status should be ON. +--source include/assert.inc + +--let $master_clients=[show status like "Rpl_semi_sync_master_clients", Value, 1] +--let assert_cond= $master_clients = 1 +--let assert_text= semi sync master clients should be 1. +--source include/assert.inc + +############################################################################### +# Case 3: Uninstallation of semi sync plugin should be disallowed when there +# are semi sync slaves even though rpl_semi_sync_master_enabled= OFF;. +############################################################################### +# Step 3.1: Disable semi sync on master +--connection master +SET GLOBAL rpl_semi_sync_master_enabled = OFF; + +# Step 3.2: Check that still Rpl_semi_sync_master_clients is 1 +--let $master_clients=[show status like "Rpl_semi_sync_master_clients", Value, 1] +--let assert_cond= $master_clients = 1 +--let assert_text= semi sync master clients should be 1. +--source include/assert.inc + +# Step 3.3: Since Rpl_semi_sync_master_clients is 1, uninstallation of +# rpl_semi_sync_master should be disallowed. +--error ER_PLUGIN_CANNOT_BE_UNINSTALLED +UNINSTALL PLUGIN rpl_semi_sync_master; + +############################################################################### +# Case 4: Uninstallation of semi sync plugin should be allowed when it is not +# in use. Same as Case 1 but this case is to check the case after enabling and +# disabling semi sync replication. +############################################################################### + +# Step 4.1: Stop IO thread on slave. +--connection slave +--source include/stop_slave.inc + +# Step 4.2: Disable semi sync on slave. +SET GLOBAL rpl_semi_sync_slave_enabled = OFF; + +# Step 4.3: Start IO thread on slave. +--source include/start_slave.inc + +# Step 4.4: Uninstall semi sync plugin, it should be successful now. +UNINSTALL PLUGIN rpl_semi_sync_slave; + +# Step 4.5: On Master, check that semi sync slaves are now '0'. +--connection master +--let $master_clients=[show status like "Rpl_semi_sync_master_clients", Value, 1] +--let assert_cond= $master_clients = 0 +--let assert_text= semi sync master clients should be 0. +--source include/assert.inc + +# Step 4.6: So uninstalling semi sync plugin should be allowed +UNINSTALL PLUGIN rpl_semi_sync_master; + +# Step 4.7: Check that replication is working fine at the end of the test case +CREATE TABLE t1(i int); +INSERT INTO t1 values (3); +DROP TABLE t1; +--sync_slave_with_master + +# Cleanup +source include/rpl_end.inc; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2-master.opt new file mode 100644 index 00000000..c4aff57c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2-master.opt @@ -0,0 +1 @@ +--gtid-mode=off diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt index 30288952..57f8b73a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt @@ -1 +1 @@ ---disable-log-slave-updates --replicate-same-server-id +--disable-log-slave-updates --replicate-same-server-id --gtid-mode=off diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2.test index c82cab1a..2c19cfdf 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id2.test @@ -1,6 +1,6 @@ # This test checks that a slave DOES execute queries originating # from itself, if running with --replicate-same-server-id. - +source include/not_gtid_enabled.inc; source include/master-slave.inc; connection slave; create table t1 (n int); @@ -63,7 +63,7 @@ start slave sql_thread; connection master; drop table t1; drop table t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore-master.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore-master.opt new file mode 100644 index 00000000..c4aff57c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore-master.opt @@ -0,0 +1 @@ +--gtid-mode=off diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt index 30288952..57f8b73a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore-slave.opt @@ -1 +1 @@ ---disable-log-slave-updates --replicate-same-server-id +--disable-log-slave-updates --replicate-same-server-id --gtid-mode=off diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore.test index 862ff48d..41dcdc48 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_id_ignore.test @@ -58,7 +58,7 @@ start slave; connection master; #connection slave; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $slave_relay_pos0= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1); connection master; @@ -103,7 +103,7 @@ start slave; connection master; #connection slave; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo *** must have caught create table *** show tables; @@ -111,7 +111,7 @@ show tables; connection master; drop table t1; #connection slave -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo end of the tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.cnf b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.cnf index 61e357b2..c7130d13 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.cnf +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.cnf @@ -1,7 +1,16 @@ !include ../my.cnf +[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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.test index 6332b57e..d31b6c2a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_server_uuid.test @@ -18,7 +18,7 @@ call mtr.add_suppression("Slave I/O thread .* register on master"); call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*"); CALL mtr.add_suppression(".*master and slave have equal MySQL server UUIDs.*"); -CALL mtr.add_suppression("Master's UUID has changed, its old UUID is.*"); +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"); @@ -26,7 +26,7 @@ CALL mtr.add_suppression("Notifying master by SET @master_binlog_checksum= @@glo --let $master_datadir=`SELECT @@DATADIR` # Sync suppressions -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --let $slave_datadir=`SELECT @@DATADIR` connection server_3; @@ -119,7 +119,8 @@ eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1', --source include/check_slave_no_error.inc connection master; -sync_slave_with_master server_3; +--let $sync_slave_connection= server_3 +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc connection master; @@ -235,4 +236,66 @@ RESET SLAVE; eval CHANGE MASTER TO MASTER_LOG_FILE= '$old_master_log_file', MASTER_LOG_POS= $old_master_log_pos; --source include/start_slave.inc + +--echo +--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 ----------------------------------------------------------------------------- + +# Step-1: Copy server 2(S1)'s auto.cnf into server 3 (S2)'s data directory. +--connection server_2 +--let $datadir2=`select @@datadir` +-- connection server_3 +--let $datadir3=`select @@datadir` +--copy_file $datadir3/auto.cnf $datadir3/auto_backup.cnf +--remove_file $datadir3/auto.cnf +--copy_file $datadir2/auto.cnf $datadir3/auto.cnf + +# Step-2: Restart the server(two servers with the same UUID) +--let $rpl_server_number= 3 +--source include/rpl_restart_server.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 + +--connection server_1 +--let $sync_slave_connection= server_3 +--source include/sync_slave_sql_with_master.inc + +# 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 + +--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 + +# Cleanup (restore the server 3's auto.cnf back to proper one and restart) +--remove_file $datadir3/auto.cnf +--copy_file $datadir3/auto_backup.cnf $datadir3/auto.cnf +--remove_file $datadir3/auto_backup.cnf +--let $rpl_server_number= 3 +--source include/rpl_restart_server.inc +--source include/stop_slave.inc --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_session_var.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_session_var.test index cf3faa65..f8105a31 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_session_var.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_session_var.test @@ -14,7 +14,7 @@ insert into t1 values('My'||'SQL', 1); set @@session.sql_mode=default; insert into t1 values('1'||'2', 2); select * from t1 where b<3 order by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 where b<3 order by a; connection master; # if the slave does the next sync_with_master fine, then it means it accepts the @@ -34,11 +34,11 @@ set @@session.sql_auto_is_null=0; insert into t1 values(null); insert into t2 select 2,a from t1 where a is null; select * from t2 order by b; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t2 order by b; connection master; drop table t1,t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug #29878 Garbage data generation when executing SESSION_USER() on a slave. @@ -53,7 +53,7 @@ CREATE TABLE t1 ( --disable_warnings INSERT INTO t1(data) VALUES(SESSION_USER()); --enable_warnings -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT length(data) < 100 FROM t1; connection master; drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_set_charset.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_set_charset.test index 296e5dfb..2b8fd0ff 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_set_charset.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_set_charset.test @@ -20,13 +20,13 @@ INSERT INTO t1 VALUES (' INSERT INTO t1 VALUES ('ðñòóôõö÷øùúûüýþÿ','F0'); select "--- on master ---"; select hex(a),b from t1 order by b; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use mysqltest1; select "--- on slave ---"; select hex(a),b from t1 order by b; connection master; drop database mysqltest1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_errors.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_errors.test index c8be61a1..fd77aa7a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_errors.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_errors.test @@ -16,7 +16,7 @@ -- connection master CREATE TABLE t1 (a INT, b blob, PRIMARY KEY(b(512))); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # action: remove table on the slave to force SQL error DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_slave_running.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_slave_running.test index 2f4e55e3..613c618e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_slave_running.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_slave_running.test @@ -83,7 +83,7 @@ connection master; # Hence, before a client thread set @@global.debug we have to ensure that: # (a) the slave threads are stopped, or (b) the slave threads are in # sync and waiting. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc eval set global debug= '$debug_saved'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_slave_status_deadlock.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_slave_status_deadlock.test new file mode 100644 index 00000000..c8d7c075 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_show_slave_status_deadlock.test @@ -0,0 +1,69 @@ +############################################################################### +# Bug#19843808: DEADLOCK ON FLUSH TABLES WITH READ LOCK + SHOW +# SLAVE STATUS +# +# Problem: +# ======== +# If a client thread on an slave does FLUSH TABLES WITH READ +# LOCK; then master does some updates, SHOW SLAVE STATUS in +# the same client will be blocked. +# +# Test: +# ===== +# Execute a DML on master and make it blocked on slave after entering commit. +# Execute FLUSH TABLES WITH READ LOCK on slave. Allow the blocked DML to +# continue. The sql thread will be blocked in a state where it has acquired +# rli->data_lock and it is waiting for MDL COMMIT lock. Now execute show slave +# status command from the same client where FLUSH TABLES WITH READ LOCK was +# issued. The show slave status command should not be blocked. +############################################################################### +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc + +--echo # Let master and slave synced with t1 table created +CREATE TABLE t1 (f INT) ENGINE= INNODB; +--source include/sync_slave_sql_with_master.inc + +--echo # Setup GLOBAL.DEBUG at slave to reach commit +--source include/rpl_connection_slave.inc +--let $debug_saved= `SELECT @@GLOBAL.DEBUG` +SET @@GLOBAL.DEBUG= '+d,dbug.reached_commit'; + +--echo # Do some DML operation on master so that it will be blocked on +--echo # slave as global read lock is in place. +--source include/rpl_connection_master.inc +INSERT INTO t1 VALUES (10); + +--echo # Issue FLUSH TABLES WITH READ LOCK after Reached is signaled +--source include/rpl_connection_slave.inc +SET DEBUG_SYNC='now WAIT_FOR Reached'; +FLUSH TABLES WITH READ LOCK; +--echo # Let sql thread continue to try to obtain commit lock +SET DEBUG_SYNC= 'now SIGNAL signal.commit_continue'; + +--echo # Wait until sql thread enters "Waiting for commit lock" state +let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist + WHERE state = "Waiting for commit lock"; +--source include/wait_condition.inc + +--source include/rpl_connection_slave.inc +--disable_result_log +query_vertical SHOW SLAVE STATUS; +--enable_result_log +UNLOCK TABLES; +SET @@GLOBAL.DEBUG= '$debug_saved'; + +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.inc + +let $diff_tables= master:t1, slave:t1; +source include/diff_tables.inc; + +--source include/rpl_connection_master.inc +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_skip_error.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_error.test index 82d6e61a..a1c60d4d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_error.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_error.test @@ -32,7 +32,7 @@ source include/have_innodb.inc; create table t1 (n int not null primary key); --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc insert into t1 values (1); --echo [on master] @@ -42,7 +42,7 @@ insert into t1 values (1); # These should work fine insert into t1 values (2),(3); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo [on slave] select * from t1 order by n; @@ -53,14 +53,14 @@ connection master; set sql_mode=strict_trans_tables; insert into t1 values (7), (8), (9); --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 order by n; source include/check_slave_is_running.inc; --echo ==== Clean Up ==== connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests # @@ -76,7 +76,7 @@ set sql_mode=strict_trans_tables; insert into t1 values (1), (2), (3); --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; source include/check_slave_is_running.inc; @@ -85,7 +85,7 @@ source include/check_slave_is_running.inc; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 5.0 tests # @@ -119,7 +119,7 @@ DELETE FROM t1 WHERE id = 4; SET SQL_LOG_BIN=1; UPDATE t1 SET id= id + 3, data = 2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); echo $error; @@ -153,7 +153,7 @@ DELETE FROM t2 WHERE id = 5; SET SQL_LOG_BIN=1; UPDATE t2 SET id= id + 3, data = 2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); echo $error; @@ -168,5 +168,5 @@ connection master; DROP TABLE t1; DROP TABLE t2; -sync_slave_with_master; +--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_skip_incident.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_incident.test index 959fde93..684c76f1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_incident.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_incident.test @@ -11,7 +11,7 @@ SELECT * FROM t1; # log before the replace statement. REPLACE INTO t1 VALUES (4); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # Now, we should have inserted the row into the table and the slave # should be running. We should also have rotated to a new binary log. @@ -24,5 +24,5 @@ connection master; --echo Should have two binary logs here --source include/show_binary_logs.inc DROP TABLE t1; ---sync_slave_with_master +--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_skip_slave_err_warnings-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_slave_err_warnings-slave.opt new file mode 100644 index 00000000..cdafabe7 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_slave_err_warnings-slave.opt @@ -0,0 +1 @@ +--no-console --log-warnings=2 --slave-skip-errors=all --log_error=$MYSQLTEST_VARDIR/tmp/slave.err --slave_transaction_retries=0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_slave_err_warnings.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_slave_err_warnings.test new file mode 100644 index 00000000..430df1e1 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_skip_slave_err_warnings.test @@ -0,0 +1,38 @@ +############################################################################### +# Bug:#17581990:SLAVE SQL: COULD NOT EXECUTE QUERY EVENT. DETAILED ERROR: ;, +# ERROR_CODE: 0 +# +# Problem: +# ======== +# Setting slave-skip-errors=all on the slave will make mysql slave +# error log to grow continuously with the following warnings. +# +# [Warning] Slave SQL: Could not execute Query event. +# Detailed error: ;, Error_code: 0 +# +# Test: +# ===== +# Set up master slave replication. Set "slave-skip-errors=all" on the slve. +# Execute simple statments on master which does not cause any error on slave. +# Check that no warning should be generated on slave. +############################################################################### +--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 + +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +INSERT INTO test.t1 VALUES (100); +DROP TABLE t1; +--source include/sync_slave_sql_with_master.inc + +# Script produces different warning when executed along with MTS, hence added +# a generic replace regular expression. +--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=Could not execute Query event. +--source extra/rpl_tests/grep_pattern.inc +--remove_file $GREP_FILE + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test index 8c936447..042d57a9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test @@ -51,7 +51,7 @@ DELIMITER ;| INSERT INTO t3 VALUES(1, 'AA'); INSERT INTO t2 VALUES(1, 'AA'); INSERT INTO t1 VALUES(1, 'AA'); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc RENAME TABLE t3 TO t3_bak; @@ -101,7 +101,7 @@ RENAME TABLE t3_bak TO t3; TRUNCATE t1; TRUNCATE t2; TRUNCATE t3; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo @@ -113,7 +113,7 @@ TRUNCATE t3; ALTER TABLE t1 ADD PRIMARY KEY (a); ALTER TABLE t2 ADD PRIMARY KEY (a); ALTER TABLE t3 ADD PRIMARY KEY (a); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc RENAME TABLE t3 TO t3_bak; --connection master @@ -157,7 +157,7 @@ RENAME TABLE t3_bak TO t3; TRUNCATE t1; TRUNCATE t2; TRUNCATE t3; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo @@ -169,7 +169,7 @@ TRUNCATE t3; ALTER TABLE t1 ENGINE=InnoDB; ALTER TABLE t2 ENGINE=InnoDB; ALTER TABLE t3 ENGINE=InnoDB; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection slave RENAME TABLE t3 TO t3_bak; @@ -215,7 +215,7 @@ source include/start_slave.inc; --echo *** Clean up *** --connection master DROP TABLE t1,t2,t3; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # End of 5.1 test --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_load_in.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_load_in.test index 80a27479..4a642669 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_load_in.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_load_in.test @@ -29,7 +29,7 @@ commit; ########################################################################## # Checking Consistency ########################################################################## -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; @@ -45,5 +45,5 @@ connection master; drop table t1; drop table t2; -sync_slave_with_master; +--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_slave_skip.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_skip.test index 67069fad..3d4aa217 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_skip.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_skip.test @@ -3,6 +3,7 @@ # both statement and row events. Hence, we only need to execute this # test for MIXED mode. source include/have_binlog_format_mixed.inc; +-- source include/not_gtid_enabled.inc # UNTIL is not supported yet (TODO: support and remove the guard) -- source include/not_mts_slave_parallel_workers.inc @@ -84,7 +85,7 @@ sync_with_master; --echo **** On Master **** connection master; DROP TABLE t1, t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # More tests for BUG#28618 @@ -123,7 +124,7 @@ END| DELIMITER ;| --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; --echo **** On Master **** @@ -154,7 +155,7 @@ SELECT * FROM t3 ORDER BY a; connection master; DROP TABLE t1, t2, t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** Case 2: Row binlog format and transactional tables **** @@ -168,7 +169,7 @@ CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb; CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; --echo *** On Master *** @@ -274,7 +275,7 @@ SELECT * FROM t6 ORDER BY a; connection master; DROP TABLE t4, t5, t6; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo **** Case 3: Statement logging format and LOAD DATA with non-transactional table **** @@ -286,7 +287,7 @@ connection master; CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam; --echo *** On Slave *** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; --echo *** On Master *** @@ -310,6 +311,6 @@ SELECT * FROM t10 ORDER BY a; connection master; DROP TABLE t10; -sync_slave_with_master; +--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_slave_status.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_status.test index 01eef4b5..4f7c3d6b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_status.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slave_status.test @@ -26,7 +26,7 @@ connection master; GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl'; --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; --replace_column 2 #### CHANGE MASTER TO master_user='rpl', master_password='rpl'; @@ -38,7 +38,7 @@ connection master; CREATE TABLE t1 (n INT); INSERT INTO t1 VALUES (1); --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; --echo ==== Delete new replication user ==== @@ -48,7 +48,7 @@ DROP USER rpl@127.0.0.1; FLUSH PRIVILEGES; --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo ==== Restart slave without privileges ===== # (slave.err will contain access denied error for this START SLAVE command) diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slow_query_log.test index b6e388c8..0422e873 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slow_query_log.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_slow_query_log.test @@ -62,7 +62,7 @@ eval $fast_query; --disable_warnings eval $slow_query; --enable_warnings -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $found_fast_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$fast_query'`; let $found_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; @@ -180,7 +180,7 @@ SET GLOBAL slow_query_log= @old_slow_query_log; connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; @@ -230,7 +230,7 @@ CREATE TABLE t1 (a int, b int); -- enable_warnings let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; if ($master_slow_query != $slave_slow_query) @@ -273,7 +273,7 @@ ALTER TABLE t1 ADD INDEX id1(a); -- enable_warnings let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; if ($master_slow_query != $slave_slow_query) @@ -314,7 +314,7 @@ TRUNCATE mysql.slow_log; -- eval $slow_query; --enable_warnings --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection slave let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; @@ -332,7 +332,7 @@ SET @@global.log_slow_slave_statements = on; -- eval $slow_query; --enable_warnings --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- connection slave let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; @@ -347,7 +347,7 @@ SET @@global.log_output= @old_log_output; SET @@global.long_query_time= @old_long_query_time; DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SET @@global.log_output= @old_log_output; SET @@global.long_query_time= @old_long_query_time; SET @@global.log_slow_slave_statements= @old_log_slow_slave_statements; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp.test index 200f8698..29154e98 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp.test @@ -15,7 +15,7 @@ drop database if exists mysqltest1; create database mysqltest1; use mysqltest1; create table t1 (a varchar(100)); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use mysqltest1; # ********************** PART 1 : STORED PROCEDURES *************** @@ -46,7 +46,7 @@ delimiter ;| --replace_result localhost.localdomain localhost 127.0.0.1 localhost --replace_column 13 # 14 # select * from mysql.proc where name='foo' and db='mysqltest1'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # You will notice in the result that the definer does not match what # it is on master, it is a known bug on which Alik is working --replace_result localhost.localdomain localhost 127.0.0.1 localhost @@ -58,7 +58,7 @@ connection master; set timestamp=1000000000; call foo(); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; # Now a SP which is not updating tables @@ -131,7 +131,7 @@ show warnings; select * from t1; select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t2; @@ -155,7 +155,7 @@ call foo4(); show warnings; select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # check that this failed-in-the-middle replicated right: select * from t2; @@ -167,7 +167,7 @@ select * from mysql.proc where name="foo4" and db='mysqltest1'; connection master; drop procedure foo4; select * from mysql.proc where name="foo4" and db='mysqltest1'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from mysql.proc where name="foo4" and db='mysqltest1'; # ********************** PART 2 : FUNCTIONS *************** @@ -200,7 +200,7 @@ select fn1(20); insert into t2 values(fn1(21)); select * from t1; select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t2; @@ -278,7 +278,7 @@ select fn3(); select * from mysql.proc where db='mysqltest1'; select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use mysqltest1; select * from t1; --replace_result localhost.localdomain localhost 127.0.0.1 localhost @@ -308,7 +308,7 @@ do fn1(100); select fn1(20); select * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # check that this failed-in-the-middle replicated right: select * from t2; @@ -331,7 +331,7 @@ delete from t1; create trigger trg before insert on t1 for each row set new.a= 10; insert into t1 values (1); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; @@ -339,7 +339,7 @@ delete from t1; drop trigger trg; insert into t1 values (1); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; @@ -355,12 +355,12 @@ create procedure foo() not deterministic reads sql data select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # This should not fail call foo(); connection master; drop procedure foo; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Clean up @@ -369,7 +369,7 @@ drop function fn1; drop database mysqltest1; drop user "zedjzlcsjhd"@127.0.0.1; use test; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use test; # @@ -397,7 +397,7 @@ insert into t1 (a) values (f1()); select * from t1; drop view v1; drop function f1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; @@ -426,7 +426,7 @@ CALL p1('test'); SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1; # Cleanup @@ -457,7 +457,7 @@ DROP FUNCTION IF EXISTS f1; --echo --echo ---> Synchronizing slave with master... ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo --echo ---> connection: master @@ -481,7 +481,7 @@ SHOW CREATE FUNCTION f1; --echo --echo ---> Synchronizing slave with master... ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ---> connection: master @@ -503,14 +503,14 @@ SHOW CREATE FUNCTION f1; DROP PROCEDURE p1; DROP FUNCTION f1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master # cleanup connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug22043: MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS" @@ -543,12 +543,12 @@ begin return 0; end| delimiter ;| -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Let us test if we don't forget to binlog the function's database connection master; use mysqltest; set @a:= mysqltest2.f1(); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # Final inspection which verifies how all statements of this test file @@ -566,7 +566,7 @@ set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creato # Clean up drop database mysqltest; drop database mysqltest2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug#36570: Parse error of CREATE PROCEDURE stmt with comments on slave @@ -600,7 +600,7 @@ delimiter ;| show procedure status like '%mysqltestbug36570%'; show create procedure ` mysqltestbug36570_p2`; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; --replace_column 5 t 6 t @@ -679,7 +679,7 @@ connection master1; --echo # --> connection master connection master; select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; # Cleanup @@ -715,7 +715,7 @@ call p1(3); --enable_warnings select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; connection master; @@ -723,7 +723,7 @@ connection master; call p1(-1); --enable_warnings select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; connection master; @@ -737,5 +737,5 @@ drop procedure p1; # Cleanup -sync_slave_with_master; +--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_sp004.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp004.test index 31e4ce37..8b895464 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp004.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp004.test @@ -46,7 +46,7 @@ delimiter ;| CALL test.p1(); SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t2 ORDER BY a; @@ -55,7 +55,7 @@ CALL test.p2(); USE test; SHOW TABLES; #SELECT * FROM test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc USE test; SHOW TABLES; #SELECT * FROM test.t3; @@ -65,7 +65,7 @@ CALL test.p1(); SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t2 ORDER BY a; #SELECT * FROM test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t2 ORDER BY a; #SELECT * FROM test.t3; @@ -81,7 +81,7 @@ DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # If the test fails, you will need to diff the dumps to see why. diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp_effects.test index 87a403d8..77b98c32 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp_effects.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sp_effects.test @@ -34,7 +34,7 @@ delimiter ;// call p1(); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT * FROM t1 ORDER BY a; connection master; @@ -51,7 +51,7 @@ delimiter ;// call p2(); SELECT * FROM t2 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT * FROM t2 ORDER BY a; @@ -94,7 +94,7 @@ SELECT a,f1(a) FROM t2 ORDER BY a; insert into t2 select f1(3); SELECT 'master:',a FROM t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT 'slave:',a FROM t1 ORDER BY a; @@ -110,7 +110,7 @@ create view v1 as select f1(a) as f from t2; select * from v1 order by f; SELECT 'master:',a FROM t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT 'slave:',a FROM t1 ORDER BY a; @@ -124,7 +124,7 @@ set @xx=123; execute s1 using @xx; SELECT 'master:',a FROM t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT 'slave:',a FROM t1 ORDER BY a; @@ -147,7 +147,7 @@ end// delimiter ;// call p1(15); SELECT 'master:',a FROM t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT 'slave:',a FROM t1 ORDER BY a; @@ -195,7 +195,7 @@ set @x=30; call p1(); SELECT 'master', a FROM t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; SELECT 'slave', a FROM t1 ORDER BY a; @@ -208,7 +208,7 @@ drop table t1; drop function f1; drop function f2; drop procedure p1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # bug#26199 Replication Failure on Slave when using stored procs @@ -240,7 +240,7 @@ select sf_bug26199(b'101111111'); select sf_bug26199('\''); select hex(b) from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; select hex(b) from t2; @@ -254,7 +254,7 @@ drop function sf_bug26199; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo end of the tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_spec_variables.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_spec_variables.test index 5cb58653..e9ed5d9a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_spec_variables.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_spec_variables.test @@ -36,7 +36,7 @@ INSERT INTO t1 (b) VALUES ('master'); INSERT INTO t1 (b) VALUES ('master'); SELECT * FROM t1 ORDER BY a; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; INSERT INTO t1 (b) VALUES ('slave'); INSERT INTO t1 (b) VALUES ('slave'); @@ -90,7 +90,7 @@ SET @@session.collation_server=utf8_bin; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; SHOW CREATE TABLE t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; SHOW CREATE TABLE t1; SHOW CREATE TABLE t2; @@ -125,7 +125,7 @@ CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c INT) ENGINE=MyISAM INSERT INTO t1 VALUES (1, 'master ', WEEK('2008-01-07')); SELECT * FROM t1 ORDER BY a; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES (2, 'slave ', WEEK('2008-01-07')); SELECT * FROM t1 ORDER BY a; @@ -152,7 +152,7 @@ CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(20), c CHA --replace_regex /\'.+\'/'FILE'/ --eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/words.dat' INTO TABLE t1 (b) SELECT COUNT(*) FROM t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --replace_regex /\'.+\'/'FILE2'/ --error 1148 --eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/words2.dat' INTO TABLE t1 (b) @@ -185,7 +185,7 @@ while ($counter) { --enable_query_log SELECT COUNT(*)=2000 FROM t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc let $counter=2000; --disable_query_log while ($counter) { @@ -233,7 +233,7 @@ SET @@session.default_storage_engine=Memory; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)); CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10)); --connection master @@ -272,7 +272,7 @@ CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c DATE); INSERT INTO t1 VALUES (1, 'master', '0000-00-00'); SELECT * FROM t1 ORDER BY a; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --error 1292 INSERT INTO t1 VALUES (1, 'slave', '0000-00-00'); SELECT * FROM t1 ORDER BY a; @@ -292,7 +292,7 @@ DROP TABLE t1; SET @@global.character_set_database=@restore_master_character_set_database; SET @@global.collation_server=@restore_master_collation_server; SET @@global.default_storage_engine=@restore_master_storage_engine; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SET @@global.character_set_database=@restore_slave_character_set_database; SET @@global.collation_server=@restore_slave_collation_server; SET @@global.max_heap_table_size=@restore_slave_max_heap_table_size; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sporadic_master.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sporadic_master.test index 592d13e6..a18bbc02 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sporadic_master.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sporadic_master.test @@ -1,6 +1,7 @@ # test to see if replication can continue when master sporadically fails on # COM_BINLOG_DUMP and additionally limits the number of events per dump +source include/not_gtid_enabled.inc; source include/master-slave.inc; create table t2(n int); @@ -9,7 +10,7 @@ insert into t1 values (NULL),(NULL); truncate table t1; # We have to use 4 in the following to make this test work with all table types insert into t1 values (4),(NULL); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --source include/start_slave.inc connection master; @@ -17,10 +18,10 @@ insert into t1 values (NULL),(NULL); flush logs; truncate table t1; insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1 ORDER BY n; connection master; drop table t1,t2; -sync_slave_with_master; +--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_sql_thread_killed_waiting_commit_lock-slave.opt b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sql_thread_killed_waiting_commit_lock-slave.opt new file mode 100644 index 00000000..8f7a7894 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sql_thread_killed_waiting_commit_lock-slave.opt @@ -0,0 +1 @@ +--sync-relay-log-info=1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sql_thread_killed_waiting_commit_lock.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sql_thread_killed_waiting_commit_lock.test new file mode 100644 index 00000000..a9aa2567 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sql_thread_killed_waiting_commit_lock.test @@ -0,0 +1,122 @@ +# ==== Purpose ==== +# +# Test if sql thread doesn't assert when it is killed at +# 'Waiting for commit lock' state. +# +# Test if killing sql thread which is waiting for commit lock and restarting +# it doesn't cause a transaction to be skipped on slave. +# +# ==== Related Bugs and Worklogs ==== +# +# BUG#16861624: KILLING WAITING SLAVE SQL THREAD: +# M_STATUS == DA_ERROR || M_STATUS == DA_OK +# +# ==== Implementation ==== +# +# In order to get the sql thread in the 'Waiting for commit lock' state +# we have to put some data into the master and, then, while replication +# is happening, lock the slave with 'FLUSH TABLES WITH READ LOCK'. +# +# Debug sync points were created to allow us to precisely put the +# sql thread in the desired state. +# +# After having the sql thread waiting for the commit lock, the test kills +# it identifying its ID by querying information_schema.processlist table. +# +# Bug#17450876: REPLICATION STOP WITH "ERROR IN XID_LOG_EVENT: COMMIT COULD +# NOT BE COMPLETED" +# +# Killing the sql thread that is waiting for a commit lock and restarting it +# will cause one transaction to be skipped on the slave. When sql thread is +# killed at this state its positions are updated in rli object but the +# transaction is yet to be committed. At the time of restart the rli object is +# read back causing a transaction to be missed. Post fix the positions in rli +# object will be rolled back. Test script ensures that rli's memory contents +# are in sync with the positions in rli repository. + +--source include/not_gtid_enabled.inc +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc + +call mtr.add_suppression("Query execution was interrupted."); +call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); + +--echo # Let master and slave synced with t1 table created +CREATE TABLE t1 (f INT) ENGINE= INNODB; +--source include/sync_slave_sql_with_master.inc + +--echo # Setup GLOBAL.DEBUG at slave to reach commit +--source include/rpl_connection_slave.inc +--let $debug_saved= `SELECT @@GLOBAL.DEBUG` +SET @@GLOBAL.DEBUG= '+d,dbug.reached_commit'; + +--echo # Do some DML operation on master so that it will be blocked on +--echo # slave as global read lock is in place. +--source include/rpl_connection_master.inc +INSERT INTO t1 VALUES (10); + +--echo # Issue FLUSH TABLES WITH READ LOCK after Reached is signaled +--source include/rpl_connection_slave.inc +SET DEBUG_SYNC='now WAIT_FOR Reached'; +FLUSH TABLES WITH READ LOCK; +--echo # Let sql thread continue to try to obtain commit lock +SET DEBUG_SYNC= 'now SIGNAL signal.commit_continue'; + +--echo # Wait until sql thread enters "Waiting for commit lock" state +let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist + WHERE state = "Waiting for commit lock"; +--source include/wait_condition.inc + +--echo # Kill sql thread +let $sql_thread_id= `SELECT ID FROM information_schema.processlist + WHERE state= "Waiting for commit lock"`; +--disable_query_log +--eval KILL $sql_thread_id +--enable_query_log +--let $er_query_interrupted= convert_error(ER_QUERY_INTERRUPTED) +--let $er_mts_inconsistent_data= convert_error(ER_MTS_INCONSISTENT_DATA) +--let $slave_sql_errno= $er_query_interrupted, $er_mts_inconsistent_data +--source include/wait_for_slave_sql_error.inc + +--echo # Restart sql thread to let it finish the replication +SET @@GLOBAL.DEBUG= '-d,dbug.reached_commit'; +UNLOCK TABLES; +# Check to ensure that in memory rli positions are equal to the positions in +# slave's repository table. +if (`SELECT @@GLOBAL.relay_log_info_repository = 'TABLE'`) +{ + --let $slave_master_log_pos_in_repo= `SELECT Master_log_pos FROM mysql.slave_relay_log_info LIMIT 1` +} +if (`SELECT @@GLOBAL.relay_log_info_repository = 'FILE'`) +{ + --disable_query_log + CREATE TABLE rli_table(rli_info VARCHAR(100)); + --let $MYSQLD_DATADIR= `select @@datadir` + --let $rli_file=$MYSQLD_DATADIR/relay-log.info + --replace_result $rli_file rli_file + --eval LOAD DATA LOCAL INFILE '$rli_file' INTO TABLE rli_table + --let $slave_master_log_pos_in_repo= `SELECT * FROM rli_table LIMIT 4,1` + DROP TABLE rli_table; + --enable_query_log +} + +--let $slave_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) +--let $assert_text= Exec_Master_Log_Pos in SHOW SLAVE STATUS must be equal to mater_log_pos in slave's repository +--let $assert_cond= $slave_master_log_pos = $slave_master_log_pos_in_repo +--source include/assert.inc +--source include/start_slave_sql.inc + +# Check consistency +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.inc +--let $diff_tables= master:t1, slave:t1 +--source include/diff_tables.inc + +# Cleanup +SET @@GLOBAL.DEBUG= '$debug_saved'; +--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_ssl.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ssl.test index 89c6caab..7e32d212 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ssl.test @@ -6,7 +6,7 @@ connection master; grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int auto_increment, KEY(t)); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Set slave to use SSL for connection to master stop slave; @@ -24,7 +24,7 @@ start slave; # Switch to master and insert one record, then sync it to slave connection master; insert into t1 values(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # The record should now be on slave select * from t1; @@ -69,7 +69,7 @@ connection master; insert into t1 values (NULL); let $master_count= `select count(*) from t1`; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/wait_for_slave_to_start.inc source include/show_slave_status.inc; source include/check_slave_is_running.inc; @@ -96,7 +96,28 @@ if ($slave_count != $master_count) connection master; drop user replssl@localhost; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc + +# ==== BUG#18165937: HITTING CRASH WHEN SETTING SSL OPTIONS THROUGH CHANGE MASTER COMMAND ==== +# +# The server would crash when setting SSL_CRL options using CHANGE +# MASTER with YASSL enabled. + +--source include/stop_slave.inc +--replace_column 2 #### +CHANGE MASTER TO + master_user = 'root', + master_ssl = 0, + master_ssl_ca = '', + master_ssl_cert = '', + master_ssl_key = '', + master_ssl_crl='', + master_ssl_crlpath=''; + +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval CHANGE MASTER TO MASTER_SSL= 1, MASTER_SSL_CRL='$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl', MASTER_SSL_CRLPATH='$MYSQL_TEST_DIR/std_data/crldir'; +--source include/start_slave.inc + --source include/stop_slave.inc --replace_column 2 #### @@ -105,7 +126,9 @@ CHANGE MASTER TO master_ssl = 0, master_ssl_ca = '', master_ssl_cert = '', - master_ssl_key = ''; + master_ssl_key = '', + master_ssl_crl='', + master_ssl_crlpath=''; --echo End of 5.0 tests --let $rpl_only_running_threads= 1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ssl1.test index c03376c8..006acc37 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ssl1.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_ssl1.test @@ -10,7 +10,7 @@ connection master; grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #trying to use this user without ssl stop slave; @@ -39,7 +39,7 @@ start slave; #avoiding unneeded sleeps connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #checking that replication is ok select * from t1; @@ -60,7 +60,7 @@ connection master; drop user replssl@localhost; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/show_slave_status.inc; source include/check_slave_is_running.inc; # End of 4.1 tests @@ -85,7 +85,7 @@ connection master; create table t1 (t int); insert into t1 values (1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo on slave; #checking that replication is ok @@ -99,7 +99,7 @@ source include/show_slave_status.inc; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --replace_column 2 #### CHANGE MASTER TO diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_000001.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_000001.test index 0b317d3e..4b35462f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_000001.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_000001.test @@ -1,6 +1,7 @@ # Requires binlog_format=statement format since query involving # get_lock() is logged in row format if binlog_format=mixed or row. -- source include/have_binlog_format_statement.inc +-- source include/not_gtid_enabled.inc -- source include/master-slave.inc CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); @@ -18,7 +19,7 @@ select * from t1 limit 10; # # Test slave with wrong password # -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc stop slave; connection master; set password for root@"localhost" = password('foo'); @@ -35,12 +36,12 @@ sleep 2; create table t3(n int); insert into t3 values(1),(2); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t3; select sum(length(word)) from t1; connection master; drop table t1,t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Test if the slave SQL thread can be more than 16K behind the slave # I/O thread (> IO_SIZE) @@ -48,7 +49,7 @@ sync_slave_with_master; connection master; # we'll use table-level locking to delay slave SQL thread eval create table t1 (n int) engine=$engine_type; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; reset master; connection slave; @@ -126,13 +127,13 @@ insert into mysql.user (Host, User, Password) select select_priv,user from mysql.user where user = _binary'blafasel2'; update mysql.user set Select_priv = "Y" where User= _binary"blafasel2"; select select_priv,user from mysql.user where user = _binary'blafasel2'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select n from t1; select select_priv,user from mysql.user where user = _binary'blafasel2'; connection master1; drop table t1; delete from mysql.user where user="blafasel2"; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test index b915f633..b4d8bbda 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test @@ -21,7 +21,7 @@ DROP TRIGGER IF EXISTS tr1; DROP FUNCTION IF EXISTS f1; --enable_warnings ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master @@ -78,7 +78,7 @@ echo # Result on master; SELECT * FROM t1; SELECT * FROM t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo # Result on slave; SELECT * FROM t1; @@ -98,7 +98,7 @@ echo # Result on master; SELECT * FROM t1; SELECT * FROM t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc echo # Result on slave; SELECT * FROM t1; @@ -113,5 +113,5 @@ DROP PROCEDURE IF EXISTS p2; DROP FUNCTION IF EXISTS f1; DROP TRIGGER IF EXISTS tr1; enable_warnings; -sync_slave_with_master; +--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_found_rows.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_found_rows.test index 84160a19..7179f691 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_found_rows.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_found_rows.test @@ -49,7 +49,7 @@ INSERT INTO logtbl VALUES(1,2,@a); SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; @@ -87,7 +87,7 @@ CALL just_log(2,3,@found_rows); SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; @@ -109,7 +109,7 @@ SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows); SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test index 92d57625..7f61684e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test @@ -1,10 +1,2 @@ ---source include/have_binlog_format_statement.inc ---source include/master-slave.inc ---source include/not_embedded.inc ---source include/not_windows.inc - -disable_query_log; -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -enable_query_log; ---source extra/rpl_tests/rpl_insert_delayed.test ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_stm_insert_delayed.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test index e858e78d..9e5f122e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test @@ -3,6 +3,7 @@ # For details look into extra/rpl_tests/rpl_lower_case_table_names.test # +-- source include/not_gtid_enabled.inc -- source include/have_innodb.inc -- source include/not_windows.inc -- source include/have_binlog_format_mixed_or_statement.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test index 7add76c0..98a0883f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test @@ -1,6 +1,8 @@ -- source include/not_ndb_default.inc -- source include/have_log_bin.inc -- source include/have_binlog_format_statement.inc +-- source include/not_gtid_enabled.inc + RESET MASTER; let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test index 4b9af69c..334a21e8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test @@ -1,20 +1,4 @@ # BUG#28777 SHOW BINLOG EVENTS does not work on relay log files # -# GOAL -# ==== -# -# Test that SHOW BINLOG EVENTS and the new SHOW RELAYLOG EVENTS works after -# the patch, both on master and slave. -# -# HOW -# === -# -# This test issues SHOW [BINLOG|RELAYLOG] EVENTS both on master and slave after -# some statements have been issued. - --- source include/master-slave.inc --- source include/have_binlog_format_mixed_or_statement.inc --- source include/not_mts_slave_parallel_workers.inc - --- source extra/rpl_tests/rpl_show_relaylog_events.inc ---source include/rpl_end.inc +--source include/not_gtid_enabled.inc +--source extra/rpl_tests/rpl_stm_mix_show_relaylog_events.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mixed_mts_crash_safe.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mixed_mts_crash_safe.test index 9396ca59..f205d47f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mixed_mts_crash_safe.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mixed_mts_crash_safe.test @@ -1,4 +1,5 @@ --source include/big_test.inc +--source include/not_gtid_enabled.inc --source include/master-slave.inc --source include/have_binlog_format_mixed.inc --source include/have_innodb.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test index 910cb214..59800ac7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test @@ -27,7 +27,7 @@ CREATE TABLE `t1` ( `c5` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ALTER TABLE `t1` Engine=InnoDB; -- connection master @@ -38,13 +38,13 @@ COMMIT; ROLLBACK; SET AUTOCOMMIT=1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- let $diff_tables= master:t1, slave:t1 -- source include/diff_tables.inc -- connection master DROP TABLE `t1`; --- sync_slave_with_master +--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_no_op.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_no_op.test index 1605b177..a91bc8c7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_no_op.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_no_op.test @@ -13,7 +13,7 @@ connection slave; create database mysqltest; connection master; drop database if exists mysqltest; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # can't read dir --replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ / --error 1049 @@ -24,7 +24,7 @@ connection slave; create table t1 (a int); connection master; drop table if exists t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # table does not exist --error 1146 select * from t1; @@ -32,11 +32,11 @@ select * from t1; # see if single-table DELETE is binlogged even if no effect connection master; create table t1 (a int, b int); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc insert into t1 values(1,1); connection master; delete from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; # see if single-table UPDATE is binlogged even if no effect @@ -44,7 +44,7 @@ insert into t1 values(1,1); connection master; insert into t1 values(2,1); update t1 set a=2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; # End of 4.1 tests @@ -57,14 +57,14 @@ delete from t1; insert into t1 values(1,1); insert into t2 values(1,1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # force a difference to see if master's multi-UPDATE will correct it update t1 set a=2; connection master; UPDATE t1, t2 SET t1.a = t2.a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t2; @@ -74,7 +74,7 @@ connection master; delete from t1; delete from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # force a difference to see if master's multi-DELETE will correct it insert into t1 values(1,1); insert into t2 values(1,1); @@ -82,7 +82,7 @@ insert into t2 values(1,1); connection master; DELETE t1.*, t2.* from t1, t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; select * from t2; @@ -90,5 +90,5 @@ select * from t2; # cleanup connection master; drop table t1, t2; -sync_slave_with_master; +--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_relay_ign_space.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test index 59ae4faa..afd40704 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test @@ -31,7 +31,7 @@ INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # wait for the SQL thread to sleep --let $show_statement= SHOW PROCESSLIST @@ -99,12 +99,12 @@ while (`select $relay_log_space > $relay_log_space_limit`) --enable_query_log --connection master ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --let $diff_tables=master:test.t1,slave:test.t1 --source include/diff_tables.inc --connection master DROP TABLE t1; ---sync_slave_with_master +--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_sql_mode.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test index 0eb41d1c..37d40ede 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test @@ -21,5 +21,5 @@ DROP TABLE t1; -- echo # assertion: sync slave with master makes slave not to stop with -- echo # duplicate key error (because it has received event -- echo # with expected error code). --- sync_slave_with_master +--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_until.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_until.test index 5d79107e..448a4be8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -31,7 +31,7 @@ let $VERSION=`select version()`; # Stop slave before it starts replication. Also sync with master # to avoid nondeterministic behaviour. --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --echo ==== Create some events on master ==== @@ -93,7 +93,7 @@ start slave; --echo [on master] connection master; --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc --let $exec_log_pos_1= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) @@ -144,6 +144,7 @@ source include/stop_slave.inc; drop table if exists t1; --enable_warnings reset slave; +RESET MASTER; --replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_until_pos_middle_gtid.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_until_pos_middle_gtid.test new file mode 100644 index 00000000..efc7945b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_until_pos_middle_gtid.test @@ -0,0 +1,91 @@ +# ==== Purpose ==== +# +# This test verifies correctness and effectiveness of the +# until-stopping when the position used is inside the Gtid_log_event +# of a group (transaction) in the relaylog. +# +# ==== Method ==== +# +# The test will create a two events transaction (GTID + QUERY), and will start +# the SQL thread using the UNTIL MASTER_LOG_FILE/POS clause, pointing to the +# first byte of the created transaction (inside of the Gtid_log_event). +# +# The test expects that, after issuing the START SLAVE SQL_THREAD with the +# UNTIL clause, the SQL thread will apply the created transaction (both +# GTID and QUERY events) even though pointing to stop after the GTID. +# The test also expects that the SQL thread will update its position +# before stopping. +# +# The test will then verify SQL thread's binlog file, position, and +# finally will wait for the SQL thread to stop. +# +# When the SQL thread stops, the test verifies if the second event of +# the transaction (QUERY) was successfully applied. +# +# ==== Related bugs ==== +# +# Bug #18306199 START SLAVE UNTIL MASTER_LOG_POS=MIDDLE-OF-GTID-EVENT +# STOPS BEFORE TRANSACTION + +--source include/have_binlog_format_statement.inc +--source include/have_gtid.inc +--source include/master-slave.inc + +# Stop the SQL thread +--source include/rpl_connection_slave.inc +--source include/stop_slave_sql.inc + +--echo # Saving master position to use on UNTIL clause of START SLAVE +--source include/rpl_connection_master.inc +--let $master_file= query_get_value(SHOW MASTER STATUS, File, 1) +--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1) +--inc $master_pos + +# Create a table in the master (one event without GTIDS, two with GTIDS) +CREATE TABLE t1 (a INT) ENGINE=InnoDB; + +# Insert some data +BEGIN; +INSERT INTO t1 VALUES (1); +COMMIT; + +# Sync the IO thread with the master +--source include/sync_slave_io_with_master.inc + +# Check if SQL thread stops correctly +# after executing the next event of the master binlog +# based on master binlog file and position + +--echo # Start SQL thread until it executed the CREATE TABLE +--replace_result $master_file MASTER_FILE $master_pos MASTER_POS +# Disable warnings to avoid logging "UNTIL condtion is not supported ..." on MTS +--disable_warnings +eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE = "$master_file", MASTER_LOG_POS = $master_pos; +--enable_warnings + +--echo # Wait until SQL thread reaches last master binlog file +--let $slave_param= Relay_Master_Log_File +--let $slave_param_value= $master_file +--let $slave_param_comparison= = +--source include/wait_for_slave_param.inc + +--echo # Wait until SQL thread reaches desired master binlog position +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos +--let $slave_param_comparison= >= +--source include/wait_for_slave_param.inc + +--echo # If the desired position was reached, SQL thread should stop. +--source include/wait_for_slave_sql_to_stop.inc + +--let $assert_cond= "[SHOW TABLES LIKE "t1"]" = "t1" +--let $assert_text= t1 should be replicated +--source include/assert.inc + +# Cleanup +--source include/start_slave_sql.inc +--source include/rpl_connection_master.inc +DROP TABLE t1; + +# End of tests +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_user_variables.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_user_variables.test index 64691a1b..1e38581f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_user_variables.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stm_user_variables.test @@ -37,7 +37,7 @@ CREATE TABLE t1 (`tinyint` TINYINT, -- echo ######################################### -- echo #### [ on master ] -- query_vertical SELECT * FROM t1 --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo #### [ on slave ] -- query_vertical SELECT * FROM t1 -- echo ######################################### @@ -67,7 +67,7 @@ INSERT INTO t1 VALUES (@positive, -- echo ######################################### -- echo #### [ on master ] -- query_vertical SELECT * FROM t1 --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo #### [ on slave ] -- query_vertical SELECT * FROM t1 -- echo ######################################### @@ -86,7 +86,7 @@ TRUNCATE t1; -- echo ######################################### -- echo #### [ on master ] -- query_vertical SELECT * FROM t1 --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo #### [ on slave ] -- query_vertical SELECT * FROM t1 -- echo ######################################### @@ -116,7 +116,7 @@ INSERT INTO t1 VALUES (@negative, -- echo ######################################### -- echo #### [ on master ] -- query_vertical SELECT * FROM t1 --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo #### [ on slave ] -- query_vertical SELECT * FROM t1 -- echo ######################################### @@ -134,7 +134,7 @@ TRUNCATE t1; ## cleanup -- connection master DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc ##################################################################### # @@ -155,7 +155,7 @@ SET @aux1= @aux; -- error ER_DUP_ENTRY INSERT INTO t1 VALUES (@aux) , (@aux1); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ## assertion: master and slave tables are in sync -- let $diff_tables=master:t1,slave:t1 @@ -165,7 +165,7 @@ INSERT INTO t1 VALUES (@aux) , (@aux1); DROP TRIGGER tr1; DROP TABLE t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo --echo # The GET DIAGNOSTICS itself is not replicated, but it can set @@ -192,7 +192,7 @@ DELIMITER ;| CALL p1(); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc connection slave; --echo # On slave, check if the statement was replicated. @@ -204,6 +204,6 @@ connection master; DROP TABLE t1; DROP PROCEDURE p1; --- sync_slave_with_master +--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_stop_slave.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave.test index 36a339a4..8d24efd0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -18,7 +18,7 @@ source include/not_gtid_enabled.inc; CREATE TABLE t1(c1 INT) ENGINE=InnoDB; CREATE TABLE t2(c1 INT) ENGINE=InnoDB; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SET DEBUG_SYNC= 'RESET'; source include/stop_slave.inc; @@ -76,15 +76,18 @@ CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; INSERT INTO t1 VALUES(1, 1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc +--source include/stop_slave.inc --source include/rpl_connection_master.inc +# make sure that there are no zombie threads +--source include/stop_dump_threads.inc let $debug_save= `SELECT @@GLOBAL.debug`; SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; --source include/rpl_connection_slave.inc -source include/restart_slave_sql.inc; +--source include/start_slave.inc BEGIN; UPDATE t1 SET c2 = 2 WHERE c1 = 1; @@ -96,6 +99,10 @@ INSERT INTO t2 VALUES(1); UPDATE t1 SET c2 = 3 WHERE c1 = 1; COMMIT; +# wait for the dump thread reach the sync point +--let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump' +--source include/wait_condition.inc + --source include/rpl_connection_slave1.inc let $show_statement= SHOW PROCESSLIST; let $field= Info; @@ -108,7 +115,12 @@ send STOP SLAVE; ROLLBACK; --source include/rpl_connection_master.inc + SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +# wait for the dump thread to come out of the +# waiting phase before resetting the signals +--let $wait_condition= select count(*)=0 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump' +--source include/wait_condition.inc SET DEBUG_SYNC= 'RESET'; --source include/rpl_connection_slave.inc @@ -116,9 +128,22 @@ source include/wait_for_slave_to_stop.inc; --source include/rpl_connection_slave1.inc reap; + +# Slave has stopped, thence lets make sure that +# we kill the zombie dump threads. Also, make +# sure that we disable the DBUG_EXECUTE_IF +# that would set the dump thread to wait +--source include/rpl_connection_master.inc +SET GLOBAL debug= '$debug_save'; +# make sure that there are no zombie threads +--source include/stop_dump_threads.inc + +--source include/rpl_connection_slave1.inc +# now the dump thread on the master will start +# from a clean slate, i.e. without the +# DBUG_EXECUTE_IF set source include/start_slave.inc; --source include/rpl_connection_master.inc DROP TABLE t1, t2; -SET GLOBAL debug= $debug_save; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index 7526e5bc..12f0f333 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -312,7 +312,7 @@ insert delayed into t2 values(@a); # rows make it to t2 on the slave. We first call # sync_slave_with_master, so that we are sure that t2 has been created # on the slave. -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2; --source include/wait_condition.inc connection master; @@ -371,7 +371,7 @@ delimiter ;| select f("try_41_"); # Two operations which compensate each other except that their net # effect is that they advance the auto_increment counter of t2 on slave: -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc use mysqltest1; insert into t2 values(2,null),(3,null),(4,null); delete from t2 where a>=2; @@ -379,7 +379,7 @@ delete from t2 where a>=2; connection master; # this is the call which didn't replicate well select f("try_42_"); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # now use prepared statement and test again, just to see that the RBB # mode isn't set at PREPARE but at EXECUTE. @@ -393,7 +393,7 @@ set @string="try_43_"; insert into t1 values(null,"try_44_"); # should be SBB execute stmt1 using @string; # should be RBB deallocate prepare stmt1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # verify that if only one table has auto_inc, it does not trigger RBB # (we'll check in binlog further below) @@ -429,7 +429,7 @@ end| delimiter ;| select f1("try_46_"),f2("try_47_"); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc insert into t2 values(2,null),(3,null),(4,null); delete from t2 where a>=2; @@ -437,7 +437,7 @@ connection master; # Test with SELECT and INSERT select f1("try_48_"),f2("try_49_"); insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_"))); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # verify that if f2 does only read on an auto_inc table, this does not # switch to RBB @@ -453,7 +453,7 @@ begin end| delimiter ;| select f1("try_53_"),f2("try_54_"); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # And now, a normal statement with a trigger (no stored functions) @@ -469,7 +469,7 @@ insert into t1 values(null,"try_56_"); # and now remove one auto_increment and verify SBB alter table t1 modify a int, drop primary key; insert into t1 values(null,"try_57_"); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Test for BUG#20499 "mixed mode with temporary table breaks binlog" # Slave used to have only 2 rows instead of 3. @@ -482,7 +482,7 @@ insert into t16 values("try_65_"); drop table t15; # we'll verify that this one is done SBB insert into t16 values("try_66_"); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # and now compare: @@ -510,7 +510,7 @@ if ($you_want_to_test_UDF) select count(*) from t9; } -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug#20863 If binlog format is changed between update and unlock of @@ -529,7 +529,7 @@ INSERT INTO t11 VALUES('Careful With That Axe, Eugene'); UNLOCK TABLES; --query_vertical SELECT * FROM t11 -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc USE mysqltest1; --query_vertical SELECT * FROM t11 @@ -540,7 +540,7 @@ CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#28086: SBR of USER() becomes corrupted on slave @@ -577,7 +577,7 @@ INSERT INTO t13 VALUES (my_user()); INSERT INTO t13 VALUES (CURRENT_USER()); INSERT INTO t13 VALUES (my_current_user()); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql @@ -617,7 +617,7 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_ } drop database mysqltest1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # Restore binlog format setting diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sync.test index 435b0fbc..2e348a3d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sync.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sync.test @@ -47,7 +47,7 @@ insert into t1(a) values(3); # Case 1: Corrupt a relay-log.bin* ######################################################################################## --echo =====Inserting data on the master but without the SQL Thread being running=======; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; let $MYSQLD_SLAVE_DATADIR= `select @@datadir`; @@ -87,7 +87,7 @@ FLUSH LOGS; --source include/start_slave.inc connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables=master:t1,slave:t1; source include/diff_tables.inc; @@ -135,7 +135,7 @@ FLUSH LOGS; --source include/start_slave.inc connection master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables=master:t1,slave:t1; source include/diff_tables.inc; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temp_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temp_table.test index 92f8cef9..cdfac7a2 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temp_table.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temp_table.test @@ -63,7 +63,7 @@ show status like 'Slave_open_temp_tables'; connect (master2,localhost,root,,); connection master2; drop table if exists t1,t2; -sync_slave_with_master; +--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_temp_table_mix_row.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test index 7d7a849a..b895c066 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test @@ -24,7 +24,7 @@ CREATE TEMPORARY TABLE t1_tmp1(a INT); INSERT INTO t1 VALUES (UUID()); --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo ==== Verify results on slave ==== SHOW STATUS LIKE "Slave_open_temp_tables"; @@ -41,7 +41,7 @@ let $wait_binlog_event= DROP; source include/wait_for_binlog_event.inc; --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo ==== Verify results on slave ==== SHOW STATUS LIKE "Slave_open_temp_tables"; @@ -56,7 +56,7 @@ SHOW STATUS LIKE "Slave_open_temp_tables"; DROP TABLE t1; --echo [on slave] -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#43046: mixed mode switch to row format with temp table lead to wrong @@ -119,7 +119,7 @@ CREATE TEMPORARY TABLE t2_tmp (a int); ALTER TABLE t1_tmp ADD COLUMN c INT; -- echo ### assertion: assert that there is one open temp table on slave --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc SHOW STATUS LIKE 'Slave_open_temp_tables'; -- connection master @@ -138,7 +138,7 @@ DROP TEMPORARY TABLE t2_tmp; # back to STATEMENT). INSERT INTO t1 VALUES (2); --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- echo ### assertion: assert that slave has no temporary tables opened SHOW STATUS LIKE 'Slave_open_temp_tables'; @@ -148,7 +148,7 @@ SHOW STATUS LIKE 'Slave_open_temp_tables'; # action: drop remaining tables DROP TABLE t3, t1; --- sync_slave_with_master +--source include/sync_slave_sql_with_master.inc -- source include/show_binlog_events.inc @@ -199,7 +199,7 @@ COMMIT; source include/show_binlog_events.inc; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo # Compare the base table. --let $diff_tables= master:t1, slave:t1 @@ -209,6 +209,6 @@ source include/show_binlog_events.inc; connection master; DROP TABLE t1; -sync_slave_with_master; +--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_temporal_fractional.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporal_fractional.test index 8a16b179..645dc9ff 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporal_fractional.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporal_fractional.test @@ -18,12 +18,12 @@ INSERT INTO t1 VALUES (@ts, @ts, @ts, @ts, @ts, @ts, @ts); INSERT INTO t1 VALUES (NOW(), NOW(), NOW(), NOW(), NOW(), NOW(), NOW()); INSERT INTO t1 VALUES (NOW(6), NOW(6), NOW(6), NOW(6), NOW(6), NOW(6), NOW(6)); --query_vertical SELECT * FROM t1 -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; --query_vertical SELECT * FROM t1 connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -42,12 +42,12 @@ INSERT INTO t1 VALUES (@ts, @ts, @ts, @ts, @ts, @ts, @ts); INSERT INTO t1 VALUES (NOW(), NOW(), NOW(), NOW(), NOW(), NOW(), NOW()); INSERT INTO t1 VALUES (NOW(6), NOW(6), NOW(6), NOW(6), NOW(6), NOW(6), NOW(6)); --query_vertical SELECT * FROM t1 -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; --query_vertical SELECT * FROM t1 connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -66,12 +66,12 @@ INSERT INTO t1 VALUES (@t, @t, @t, @t, @t, @t, @t); INSERT INTO t1 VALUES (CURTIME(), CURTIME(), CURTIME(), CURTIME(), CURTIME(), CURTIME(), CURTIME()); INSERT INTO t1 VALUES (CURTIME(6), CURTIME(6), CURTIME(6), CURTIME(6), CURTIME(6), CURTIME(6), CURTIME(6)); --query_vertical SELECT * FROM t1 -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; --query_vertical SELECT * FROM t1 connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary.test index ffc1f204..c7be0b7d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary.test @@ -1,4 +1,5 @@ # Test need anonymous user when connection are made as "zedjzlcsjhd" +source include/not_gtid_enabled.inc; source include/add_anonymous_users.inc; -- source include/master-slave.inc @@ -60,14 +61,14 @@ enable_warnings; CREATE TEMPORARY TABLE t1 (a char(1)); INSERT INTO t1 VALUES ('a'); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; source include/start_slave.inc; connection master; INSERT INTO t1 VALUES ('b'); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # case 2: crash on sp_rcontext::find_handler because it used # reference to invalid THD object after slave restart @@ -80,20 +81,20 @@ enable_warnings; CREATE TEMPORARY TABLE `t1`(`a` tinyint,`b` char(1))engine=myisam; INSERT INTO `t1` set `a`=128,`b`='128'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc source include/stop_slave.inc; source include/start_slave.inc; connection master; INSERT INTO `t1` set `a`=128,`b`='128'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # cleanup connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; @@ -220,7 +221,7 @@ drop table t1,t2; # don't get any memory leaks for this create temporary table t3 (f int); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # The server will now close done @@ -232,7 +233,7 @@ sync_slave_with_master; connection master; create temporary table t4 (f int); create table t5 (f int); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # connection slave stop slave; # to prepare for reconnecting w/o waiting for timeout connection master; @@ -275,7 +276,7 @@ connection master; create table t1(f int); insert into t1 values (1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; select * from t1 /* must be 1 */; @@ -288,20 +289,20 @@ drop table t1; --write_file $MYSQLTEST_VARDIR/tmp/bug14157.sql create table t1 (a int); set names latin1; -create temporary table `äöüÄÖÜ` (a int); -insert into `äöüÄÖÜ` values (1); -insert into t1 select * from `äöüÄÖÜ` +create temporary table `äöüÃÃÃ` (a int); +insert into `äöüÃÃÃ` values (1); +insert into t1 select * from `äöüÃÃÃ` EOF --exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=latin1 test < $MYSQLTEST_VARDIR/tmp/bug14157.sql -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #connection slave; select * from t1; connection master; drop table t1; --remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # Delete the anonymous users. --source include/stop_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary_errors.test index 69863df8..3a1a6499 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary_errors.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_temporary_errors.test @@ -11,7 +11,7 @@ connection master; CREATE TABLE t1 (a INT PRIMARY KEY, b INT); INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW STATUS LIKE 'Slave_retried_transactions'; # since bug#31552/31609 idempotency is not default any longer. In order # the following UPDATE t1 to pass the mode is switched temprorarily @@ -24,7 +24,7 @@ UPDATE t1 SET a = 5, b = 5 WHERE a = 1; SELECT * FROM t1; #SHOW BINLOG EVENTS; --echo **** On Slave **** -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; SHOW STATUS LIKE 'Slave_retried_transactions'; SELECT * FROM t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_timestamp_upgrage_55.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_timestamp_upgrage_55.test new file mode 100644 index 00000000..02cfb2b4 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_timestamp_upgrage_55.test @@ -0,0 +1,75 @@ +# ==== Purpose ==== +# +# To check, when we have master with table having +# TIMESTAMP(0), DATETIME(0) or TIME(0), slave +# having same table but we have created them in 5.5 +# and upgraded it. +# If we try to do replication, we will not get an assert. +# +# ==== Implementation ==== +# +# In Master--> +# create a table in master having TIMESTAMP(0), +# DATETIME(0) or TIME(0). +# In Slave--> +# copy the frm of the table created in 5.5 and upgraded. +# Insert value in master with row base replication on. +# +# ==== Related Bugs ==== +# +# Bug#17532932 TIMESTAMP AND DATETIMES SELF-INCOMPATIBLE +# DURING REPLICATION + +--source include/have_binlog_format_row.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +--source include/rpl_connection_slave.inc +--source include/stop_slave.inc + +--source include/start_slave.inc +--let $SLAVE_DATADIR=`SELECT @@DATADIR` + +--source include/rpl_connection_master.inc +# +# Creating table a MYISAM Engine, As if we create a table in INNODB, we have +# to skip some test cases. As certain INNODB tables like +# mysql/slave_master_info, mysql/slave_relay_log_info, mysql/slave_master_info +# are not be there in upgraded 5.5 tables. +# +CREATE TABLE bug17532932(a TIMESTAMP, + b DATETIME, + c TIME)ENGINE=MYISAM; +--source include/sync_slave_sql_with_master.inc +DROP TABLE bug17532932; +# +# Copy 5.5 bug17532932-ibdata1 and bug17532932.frm in slave's data dir. +# These files are created using "CREATE TABLE bug17532932(a TIMESTAMP, +# b DATETIME, c TIME);" +# +# To do that, stop slave, copy .frm, .MYD, .MYI file and then start server. +--let $rpl_server_number= 2 +--source include/rpl_stop_server.inc +--copy_file ./std_data/bug17532932.frm $slave_datadir/test/bug17532932.frm +--copy_file ./std_data/bug17532932.MYD $slave_datadir/test/bug17532932.MYD +--copy_file ./std_data/bug17532932.MYI $slave_datadir/test/bug17532932.MYI +--source include/rpl_start_server.inc +--source include/rpl_start_slaves.inc + + +--source include/rpl_connection_master.inc +INSERT INTO bug17532932 VALUES ("2014-04-16 12:35:51", + "2010-08-26 12:15:52", + "-38:59:59"); + +--source include/sync_slave_sql_with_master.inc + +--let $diff_tables= master:bug17532932, slave:bug17532932 +--source include/diff_tables.inc + + +# Cleanup +--source include/rpl_connection_master.inc +DROP TABLE bug17532932; + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_timezone.test index 6252a4db..15a3d4fe 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_timezone.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_timezone.test @@ -45,7 +45,7 @@ select @@time_zone; insert into t1 values ('20050101000000', NULL), ('20050611093902',NULL); insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL); SELECT * FROM t1 ORDER BY n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #set time_zone='UTC'; SELECT * FROM t1 ORDER BY n; @@ -56,7 +56,7 @@ delete from t1; set time_zone='Europe/Moscow'; insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL); SELECT * FROM t1 ORDER BY n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set time_zone='Europe/Moscow'; SELECT * FROM t1 ORDER BY n; connection master; @@ -73,7 +73,7 @@ delete from t1; set time_zone='UTC'; load data infile '../../std_data/rpl_timezone2.dat' into table t1; SELECT * FROM t1 ORDER BY n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set time_zone='UTC'; SELECT * FROM t1 ORDER BY n; set time_zone='Europe/Moscow'; @@ -93,7 +93,7 @@ set time_zone='MET'; --disable_warnings ONCE insert into t2 (select * from t1); SELECT * FROM t1 ORDER BY n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY n; # @@ -103,7 +103,7 @@ connection master; delete from t2; set timestamp=1000072000; insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY n; # @@ -114,7 +114,7 @@ delete from t2; insert into t2 values (from_unixtime(1000000000),NULL), (unix_timestamp('2001-09-09 03:46:40'),NULL); SELECT * FROM t2 ORDER BY n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # We should get same result on slave as on master SELECT * FROM t2 ORDER BY n; @@ -133,13 +133,13 @@ set time_zone='UTC'; insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone),NULL); insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'),NULL); SELECT * FROM t2 ORDER BY n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY n; # Clean up connection master; drop table t1, t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Restore original timezone @@ -160,7 +160,7 @@ SET @@session.time_zone='Japan'; UPDATE t1 SET b= '1970-01-01 08:59:59' WHERE a= 1; SELECT * FROM t1 ORDER BY a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SET @@session.time_zone='Japan'; # must procdure the same result as the SELECT on the master SELECT * FROM t1 ORDER BY a; @@ -169,7 +169,7 @@ SET @@session.time_zone = default; connection master; DROP TABLE t1; SET @@session.time_zone = default; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/stop_slave.inc # Bug#41719 delayed INSERT into timestamp col needs set time_zone for concurrent binlogging diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index aa22b239..7b052f96 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -10,7 +10,7 @@ source include/have_binlog_format_row.inc; LET $ENGINE_TYPE= MyISAM; source extra/rpl_tests/rpl_tmp_table_and_DDL.test; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG #51839 diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_trigger.test index bb2e5f35..d694fdc7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_trigger.test @@ -56,7 +56,7 @@ insert into t2 values(NULL,0),(500,0); select a,b, truncate(rand_value,4) from t1; select * from t2; select a,name, old_a, old_b, truncate(rand_value,4) from t3; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --disable_query_log select "--- On slave --" as ""; --enable_query_log @@ -120,7 +120,7 @@ SELECT trigger_name, definer FROM information_schema.triggers WHERE trigger_name = 't1_first'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --disable_query_log select "--- On slave --" as ""; --enable_query_log @@ -179,7 +179,7 @@ create database other; use other; insert into test.t1 values (1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; use test; @@ -226,7 +226,7 @@ while ($rnd) dec $i; } - sync_slave_with_master; + --source include/sync_slave_sql_with_master.inc #connection slave; eval select * from t1$rnd; delimiter |; @@ -265,7 +265,7 @@ while ($rnd) dec $i; } - sync_slave_with_master; + --source include/sync_slave_sql_with_master.inc #connection slave; eval SELECT * from t1$rnd /* must be f1 $max_rows ... 1 */; eval SELECT * from t3$rnd /* must be f3 $max_rows * 100 ... 100 */; @@ -277,7 +277,7 @@ while ($rnd) connection master; eval drop table t1$rnd; - sync_slave_with_master; + --source include/sync_slave_sql_with_master.inc connection master; dec $rnd; @@ -409,7 +409,7 @@ DROP TABLE IF EXISTS t2; --echo --echo ---> Synchronizing slave with master... ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo --echo ---> connection: master @@ -441,7 +441,7 @@ SELECT * FROM t2; --echo --echo ---> Synchronizing slave with master... ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ---> connection: master @@ -463,7 +463,7 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master # @@ -493,13 +493,13 @@ drop trigger if exists t1_bi; insert into t1 values (3, "c"); select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from t1; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug#40116: Uncommited changes are replicated and stay on slave after @@ -525,7 +525,7 @@ set autocommit = 0; insert into t1 values ( 1 ); --enable_warnings rollback; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; --source include/diff_tables.inc @@ -535,7 +535,7 @@ let $diff_tables= master:log, slave:log; connection master; drop table t1, log; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # End of tests diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_trunc_temp.test index 0e7d5483..ee05cb94 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_trunc_temp.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_trunc_temp.test @@ -27,19 +27,19 @@ source include/master-slave.inc; create temporary table t1 (n int); insert into t1 values(1); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc show status like 'Slave_open_temp_tables'; # Perform a delete from temp table connection master; delete from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc show status like 'Slave_open_temp_tables'; # Perform truncate on temp table connection master; truncate t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc show status like 'Slave_open_temp_tables'; # Disconnect the master, temp table on slave should dissapear diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_typeconv.test index ef521666..946f8a5d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_typeconv.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_typeconv.test @@ -1,5 +1,6 @@ #Want to skip this test from daily Valgrind execution --source include/no_valgrind_without_big.inc +--source include/not_gtid_enabled.inc --source include/have_binlog_format_row.inc --source include/master-slave.inc @@ -69,7 +70,7 @@ call mtr.add_suppression("The slave coordinator and worker threads are stopped, connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc set global slave_type_conversions = @saved_slave_type_conversions; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test index ba217210..d17f389c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test @@ -13,14 +13,14 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = ''; connection master; CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB; INSERT INTO t1 VALUES (b'0', b'01', b'101'); -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; connection master; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_unknown_ignorable_event.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_unknown_ignorable_event.test new file mode 100644 index 00000000..dfd1e308 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_unknown_ignorable_event.test @@ -0,0 +1,69 @@ +# ==== Purpose ==== +# +# Bug#19949915 IGNORABLE EVENTS DO NOT WORK AND ARE NOT TESTED +# +# Problem: +# In 5.6, Ignorable log events were introduced. These events have +# the flag LOG_EVENT_IGNORABLE_F flag (0x80) set in the flags field. +# When the server (specifically, the replication receiver and applier +# threads) sees an event with a type code it does not recognize, the +# server is supposed to check if this flag is set. If the flag is not +# set, the server generates an error and stops; if the flag is set, +# the server ignores the event. The purpose is to allow future server +# versions to introduce new event types that the slave can ignore +# (such as informational event types). However, this does not work, +# since the slave applier thread explicitly checks if the type code +# is in the range of known event types, and reports an error, before +# it goes further and checks if the event is ignorable. +# Fix: +# The slave applier thread does not check if this is a known event +# type any more. +# +# Steps to reproduce: +# 1) Set a debug point on slave to simulate unknown ignorable log events. +# 2) Write a write_rows log event and a previous gtids log event +# if gtid mode is on to binlog on master. +# 3) The slave receiver thread simulates an unknown ignorable +# log event by rewriting the write rows log event and +# previous gtids log event if gtid mode is on before +# writing it(them) in relay log. +# 4) Verify that the slave applier thread skips the unknown ignorable +# log event. +# + +--source include/have_binlog_format_row.inc +--source include/master-slave.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc + +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +--source include/sync_slave_sql_with_master.inc +--echo # Set a debug point on slave to simulate unknown ignorable log events. +SET @save_debug=@@global.debug; +SET GLOBAL DEBUG='d,simulate_unknown_ignorable_log_event'; + +--source include/rpl_connection_master.inc + +--echo # Write a previous_gtids log event to binlog +--echo # on master if gtid mode is on. +FLUSH LOGS; +--echo # Write a write_rows log event to binlog on master. +INSERT INTO t1 VALUES (1); + +--echo # The slave receiver thread simulates an unknown ignorable +--echo # log event by rewriting the write_rows log event and +--echo # previous_gtids log event if gtid mode is on before +--echo # writing it(them) in relay log. +--source include/sync_slave_sql_with_master.inc + +--echo # Verify that the slave applier thread skips these unknown ignorable +--echo # log event. +--let $assert_text= Table t1 must not contain 1 +--let $assert_cond= [SELECT count(*) FROM t1 WHERE c1=1] = 0 +--source include/assert.inc +SET GLOBAL DEBUG= @save_debug; + +# 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_user.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_user.test index 95435424..73cf7dae 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_user.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_user.test @@ -29,7 +29,7 @@ create user 'foo'@'fakehost', 'bar'@'fakehost'; create user 'foo1'@'fakehost' IDENTIFIED BY 'foo1', 'foo2'@'fakehost' IDENTIFIED BY PASSWORD'*1111111111111111111111111111111111111111', 'foo3'@'fakehost'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select Host,User from mysql.user where Host='fakehost'; --let $diff_tables= master:mysql.user, slave:mysql.user source include/diff_tables.inc; @@ -44,7 +44,7 @@ rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost --error ER_CANNOT_USER rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user2'@'fakehost' to 'barfoo'@'fakehost'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select Host,User from mysql.user where Host='fakehost'; # @@ -58,7 +58,7 @@ drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost'; --error ER_CANNOT_USER drop user 'not_exist_user1'@'fakehost', 'not_exist_user2'@'fakehost'; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select Host,User from mysql.user where Host='fakehost'; @@ -69,7 +69,7 @@ select Host,User from mysql.user where Host='fakehost'; connection master; CREATE USER must_change2@localhost IDENTIFIED BY 'aha'; ALTER USER must_change2@localhost PASSWORD EXPIRE; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select Host,User,password_expired from mysql.user where user='must_change2'; connect(must_change_con_slave,localhost,must_change2,aha,test,$SLAVE_MYPORT,); @@ -87,7 +87,7 @@ SET PASSWORD = PASSWORD('aha2'); connection master; disconnect must_change_con_master; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; connect(must_change_con_slave,localhost,must_change2,aha2,test,$SLAVE_MYPORT,); @@ -99,7 +99,7 @@ disconnect must_change_con_slave; DROP USER must_change2@localhost; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_user_variables.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_user_variables.test index dd6ddf39..e10255af 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_user_variables.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_user_variables.test @@ -25,8 +25,12 @@ enable_query_log; # test the slave immediately writes DROP TEMPORARY TABLE this_old_table). # We wait for the slave to have written all he wants to the binlog # (otherwise RESET MASTER may come too early). -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc reset master; +connection slave; +--source include/stop_slave.inc +RESET MASTER; +--source include/start_slave.inc connection master; create table t1(n char(30)); @@ -51,7 +55,7 @@ select * from t1 where n = '<nonexistant>'; connection master1; # see if variable is reset in binlog when thread changes insert into t1 values (@a),(@a),(@a*5); SELECT * FROM t1 ORDER BY n; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY n; connection master; insert into t1 select * FROM (select @var1 union select @var2) AS t2; @@ -110,7 +114,7 @@ CREATE TRIGGER test.insert_bi BEFORE INSERT END| DELIMITER ;| -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # Set @var and call the procedure, repeat with different values @@ -125,7 +129,7 @@ CALL test.insert(); SELECT * FROM t20; SELECT * FROM t21; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo On slave: Check the tables for correct data and it matches master @@ -171,7 +175,7 @@ INSERT INTO t1 VALUES (square()); SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo On slave: Retrieve the values from the table and verify they are the same as on master @@ -215,7 +219,7 @@ CREATE FUNCTION f2() returns int deterministic BEGIN END | DELIMITER ;| -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # Set an @var to a value and insert data into a table using the first function. @@ -229,7 +233,7 @@ INSERT INTO t1 values(f2()); --echo On master: Retrieve the values from the table -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; SELECT * from t1; @@ -272,7 +276,7 @@ CREATE trigger t1_bi before INSERT on t1 for each row BEGIN END | DELIMITER ;| -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # Set the @var to a value then insert data into first table. @@ -285,7 +289,7 @@ INSERT INTO t1 values (5); SELECT * from t1; SELECT * from t2; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo On slave: Check the tables for correct data and it matches master @@ -303,7 +307,7 @@ create table t1(a int, b int); prepare s1 from 'insert into t1 values (@x:=@x+1, ?)'; set @x=1; execute s1 using @x; select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; connection master; @@ -322,7 +326,7 @@ set @x='1.1'; execute s1 using @x; --enable_warnings select * from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection slave; select * from t1; connection master; @@ -353,7 +357,7 @@ FUNCTION f2() RETURNS INT BEGIN END| DELIMITER ;| -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc connection master; # Set the variable and execute the functions. @@ -366,7 +370,7 @@ SELECT f1(), f2(); INSERT INTO t1 VALUES(f1()); SELECT * FROM t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo On slave: Check the table for correct data and it matches master @@ -380,6 +384,6 @@ DROP FUNCTION f1; DROP FUNCTION f2; DROP TABLE t1; -sync_slave_with_master; +--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_variables.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_variables.test index eee36a37..c85fab95 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_variables.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_variables.test @@ -695,7 +695,7 @@ EXECUTE p49; EXECUTE p50; EXECUTE p51; EXECUTE p52; EXECUTE p53; EXECUTE p54; EXECUTE p55; EXECUTE p56; EXECUTE p57; EXECUTE p58; EXECUTE p59; EXECUTE p60; EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master @@ -704,7 +704,7 @@ EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64; # Show the result in table test.tstmt on master... SELECT * FROM tstmt ORDER BY id; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # ... then compare test.tstmt on master to the other tables on master and slave. let $diff_tables= master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep; @@ -741,5 +741,5 @@ SET @@global.sql_mode= @s_sql_mode; SET @@global.sync_binlog= @s_sync_binlog; connection master; -sync_slave_with_master; +--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_variables_stm.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_variables_stm.test index 8943585b..fe19108d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_variables_stm.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_variables_stm.test @@ -571,7 +571,7 @@ EXECUTE p49; EXECUTE p50; EXECUTE p51; EXECUTE p52; EXECUTE p53; EXECUTE p54; EXECUTE p55; EXECUTE p56; EXECUTE p57; EXECUTE p58; EXECUTE p59; EXECUTE p60; EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master @@ -580,7 +580,7 @@ EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64; # Show the result in table test.tstmt on master... SELECT * FROM tstmt ORDER BY id; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc # ... then compare test.tstmt on master to the other tables on master and slave. let $diff_tables= master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep; @@ -617,5 +617,5 @@ SET @@global.lc_time_names= @s_lc_time_names; SET @@global.collation_database= @s_collation_database; connection master; -sync_slave_with_master; +--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_view.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_view.test index 3f0052cd..dd90f0f7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_view.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_view.test @@ -4,8 +4,7 @@ source include/master-slave.inc; --disable_warnings drop table if exists t1,v1; drop view if exists t1,v1; -sync_slave_with_master; -reset master; +--source include/sync_slave_sql_with_master.inc --enable_warnings # @@ -18,33 +17,33 @@ insert into t1 values (1); create view v1 as select a from t1; insert into v1 values (2); select * from v1 order by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # view already have to be on slave select * from v1 order by a; connection master; update v1 set a=3 where a=1; select * from v1 order by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from v1 order by a; connection master; delete from v1 where a=2; select * from v1 order by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from v1 order by a; connection master; # 'alter view' internally maped to creation, but still check that it works alter view v1 as select a as b from t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc select * from v1 order by 1; connection master; drop view v1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc #error, because view have to be removed from slave -- error 1146 select * from v1 order by a; connection master; drop table t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # Change Author: JBM # Change Date: 2005-12-22 # Change: Commented out binlog events to work with SBR and RBR @@ -74,7 +73,7 @@ DROP VIEW IF EXISTS v1; --echo --echo ---> Synchronizing slave with master... ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo --echo ---> connection: master @@ -102,7 +101,7 @@ SELECT * FROM t1; --echo --echo ---> Synchronizing slave with master... ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo ---> connection: master @@ -123,7 +122,7 @@ SELECT * FROM t1; DROP VIEW v1; DROP TABLE t1; ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --connection master # @@ -135,7 +134,7 @@ create table t1(a int, b int); insert into t1 values (1, 1), (1, 2), (1, 3); create view v1(a, b) as select a, sum(b) from t1 group by a; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc explain v1; show create table v1; select * from v1; @@ -144,7 +143,7 @@ connection master; drop table t1; drop view v1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # BUG#28244 CREATE VIEW breaks replication when view exists @@ -156,7 +155,7 @@ CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v1 AS SELECT * FROM t1; DROP VIEW v1; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc # # Bug#32575 Parse error of stmt with extended comments on slave side @@ -169,12 +168,12 @@ CREATE TABLE t1 (a INT); /*!50001 VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) */ /*!50002 WITH CASCADED CHECK OPTION */; SHOW CREATE VIEW v1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc SHOW CREATE VIEW v1; connection master; DROP VIEW v1; DROP TABLE t1; -sync_slave_with_master; +--source include/sync_slave_sql_with_master.inc --echo End of 5.0 tests --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_view_multi.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_view_multi.test index 22509f8e..bccf866e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_view_multi.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_view_multi.test @@ -25,7 +25,7 @@ drop tables if exists t1, t2; drop view if exists v1; --enable_warnings --echo # Syncing slave with master and switching to connection 'slave' ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc connect (master2,127.0.0.1,root,,test,$MASTER_MYPORT,); @@ -77,7 +77,7 @@ connection master; --echo # Check that insertion through view did happen. select * from t1; --echo # Syncing slave with master and switching to connection 'slave' ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo # Check that slave was able to replicate this sequence --echo # which means that we got correct binlog order. select * from t1; @@ -131,7 +131,7 @@ select * from t1; select * from t2; --echo # Syncing slave with master and switching to connection 'slave' ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --echo # Now let us check that statements were logged in proper order --echo # So we have same result on slave. select * from t1; @@ -142,5 +142,5 @@ connection master; drop table t1, t2; drop view v1; --echo # Syncing slave with master and switching to connection 'slave' ---sync_slave_with_master +--source include/sync_slave_sql_with_master.inc --source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result index 136aee25..37a2865f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result @@ -22,6 +22,7 @@ fn1(0) 0 create table t2 (a int) engine=NDB; insert into t2 values(fn1(2)); +include/sync_slave_sql_with_master.inc SHOW CREATE TABLE test.t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result index 4fb33dc4..ab03d8e0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result @@ -24,6 +24,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3; LENGTH(data) 16384 +include/sync_slave_sql_with_master.inc **** Data Insert Validation Slave Section test.t1 **** @@ -50,6 +51,7 @@ LENGTH(data) SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; LENGTH(data) 17408 +include/sync_slave_sql_with_master.inc **** Data Update Validation Slave Section test.t1 **** @@ -109,6 +111,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 20000 b2 30000 dd2 +include/sync_slave_sql_with_master.inc **** Data Insert Validation Slave Section test.t2 **** @@ -136,6 +139,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) 2 2256 b1 3000 dd1 +include/sync_slave_sql_with_master.inc **** Data Update Validation Slave Section test.t2 **** @@ -150,4 +154,5 @@ c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3) DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result index 5f61e4d7..92c29b78 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result @@ -2,11 +2,14 @@ include/master-slave.inc [connection master] create table t1 (a int, b int) engine=NDB; insert into t1 values(1,1); +include/sync_slave_sql_with_master.inc select * from t1; a b 1 1 delete from t1; +include/sync_slave_sql_with_master.inc select * from t1; a b drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result index 3829d146..7aa6e417 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result @@ -22,6 +22,7 @@ START TRANSACTION; INSERT INTO test.t1 VALUES (null,test.f1()); ROLLBACK; SET AUTOCOMMIT=1; +include/sync_slave_sql_with_master.inc DROP FUNCTION test.f1; DROP TABLE test.t1; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result index 6659a259..ce8ac573 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result @@ -21,9 +21,11 @@ INSERT INTO t2 VALUES (5, 4); INSERT INTO t2 VALUES (6, 6); INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; include/assert.inc [Count of elements in t1 should be 6.] +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:test.t1 , slave:test.t1] INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; include/assert.inc [Count of elements in t1 should be 6.] include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.] drop table t1, t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result index f3142678..2c590956 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result @@ -38,15 +38,19 @@ a b 1 0 2 1 drop table t1,t2; +include/sync_slave_sql_with_master.inc reset master; +RESET MASTER; CREATE TABLE t1 ( a INT ); INSERT INTO t1 VALUES (0); UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; select * from t1; a 3 +include/sync_slave_sql_with_master.inc select * from t1; a 3 drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result index ebb41643..65f00c64 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result @@ -30,6 +30,7 @@ SELECT * FROM t2 ORDER BY a; a b 1 6 2 6 +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY a; a b 1 0 @@ -65,6 +66,7 @@ WHERE b2 = 'baz') AND a.a3 IS NULL AND a.a4 = 'foo' AND a.a5 = 'bar'; +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a1 a2 a3 a4 a5 No 1 NULL foo bar @@ -114,6 +116,7 @@ FROM t3 WHERE y = 34 ) WHERE b.x = 23; +include/sync_slave_sql_with_master.inc SELECT * FROM t1; i j x y z 1 2 23 24 71 @@ -174,6 +177,7 @@ idpro price nbprice 1 1.0000 3 2 1.0000 2 3 2.0000 1 +include/sync_slave_sql_with_master.inc select "-- SLAVE AFTER JOIN --" as ""; -- SLAVE AFTER JOIN -- diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result index 5ceb3311..9c61e4c0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +include/sync_slave_sql_with_master.inc stop slave; create table t1 (a int) engine=NDB; reset slave; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result index 333e943d..5da1b6d5 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result @@ -36,6 +36,7 @@ RESET SLAVE; SELECT COUNT(*) FROM t1; COUNT(*) 5000 +RESET MASTER; LOCK TABLES t1 READ; START SLAVE; UNLOCK TABLES; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_basic.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_basic.result index 2d101508..b5a1c9fe 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_basic.result @@ -3,6 +3,7 @@ include/master-slave.inc CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'NDB' ; SELECT * FROM t1; C1 C2 +include/sync_slave_sql_with_master.inc SELECT * FROM t1; C1 C2 INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X'); @@ -15,6 +16,7 @@ A C X X X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A A @@ -30,6 +32,7 @@ A B A C X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B @@ -43,6 +46,7 @@ A B A I X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY C1,C2; C1 C2 A B @@ -56,6 +60,7 @@ A B A I X Y X Z +include/sync_slave_sql_with_master.inc SELECT * FROM t1 ORDER BY c1,c2; C1 C2 A B @@ -84,6 +89,7 @@ c1 c12 c2 5 A 25 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 2 @@ -114,6 +120,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -137,6 +144,7 @@ c1 c12 c2 7 A 49 8 A 64 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -158,6 +166,7 @@ c1 c12 c2 6 A 36 7 A 49 9 A 81 +include/sync_slave_sql_with_master.inc SELECT * FROM t2 ORDER BY c1,c2; c1 c12 c2 1 A 1 @@ -179,6 +188,7 @@ A C 1 B 2 X X 3 B 1 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A A 3 B 2 @@ -194,6 +204,7 @@ A B 1 B 1 A C 1 B 2 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 @@ -207,6 +218,7 @@ A B 1 B 1 A I 1 B 2 X Y 2 B 1 X Z 2 B 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t3 ORDER BY C1,C2; C1 C2 pk1 C3 pk2 A B 1 B 1 @@ -224,6 +236,7 @@ X X 3 A C 4 X Z 5 A A 6 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -239,6 +252,7 @@ A B 1 X Y 2 A C 4 X Z 5 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -252,6 +266,7 @@ A B 1 X Y 2 A I 4 X Z 5 +include/sync_slave_sql_with_master.inc SELECT * FROM t6 ORDER BY C3; C1 C2 C3 A B 1 @@ -306,6 +321,7 @@ X Q 5 7 R 49 X Y 2 S 1 X Q 5 7 R 49 X Z 2 S 2 X Q 5 9 R 81 X Y 2 S 1 X Q 5 9 R 81 X Z 2 S 2 +include/sync_slave_sql_with_master.inc SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2; C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2 X Q 2 1 R 1 X Y 2 S 1 @@ -355,10 +371,12 @@ INSERT INTO t4 SET C1 = 1; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 +include/sync_slave_sql_with_master.inc SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'NDB' ; +include/sync_slave_sql_with_master.inc --- on slave: original values --- INSERT INTO t7 VALUES (1,3), (2,6), (3,9); SELECT * FROM t7 ORDER BY C1; @@ -374,6 +392,7 @@ C1 C2 1 2 2 4 3 6 +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --- on slave: old values should be overwritten by replicated values --- SELECT * FROM t7 ORDER BY C1; @@ -393,6 +412,7 @@ ERROR 23000: Duplicate entry '99' for key 'c' SELECT * FROM t8 ORDER BY a; a b c 99 99 99 +include/sync_slave_sql_with_master.inc --- on slave --- SELECT * FROM t8 ORDER BY a; a b c @@ -407,6 +427,7 @@ a b c set @@global.slave_exec_mode= 'IDEMPOTENT'; --- on master --- INSERT INTO t8 VALUES (2,4,8); +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; --- on slave --- SELECT * FROM t8 ORDER BY a; @@ -418,15 +439,18 @@ a b c **** Test for BUG#31552 **** **** On Master **** DELETE FROM t1; +include/sync_slave_sql_with_master.inc include/rpl_reset.inc **** On Master **** INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); **** On Master **** +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= 'IDEMPOTENT'; DELETE FROM t1 WHERE C1 = 'L'; DELETE FROM t1; SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 +include/sync_slave_sql_with_master.inc set @@global.slave_exec_mode= default; include/check_slave_is_running.inc SELECT COUNT(*) FROM t1 ORDER BY c1,c2; @@ -438,20 +462,24 @@ CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); INSERT INTO t1 VALUES( '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); **** On Slave **** +include/sync_slave_sql_with_master.inc SELECT * FROM t1; a b c 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'NDB' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'NDB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'NDB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, @@ -459,10 +487,12 @@ j INT NOT NULL) ENGINE = 'NDB' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'NDB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'NDB' ; +include/sync_slave_sql_with_master.inc ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, @@ -472,10 +502,12 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] [expecting slave to replicate correctly] INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t2, slave:t2] SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); @@ -486,6 +518,7 @@ include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t4, slave:t4] [expecting slave to stop] INSERT INTO t5 VALUES (1, "", 1); @@ -502,15 +535,19 @@ include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t7, slave:t7] drop table t1, t2, t3, t4, t5, t6, t7; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='NDB' ; INSERT INTO t1 VALUES (1), (2), (3); UPDATE t1 SET a = 10; ERROR 23000: Duplicate entry '10' for key 'PRIMARY' INSERT INTO t1 VALUES (4); +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( `pk` int(11) NOT NULL AUTO_INCREMENT, @@ -579,8 +616,10 @@ UPDATE t1 SET a = 9 WHERE a < 3; INSERT INTO t1 ( a ) VALUES ( 3 ); UPDATE t1 SET a = 0 WHERE a < 4; UPDATE t1 SET a = 8 WHERE a < 5; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc CREATE TABLE t1 (a bit) ENGINE='NDB' ; INSERT IGNORE INTO t1 VALUES (NULL); INSERT INTO t1 ( a ) VALUES ( 0 ); @@ -621,6 +660,8 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0; UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2; INSERT INTO t1 ( a ) VALUES ( 1 ); UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3; +include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:t1, slave:t1] drop table t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result index 064dacd5..141c8095 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result @@ -30,6 +30,7 @@ release_lock("test") SELECT * FROM test.t1; a 5 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; a 5 @@ -45,10 +46,12 @@ release_lock("test") SELECT * FROM test.t1; a 8 +include/sync_slave_sql_with_master.inc SELECT * FROM test.t1; a 8 DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result index 2dd17547..030de802 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result @@ -33,9 +33,12 @@ BEGIN INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1'); END| CALL p2(); +include/sync_slave_sql_with_master.inc CALL p1(); +include/sync_slave_sql_with_master.inc DROP TABLE t1; DROP TABLE t2; DROP PROCEDURE p1; DROP PROCEDURE p2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result index c6d9e291..96aede30 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result @@ -15,6 +15,7 @@ n d select * from test.t2; n f 1 0 +include/sync_slave_sql_with_master.inc select * from test.t1; n d 1 1.234 @@ -24,4 +25,5 @@ n f DROP TRIGGER test.t1_bi_t2; DROP TABLE test.t1; DROP TABLE test.t2; +include/sync_slave_sql_with_master.inc include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlog_error_action_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlog_error_action_basic.result new file mode 100644 index 00000000..12a760c5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlog_error_action_basic.result @@ -0,0 +1,45 @@ +SELECT @@GLOBAL.binlog_error_action; +@@GLOBAL.binlog_error_action +IGNORE_ERROR +IGNORE_ERROR Expected +SELECT @@SESSION.binlog_error_action; +ERROR HY000: Variable 'binlog_error_action' is a GLOBAL variable +SET @start_value= @@global.binlog_error_action; +SHOW GLOBAL VARIABLES LIKE 'binlog_error_action'; +Variable_name Value +binlog_error_action IGNORE_ERROR +SET @@GLOBAL.binlog_error_action=IGNORE_ERROR; +SELECT @@GLOBAL.binlog_error_action; +@@GLOBAL.binlog_error_action +IGNORE_ERROR +IGNORE_ERROR Expected +SET @@GLOBAL.binlog_error_action=ABORT_SERVER; +SELECT @@GLOBAL.binlog_error_action; +@@GLOBAL.binlog_error_action +ABORT_SERVER +ABORT_SERVER Expected +SELECT @@GLOBAL.binlog_error_action = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_error_action'; +@@GLOBAL.binlog_error_action = VARIABLE_VALUE +1 +1 Expected +SELECT COUNT(@@GLOBAL.binlog_error_action); +COUNT(@@GLOBAL.binlog_error_action) +1 +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_error_action'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +SELECT COUNT(@@binlog_error_action); +COUNT(@@binlog_error_action) +1 +1 Expected +SELECT COUNT(@@GLOBAL.binlog_error_action); +COUNT(@@GLOBAL.binlog_error_action) +1 +1 Expected +SET @@global.binlog_error_action= @start_value; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlog_gtid_simple_recovery_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlog_gtid_simple_recovery_basic.result new file mode 100644 index 00000000..143993cc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlog_gtid_simple_recovery_basic.result @@ -0,0 +1,27 @@ +SELECT @@GLOBAL.binlog_gtid_simple_recovery; +@@GLOBAL.binlog_gtid_simple_recovery +0 +SELECT COUNT(@@GLOBAL.binlog_gtid_simple_recovery); +COUNT(@@GLOBAL.binlog_gtid_simple_recovery) +1 +SELECT COUNT(@@binlog_gtid_simple_recovery); +COUNT(@@binlog_gtid_simple_recovery) +1 +SELECT @@SESSION.binlog_gtid_simple_recovery; +ERROR HY000: Variable 'binlog_gtid_simple_recovery' is a GLOBAL variable +SHOW GLOBAL VARIABLES LIKE 'binlog_gtid_simple_recovery'; +Variable_name Value +binlog_gtid_simple_recovery OFF +SHOW SESSION VARIABLES LIKE 'binlog_gtid_simple_recovery'; +Variable_name Value +binlog_gtid_simple_recovery OFF +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_gtid_simple_recovery'; +VARIABLE_NAME VARIABLE_VALUE +BINLOG_GTID_SIMPLE_RECOVERY OFF +SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='binlog_gtid_simple_recovery'; +VARIABLE_NAME VARIABLE_VALUE +BINLOG_GTID_SIMPLE_RECOVERY OFF +SET GLOBAL binlog_gtid_simple_recovery=1; +ERROR HY000: Variable 'binlog_gtid_simple_recovery' is a read only variable +SET SESSION binlog_gtid_simple_recovery=1; +ERROR HY000: Variable 'binlog_gtid_simple_recovery' is a read only variable diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlogging_impossible_mode_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlogging_impossible_mode_basic.result new file mode 100644 index 00000000..f98b0c4d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/binlogging_impossible_mode_basic.result @@ -0,0 +1,67 @@ +SELECT @@GLOBAL.binlogging_impossible_mode; +@@GLOBAL.binlogging_impossible_mode +IGNORE_ERROR +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +IGNORE_ERROR Expected +SELECT @@SESSION.binlogging_impossible_mode; +ERROR HY000: Variable 'binlogging_impossible_mode' is a GLOBAL variable +SET @start_value= @@global.binlogging_impossible_mode; +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +SHOW GLOBAL VARIABLES LIKE 'binlogging_impossible_mode'; +Variable_name Value +binlogging_impossible_mode IGNORE_ERROR +SET @@GLOBAL.binlogging_impossible_mode=IGNORE_ERROR; +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +SELECT @@GLOBAL.binlogging_impossible_mode; +@@GLOBAL.binlogging_impossible_mode +IGNORE_ERROR +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +IGNORE_ERROR Expected +SET @@GLOBAL.binlogging_impossible_mode=ABORT_SERVER; +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +SELECT @@GLOBAL.binlogging_impossible_mode; +@@GLOBAL.binlogging_impossible_mode +ABORT_SERVER +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +ABORT_SERVER Expected +SELECT @@GLOBAL.binlogging_impossible_mode = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlogging_impossible_mode'; +@@GLOBAL.binlogging_impossible_mode = VARIABLE_VALUE +1 +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +1 Expected +SELECT COUNT(@@GLOBAL.binlogging_impossible_mode); +COUNT(@@GLOBAL.binlogging_impossible_mode) +1 +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlogging_impossible_mode'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +SELECT COUNT(@@binlogging_impossible_mode); +COUNT(@@binlogging_impossible_mode) +1 +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +1 Expected +SELECT COUNT(@@GLOBAL.binlogging_impossible_mode); +COUNT(@@GLOBAL.binlogging_impossible_mode) +1 +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead +1 Expected +SET @@global.binlogging_impossible_mode= @start_value; +Warnings: +Warning 1287 '@@binlogging_impossible_mode' is deprecated and will be removed in a future release. Please use '@@binlog_error_action' instead diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/block_encryption_mode_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/block_encryption_mode_basic.result new file mode 100644 index 00000000..b979f072 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/block_encryption_mode_basic.result @@ -0,0 +1,200 @@ +SET @start_global_value = @@global.block_encryption_mode; +SELECT @start_global_value; +@start_global_value +aes-128-ecb +SET @start_session_value = @@session.block_encryption_mode; +SELECT @start_session_value; +@start_session_value +aes-128-ecb +'#--------------------FN_DYNVARS_002_01-------------------------#' +SET @@global.block_encryption_mode = 'aes-192-ecb'; +SET @@global.block_encryption_mode = DEFAULT; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = 'aes-192-ecb'; +SET @@session.block_encryption_mode = DEFAULT; +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +'#--------------------FN_DYNVARS_002_02-------------------------#' +SET @@global.block_encryption_mode = @start_global_value; +SELECT @@global.block_encryption_mode = 'aes-128-ecb'; +@@global.block_encryption_mode = 'aes-128-ecb' +1 +SET @@session.block_encryption_mode = @start_session_value; +SELECT @@session.block_encryption_mode = 'aes-128-ecb'; +@@session.block_encryption_mode = 'aes-128-ecb' +1 +'#--------------------FN_DYNVARS_002_03-------------------------#' +SET @@global.block_encryption_mode = 'aes-128-ecb'; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = 'aes-256-ecb'; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-256-ecb +SET @@global.block_encryption_mode = 'aes-256-cbc'; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-256-cbc +'#--------------------FN_DYNVARS_002_04-------------------------#' +SET @@session.block_encryption_mode = 'aes-128-ecb'; +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = 'aes-256-ecb'; +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-256-ecb +SET @@session.block_encryption_mode = 'aes-256-cbc'; +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-256-cbc +'#------------------FN_DYNVARS_002_05-----------------------#' +SET @@global.block_encryption_mode = 0; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = -1024; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of '-1024' +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = 65536; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of '65536' +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = 4294967295; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of '4294967295' +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = 65535.4; +ERROR 42000: Incorrect argument type to variable 'block_encryption_mode' +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = ON; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of 'ON' +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = OFF; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of 'OFF' +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = test; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of 'test' +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@global.block_encryption_mode = 'des-128-ecb'; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of 'des-128-ecb' +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = 0; +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = -1024; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of '-1024' +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = 65536; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of '65536' +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = 4294967295; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of '4294967295' +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = 65535.4; +ERROR 42000: Incorrect argument type to variable 'block_encryption_mode' +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = ON; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of 'ON' +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = OFF; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of 'OFF' +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = test; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of 'test' +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = 'des-128-ecb'; +ERROR 42000: Variable 'block_encryption_mode' can't be set to the value of 'des-128-ecb' +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +'#------------------FN_DYNVARS_002_06-----------------------#' +SELECT @@global.block_encryption_mode = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='block_encryption_mode'; +@@global.block_encryption_mode = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_002_07-----------------------#' +SELECT @@session.block_encryption_mode = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='block_encryption_mode'; +@@session.block_encryption_mode = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_002_08-----------------------#' +SET @@global.block_encryption_mode = TRUE; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-192-ecb +SET @@global.block_encryption_mode = FALSE; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.block_encryption_mode = 'aes-192-ecb'; +SET @@session.block_encryption_mode = 'aes-256-cbc'; +SELECT @@block_encryption_mode = @@global.block_encryption_mode; +@@block_encryption_mode = @@global.block_encryption_mode +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@block_encryption_mode = 'aes-192-cbc'; +SELECT @@block_encryption_mode = @@local.block_encryption_mode; +@@block_encryption_mode = @@local.block_encryption_mode +1 +SELECT @@local.block_encryption_mode = @@session.block_encryption_mode; +@@local.block_encryption_mode = @@session.block_encryption_mode +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET block_encryption_mode = 'aes-128-cbc'; +SELECT @@block_encryption_mode; +@@block_encryption_mode +aes-128-cbc +SELECT local.block_encryption_mode; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.block_encryption_mode; +ERROR 42S02: Unknown table 'session' in field list +SELECT block_encryption_mode = @@session.block_encryption_mode; +ERROR 42S22: Unknown column 'block_encryption_mode' in 'field list' +SET @@global.block_encryption_mode = @start_global_value; +SELECT @@global.block_encryption_mode; +@@global.block_encryption_mode +aes-128-ecb +SET @@session.block_encryption_mode = @start_session_value; +SELECT @@session.block_encryption_mode; +@@session.block_encryption_mode +aes-128-ecb +# +# End of 5.7 tests +# diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/debug_sync_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/debug_sync_basic.result index 6ebb46dd..b41bef26 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/debug_sync_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/debug_sync_basic.result @@ -2,17 +2,17 @@ select @@global.debug_sync; ERROR HY000: Variable 'debug_sync' is a SESSION variable select @@session.debug_sync; @@session.debug_sync -ON - current signal: '' +ON - signals: '' show global variables like "debug_sync"; Variable_name Value show session variables like "debug_sync"; Variable_name Value -debug_sync ON - current signal: '' +debug_sync ON - signals: '' select * from information_schema.global_variables where variable_name="debug_sync"; VARIABLE_NAME VARIABLE_VALUE select * from information_schema.session_variables where variable_name="debug_sync"; VARIABLE_NAME VARIABLE_VALUE -DEBUG_SYNC ON - current signal: '' +DEBUG_SYNC ON - signals: '' set @@session.debug_sync=1; ERROR 42000: Incorrect argument type to variable 'debug_sync' set @@session.debug_sync=1.1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/general_log_file_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/general_log_file_basic.result index 611e0f80..30bb0f35 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/general_log_file_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/general_log_file_basic.result @@ -10,6 +10,7 @@ RIGHT(@@global.general_log_file, length(@a)) = @a 1 '#--------------------FN_DYNVARS_004_02------------------------#' SET @@global.general_log_file = mytest.log; +ERROR 42000: Incorrect argument type to variable 'general_log_file' SET @@global.general_log_file = 12; ERROR 42000: Incorrect argument type to variable 'general_log_file' '#----------------------FN_DYNVARS_004_03------------------------#' diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result new file mode 100644 index 00000000..abf2cdaf --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result @@ -0,0 +1,26 @@ +# +# Basic test for innodb_fil_make_page_dirty_debug. +# +SELECT @@global.innodb_fil_make_page_dirty_debug; +@@global.innodb_fil_make_page_dirty_debug +0 +set global innodb_fil_make_page_dirty_debug = 0; +SELECT @@global.innodb_fil_make_page_dirty_debug; +@@global.innodb_fil_make_page_dirty_debug +0 +set global innodb_fil_make_page_dirty_debug = 0; +set global innodb_fil_make_page_dirty_debug = dummy; +ERROR 42000: Incorrect argument type to variable 'innodb_fil_make_page_dirty_debug' +set innodb_fil_make_page_dirty_debug = ON; +ERROR HY000: Variable 'innodb_fil_make_page_dirty_debug' is a GLOBAL variable and should be set with SET GLOBAL +# An example usage. +create table t1 (f1 int primary key) engine = innodb; +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; +drop table t1; +# Must always be 0. +SELECT @@global.innodb_fil_make_page_dirty_debug; +@@global.innodb_fil_make_page_dirty_debug +0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result index 0aefabd4..59f6431a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result @@ -25,8 +25,14 @@ set global innodb_ft_result_cache_limit=1000000; select @@innodb_ft_result_cache_limit; @@innodb_ft_result_cache_limit 1000000 -set global innodb_ft_result_cache_limit=4000000000; +set global innodb_ft_result_cache_limit=4294967295; select @@innodb_ft_result_cache_limit; @@innodb_ft_result_cache_limit -4000000000 +4294967295 +set global innodb_ft_result_cache_limit=4*1024*1024*1024; +Warnings: +Warning 1292 Truncated incorrect innodb_ft_result_cache_limit value: '4294967296' +select @@innodb_ft_result_cache_limit; +@@innodb_ft_result_cache_limit +4294967295 set global innodb_ft_result_cache_limit=2000000000; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result new file mode 100644 index 00000000..20e2b78e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result @@ -0,0 +1,26 @@ +# +# Basic test for innodb_saved_page_number_debug. +# +SELECT @@global.innodb_saved_page_number_debug; +@@global.innodb_saved_page_number_debug +0 +set global innodb_saved_page_number_debug = 10; +SELECT @@global.innodb_saved_page_number_debug; +@@global.innodb_saved_page_number_debug +10 +set global innodb_saved_page_number_debug = 100; +set global innodb_saved_page_number_debug = dummy; +ERROR 42000: Incorrect argument type to variable 'innodb_saved_page_number_debug' +set innodb_saved_page_number_debug = ON; +ERROR HY000: Variable 'innodb_saved_page_number_debug' is a GLOBAL variable and should be set with SET GLOBAL +# An example usage. +create table t1 (f1 int primary key) engine = innodb; +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; +drop table t1; +set global innodb_saved_page_number_debug = 0; +SELECT @@global.innodb_saved_page_number_debug; +@@global.innodb_saved_page_number_debug +0 diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result index fb7093ec..0335db8e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/innodb_thread_sleep_delay_basic.result @@ -41,6 +41,8 @@ set global innodb_thread_sleep_delay=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' set global innodb_thread_sleep_delay="foo"; ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' +set global innodb_thread_sleep_delay=18446744073709551616; +ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' set global innodb_thread_sleep_delay=-7; Warnings: Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '-7' @@ -50,6 +52,34 @@ select @@global.innodb_thread_sleep_delay; select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; VARIABLE_NAME VARIABLE_VALUE INNODB_THREAD_SLEEP_DELAY 0 +set global innodb_thread_sleep_delay=0; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +0 +set global innodb_thread_sleep_delay=1000; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +1000 +set global innodb_thread_sleep_delay=1000000; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +1000000 +set global innodb_thread_sleep_delay=1000001; +Warnings: +Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '1000001' +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +1000000 +set global innodb_thread_sleep_delay=4294967295; +Warnings: +Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '4294967295' +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +1000000 +set global innodb_thread_sleep_delay=555; +select @@global.innodb_thread_sleep_delay; +@@global.innodb_thread_sleep_delay +555 SET @@global.innodb_thread_sleep_delay = @start_global_value; SELECT @@global.innodb_thread_sleep_delay; @@global.innodb_thread_sleep_delay diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result index a7c6f133..daddc4af 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result @@ -4,31 +4,43 @@ SET @old_long_query_time= @@session.long_query_time; SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements; USE test; CREATE TABLE log_slow_admin_statements ( -i INT PRIMARY KEY, -j INT -); +i INT PRIMARY KEY AUTO_INCREMENT, +j VARCHAR(255) +) ENGINE=InnoDB; SET GLOBAL log_output = 'file,table'; SET GLOBAL slow_query_log = on; SET SESSION long_query_time = 0; SET GLOBAL log_slow_admin_statements = on; -ALTER TABLE log_slow_admin_statements ADD COLUMN k INT; -INSERT INTO log_slow_admin_statements VALUES (1,2,3), (4,5,6); +ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17; +CREATE PROCEDURE add_rows() +BEGIN +DECLARE count INT; +SET count = 1; +INSERT INTO log_slow_admin_statements(j) values (REPEAT('A', 255)); +WHILE count <= 15 DO +INSERT INTO log_slow_admin_statements(j) SELECT j FROM log_slow_admin_statements; +SET count = count + 1; +END WHILE; +END +$ +CALL add_rows(); OPTIMIZE TABLE log_slow_admin_statements; Table Op Msg_type Msg_text +test.log_slow_admin_statements optimize note Table does not support optimize, doing recreate + analyze instead test.log_slow_admin_statements optimize status OK -INSERT INTO log_slow_admin_statements VALUES (7,8,9), (10,11,12); -ANALYZE TABLE log_slow_admin_statements; +CHECK TABLE log_slow_admin_statements EXTENDED; Table Op Msg_type Msg_text -test.log_slow_admin_statements analyze status OK +test.log_slow_admin_statements check status OK DROP TABLE log_slow_admin_statements; SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%'; sql_text -ALTER TABLE log_slow_admin_statements ADD COLUMN k INT +ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17 OPTIMIZE TABLE log_slow_admin_statements -ANALYZE TABLE log_slow_admin_statements +CHECK TABLE log_slow_admin_statements EXTENDED DROP TABLE log_slow_admin_statements SET @@global.log_output= @old_log_output; SET @@global.slow_query_log= @old_slow_query_log; SET @@session.long_query_time= @old_long_query_time; SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements; +DROP PROCEDURE add_rows; TRUNCATE TABLE mysql.slow_log; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/secure_auth_func.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/secure_auth_func.result index 5662e05a..fd48b776 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/secure_auth_func.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/secure_auth_func.result @@ -19,6 +19,7 @@ DROP USER 'testUser'@'localhost'; CREATE USER 'testUser'@'localhost' identified with 'mysql_old_password'; SET PASSWORD FOR 'testUser'@'localhost'= OLD_PASSWORD('newpass'); Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead ** Connecting con_user2 using testUser ** ** Connection default** @@ -35,6 +36,7 @@ host='localhost'; FLUSH PRIVILEGES; SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass'); Warnings: +Warning 1287 'OLD_PASSWORD' is deprecated and will be removed in a future release. Please use PASSWORD instead Warning 1287 'pre-4.1 password hash' is deprecated and will be removed in a future release. Please use post-4.1 password hash instead ** Connecting con_user4 using testUser ** ERROR HY000: Server is running in --secure-auth mode, but 'testUser'@'localhost' has a password in the old format; please change the password to the new format diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/simplified_binlog_gtid_recovery_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/simplified_binlog_gtid_recovery_basic.result new file mode 100644 index 00000000..e16e90d3 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/simplified_binlog_gtid_recovery_basic.result @@ -0,0 +1,33 @@ +SELECT @@GLOBAL.simplified_binlog_gtid_recovery; +@@GLOBAL.simplified_binlog_gtid_recovery +0 +Warnings: +Warning 1287 '@@simplified_binlog_gtid_recovery' is deprecated and will be removed in a future release. Please use '@@binlog_gtid_simple_recovery' instead +SELECT COUNT(@@GLOBAL.simplified_binlog_gtid_recovery); +COUNT(@@GLOBAL.simplified_binlog_gtid_recovery) +1 +Warnings: +Warning 1287 '@@simplified_binlog_gtid_recovery' is deprecated and will be removed in a future release. Please use '@@binlog_gtid_simple_recovery' instead +SELECT COUNT(@@simplified_binlog_gtid_recovery); +COUNT(@@simplified_binlog_gtid_recovery) +1 +Warnings: +Warning 1287 '@@simplified_binlog_gtid_recovery' is deprecated and will be removed in a future release. Please use '@@binlog_gtid_simple_recovery' instead +SELECT @@SESSION.simplified_binlog_gtid_recovery; +ERROR HY000: Variable 'simplified_binlog_gtid_recovery' is a GLOBAL variable +SHOW GLOBAL VARIABLES LIKE 'simplified_binlog_gtid_recovery'; +Variable_name Value +simplified_binlog_gtid_recovery OFF +SHOW SESSION VARIABLES LIKE 'simplified_binlog_gtid_recovery'; +Variable_name Value +simplified_binlog_gtid_recovery OFF +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='simplified_binlog_gtid_recovery'; +VARIABLE_NAME VARIABLE_VALUE +SIMPLIFIED_BINLOG_GTID_RECOVERY OFF +SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='simplified_binlog_gtid_recovery'; +VARIABLE_NAME VARIABLE_VALUE +SIMPLIFIED_BINLOG_GTID_RECOVERY OFF +SET GLOBAL simplified_binlog_gtid_recovery=1; +ERROR HY000: Variable 'simplified_binlog_gtid_recovery' is a read only variable +SET SESSION simplified_binlog_gtid_recovery=1; +ERROR HY000: Variable 'simplified_binlog_gtid_recovery' is a read only variable diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result index e3c48725..c032a36c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result @@ -7,6 +7,7 @@ RIGHT(@@global.slow_query_log_file, length(@a)) = @a 1 '#--------------------FN_DYNVARS_004_02------------------------#' SET @@global.slow_query_log_file = mytest.log; +ERROR 42000: Incorrect argument type to variable 'slow_query_log_file' SET @@global.slow_query_log_file = 12; ERROR 42000: Incorrect argument type to variable 'slow_query_log_file' '#----------------------FN_DYNVARS_004_03------------------------#' diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result index 5e8fe4e0..7d9ef4f7 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result @@ -57,11 +57,16 @@ ERROR 42000: Variable 'sql_log_bin' can't be set to the value of ' SET @@session.sql_log_bin = NO; ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'NO' '#-------------------FN_DYNVARS_156_05----------------------------#' +SELECT @@global.sql_log_bin; +@@global.sql_log_bin +1 SET @@global.sql_log_bin = 0; +ERROR 42000: Variable 'sql_log_bin' can't be set to the value of '0' SELECT @@global.sql_log_bin; @@global.sql_log_bin -0 +1 SET @@global.sql_log_bin = 1; +ERROR 42000: Variable 'sql_log_bin' can't be set to the value of '1' '#----------------------FN_DYNVARS_156_06------------------------#' SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sql_log_bin'; count(VARIABLE_VALUE) diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sql_mode_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sql_mode_basic.result index 7439ac0a..7b425330 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sql_mode_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/sql_mode_basic.result @@ -60,6 +60,8 @@ SELECT @@global.sql_mode; @@global.sql_mode ANSI_QUOTES SET @@global.sql_mode = ERROR_FOR_DIVISION_BY_ZERO; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. SELECT @@global.sql_mode; @@global.sql_mode ERROR_FOR_DIVISION_BY_ZERO @@ -108,10 +110,14 @@ SELECT @@global.sql_mode; @@global.sql_mode NO_UNSIGNED_SUBTRACTION SET @@global.sql_mode = NO_ZERO_DATE; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. SELECT @@global.sql_mode; @@global.sql_mode NO_ZERO_DATE SET @@global.sql_mode = NO_ZERO_IN_DATE; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. SELECT @@global.sql_mode; @@global.sql_mode NO_ZERO_IN_DATE @@ -190,6 +196,8 @@ SELECT @@session.sql_mode; @@session.sql_mode ANSI_QUOTES SET @@session.sql_mode = ERROR_FOR_DIVISION_BY_ZERO; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. SELECT @@session.sql_mode; @@session.sql_mode ERROR_FOR_DIVISION_BY_ZERO @@ -238,10 +246,14 @@ SELECT @@session.sql_mode; @@session.sql_mode NO_UNSIGNED_SUBTRACTION SET @@session.sql_mode = NO_ZERO_DATE; +Warnings: +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. SELECT @@session.sql_mode; @@session.sql_mode NO_ZERO_DATE SET @@session.sql_mode = NO_ZERO_IN_DATE; +Warnings: +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. SELECT @@session.sql_mode; @@session.sql_mode NO_ZERO_IN_DATE @@ -363,6 +375,10 @@ SELECT @@global.sql_mode; @@global.sql_mode REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY,POSTGRESQL,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,HIGH_NOT_PRECEDENCE SET @@global.sql_mode = 4294967295; +Warnings: +Warning 1681 'ERROR_FOR_DIVISION_BY_ZERO' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. +Warning 1681 'NO_ZERO_IN_DATE' is deprecated and will be removed in a future release. SELECT @@global.sql_mode; @@global.sql_mode REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,,,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result index 50a5285b..7c495581 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/r/timed_mutexes_basic.result @@ -1,34 +1,56 @@ SET @global_start_value = @@global.timed_mutexes; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @global_start_value; @global_start_value 0 '#--------------------FN_DYNVARS_177_01------------------------#' SET @@global.timed_mutexes = 1; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SET @@global.timed_mutexes = DEFAULT; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 0 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. '#---------------------FN_DYNVARS_177_02-------------------------#' SET timed_mutexes = 1; ERROR HY000: Variable 'timed_mutexes' is a GLOBAL variable and should be set with SET GLOBAL SELECT @@timed_mutexes; @@timed_mutexes 0 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT global.timed_mutexes; ERROR 42S02: Unknown table 'global' in field list SET global timed_mutexes = 1; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 1 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. '#--------------------FN_DYNVARS_177_03------------------------#' SET @@global.timed_mutexes = 0; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 0 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SET @@global.timed_mutexes = 1; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 1 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. '#--------------------FN_DYNVARS_177_04-------------------------#' SET @@global.timed_mutexes = -1; ERROR 42000: Variable 'timed_mutexes' can't be set to the value of '-1' @@ -72,9 +94,13 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='timed_mutexes'; IF(@@global.timed_mutexes, "ON", "OFF") = VARIABLE_VALUE 1 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 1 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='timed_mutexes'; @@ -82,23 +108,43 @@ VARIABLE_VALUE ON '#---------------------FN_DYNVARS_177_08-------------------------#' SET @@global.timed_mutexes = OFF; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 0 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SET @@global.timed_mutexes = ON; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 1 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. '#---------------------FN_DYNVARS_177_09----------------------#' SET @@global.timed_mutexes = TRUE; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 1 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SET @@global.timed_mutexes = FALSE; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 0 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SET @@global.timed_mutexes = @global_start_value; +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. SELECT @@global.timed_mutexes; @@global.timed_mutexes 0 +Warnings: +Warning 1287 '@@timed_mutexes' is deprecated and will be removed in a future release. diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlog_error_action_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlog_error_action_basic.test new file mode 100644 index 00000000..5c93af1a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlog_error_action_basic.test @@ -0,0 +1,69 @@ +################## mysql-test\t\binlog_error_action_basic.test ################ +# # +# Variable Name: binlog_error_action # +# Scope: Global # +# Data Type: enumeration # +# # +# # +# Creation Date: 2014-09-11 # +# Author : Sujatha Sivakumar # +# # +# # +# Description:Test Cases of Dynamic System Variable binlog_error_action # +# that checks the behavior of this variable in the following ways # +# * Value Check # +# * Scope Check # +############################################################################### + + +SELECT @@GLOBAL.binlog_error_action; +--echo IGNORE_ERROR Expected + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@SESSION.binlog_error_action; + +SET @start_value= @@global.binlog_error_action; +#################################################################### +# Displaying default value # +#################################################################### +SHOW GLOBAL VARIABLES LIKE 'binlog_error_action'; + +#################################################################### +# Check if Value can set # +#################################################################### +SET @@GLOBAL.binlog_error_action=IGNORE_ERROR; +SELECT @@GLOBAL.binlog_error_action; +--echo IGNORE_ERROR Expected + +SET @@GLOBAL.binlog_error_action=ABORT_SERVER; +SELECT @@GLOBAL.binlog_error_action; +--echo ABORT_SERVER Expected + +################################################################# +# Check if the value in GLOBAL Table matches value in variable # +################################################################# + +SELECT @@GLOBAL.binlog_error_action = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_error_action'; +--echo 1 Expected + +SELECT COUNT(@@GLOBAL.binlog_error_action); +--echo 1 Expected + +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_error_action'; +--echo 1 Expected + + +################################################################################ +# Check if binlog_error_action can be accessed with @@ sign # +################################################################################ + +SELECT COUNT(@@binlog_error_action); +--echo 1 Expected +SELECT COUNT(@@GLOBAL.binlog_error_action); +--echo 1 Expected + +SET @@global.binlog_error_action= @start_value; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlog_gtid_simple_recovery_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlog_gtid_simple_recovery_basic.test new file mode 100644 index 00000000..8589987c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlog_gtid_simple_recovery_basic.test @@ -0,0 +1,21 @@ +# +# only GLOBAL +# +SELECT @@GLOBAL.binlog_gtid_simple_recovery; +SELECT COUNT(@@GLOBAL.binlog_gtid_simple_recovery); +SELECT COUNT(@@binlog_gtid_simple_recovery); +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@SESSION.binlog_gtid_simple_recovery; +SHOW GLOBAL VARIABLES LIKE 'binlog_gtid_simple_recovery'; +SHOW SESSION VARIABLES LIKE 'binlog_gtid_simple_recovery'; +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_gtid_simple_recovery'; +SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='binlog_gtid_simple_recovery'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET GLOBAL binlog_gtid_simple_recovery=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET SESSION binlog_gtid_simple_recovery=1; + diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlogging_impossible_mode_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlogging_impossible_mode_basic.test new file mode 100644 index 00000000..ae3c3cd8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/binlogging_impossible_mode_basic.test @@ -0,0 +1,69 @@ +################## mysql-test\t\binlogging_impossible_mode_basic.test ######### +# # +# Variable Name: binlogging_impossible_mode # +# Scope: Global # +# Data Type: enumeration # +# # +# # +# Creation Date: 2014-04-21 # +# Author : Sujatha Sivakumar # +# # +# # +# Description:Test Cases of Dynamic System Variable binlogging_impossible_mode# +# that checks the behavior of this variable in the following ways # +# * Value Check # +# * Scope Check # +############################################################################### + + +SELECT @@GLOBAL.binlogging_impossible_mode; +--echo IGNORE_ERROR Expected + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@SESSION.binlogging_impossible_mode; + +SET @start_value= @@global.binlogging_impossible_mode; +#################################################################### +# Displaying default value # +#################################################################### +SHOW GLOBAL VARIABLES LIKE 'binlogging_impossible_mode'; + +#################################################################### +# Check if Value can set # +#################################################################### +SET @@GLOBAL.binlogging_impossible_mode=IGNORE_ERROR; +SELECT @@GLOBAL.binlogging_impossible_mode; +--echo IGNORE_ERROR Expected + +SET @@GLOBAL.binlogging_impossible_mode=ABORT_SERVER; +SELECT @@GLOBAL.binlogging_impossible_mode; +--echo ABORT_SERVER Expected + +################################################################# +# Check if the value in GLOBAL Table matches value in variable # +################################################################# + +SELECT @@GLOBAL.binlogging_impossible_mode = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlogging_impossible_mode'; +--echo 1 Expected + +SELECT COUNT(@@GLOBAL.binlogging_impossible_mode); +--echo 1 Expected + +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlogging_impossible_mode'; +--echo 1 Expected + + +################################################################################ +# Check if binlogging_impossible_mode can be accessed with @@ sign # +################################################################################ + +SELECT COUNT(@@binlogging_impossible_mode); +--echo 1 Expected +SELECT COUNT(@@GLOBAL.binlogging_impossible_mode); +--echo 1 Expected + +SET @@global.binlogging_impossible_mode= @start_value; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/block_encryption_mode_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/block_encryption_mode_basic.test new file mode 100644 index 00000000..7a76af77 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/block_encryption_mode_basic.test @@ -0,0 +1,225 @@ +############## mysql-test\t\block_encryption_mode_basic.test ################### +# # +# Variable Name: block_encryption_mode # +# Scope: GLOBAL & SESSION # +# Access Type: Dynamic # +# Data Type: Enum # +# Default Value: aes-128-ecb # +# # +# # +# # +# # +################################################################################ + +--source include/load_sysvars.inc + +##################################################################### +# START OF block_encryption_mode TESTS # +##################################################################### + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.block_encryption_mode; +SELECT @start_global_value; +SET @start_session_value = @@session.block_encryption_mode; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_002_01-------------------------#' +##################################################################### +# Display the DEFAULT value of block_encryption_mode # +##################################################################### + +SET @@global.block_encryption_mode = 'aes-192-ecb'; +SET @@global.block_encryption_mode = DEFAULT; +SELECT @@global.block_encryption_mode; + +SET @@session.block_encryption_mode = 'aes-192-ecb'; +SET @@session.block_encryption_mode = DEFAULT; +SELECT @@session.block_encryption_mode; + + +--echo '#--------------------FN_DYNVARS_002_02-------------------------#' +##################################################################### +# Check the DEFAULT value of block_encryption_mode # +##################################################################### + +SET @@global.block_encryption_mode = @start_global_value; +SELECT @@global.block_encryption_mode = 'aes-128-ecb'; +SET @@session.block_encryption_mode = @start_session_value; +SELECT @@session.block_encryption_mode = 'aes-128-ecb'; + + +--echo '#--------------------FN_DYNVARS_002_03-------------------------#' +############################################################################### +# Change the value of block_encryption_mode to a valid value for GLOBAL Scope # +############################################################################### + +SET @@global.block_encryption_mode = 'aes-128-ecb'; +SELECT @@global.block_encryption_mode; +SET @@global.block_encryption_mode = 'aes-256-ecb'; +SELECT @@global.block_encryption_mode; +SET @@global.block_encryption_mode = 'aes-256-cbc'; +SELECT @@global.block_encryption_mode; + + +--echo '#--------------------FN_DYNVARS_002_04-------------------------#' +############################################################################### +# Change the value of block_encryption_mode to a valid value for SESSION Scope# +############################################################################### + +SET @@session.block_encryption_mode = 'aes-128-ecb'; +SELECT @@session.block_encryption_mode; +SET @@session.block_encryption_mode = 'aes-256-ecb'; +SELECT @@session.block_encryption_mode; +SET @@session.block_encryption_mode = 'aes-256-cbc'; +SELECT @@session.block_encryption_mode; + + +--echo '#------------------FN_DYNVARS_002_05-----------------------#' +################################################################# +# Change the value of block_encryption_mode to an invalid value # +################################################################# +# for global scope +SET @@global.block_encryption_mode = 0; +SELECT @@global.block_encryption_mode; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.block_encryption_mode = -1024; +SELECT @@global.block_encryption_mode; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.block_encryption_mode = 65536; +SELECT @@global.block_encryption_mode; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.block_encryption_mode = 4294967295; +SELECT @@global.block_encryption_mode; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.block_encryption_mode = 65535.4; +SELECT @@global.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.block_encryption_mode = ON; +SELECT @@global.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.block_encryption_mode = OFF; +SELECT @@global.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.block_encryption_mode = test; +SELECT @@global.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@global.block_encryption_mode = 'des-128-ecb'; +SELECT @@global.block_encryption_mode; +# for session scope +SET @@session.block_encryption_mode = 0; +SELECT @@session.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.block_encryption_mode = -1024; +SELECT @@session.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.block_encryption_mode = 65536; +SELECT @@session.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.block_encryption_mode = 4294967295; +SELECT @@session.block_encryption_mode; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.block_encryption_mode = 65535.4; +SELECT @@session.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.block_encryption_mode = ON; +SELECT @@session.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.block_encryption_mode = OFF; +SELECT @@session.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.block_encryption_mode = test; +SELECT @@session.block_encryption_mode; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.block_encryption_mode = 'des-128-ecb'; +SELECT @@session.block_encryption_mode; + + + +--echo '#------------------FN_DYNVARS_002_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SELECT @@global.block_encryption_mode = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='block_encryption_mode'; + + +--echo '#------------------FN_DYNVARS_002_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.block_encryption_mode = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='block_encryption_mode'; + + +--echo '#------------------FN_DYNVARS_002_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.block_encryption_mode = TRUE; +SELECT @@global.block_encryption_mode; +SET @@global.block_encryption_mode = FALSE; +SELECT @@global.block_encryption_mode; + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +############################################################################### +# Check if global and session variables are independant of each other # +############################################################################### + +SET @@global.block_encryption_mode = 'aes-192-ecb'; +SET @@session.block_encryption_mode = 'aes-256-cbc'; +SELECT @@block_encryption_mode = @@global.block_encryption_mode; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +############################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points # +# to same session variable # +############################################################################## + +SET @@block_encryption_mode = 'aes-192-cbc'; +SELECT @@block_encryption_mode = @@local.block_encryption_mode; +SELECT @@local.block_encryption_mode = @@session.block_encryption_mode; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +############################################################################### +# Check if block_encryption_mode can be accessed with and without @@ sign # +############################################################################### + +SET block_encryption_mode = 'aes-128-cbc'; +SELECT @@block_encryption_mode; +--Error ER_UNKNOWN_TABLE +SELECT local.block_encryption_mode; +--Error ER_UNKNOWN_TABLE +SELECT session.block_encryption_mode; +--Error ER_BAD_FIELD_ERROR +SELECT block_encryption_mode = @@session.block_encryption_mode; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.block_encryption_mode = @start_global_value; +SELECT @@global.block_encryption_mode; +SET @@session.block_encryption_mode = @start_session_value; +SELECT @@session.block_encryption_mode; + + +################################################### +# END OF block_encryption_mode TESTS # +################################################### + +--echo # +--echo # End of 5.7 tests +--echo # diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/general_log_file_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/general_log_file_basic.test index 43d7414a..c1be3f53 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/general_log_file_basic.test +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/general_log_file_basic.test @@ -54,7 +54,7 @@ SELECT RIGHT(@@global.general_log_file, length(@a)) = @a; # Change the value of general_log_file to a invalid value # ####################################################################### -# Assumed text if no quotes or numbers. +--error ER_WRONG_TYPE_FOR_VAR SET @@global.general_log_file = mytest.log; --error ER_WRONG_TYPE_FOR_VAR SET @@global.general_log_file = 12; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_fil_make_page_dirty_debug_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_fil_make_page_dirty_debug_basic.test new file mode 100644 index 00000000..950dbabd --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_fil_make_page_dirty_debug_basic.test @@ -0,0 +1,34 @@ +--echo # +--echo # Basic test for innodb_fil_make_page_dirty_debug. +--echo # + +--source include/have_innodb.inc + +# The config variable is a debug variable +-- source include/have_debug.inc + +SELECT @@global.innodb_fil_make_page_dirty_debug; + +set global innodb_fil_make_page_dirty_debug = 0; + +SELECT @@global.innodb_fil_make_page_dirty_debug; + +set global innodb_fil_make_page_dirty_debug = 0; + +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_fil_make_page_dirty_debug = dummy; + +--error ER_GLOBAL_VARIABLE +set innodb_fil_make_page_dirty_debug = ON; + +--echo # An example usage. +create table t1 (f1 int primary key) engine = innodb; +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; +drop table t1; + +--echo # Must always be 0. +SELECT @@global.innodb_fil_make_page_dirty_debug; + diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test index 2967d92c..0fc9b5dc 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test @@ -27,7 +27,10 @@ select @@innodb_ft_result_cache_limit; set global innodb_ft_result_cache_limit=1000000; select @@innodb_ft_result_cache_limit; -set global innodb_ft_result_cache_limit=4000000000; +set global innodb_ft_result_cache_limit=4294967295; +select @@innodb_ft_result_cache_limit; + +set global innodb_ft_result_cache_limit=4*1024*1024*1024; select @@innodb_ft_result_cache_limit; eval set global innodb_ft_result_cache_limit=$innodb_ft_result_cache_limit_orig; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_saved_page_number_debug_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_saved_page_number_debug_basic.test new file mode 100644 index 00000000..74ce3ffc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_saved_page_number_debug_basic.test @@ -0,0 +1,35 @@ +--echo # +--echo # Basic test for innodb_saved_page_number_debug. +--echo # + +--source include/have_innodb.inc + +# The config variable is a debug variable +-- source include/have_debug.inc + +SELECT @@global.innodb_saved_page_number_debug; + +set global innodb_saved_page_number_debug = 10; + +SELECT @@global.innodb_saved_page_number_debug; + +set global innodb_saved_page_number_debug = 100; + +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_saved_page_number_debug = dummy; + +--error ER_GLOBAL_VARIABLE +set innodb_saved_page_number_debug = ON; + +--echo # An example usage. +create table t1 (f1 int primary key) engine = innodb; +select space from information_schema.innodb_sys_tables +where name = 'test/t1' into @space_id; +set global innodb_saved_page_number_debug = 0; +set global innodb_fil_make_page_dirty_debug = @space_id; +drop table t1; + +set global innodb_saved_page_number_debug = 0; + +SELECT @@global.innodb_saved_page_number_debug; + diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test index 7156f309..8cc4bfd3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test @@ -40,11 +40,29 @@ set global innodb_thread_sleep_delay=1.1; set global innodb_thread_sleep_delay=1e1; --error ER_WRONG_TYPE_FOR_VAR set global innodb_thread_sleep_delay="foo"; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_thread_sleep_delay=18446744073709551616; set global innodb_thread_sleep_delay=-7; select @@global.innodb_thread_sleep_delay; select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; +# +# correct/overflowed values +# +set global innodb_thread_sleep_delay=0; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=1000; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=1000000; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=1000001; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=4294967295; +select @@global.innodb_thread_sleep_delay; +set global innodb_thread_sleep_delay=555; +select @@global.innodb_thread_sleep_delay; + # # cleanup # diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test index e68b0f26..382edeca 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test @@ -8,9 +8,9 @@ SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements; USE test; CREATE TABLE log_slow_admin_statements ( - i INT PRIMARY KEY, - j INT -); + i INT PRIMARY KEY AUTO_INCREMENT, + j VARCHAR(255) +) ENGINE=InnoDB; # enable slow logging to table SET GLOBAL log_output = 'file,table'; @@ -18,19 +18,38 @@ SET GLOBAL slow_query_log = on; SET SESSION long_query_time = 0; SET GLOBAL log_slow_admin_statements = on; -# test ALTER, OPTIMIZE and ANALYZE against the table show up -ALTER TABLE log_slow_admin_statements ADD COLUMN k INT; +# test ALTER, OPTIMIZE and CHECK against the table shown up +ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17; -# add some rows so OPTIMIZE runs -INSERT INTO log_slow_admin_statements VALUES (1,2,3), (4,5,6); +# add rows so OPTIMIZE and CHECK runs +DELIMITER $; + +CREATE PROCEDURE add_rows() +BEGIN + DECLARE count INT; + SET count = 1; + INSERT INTO log_slow_admin_statements(j) values (REPEAT('A', 255)); + WHILE count <= 15 DO + INSERT INTO log_slow_admin_statements(j) SELECT j FROM log_slow_admin_statements; + SET count = count + 1; + END WHILE; +END +$ + +DELIMITER ;$ + +CALL add_rows(); + +# OPTIMIZE TABLE OPTIMIZE TABLE log_slow_admin_statements; -# and again so ANALYZE runs -INSERT INTO log_slow_admin_statements VALUES (7,8,9), (10,11,12); -ANALYZE TABLE log_slow_admin_statements; +# CHECK TABLE +CHECK TABLE log_slow_admin_statements EXTENDED; +# DROP TABLE DROP TABLE log_slow_admin_statements; +# ALTER, OPTIMIZE, CHECK and DROP operations should be logged in slow query log. SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%'; SET @@global.log_output= @old_log_output; @@ -38,4 +57,5 @@ SET @@global.slow_query_log= @old_slow_query_log; SET @@session.long_query_time= @old_long_query_time; SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements; +DROP PROCEDURE add_rows; TRUNCATE TABLE mysql.slow_log; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test index d2062698..76085bb1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test @@ -1,4 +1,5 @@ # Copyright (C) 2010 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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic.test index c10700b8..f10126b1 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic.test +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic.test @@ -1,4 +1,5 @@ # Copyright (C) 2012 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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/simplified_binlog_gtid_recovery_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/simplified_binlog_gtid_recovery_basic.test new file mode 100644 index 00000000..beb16898 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/simplified_binlog_gtid_recovery_basic.test @@ -0,0 +1,21 @@ +# +# only GLOBAL +# +SELECT @@GLOBAL.simplified_binlog_gtid_recovery; +SELECT COUNT(@@GLOBAL.simplified_binlog_gtid_recovery); +SELECT COUNT(@@simplified_binlog_gtid_recovery); +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@SESSION.simplified_binlog_gtid_recovery; +SHOW GLOBAL VARIABLES LIKE 'simplified_binlog_gtid_recovery'; +SHOW SESSION VARIABLES LIKE 'simplified_binlog_gtid_recovery'; +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='simplified_binlog_gtid_recovery'; +SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='simplified_binlog_gtid_recovery'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET GLOBAL simplified_binlog_gtid_recovery=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET SESSION simplified_binlog_gtid_recovery=1; + diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test index bac0d0c8..8e68ed41 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test @@ -52,7 +52,7 @@ SELECT RIGHT(@@global.slow_query_log_file, length(@a)) = @a; # Change the value of slow_query_log_file to a invalid value # ####################################################################### -# Assumed text if no quotes or numbers. +--error ER_WRONG_TYPE_FOR_VAR SET @@global.slow_query_log_file = mytest.log; --error ER_WRONG_TYPE_FOR_VAR SET @@global.slow_query_log_file = 12; diff --git a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test index 153a0be0..1e697e72 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test +++ b/mysql-wsrep-5.6/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test @@ -109,11 +109,15 @@ SET @@session.sql_log_bin = NO; --echo '#-------------------FN_DYNVARS_156_05----------------------------#' ########################################################################### -# Test if accessing global sql_log_bin gives error # +# Test if setting global sql_log_bin gives error, # +# and there is no error on reading it. # ########################################################################### +SELECT @@global.sql_log_bin; +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_log_bin = 0; SELECT @@global.sql_log_bin; +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_log_bin = 1; --echo '#----------------------FN_DYNVARS_156_06------------------------#' diff --git a/mysql-wsrep-5.6/mysql-test/t/alter_table.test b/mysql-wsrep-5.6/mysql-test/t/alter_table.test index 598c40f7..b294bf01 100644 --- a/mysql-wsrep-5.6/mysql-test/t/alter_table.test +++ b/mysql-wsrep-5.6/mysql-test/t/alter_table.test @@ -1223,28 +1223,6 @@ deallocate prepare stmt1; drop table t2; ---echo # ---echo # Bug#11938817 ALTER BEHAVIOR DIFFERENT THEN DOCUMENTED ---echo # - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1(a INT) engine=innodb; -INSERT INTO t1 VALUES (1), (2); - ---enable_info ---echo # This should not do anything -ALTER TABLE t1; ---echo # Check that we rebuild the table -ALTER TABLE t1 engine=innodb; ---echo # This should also rebuild the table -ALTER TABLE t1 FORCE; ---disable_info - -DROP TABLE t1; - --echo # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't --echo # identify correct column name. --echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/bug17076131-master.opt b/mysql-wsrep-5.6/mysql-test/t/bug17076131-master.opt new file mode 100644 index 00000000..2d7de8ce --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/bug17076131-master.opt @@ -0,0 +1,2 @@ +--no-console +--log-error=$MYSQLTEST_VARDIR/tmp/mysql.err diff --git a/mysql-wsrep-5.6/mysql-test/t/bug17076131.test b/mysql-wsrep-5.6/mysql-test/t/bug17076131.test new file mode 100644 index 00000000..d025e1a8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/bug17076131.test @@ -0,0 +1,28 @@ +--echo # +--echo # Bug#17076131 MYSQLDUMP FAILS WHEN ERR LOG ON RUNNING SERVER IS +--echo # DELETED ON WINDOWS +--echo # + +--source include/not_embedded.inc + +--echo # Creating file aliases. +let $dump_with_err_log=$MYSQLTEST_VARDIR/tmp/bug17076131_with_err_log.sql; +let $dump_without_err_log=$MYSQLTEST_VARDIR/tmp/bug17076131_without_err_log.sql; + +--echo # Executing mysqldump normally. +--exec $MYSQL_DUMP --extended-insert --flush-logs --add-drop-database --add-drop-table --force --databases --skip-dump-date mysql > $dump_with_err_log + +--echo # Removing Error_log file. +--remove_file $MYSQLTEST_VARDIR/tmp/mysql.err + +--echo # Executing mysqldump after deleting error_log file. +--exec $MYSQL_DUMP --extended-insert --flush-logs --add-drop-database --add-drop-table --force --databases --skip-dump-date mysql > $dump_without_err_log + +--echo # Checking diff of the 2 dumps. +--diff_files $dump_with_err_log $dump_without_err_log +--echo # No Difference found. + +--echo # Clean Up. +--remove_file $dump_with_err_log +--remove_file $dump_without_err_log +--echo # End of Test. diff --git a/mysql-wsrep-5.6/mysql-test/t/check_auto_permission.test b/mysql-wsrep-5.6/mysql-test/t/check_auto_permission.test new file mode 100644 index 00000000..2ed2ebbe --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/check_auto_permission.test @@ -0,0 +1,60 @@ +############################################################################# +# Bug#17786581:SERVER WRITES INTO WORLD-WRITEABLE FILE EVEN AFTER WARNING ABOUT +# IT. +# +# Problem: +# ======== +# UUID exists in a file named "auto.cnf", make this auto.cnf file as world +# writable. The server starts, and it sees the auto.cnf is world writable and +# writes a following warning: +# +# Warning: World-writable con-fig file './auto.cnf' is ignored +# +# A new UUID is generated and the new UUID is once again written to the same +# world writable file which is not safe. +# +# Test: +# ===== +# During the execution of the script change file permissions of 'auto.cnf' to +# 777. Restart the server and check that the newly generated 'auto.cnf' file +# has valid 660 file permissions. +############################################################################### +# Run only on Linux:Since file permissions vary from one os to the other +# we execute this script only on linux to avoid test failures. +--source include/linux.inc +# include/restart_mysqld.inc does not work in embedded mode +--source include/not_embedded.inc + +CALL mtr.add_suppression("World-writable config file './auto.cnf' is ignored"); +CALL mtr.add_suppression("World-writable config file './auto.cnf' has been removed."); + +# Change file permissions to world writable +--let $MYSQL_DATA_DIR=`select @@datadir` +--let _INPUT_FILE_=$MYSQL_DATA_DIR/auto.cnf +--let _FILE_PERMS_=0777 +--source include/change_file_perms.inc + +# Restart the server +--source include/restart_mysqld.inc + +# Check that it has 660 valid permissions. +--perl + use strict; + my $input_file= $ENV{'_INPUT_FILE_'}; + my $mode = (stat($input_file))[2]; + open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/permissions.inc") or die; + my $perm= $mode & 07777; + print FILE "let \$FILE_PERMISSIONS= $perm;\n"; + close FILE; +EOF + +--source $MYSQL_TMP_DIR/permissions.inc +--remove_file $MYSQL_TMP_DIR/permissions.inc + +--let $assert_cond= $FILE_PERMISSIONS= 432 +--let $assert_text= File permissions should be equl to decimal 432(i.e octal 660). +--source include/assert.inc + +# Clear +--let _FILE_PERMS_= +--let _INPUT_FILE_= diff --git a/mysql-wsrep-5.6/mysql-test/t/count_distinct.test b/mysql-wsrep-5.6/mysql-test/t/count_distinct.test index 10b4ac6f..503bfb8f 100644 --- a/mysql-wsrep-5.6/mysql-test/t/count_distinct.test +++ b/mysql-wsrep-5.6/mysql-test/t/count_distinct.test @@ -107,3 +107,143 @@ create view v1 as select * from t1; select count(distinct i) from v1; drop table t1; drop view v1; + +--echo # +--echo # Bug#11760197: INCORRECT RESULTS WITH COUNT DISTINCT AND BIG_TABLES +--echo # + +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SET @big_tables_save= @@big_tables; +SET SESSION big_tables=0; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +SET SESSION big_tables=1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +DROP TABLE t1; + +CREATE TABLE t1 (a BLOB ,PRIMARY KEY(a(10))); +INSERT INTO t1 VALUES (1),(2); +SET SESSION big_tables=0; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = '1'; +SET SESSION big_tables=1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = '1'; +DROP TABLE t1; + +CREATE TABLE t1 (a CHAR PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SET SESSION big_tables=0; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = '1'; +SET SESSION big_tables=1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = 1; +SELECT COUNT(DISTINCT t1.a) FROM t1,t1 t2 WHERE t1.a = '1'; +SET SESSION big_tables= @big_tables_save; +DROP TABLE t1; + +--echo # +--echo # BUG#17607155: ASSERTION FAILED: +--echo # ((ITEM_RESULT_FIELD*)ITEM)->RESULT_FIELD +--echo # + +CREATE TABLE t (a INT)ENGINE=INNODB; +INSERT t VALUES(1); +SELECT '' FROM t GROUP BY 1 WITH ROLLUP HAVING GROUP_CONCAT(''); +DROP TABLE t; + +--echo # +--echo # BUG#17957913: ASSERTION `((ITEM_RESULT_FIELD*)ITEM)->RESULT_FIELD' +--echo # FAILS IN CREATE_TMP_FIELD +--echo # + +CREATE TABLE t1 ( i INT ); +INSERT INTO t1 VALUES (1),(2); +SELECT GROUP_CONCAT(i,'foo') AS f1 FROM t1 GROUP BY 'a' WITH ROLLUP; +DROP TABLE t1; + +--echo # +--echo # Bug #17555462: SELECT DISTINCT OF VIEW WITH CONSTANT STRING +--echo # RETURNS WRONG RESULT +--echo # + +CREATE TABLE t (x char(3)); +INSERT INTO t VALUES ('foo'), ('bar'); +CREATE VIEW v AS SELECT 'x' AS x FROM t; +SELECT DISTINCT x FROM v; + +DROP TABLE t; +DROP VIEW v; + +--echo # +--echo # Bug #17634335 SELECT DISTINCT...GROUP BY RETURNS WRONG +--echo # RESULTS IN SOME CASES +--echo # + +CREATE TABLE t1 ( +a int(11) DEFAULT NULL, +b int(11) DEFAULT NULL, +c int(11) DEFAULT NULL +) ENGINE=InnoDB; + +INSERT INTO t1 +VALUES (1,1,1),(1,2,1),(1,3,0), + (1,4,0),(2,1,1),(2,2,1),(2,3,0),(2,4,0); +SELECT DISTINCT a, b +FROM (SELECT * FROM t1 ORDER BY a, b) AS f +GROUP BY a,c; +SELECT DISTINCT a, b, 0 +FROM (SELECT * FROM t1 ORDER BY a, b) AS f +GROUP BY a,c; +DROP TABLE t1; + +--echo # +--echo # Bug #18853696 WRONG RESULT FOR COUNT DISTINCT OF RESULT +--echo # OF JOINED DERIVED TABLE +--echo # + +CREATE TABLE t1 ( +pk INT NOT NULL, +col_varchar_key VARCHAR(1), +col_varchar_nokey VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key) +); + +INSERT INTO t1 VALUES (10,'x','x'); +INSERT INTO t1 VALUES (11,'d','d'); +INSERT INTO t1 VALUES (12,'r','r'); +INSERT INTO t1 VALUES (13,'f','f'); +INSERT INTO t1 VALUES (14,'y','y'); + +CREATE TABLE t2 ( +pk INT NOT NULL, +col_int_nokey INT, +col_varchar_key VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key) +); + +INSERT INTO t2 VALUES (1,7,'x'); + +SELECT COUNT( DISTINCT table1.col_varchar_key ) +FROM t2 AS table1 +JOIN (SELECT * FROM t1) AS table2 +ON ( table2.pk = table1.col_int_nokey ) +WHERE table1.pk = 1; + +SELECT COUNT( DISTINCT table1.col_varchar_key ) +FROM t2 AS table1 +JOIN t1 AS table2 +ON ( table2.pk = table1.col_int_nokey ) +WHERE table1.pk = 1; + +SELECT COUNT( table1.col_varchar_key ) +FROM t2 AS table1 +JOIN (SELECT * FROM t1) AS table2 +ON ( table2.pk = table1.col_int_nokey ) +WHERE table1.pk = 1; + +DROP TABLE t1,t2; + +--echo # End of test for Bug#18853696 diff --git a/mysql-wsrep-5.6/mysql-test/t/ctype_cp932.test b/mysql-wsrep-5.6/mysql-test/t/ctype_cp932.test new file mode 100644 index 00000000..96a2666f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/ctype_cp932.test @@ -0,0 +1,29 @@ +-- source include/have_cp932.inc +--echo # +--echo # Bug #11755818 LIKE DOESN'T MATCH WHEN CP932_BIN/SJIS_BIN COLLATIONS ARE +--echo # USED. +--echo # + +SET @old_character_set_client= @@character_set_client; +SET @old_character_set_connection= @@character_set_connection; +SET @old_character_set_results= @@character_set_results; +SET character_set_client= 'utf8'; +SET character_set_connection= 'utf8'; +SET character_set_results= 'utf8'; + +CREATE TABLE t1 (a VARCHAR(10) COLLATE cp932_bin); +INSERT INTO t1 VALUES('ï½¶ï½¶'); +SELECT * FROM t1 WHERE a LIKE '%ï½¶'; +SELECT * FROM t1 WHERE a LIKE '_ï½¶'; +SELECT * FROM t1 WHERE a LIKE '%_ï½¶'; + +ALTER TABLE t1 MODIFY a VARCHAR(100) COLLATE sjis_bin; +SELECT * FROM t1 WHERE a LIKE '%ï½¶'; +SELECT * FROM t1 WHERE a LIKE '_ï½¶'; +SELECT * FROM t1 WHERE a LIKE '%_ï½¶'; +DROP TABLE t1; + +## Reset to initial values +SET @@character_set_client= @old_character_set_client; +SET @@character_set_connection= @old_character_set_connection; +SET @@character_set_results= @old_character_set_results; diff --git a/mysql-wsrep-5.6/mysql-test/t/ctype_uca.test b/mysql-wsrep-5.6/mysql-test/t/ctype_uca.test index 76814189..eea42571 100644 --- a/mysql-wsrep-5.6/mysql-test/t/ctype_uca.test +++ b/mysql-wsrep-5.6/mysql-test/t/ctype_uca.test @@ -542,6 +542,54 @@ SET collation_connection=utf8_german2_ci; SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci; --source include/ctype_unicode520.inc +--echo # +--echo # Bug #16204175 : COLLATION NAME MISSING FROM LOG MESSAGES +--echo # ABOUT LDML DEFINITION PROBLEMS +--echo # + +-- source include/not_embedded.inc + +# Creating a temporary file for Index.xml +--copy_file $MYSQL_CHARSETSDIR/Index.xml $MYSQLTEST_VARDIR/temp.xml +--remove_file $MYSQL_CHARSETSDIR/Index.xml + +# Adding an unknown collation with invalid grammer rules. +--write_file $MYSQL_CHARSETSDIR/Index.xml +<?xml version='1.0' encoding="utf-8"?> +<charsets max-id="99"> +<charset name="utf8"> + <family>Unicode</family> + <description>UTF-8 Unicode</description> + <alias>utf-8</alias> + <collation name="utf8_test" id="248"> + <rules> + <reset>A</reset> + </rules> + </collation> +</charset> +</charsets> +EOF + +# Restart the server +-- source include/restart_mysqld.inc + +--echo # Check whether the new collation is loaded after restart +SHOW COLLATION LIKE 'utf8_test'; + +--echo # Create a table with the unknown collation. +--error ER_UNKNOWN_COLLATION +CREATE TABLE t1(id INT PRIMARY KEY, c CHAR(1) COLLATE utf8_test); + +--echo # Below error is caused as a result of this test. The error message +--echo # contains collation name which is added as a part of the fix. +call mtr.add_suppression("Shift expected at '' for COLLATION : utf8_test"); + +# Cleanup +--remove_file $MYSQL_CHARSETSDIR/Index.xml +--copy_file $MYSQLTEST_VARDIR/temp.xml $MYSQL_CHARSETSDIR/Index.xml +--remove_file $MYSQLTEST_VARDIR/temp.xml +-- source include/restart_mysqld.inc + --echo # --echo # End of 5.6 tests --echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/derived.test b/mysql-wsrep-5.6/mysql-test/t/derived.test index 2b9f1eb6..f18c76c5 100644 --- a/mysql-wsrep-5.6/mysql-test/t/derived.test +++ b/mysql-wsrep-5.6/mysql-test/t/derived.test @@ -1333,3 +1333,171 @@ INSERT INTO t3 VALUES (0); SELECT * FROM (SELECT * FROM t1) AS a1 RIGHT JOIN t3 LEFT JOIN t2 ON d=c ON a=c; DROP TABLE t1, t2, t3; + +--echo # +--echo # Bug #17814492 - INVALID RESULTS FROM SUBQUERY WITH IN CLAUSE +--echo # + +CREATE TABLE t1 ( + a INTEGER NOT NULL, + b VARCHAR(1000) NOT NULL, + c TEXT NOT NULL +)ENGINE=InnoDB; + +INSERT INTO t1 VALUES (1, 'xxx', 'abc'); +INSERT INTO t1 VALUES (2, 'yyy', 'abc'); +INSERT INTO t1 SELECT a, b, c FROM t1 WHERE b='yyy'; +INSERT INTO t1 SELECT a, b, c FROM t1 WHERE b='yyy'; +INSERT INTO t1 SELECT a, b, c FROM t1 WHERE b='yyy'; + +CREATE TABLE t2 ( + a INTEGER NOT NULL +)ENGINE=InnoDB; + +INSERT INTO t2 VALUES (1), (2); + +SET @save_optimizer_switch= @@optimizer_switch; +SET @@SESSION.optimizer_switch="index_condition_pushdown=on"; + +EXPLAIN SELECT a1.a, a1.b, a1.c FROM (SELECT a, b, c FROM t1 ) a1 +JOIN t2 ON a1.a=t2.a WHERE a1.b='xxx'; + +SELECT a1.a, a1.b, a1.c FROM (SELECT a, b, c FROM t1 ) a1 +JOIN t2 ON a1.a=t2.a WHERE a1.b='xxx'; + +SET @@SESSION.optimizer_switch= @save_optimizer_switch; + +DROP TABLE t2, t1; + +--echo # End of test for Bug #17814492 + + +--echo # +--echo # Bug #18607971 : 5.5 TO 5.6 REGRESSION WITH A SUBQUERY IN THE FROM +--echo # CLAUSE. +--echo # + +CREATE TABLE t(id INT PRIMARY KEY, + c1 INT, c2 INT, key(c2)) engine=InnoDB; +INSERT INTO t(id, c1, c2) VALUES(1, 2, 3), (2, 3, 4), (3, 3, 4), (4, 3, 4); + +ANALYZE TABLE t; + +EXPLAIN SELECT * FROM + (SELECT t1.c1 + FROM t t1 INNER JOIN t t2 ON t1.c1= 3 + GROUP BY t1.c1) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.id + FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.id + GROUP BY t1.id, t2.c2) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.c1 + FROM t t1 INNER JOIN t t2 ON t1.c1= 3 AND t2.c2= 3 + GROUP BY t1.c1) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.c1 + FROM t t1 INNER JOIN t t2 ON t1.c1= 3 AND t2.c2= 3 + GROUP BY t1.c1, t2.c2) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.c1 + FROM t t1 INNER JOIN t t2 ON t1.c1= 3 AND t2.c2= 3 + GROUP BY t1.c1, t1.id) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.id + FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.c1 + GROUP BY t2.c1, t1.id) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.id + FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.id + GROUP BY t2.c1, t1.id) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.id + FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.id + GROUP BY t2.c2, t1.id) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.id + FROM t t1 INNER JOIN t t2 ON t1.id=1 AND t1.c1=t2.id + GROUP BY t1.id, t2.c2) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.id + FROM t t1 INNER JOIN t t2 INNER JOIN t t3 ON t1.id=1 AND t1.c1=t2.id AND t2.c1=t3.id + GROUP BY t1.id, t2.c2, t3.c2) a, t b + WHERE b.id BETWEEN 1 AND 10; + +#distinct +EXPLAIN SELECT * FROM + (SELECT DISTINCT t1.id + FROM t t1 + WHERE t1.id= 1) a, t b + WHERE b.id BETWEEN 1 AND 10; + +#group by with expression. +EXPLAIN SELECT * FROM + (SELECT t1.id + 1 + FROM t t1 INNER JOIN t t2 ON t1.id= 1 + GROUP BY t1.id + 1) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.c1 + FROM t t1 INNER JOIN t t2 ON t1.c1= 3 + GROUP BY 1.5) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.id + FROM t t1 INNER JOIN t t2 ON mod(t1.id,1000)= 1 + GROUP BY t1.id) a, t b + WHERE b.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM + (SELECT t1.id + 1 + FROM t t1 INNER JOIN t t2 ON t1.id + 1= 2 + GROUP BY t1.id + 1) a, t b + WHERE b.id BETWEEN 1 AND 10; + +#Test view ref in group by. + +CREATE VIEW v1 AS SELECT c1 a FROM t WHERE c1 = 3; +CREATE VIEW v2 AS SELECT c2 b FROM t WHERE c2 > 3; +EXPLAIN SELECT * FROM (SELECT v1.a + FROM v1 LEFT OUTER JOIN v2 ON v1.a = v2.b + GROUP BY v1.a) p, t q + WHERE q.id BETWEEN 1 AND 10; + +DROP VIEW v1; +CREATE VIEW v1 AS SELECT c1 a FROM t; + +EXPLAIN SELECT * FROM (SELECT v1.a + FROM v1 LEFT OUTER JOIN v2 ON v1.a = v2.b AND v1.a = 10 + GROUP BY v1.a) p, t q + WHERE q.id BETWEEN 1 AND 10; + +EXPLAIN SELECT * FROM (SELECT v1.a + FROM v1 LEFT OUTER JOIN v2 ON v1.a = v2.b + WHERE v1.a = 3 + GROUP BY v1.a) p, t q + WHERE q.id BETWEEN 1 AND 10; + +DROP VIEW v1, v2; +DROP TABLE t; + diff --git a/mysql-wsrep-5.6/mysql-test/t/dynamic_tracing.test b/mysql-wsrep-5.6/mysql-test/t/dynamic_tracing.test new file mode 100644 index 00000000..50f71a7f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/dynamic_tracing.test @@ -0,0 +1,152 @@ +# This scripts checks dtrace probes provided by mysqld using real dtrace tool +# and systemtap. +--source include/not_windows.inc + +--let OUTPUT_FILENAME= $MYSQLTEST_VARDIR/tmp/output.txt +--let MYSQLD_PIDFILE= `SELECT @@pid_file` +--let MYSQLD= $MYSQLD +--let SCRIPT_OUTPUT_FILE= $MYSQLTEST_VARDIR/tmp/script_output.txt + +--perl + my $pid_filename = $ENV{'MYSQLD_PIDFILE'}; + my $output_filename = $ENV{'OUTPUT_FILENAME'}; + my $mysqld = $ENV{'MYSQLD'}; + + my $mysqld_pid = 0; + my $dyn_trace_tool_available = 0; + my $user_has_permissions = 0; + my $mysqld_has_dtrace_probes = 0; + my $command = ""; + my $ret; + +# Check whether Dtrace tool exists or not. If exists then capture its output. + $ret = `dtrace -V 2>&1`; + if ($? == 0) + { + if (($ret =~ m/Sun D/) || ($ret =~ m/Oracle D/)) + { + $dyn_trace_tool_available = 1; + + # Check whether user has Dtrace tool execution permission or not + $ret = `dtrace -v 2>&1`; + if (!($ret =~ m/DTrace requires additional privileges/)) + { + $user_has_permissions = 1; + + $mysqld_pid= `cat $pid_filename`; + chomp($mysqld_pid); + + # Check whether MySQL Dtrace providers exists or not. + $ret=`dtrace -l -p $mysqld_pid | + egrep -ci \"net-read-done|connection-start|query-parse-start\"`; + if ($ret != 0) + { + $mysqld_has_dtrace_probes = 1; + $command = "dtrace -s \$MYSQL_TEST_DIR/std_data/dtrace.d "; + } + } + } + } + else + { + # check whether stap tool exists or not. + $ret= `stap 2>&1`; + if ($ret == 0) + { + $dyn_trace_tool_available= 1; + + # Check whether user has permission to run stap. + $ret= `stap -e 'probe process("ls").function("main") { exit() }' + -c ls 2>&1|egrep -ic "You should be part of the group \"stapusr"`; + + # Check whether user has permission to run staprun or not. + if ($ret == 0) + { + $ret= `staprun 2>&1|egrep -ic "Permission denied"`; + } + if ($ret == 0) + { + $user_has_permissions= 1; + + # Check whether MySQL stap markers are available or not. + $ret= `stap -L 'process("$mysqld").mark("*")'| + egrep -ci \"net__read__done|connection__start|query__parse__start\"`; + if ($ret != 0) + { + $mysqld_has_dtrace_probes = 1; + $command= "stap \$MYSQL_TEST_DIR/std_data/system_tap.stp $mysqld "; + } + } + } + } + + # Write output to file. + open(FILE, ">> $output_filename"); + print FILE "--let \$DYN_TRACE_TOOL_AVAILABLE= $dyn_trace_tool_available\n"; + print FILE "--let \$USER_HAS_PERMISSIONS= $user_has_permissions\n"; + print FILE "--let \$MYSQLD_HAS_DTRACE_PROBES= $mysqld_has_dtrace_probes\n"; + print FILE "--let COMMAND= $command\n"; + close(FILE); +EOF + +source $OUTPUT_FILENAME; + +if (!$DYN_TRACE_TOOL_AVAILABLE) +{ + --skip Real DTrace or System tap tool is required to run this test. +} + +if (!$USER_HAS_PERMISSIONS) +{ + --skip dtrace/stap tool requires additional privileges to run this test. +} + +if (!$MYSQLD_HAS_DTRACE_PROBES) +{ + --skip MySQLD does not have MySQL probes. +} + +--disable_result_log +DELIMITER $; + +CREATE PROCEDURE create_table_and_insert_rows() +BEGIN + DECLARE count INT; + SET count = 1; + + SELECT SLEEP(10); + CREATE TABLE t1 (f1 INT); + INSERT INTO t1 VALUES (7894); + WHILE count <= 5 DO + INSERT INTO t1 SELECT * FROM t1; + SET count = count + 1; + END WHILE; + + SET count = 1; + WHILE count <= 10000 DO + SELECT SQL_NO_CACHE count(*) from t1; + SET count = count + 1; + END WHILE; +END +$ + +DELIMITER ;$ + +# Running Dtrace script in background. +--perl + system("$ENV{'COMMAND'} >$ENV{'SCRIPT_OUTPUT_FILE'} 2>&1 &"); +EOF + +CALL create_table_and_insert_rows(); +# Waiting for few secs to allow Dtrace to write all trace output to file. +SELECT SLEEP(4); +--enable_result_log + +# Dtrace output +--exec cat $SCRIPT_OUTPUT_FILE + +# Cleanup +--remove_file $OUTPUT_FILENAME +--remove_file $SCRIPT_OUTPUT_FILE +DROP TABLE t1; +DROP PROCEDURE create_table_and_insert_rows; diff --git a/mysql-wsrep-5.6/mysql-test/t/file_contents.test b/mysql-wsrep-5.6/mysql-test/t/file_contents.test index 57a79360..d61a5b93 100644 --- a/mysql-wsrep-5.6/mysql-test/t/file_contents.test +++ b/mysql-wsrep-5.6/mysql-test/t/file_contents.test @@ -17,13 +17,17 @@ 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/*-server*"; } else { # RedHat: version number in directory name $dir_docs = glob "$dir_docs/MySQL-server*"; if (! -d "$dir_docs") { # If not it might be ULN so try that - $dir_docs = glob "$dir_bin/share/doc/mysql-community-server*"; + $dir_docs = glob "$dir_bin/share/doc/mysql-*-server*"; + if (! -f "$dir_docs/INFO_BIN") { + # Debian/ Ubuntu + $dir_docs = glob "$dir_bin/share/mysql/docs"; + } } } } elsif ($dir_bin =~ m|/usr$|) { @@ -31,17 +35,21 @@ if ($dir_bin =~ m|/usr/|) { $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/*-server*"; } else { # RedHat: version number in directory name $dir_docs = glob "$dir_docs/MySQL-server*"; if (! -d "$dir_docs") { # If not it might be ULN so try that - $dir_docs = glob "$dir_bin/share/doc/mysql-community-server*"; + $dir_docs = glob "$dir_bin/share/doc/mysql-*-server*"; + if (! -f "$dir_docs/INFO_BIN") { + # Debian/ Ubuntu + $dir_docs = glob "$dir_bin/share/mysql/docs"; + } } } } else { - # tar.gz package, Windows, or developer work (in BZR) + # tar.gz package, Windows, or developer work (in git) $dir_docs = $dir_bin; $dir_docs =~ s|/lib||; if(-d "$dir_docs/docs") { @@ -55,7 +63,7 @@ $found_revision = "No line 'revision-id: .....'"; open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n"; while(defined ($line = <I_SRC>)) { if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";} - if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";} + if ($line =~ m|^commit: \w{40}$|) {$found_revision = "Found GIT revision id";} } close I_SRC; print "INFO_SRC: $found_version / $found_revision\n"; diff --git a/mysql-wsrep-5.6/mysql-test/t/func_aes.test b/mysql-wsrep-5.6/mysql-test/t/func_aes.test new file mode 100644 index 00000000..f71cf48d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/func_aes.test @@ -0,0 +1,225 @@ +--echo # Tests of the AES functionality + +--echo # +--echo # WL#6781: Support multiple AES encryption modes +--echo # + +--echo #### AES_ENCRYPT return type + +--echo # must be aes-128-ecb +SELECT @@block_encryption_mode; + +--echo # must work and return a string +SELECT TO_BASE64(AES_ENCRYPT('a', 'b')); + +--echo # must return 16 +SELECT LENGTH(AES_ENCRYPT('a', 'b')); + +--echo # must return binary +SELECT CHARSET(AES_ENCRYPT('a', 'b')); + +--echo # must be equal +SELECT AES_ENCRYPT('a', 'b') = AES_ENCRYPT('a', 'b'); + + +--echo #### AES_ENCRYPT parameters + +--echo # must return NULL +SELECT AES_ENCRYPT('a', NULL); +SELECT AES_ENCRYPT(NULL, 'a'); +SELECT AES_ENCRYPT(NULL, NULL); + +--echo # must return value +SELECT TO_BASE64(AES_ENCRYPT('a', 0)); +SELECT TO_BASE64(AES_ENCRYPT('a', 12.04)); +SELECT TO_BASE64(AES_ENCRYPT(0, 'a')); +SELECT TO_BASE64(AES_ENCRYPT(12.04, 'a')); +SELECT TO_BASE64(AES_ENCRYPT(0, 0)); +SELECT TO_BASE64(AES_ENCRYPT(12.04, 12.04)); + + +--echo #### parameter conversion + +--echo must be equal +SELECT AES_ENCRYPT('a', 12.04) = AES_ENCRYPT('a', '12.04'); +SELECT AES_ENCRYPT('a', 0) = AES_ENCRYPT('a', '0'); +SELECT AES_ENCRYPT(12.04, 'a') = AES_ENCRYPT('12.04', 'a'); +SELECT AES_ENCRYPT(0, 'a') = AES_ENCRYPT('0', 'a'); +SELECT AES_ENCRYPT('\x0Z', 'a') = AES_ENCRYPT('\x0Z', 'a'); +SELECT AES_ENCRYPT('a', '\x0Z') = AES_ENCRYPT('a', '\x0Z'); + +--echo # must not be equal +SELECT AES_ENCRYPT('a', '\x0Y') = AES_ENCRYPT('a', '\x0Z'); +SELECT AES_ENCRYPT('\x0Y', 'a') = AES_ENCRYPT('\x0Z', 'a'); + + +--echo #### algorithm + +--echo # must not be equal +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('b', 'a'); +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'b'); +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('aa', 'a'); +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'aa'); +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT(REPEAT('a',1000), 'a'); +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', REPEAT('a',1000)); + + +--echo #### persistense + +CREATE TABLE t1 (a BINARY(16) PRIMARY KEY); + +--echo # must pass without a warning +INSERT INTO t1 VALUES (AES_ENCRYPT('a','a')); + +--echo # must fail +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (AES_ENCRYPT('a','a')); + +--echo # must pass +INSERT INTO t1 VALUES (AES_ENCRYPT('b','a')); + +--echo # must return 1 +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('a', 'a'); + +--echo # must return 1 +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('b', 'a'); + +--echo # must return 0 +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('c', 'a'); +SELECT COUNT(*) FROM t1 WHERE a = AES_ENCRYPT('a', 'c'); + +SELECT TO_BASE64(a) FROM t1 ORDER BY a; + +--echo # cleanup +DROP TABLE t1; + + +--echo #### IV + +--echo # must be equal +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'a', REPEAT('a', 16)); +SELECT AES_ENCRYPT('a', 'a') = AES_ENCRYPT('a', 'a', REPEAT('b', 16)); + +--echo # must return a warning +SELECT TO_BASE64(AES_ENCRYPT('a', 'a', 'a')); + +--echo # must pass +SELECT TO_BASE64(AES_ENCRYPT('a', 'a', NULL)); +SELECT TO_BASE64(AES_ENCRYPT('a', 'a', REPEAT('a', 1024))); +SELECT TO_BASE64(AES_ENCRYPT('a', 'a', RANDOM_BYTES(16))); + + +--echo #### RANDOM_BYTES + + +--echo # must be 1 +SELECT LENGTH(RANDOM_BYTES(1)); + +--echo # must return binary +SELECT CHARSET(RANDOM_BYTES(1)); + +--echo # must return an error +--error ER_DATA_OUT_OF_RANGE +SELECT RANDOM_BYTES(1000000000000); + +--error ER_DATA_OUT_OF_RANGE +SELECT LENGTH(RANDOM_BYTES(0)); + + +--echo #### AES_DECRYPT + +--echo # must return binary +SELECT CHARSET(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a')); + +--echo # must return 1 +SELECT LENGTH(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a')); + +--echo # must be equal +SELECT AES_DECRYPT(AES_ENCRYPT('a','a'), 'a') = 'a'; + +--echo # must be equal +SELECT AES_DECRYPT(AES_ENCRYPT(_UTF8'ÐоÑо', 'a'), 'a') = _UTF8'ÐоÑо'; +SELECT AES_DECRYPT(AES_ENCRYPT('ÐоÑо', 'a'), 'a') = 'ÐоÑо'; + +--echo # must be NULL +SELECT AES_DECRYPT(NULL, 'a'); +SELECT AES_DECRYPT('a', NULL); +SELECT AES_DECRYPT(NULL, NULL); + + +--echo #### AES_DECRYPT IV + +--echo # must be equal +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', NULL); +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', REPEAT('a',16)); +SELECT 'a' = AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', REPEAT('a',100)); + +--echo # must return a warning +SELECT TO_BASE64(AES_DECRYPT(AES_ENCRYPT('a', 'a'), 'a', 'a')); + + +--echo #### 128, 192 and 256 bit ECB + + +CREATE TABLE aes_ecb(a VARCHAR(16), b128 CHAR(16), b192 CHAR(16), b256 CHAR(16)); +INSERT INTO aes_ecb (a) VALUES ('a'), ('ÐоÑо'), (REPEAT('a', 10)); + +SET SESSION block_encryption_mode='aes-128-ecb'; +UPDATE aes_ecb SET b128 = AES_ENCRYPT(a, 'a'); + +SET SESSION block_encryption_mode='aes-192-ecb'; +UPDATE aes_ecb SET b192 = AES_ENCRYPT(a, 'a'); + +SET SESSION block_encryption_mode='aes-256-ecb'; +UPDATE aes_ecb SET b256 = AES_ENCRYPT(a, 'a'); + +--echo # must return 0 +SELECT COUNT(*) FROM aes_ecb WHERE b128 = b192 OR B192 = b256 OR b128=b256; + +SET SESSION block_encryption_mode='aes-256-ecb'; + +--echo # must return 3 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b256, 'a'); + +--echo # must return 0 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b256, 'b'); + +SET SESSION block_encryption_mode='aes-192-ecb'; + +--echo # must return 3 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b192, 'a'); + +--echo # must return 0 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b192, 'b'); + +SET SESSION block_encryption_mode='aes-128-ecb'; + +--echo # must return 3 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b128, 'a'); + +--echo # must return 0 +SELECT COUNT(*) FROM aes_ecb WHERE a = AES_DECRYPT(b128, 'b'); + + +SET SESSION block_encryption_mode=DEFAULT; +DROP TABLE aes_ecb; + + +let $block_mode=cbc; +source include/func_aes_block.inc; + +let $block_mode=default; + + +--echo # +--echo # Bug #18259229: SERVER CRASHES WITH THE FUNCTION RANDOM_BYTES() +--echo # + +--echo # INT_MAX - 9 (terminating 0 + rounding). Should not crash +--error ER_DATA_OUT_OF_RANGE +SELECT RANDOM_BYTES(2147483647 - 9); + + +--echo # +--echo # End of 5.7 tests +--echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb1.test b/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb1.test new file mode 100644 index 00000000..c7b12338 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb1.test @@ -0,0 +1,20 @@ +--echo # Tests of the AES CFB1 block mode +--disable_query_log +--disable_result_log +--error 0,ER_WRONG_VALUE_FOR_VAR +SET SESSION block_encryption_mode='aes-128-cfb1'; +--enable_query_log +--enable_result_log + +if (`SELECT @@SESSION.block_encryption_mode <> 'aes-128-cfb1'`) { + skip No cfb1 support; +} + +let $block_mode=cfb1; +source include/func_aes_block.inc; + +SET SESSION block_encryption_mode=default; + +--echo # +--echo # End of 5.7 tests +--echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb128.test b/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb128.test new file mode 100644 index 00000000..0c17a76a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb128.test @@ -0,0 +1,20 @@ +--echo # Tests of the AES CFB128 block mode +--disable_query_log +--disable_result_log +--error 0,ER_WRONG_VALUE_FOR_VAR +SET SESSION block_encryption_mode='aes-128-cfb128'; +--enable_query_log +--enable_result_log + +if (`SELECT @@SESSION.block_encryption_mode <> 'aes-128-cfb128'`) { + skip No cfb128 support; +} + +let $block_mode=cfb128; +source include/func_aes_block.inc; + +SET SESSION block_encryption_mode=default; + +--echo # +--echo # End of 5.7 tests +--echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb8.test b/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb8.test new file mode 100644 index 00000000..749f4801 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/func_aes_cfb8.test @@ -0,0 +1,20 @@ +--echo # Tests of the AES CFB8 block mode +--disable_query_log +--disable_result_log +--error 0,ER_WRONG_VALUE_FOR_VAR +SET SESSION block_encryption_mode='aes-128-cfb8'; +--enable_query_log +--enable_result_log + +if (`SELECT @@SESSION.block_encryption_mode <> 'aes-128-cfb8'`) { + skip No cfb8 support; +} + +let $block_mode=cfb8; +source include/func_aes_block.inc; + +SET SESSION block_encryption_mode=default; + +--echo # +--echo # End of 5.7 tests +--echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/func_aes_misc.test b/mysql-wsrep-5.6/mysql-test/t/func_aes_misc.test new file mode 100644 index 00000000..7ccc6f6f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/func_aes_misc.test @@ -0,0 +1,180 @@ +--echo ############################################## +--echo #### Tests for ECB Mode +--echo ############################################## + +SET @IV='abcd1234efgh5678'; +SET @KEYS=REPEAT('c', 16); +SET @ENCSTR=REPEAT('d', 256); + +--echo "--------------------------------------------" +let $block_mode=aes-128-ecb; +--echo ##################### Testing with mode : $block_mode +eval SET SESSION block_encryption_mode="$block_mode"; +SELECT @@global.block_encryption_mode; +SELECT @@session.block_encryption_mode; + +--echo ####Test without tables +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR; + +--echo ####Test with InnoDB tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)); +INSERT INTO t1 values(@ENCSTR); +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; + +--echo ####Test with MyISAM tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)) engine=MyISAM; +INSERT INTO t1 values(@ENCSTR); +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; + +--echo "--------------------------------------------" +let $block_mode=aes-192-ecb; +--echo ##################### Testing with mode : $block_mode +eval SET SESSION block_encryption_mode="$block_mode"; +SELECT @@global.block_encryption_mode; +SELECT @@session.block_encryption_mode; + +--echo ####Test without tables +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR; + +--echo ####Test with InnoDB tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)); +INSERT INTO t1 values(@ENCSTR); +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; + +--echo ####Test with MyISAM tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)) engine=MyISAM; +INSERT INTO t1 values(@ENCSTR); +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; +--echo "--------------------------------------------" +let $block_mode=aes-256-ecb; +--echo ##################### Testing with mode : $block_mode +eval SET SESSION block_encryption_mode="$block_mode"; +--echo should return 1 +SELECT @@global.block_encryption_mode; +--echo should return 1 +SELECT @@session.block_encryption_mode; + +--echo ####Test without tables +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR; + +--echo ####Test with InnoDB tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)); +INSERT INTO t1 values(@ENCSTR); +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; + +--echo ####Test with MyISAM tables +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)) engine=MyISAM; +INSERT INTO t1 values(@ENCSTR); +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS), @KEYS)=@ENCSTR FROM t1; +--echo should return 1 +SELECT AES_DECRYPT(AES_ENCRYPT(@ENCSTR, @KEYS, @IV), @KEYS, @IV)=@ENCSTR FROM t1; +DROP TABLE IF EXISTS t1; +--echo "--------------------------------------------" + +--echo ############################################## +--echo "Tests related to RANDOM_BYTES()" +--echo ############################################## +--echo should return 1 +select LENGTH(RANDOM_BYTES(1))=1; +--echo should return 1 +select LENGTH(RANDOM_BYTES(1024))=1024; +SET @KEYS=RANDOM_BYTES(1); +SET @KEYS=RANDOM_BYTES(1024); + +--error 1690 +select RANDOM_BYTES(0); + +--error 1690 +select RANDOM_BYTES(1025); +--echo ############################################## +--echo "Tests related to boundary values of IV" +--echo ############################################## +SET @IV='abcdefghijklmnophelloworldworldisgreat'; +SET @IV1='abcdefghijklmnopqrstuvwxyz'; +SET @KEYS='helloworld'; +SET @ENCSTR=REPEAT('K',100); +SET @@session.block_encryption_mode = 'aes-256-cbc'; + +--echo should return 1 +select AES_ENCRYPT(@ENCSTR, @KEYS, @IV)=AES_ENCRYPT(@ENCSTR, @KEYS, @IV1); +--echo ############################################## +--echo "Few negative tests with invalid/different keys and IV" +--echo ############################################## +SET @IV='ijkl8765mnop2345'; +SET @KEYS='helloworld1234567890'; +SET @ENCSTR=REPEAT('J',255); + +SET @@session.block_encryption_mode = 'aes-128-ecb'; + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 varchar(256)); +INSERT INTO t1 values(AES_ENCRYPT(@ENCSTR, @KEYS, @IV)); + +--echo Combination1.............. +SET @@session.block_encryption_mode = 'aes-192-ecb'; +--echo should return NULL +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; + +--echo Combination2.............. +SET @@session.block_encryption_mode = 'aes-256-ecb'; +--echo should return NULL +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; + +--echo Combination3.............. +SET @@session.block_encryption_mode = 'aes-128-cbc'; +--echo should return 0 or NULL +SELECT COALESCE (AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR,0) FROM t1; + +--echo Combination4.............. +SET @@session.block_encryption_mode = 'aes-192-cbc'; +--echo should return NULL +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; + +--echo Combination5.............. +SET @@session.block_encryption_mode = 'aes-256-cbc'; +--echo should return NULL +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; + +--echo Combination6.............. +SET @@session.block_encryption_mode = 'aes-128-ecb'; +--echo should return 1 +SELECT AES_DECRYPT(f1, @KEYS, @IV)=@ENCSTR FROM t1; + +SET @@session.block_encryption_mode = DEFAULT; +DROP TABLE IF EXISTS t1; + + +--echo # +--echo # End of 5.7 tests +--echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/func_aes_ofb.test b/mysql-wsrep-5.6/mysql-test/t/func_aes_ofb.test new file mode 100644 index 00000000..1bba9b10 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/func_aes_ofb.test @@ -0,0 +1,20 @@ +--echo # Tests of the AES ofb block mode +--disable_query_log +--disable_result_log +--error 0,ER_WRONG_VALUE_FOR_VAR +SET SESSION block_encryption_mode='aes-128-ofb'; +--enable_query_log +--enable_result_log + +if (`SELECT @@SESSION.block_encryption_mode <> 'aes-128-ofb'`) { + skip No ofb support; +} + +let $block_mode=ofb; +source include/func_aes_block.inc; + +SET SESSION block_encryption_mode=default; + +--echo # +--echo # End of 5.7 tests +--echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/group_min_max.test b/mysql-wsrep-5.6/mysql-test/t/group_min_max.test index d1a98439..3d355f79 100644 --- a/mysql-wsrep-5.6/mysql-test/t/group_min_max.test +++ b/mysql-wsrep-5.6/mysql-test/t/group_min_max.test @@ -1244,3 +1244,47 @@ explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1; drop table t1; --echo # End of test#50539. +--echo # +--echo # Bug#17217128 - BAD INTERACTION BETWEEN MIN/MAX AND +--echo # "HAVING SUM(DISTINCT)": WRONG RESULTS. +--echo # + +CREATE TABLE t (a INT, b INT, KEY(a,b)); +INSERT INTO t VALUES (1,1), (2,2), (3,3), (4,4), (1,0), (3,2), (4,5); +let $DEFAULT_TRACE_MEM_SIZE=1048576; # 1MB +eval set optimizer_trace_max_mem_size=$DEFAULT_TRACE_MEM_SIZE; +set @@session.optimizer_trace='enabled=on'; +set end_markers_in_json=on; + +ANALYZE TABLE t; + +SELECT a, SUM(DISTINCT a), MIN(b) FROM t GROUP BY a; +EXPLAIN SELECT a, SUM(DISTINCT a), MIN(b) FROM t GROUP BY a; +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK + FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; + +SELECT a, SUM(DISTINCT a), MAX(b) FROM t GROUP BY a; +EXPLAIN SELECT a, SUM(DISTINCT a), MAX(b) FROM t GROUP BY a; +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK + FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; + +SELECT a, MAX(b) FROM t GROUP BY a HAVING SUM(DISTINCT a); +EXPLAIN SELECT a, MAX(b) FROM t GROUP BY a HAVING SUM(DISTINCT a); +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK + FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; + +SELECT SUM(DISTINCT a), MIN(b), MAX(b) FROM t; +EXPLAIN SELECT SUM(DISTINCT a), MIN(b), MAX(b) FROM t; +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK + FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; + +SELECT a, SUM(DISTINCT a), MIN(b), MAX(b) FROM t GROUP BY a; +EXPLAIN SELECT a, SUM(DISTINCT a), MIN(b), MAX(b) FROM t GROUP BY a; +SELECT TRACE RLIKE 'have_both_agg_distinct_and_min_max' AS OK + FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; + +SET optimizer_trace_max_mem_size=DEFAULT; +SET optimizer_trace=DEFAULT; +SET end_markers_in_json=DEFAULT; + +DROP TABLE t; diff --git a/mysql-wsrep-5.6/mysql-test/t/group_min_max_innodb.test b/mysql-wsrep-5.6/mysql-test/t/group_min_max_innodb.test index 985b43a9..eab60346 100644 --- a/mysql-wsrep-5.6/mysql-test/t/group_min_max_innodb.test +++ b/mysql-wsrep-5.6/mysql-test/t/group_min_max_innodb.test @@ -138,3 +138,122 @@ SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b'; DROP TABLE t1; --echo End of 5.5 tests + +--echo # +--echo # Bug#17909656 - WRONG RESULTS FOR A SIMPLE QUERY WITH GROUP BY +--echo # + +CREATE TABLE t0 ( + i1 INTEGER NOT NULL +); + +INSERT INTO t0 VALUES (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); + +CREATE TABLE t1 ( + c1 CHAR(1) NOT NULL, + i1 INTEGER NOT NULL, + i2 INTEGER NOT NULL, + UNIQUE KEY k1 (c1,i2) +) ENGINE=InnoDB; + +INSERT INTO t1 SELECT 'A',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'B',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'C',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'D',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'E',i1,i1 FROM t0; +INSERT INTO t1 SELECT 'F',i1,i1 FROM t0; + +CREATE TABLE t2 ( + c1 CHAR(1) NOT NULL, + i1 INTEGER NOT NULL, + i2 INTEGER NOT NULL, + UNIQUE KEY k2 (c1,i1,i2) +) ENGINE=InnoDB; + +INSERT INTO t2 SELECT 'A',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'B',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'C',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'D',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'E',i1,i1 FROM t0; +INSERT INTO t2 SELECT 'F',i1,i1 FROM t0; + +-- disable_result_log +ANALYZE TABLE t1; +ANALYZE TABLE t2; +-- enable_result_log + +let $DEFAULT_TRACE_MEM_SIZE=1048576; # 1MB +eval set optimizer_trace_max_mem_size=$DEFAULT_TRACE_MEM_SIZE; +set @@session.optimizer_trace='enabled=on'; +set end_markers_in_json=on; +let $show_method= +SELECT TRACE RLIKE 'minmax_keypart_in_disjunctive_query' +AS OK FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; + +let query= +SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F') +GROUP BY c1; +--replace_column 9 ROWS +eval EXPLAIN $query; +eval $query; +eval $show_method; + +let query= +SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17)) +GROUP BY c1; +--replace_column 9 ROWS +eval EXPLAIN $query; +eval $query; +eval $show_method; + +let query= +SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 ) +GROUP BY c1; +--replace_column 9 ROWS +eval EXPLAIN $query; +eval $query; +eval $show_method; + +let query= +SELECT c1, max(i2) FROM t1 +WHERE ((c1 = 'C' AND (i2 = 40 OR i2 = 30)) OR ( c1 = 'F' AND (i2 = 40 ))) +GROUP BY c1; +--replace_column 9 ROWS +eval EXPLAIN $query; +eval $query; +eval $show_method; + +let query= +SELECT c1, i1, max(i2) FROM t2 +WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ) +GROUP BY c1,i1; +--replace_column 9 ROWS +eval EXPLAIN $query; +eval $query; +eval $show_method; + +let query= +SELECT c1, i1, max(i2) FROM t2 +WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )) +GROUP BY c1,i1; +--replace_column 9 ROWS +eval EXPLAIN $query; +eval $query; +eval $show_method; + +let query= +SELECT c1, i1, max(i2) FROM t2 +WHERE ((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35) OR ( i2 = 17 )) +GROUP BY c1,i1; +--replace_column 9 ROWS +eval EXPLAIN $query; +eval $query; +eval $show_method; + +SET optimizer_trace_max_mem_size=DEFAULT; +SET optimizer_trace=DEFAULT; +SET end_markers_in_json=DEFAULT; + +DROP TABLE t0,t1,t2; diff --git a/mysql-wsrep-5.6/mysql-test/t/information_schema-big.test b/mysql-wsrep-5.6/mysql-test/t/information_schema-big.test index c9cd65f0..be215519 100644 --- a/mysql-wsrep-5.6/mysql-test/t/information_schema-big.test +++ b/mysql-wsrep-5.6/mysql-test/t/information_schema-big.test @@ -30,6 +30,7 @@ SELECT t.table_name, c1.column_name c2.table_name = t.table_name AND c2.column_name LIKE '%SCHEMA%' ) + AND t.table_name NOT LIKE 'ndb%' AND t.table_name NOT LIKE 'innodb%'; SELECT t.table_name, c1.column_name FROM information_schema.tables t @@ -45,4 +46,5 @@ SELECT t.table_name, c1.column_name c2.table_name = t.table_name AND c2.column_name LIKE '%SCHEMA%' ) + AND t.table_name NOT LIKE 'ndb%' AND t.table_name NOT LIKE 'innodb%'; diff --git a/mysql-wsrep-5.6/mysql-test/t/information_schema.test b/mysql-wsrep-5.6/mysql-test/t/information_schema.test index 53489f06..e70155b5 100644 --- a/mysql-wsrep-5.6/mysql-test/t/information_schema.test +++ b/mysql-wsrep-5.6/mysql-test/t/information_schema.test @@ -1838,6 +1838,23 @@ select TABLE_NAME,COLUMN_NAME,DATA_TYPE,DATETIME_PRECISION from information_sche drop database mysqltest; use test; +--echo # +--echo # Test for bug #16869534 - "QUERYING SUBSET OF COLUMNS DOESN'T USE TABLE +--echo # CACHE; OPENED_TABLES INCREASES" +--echo # +--disable_result_log +SELECT * FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +SELECT VARIABLE_VALUE INTO @val1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE + VARIABLE_NAME LIKE 'Opened_tables'; +--disable_result_log +SELECT ENGINE FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +--echo # The below SELECT query should give same output as above SELECT query. +SELECT VARIABLE_VALUE INTO @val2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE + VARIABLE_NAME LIKE 'Opened_tables'; +--echo # The below select should return '1' +SELECT @val1 = @val2; --echo # --echo # End of 5.5 tests diff --git a/mysql-wsrep-5.6/mysql-test/t/innodb_mysql_sync.test b/mysql-wsrep-5.6/mysql-test/t/innodb_mysql_sync.test index 6df63bd0..66f1fce3 100644 --- a/mysql-wsrep-5.6/mysql-test/t/innodb_mysql_sync.test +++ b/mysql-wsrep-5.6/mysql-test/t/innodb_mysql_sync.test @@ -592,6 +592,205 @@ DROP TABLE t1; SET DEBUG_SYNC= 'RESET'; +--echo # +--echo #BUG#13975225:ONLINE OPTIMIZE TABLE FOR INNODB TABLES +--echo # + +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +connect(con1,localhost,root,,); + +--echo #Setting up INNODB table. +CREATE TABLE t1(fld1 INT, fld2 INT, fld3 INT) ENGINE= INNODB; +INSERT INTO t1 VALUES (155, 45, 55); + +--echo #Concurrent INSERT, UPDATE, SELECT and DELETE is supported +--echo #during OPTIMIZE TABLE operation for INNODB tables. +--enable_connect_log +--connection default +--echo #OPTIMIZE TABLE operation. +--send OPTIMIZE TABLE t1 + +--connection con1 +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +--echo # With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (10, 11, 12); +UPDATE t1 SET fld1= 20 WHERE fld1= 155; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +SET DEBUG_SYNC= 'now SIGNAL continue'; + +--connection default +--reap +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; + +--echo #Concurrent INSERT, UPDATE, SELECT and DELETE is supported +--echo #during OPTIMIZE TABLE operation for Partitioned table. + +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +--echo #Setup PARTITIONED table. +CREATE TABLE t1(fld1 INT) ENGINE= INNODB PARTITION BY HASH(fld1) PARTITIONS 4; +INSERT INTO t1 VALUES(10); + +--echo #OPTIMIZE TABLE operation. +--send OPTIMIZE TABLE t1 + +--connection con1 +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +--echo # With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +SET DEBUG_SYNC= 'now SIGNAL continue'; + +--connection default +--reap +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; + +--echo #ALTER TABLE FORCE and ALTER TABLE ENGINE uses online rebuild +--echo #of the table. + +CREATE TABLE t1(fld1 INT, fld2 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(10, 20); + +--enable_info +ALTER TABLE t1 FORCE; +ALTER TABLE t1 ENGINE=INNODB; + +--echo #ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE uses +--echo #table copy when the old_alter_table enabled. +SET SESSION old_alter_table= TRUE; +ALTER TABLE t1 FORCE; +ALTER TABLE t1 ENGINE= INNODB; + +SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded'; +--echo #OPTIMIZE TABLE operation using table copy. +--send OPTIMIZE TABLE t1 + +--connection con1 +SET DEBUG_SYNC= 'now WAIT_FOR upgraded'; +INSERT INTO t1 VALUES(10, 20); + +--connection default +--reap +SET DEBUG_SYNC= 'RESET'; +SET SESSION old_alter_table= FALSE; + +--echo #ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy +--echo #when ALGORITHM COPY is used. +ALTER TABLE t1 FORCE, ALGORITHM= COPY; +ALTER TABLE t1 ENGINE= INNODB, ALGORITHM= COPY; +--disable_info + +#cleanup +DROP TABLE t1; + +--echo #OPTIMIZE TABLE on a table with FULLTEXT index uses +--echo #ALTER TABLE FORCE using COPY algorithm here. This +--echo #test case ensures the COPY table debug sync point is hit. + +SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded'; + +--echo #Setup a table with FULLTEXT index. +--connection default +CREATE TABLE t1(fld1 CHAR(10), FULLTEXT(fld1)) ENGINE= INNODB; +INSERT INTO t1 VALUES("String1"); + +--echo #OPTIMIZE TABLE operation. +--send OPTIMIZE TABLE t1 + +--connection con1 +SET DEBUG_SYNC= 'now WAIT_FOR upgraded'; +INSERT INTO t1 VALUES("String2"); + +--connection default +--reap +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; + +--echo #Test which demonstrates that ALTER TABLE, OPTIMIZE PARTITION +--echo #takes OPTIMIZE TABLE code path, hence does an online rebuild +--echo #of the table with the patch. + +--connection default +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +--echo #Setup PARTITIONED table. +CREATE TABLE t1(fld1 INT) ENGINE= INNODB PARTITION BY HASH(fld1) PARTITIONS 4; +INSERT INTO t1 VALUES(10); + +--echo #OPTIMIZE ALL PARTITIONS operation. +--send ALTER TABLE t1 OPTIMIZE PARTITION ALL + +--connection con1 +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +--echo # With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +SET DEBUG_SYNC= 'now SIGNAL continue'; + +--connection default +--reap +SET DEBUG_SYNC= 'RESET'; + +--echo #OPTIMIZE PER PARTITION operation. +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +--send ALTER TABLE t1 OPTIMIZE PARTITION p0 + +--connection con1 +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +--echo # With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +SET DEBUG_SYNC= 'now SIGNAL continue'; + +--connection default +--reap +SET DEBUG_SYNC= 'RESET'; + +--echo # Test case for Bug#11938817 (ALTER BEHAVIOR DIFFERENT THEN DOCUMENTED). +--enable_info +--echo # This should not do anything +ALTER TABLE t1; +--disable_info + +#Note that sync point is activated in the online rebuild code path. +SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuild'; + +--echo # Check that we rebuild the table +--send ALTER TABLE t1 engine=innodb + +--connection con1 +SET DEBUG_SYNC= 'now WAIT_FOR rebuild'; + +--connection default +--reap + +SET DEBUG_SYNC= 'RESET'; + +SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuild'; + +--echo # Check that we rebuild the table +--send ALTER TABLE t1 FORCE + +--connection con1 +SET DEBUG_SYNC= 'now WAIT_FOR rebuild'; + +--connection default +--reap + +--disable_connect_log +--disconnect con1 + +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; + + # 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 diff --git a/mysql-wsrep-5.6/mysql-test/t/innodb_recovery_with_upper_case_names-master.opt b/mysql-wsrep-5.6/mysql-test/t/innodb_recovery_with_upper_case_names-master.opt new file mode 100644 index 00000000..bd3c3c39 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/innodb_recovery_with_upper_case_names-master.opt @@ -0,0 +1 @@ +--innodb-fast-shutdown=2 diff --git a/mysql-wsrep-5.6/mysql-test/t/innodb_recovery_with_upper_case_names.test b/mysql-wsrep-5.6/mysql-test/t/innodb_recovery_with_upper_case_names.test new file mode 100644 index 00000000..7b1af536 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/innodb_recovery_with_upper_case_names.test @@ -0,0 +1,63 @@ +--echo Bug #18412598 UNCLEAN SYSTEM SHUTDOWN RECOVERY FAILS +--echo FOR SCHEMA WITH CAPITAL LETTERS + +--source include/have_innodb.inc +--source include/not_embedded.inc +--source include/have_case_insensitive_file_system.inc + +# Start the server with innodb-fast-shutdown=2,so that +# during next invocation of server it enters crash +# recovery mode + +create database MYDB; +USE MYDB; +CREATE TABLE mytable (id int primary key) ENGINE=innodb; +CREATE TABLE FOO (id int,constraint FOREIGN KEY (id) REFERENCES mytable(id) ON DELETE CASCADE) ENGINE=innodb; +CREATE TABLE mytable_ref (id int,constraint FOREIGN KEY (id) REFERENCES FOO(id) ON DELETE CASCADE) ENGINE=innodb; + +INSERT INTO mytable VALUES (10),(20),(30),(40); +INSERT INTO FOO VALUES (20),(10); +INSERT INTO mytable_ref VALUES (20),(10); + +SHOW VARIABLES LIKE 'innodb_fast_shutdown'; + +START TRANSACTION; + +INSERT INTO mytable VALUES (50); +INSERT INTO FOO VALUES (50); +INSERT INTO mytable_ref VALUES (50); + +# Stop the server +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc + +--echo # Restart the server. This will go into crash recovery mode +--exec echo "restart: --innodb-fast-shutdown=0 " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +USE MYDB; +SELECT * FROM mytable; +SELECT * FROM FOO; +SELECT * FROM mytable_ref; + +DELETE FROM mytable WHERE id =10; + +SELECT * FROM FOO; +SELECT * FROM mytable_ref; + +# Create table with mixed names,this should +# fail in case insensitive systems + +--error ER_TABLE_EXISTS_ERROR +CREATE TABLE MYtable (id int) ENGINE=innodb; + +--error ER_TABLE_EXISTS_ERROR +CREATE TABLE Foo (id int) ENGINE=innodb; + +DROP TABLE mytable_ref,FOO; +DROP TABLE mytable; +use test; +DROP DATABASE MYDB; + diff --git a/mysql-wsrep-5.6/mysql-test/t/loaddata.test b/mysql-wsrep-5.6/mysql-test/t/loaddata.test index 80956aa2..aa7be524 100644 --- a/mysql-wsrep-5.6/mysql-test/t/loaddata.test +++ b/mysql-wsrep-5.6/mysql-test/t/loaddata.test @@ -635,3 +635,24 @@ create table t1(a point); drop table t1; --echo End of 5.1 tests + +--echo # +--echo # Bug#11759519 INFINITE HANG WITH 100% CPU USAGE WITH LOAD DATA LOCAL AND IMPORT ERRORS +--echo # +SET @old_mode= @@sql_mode; +CREATE TABLE t1 (fld1 INT); +--copy_file $EXE_MYSQL $MYSQLTEST_VARDIR/mysql + +SET sql_mode='strict_all_tables'; + +--echo # Without fix, load data hangs forever. +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,1000 +eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/mysql' REPLACE INTO TABLE t1 + FIELDS TERMINATED BY 't' LINES TERMINATED BY ''; + +SET @@sql_mode= @old_mode; + +--remove_file $MYSQLTEST_VARDIR/mysql +DROP TABLE t1; + diff --git a/mysql-wsrep-5.6/mysql-test/t/lock_sync.test b/mysql-wsrep-5.6/mysql-test/t/lock_sync.test index f00080d9..5754189a 100644 --- a/mysql-wsrep-5.6/mysql-test/t/lock_sync.test +++ b/mysql-wsrep-5.6/mysql-test/t/lock_sync.test @@ -1088,6 +1088,10 @@ INSERT INTO t1 VALUES (1), (2); connect (con1, localhost, root); connect (con2, localhost, root); +--echo # Note: This test now provides coverage for the scenario where +--echo # opening of table during analyze phase of OPTIMIZE TABLE +--echo # fails (instead of original coverage for open_ltable() code). + --echo # Connection con1 connection con1; SET SESSION lock_wait_timeout= 1; @@ -1100,7 +1104,7 @@ connection con2; SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate'; SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock'; --echo # Sending: ---send INSERT INTO t1 VALUES (3) +--send LOCK TABLES t1 WRITE --echo # Connection default connection default; @@ -1117,7 +1121,7 @@ disconnect con1; --echo # Connection con2 connection con2; ---echo # Reaping: INSERT INTO t1 VALUES (3) +--echo # Reaping: LOCK TABLES t1 WRITE --reap disconnect con2; --source include/wait_until_disconnected.inc @@ -1187,6 +1191,113 @@ disconnect con1; disconnect con2; +--echo # +--echo #Bug#18110156: RECREATE+ANALYZE OPTIMIZE TABLE T AND ONLINE +--echo # ALTER TABLE T MAY DEADLOCK + +CREATE TABLE t1 (fld1 INT) ENGINE=InnoDB; +connect (con1, localhost, root); +connect (con2, localhost, root); + +--enable_connect_log +connection con1; +SET DEBUG_SYNC= 'before_lock_tables_takes_lock SIGNAL before_thr_lock WAIT_FOR do_thr_lock EXECUTE 3'; +SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze'; +--send OPTIMIZE TABLE t1 + +connection con2; +--echo # Skip thr_lock acquisition during the initial phase of OPTIMIZE TABLE +SET DEBUG_SYNC= 'now WAIT_FOR before_thr_lock'; +SET DEBUG_SYNC= 'now SIGNAL do_thr_lock'; +--echo # Skip thr_lock acquisition during the recreate phase of OPTIMIZE TABLE +SET DEBUG_SYNC= 'now WAIT_FOR before_thr_lock'; +SET DEBUG_SYNC= 'now SIGNAL do_thr_lock'; +SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate'; +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL lock_downgraded +WAIT_FOR finish_alter'; +--send ALTER TABLE t1 ADD INDEX index1(fld1), ALGORITHM=INPLACE, LOCK=NONE + +--echo #Without the patch, the test case hangs. +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR lock_downgraded'; +SET DEBUG_SYNC= 'now SIGNAL opti_analyze'; +SET DEBUG_SYNC= 'now WAIT_FOR before_thr_lock'; +SET DEBUG_SYNC= 'now SIGNAL finish_alter'; +SET DEBUG_SYNC= 'now SIGNAL do_thr_lock'; + +--echo #Reap: OPTIMIZE TABLE t1 +--connection con1 +--reap + +--echo #Reap: ALTER TABLE t1 +--connection con2 +--reap +--disable_connect_log + +--echo #Clean up. +--connection default +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +--disconnect con2 +--disconnect con1 + + +--echo # +--echo # Bug#19070633 - POSSIBLE ACCESS TO FREED MEMORY IN IS_FREE_LOCK() AND IS_USED_LOCK(). +--echo # + +--enable_connect_log + +--echo # Verifying issue for IS_FREE_LOCK() function. +SELECT GET_LOCK("lock_19070633", 600); + +connect (con1, localhost, root,,); +--echo # Waiting after getting user level lock info and releasing mutex. +SET DEBUG_SYNC= 'after_getting_user_level_lock_info SIGNAL parked WAIT_FOR go'; +--echo # Sending: SELECT IS_FREE_LOCK("lock_19070633"); +send SELECT IS_FREE_LOCK("lock_19070633"); + +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR parked'; +SELECT RELEASE_LOCK("lock_19070633"); +--echo # Signaling connection con1 after releasing the lock. +--echo # Without fix, accessing user level lock info in con1 would result in +--echo # crash or valgrind issue invalid read is reported. +SET DEBUG_SYNC= 'now SIGNAL go'; + +connection con1; +--echo # Reaping: SELECT IS_FREE_LOCK("lock_19070633"); +--reap + +connection default; +--echo # Verifying issue for IS_USED_LOCK() function. +SELECT GET_LOCK("lock_19070633", 600); + +connection con1; +--echo # Waiting after getting user level lock info and releasing mutex. +SET DEBUG_SYNC= 'after_getting_user_level_lock_info SIGNAL parked WAIT_FOR go'; +--echo # Sending: SELECT IS_USED_LOCK("lock_19070633"); +send SELECT IS_USED_LOCK("lock_19070633"); + +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR parked'; +SELECT RELEASE_LOCK("lock_19070633"); +--echo # Signaling connection con1 after releasing the lock. +--echo # Without fix, accessing user level lock info in con1 would result in +--echo # crash or valgrind issue invalid read is reported. +SET DEBUG_SYNC= 'now SIGNAL go'; + +connection con1; +--echo # Reaping: SELECT IS_USED_LOCK("lock_19070633"); +--replace_column 1 # +--reap + +connection default; +SET DEBUG_SYNC= 'RESET'; +disconnect con1; + +--disable_connect_log + # 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 diff --git a/mysql-wsrep-5.6/mysql-test/t/log_errchk.test b/mysql-wsrep-5.6/mysql-test/t/log_errchk.test new file mode 100644 index 00000000..02d4aa69 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/log_errchk.test @@ -0,0 +1,65 @@ +# +--source include/not_windows.inc +--source include/force_restart.inc +--source include/not_embedded.inc + +# +# Bug#14757009 : WHEN THE GENERAL_LOG IS A SOCKET AND THE READER GOES AWAY, +# MYSQL QUITS WORKING. +# +call mtr.add_suppression("Could not open"); + +--let $gen_log_file= $MYSQLTEST_VARDIR/tmp/general_log.fifo +--let $slow_query_log_file= $MYSQLTEST_VARDIR/tmp/slow_log.fifo +--let GREP_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err + +--exec mkfifo $gen_log_file +--exec mkfifo $slow_query_log_file + +--echo # Case 1: Setting fife file to general_log_file and slow_query_log_file +--echo # system variable. +# Only regular files can be set to general log. Setting fifo file to general log +# reports an error. +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--error ER_WRONG_VALUE_FOR_VAR +--eval SET GLOBAL general_log_file="$gen_log_file"; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--error ER_WRONG_VALUE_FOR_VAR +--eval SET GLOBAL slow_query_log_file="$slow_query_log_file"; + +--echo # Case 2: Starting server with fifo file as general log file +--echo # and slow query log file. +# Restart server with fifo file as general log file. +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server 60 +--source include/wait_until_disconnected.inc +--enable_reconnect +# Write file to make mysql-test-run.pl start up the server again +--exec echo "restart: --general-log-file=$gen_log_file --slow-query-log-file=$slow_query_log_file" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/wait_until_connected_again.inc + +# With fix error should be reported in the error log file if file is not a +# regular file. +--perl + my $file= $ENV{'GREP_FILE'}; + my $pattern= "Turning logging off for the whole duration"; + open(FILE, "$file") or die("Unable to open $file: $!\n"); + my $count = 0; + while (<FILE>) { + if ($_ =~ m/$pattern/) { + $count++; + break; + } + } + if ($count >= 2){ + print "Setting fifo file as general log file and slow query log failed.\n"; + } else { + print "test failed.\n"; + } + close(FILE); +EOF + +# Cleanup +--remove_file $gen_log_file +--remove_file $slow_query_log_file diff --git a/mysql-wsrep-5.6/mysql-test/t/long_tmpdir-master.sh b/mysql-wsrep-5.6/mysql-test/t/long_tmpdir-master.sh old mode 100644 new mode 100755 index 318955fb..1edb0b21 --- a/mysql-wsrep-5.6/mysql-test/t/long_tmpdir-master.sh +++ b/mysql-wsrep-5.6/mysql-test/t/long_tmpdir-master.sh @@ -1,3 +1,5 @@ +#! /bin/bash + d="$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789" test -d "$d" || mkdir "$d" rm -f "$d"/* diff --git a/mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir-master.sh b/mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir-master.sh old mode 100644 new mode 100755 index 95c26e3a..cb34f9f7 --- a/mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir-master.sh +++ b/mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir-master.sh @@ -1,3 +1,5 @@ +#! /bin/bash + # This test requires a non-lowercase tmpdir directory on a case-sensitive # filesystem. diff --git a/mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh b/mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh old mode 100644 new mode 100755 index 95c26e3a..64be9318 --- a/mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh +++ b/mysql-wsrep-5.6/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh @@ -1,3 +1,5 @@ +#! /bin/bash +# # This test requires a non-lowercase tmpdir directory on a case-sensitive # filesystem. diff --git a/mysql-wsrep-5.6/mysql-test/t/lowercase_table4-master.opt b/mysql-wsrep-5.6/mysql-test/t/lowercase_table4-master.opt old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/t/lowercase_table4.test b/mysql-wsrep-5.6/mysql-test/t/lowercase_table4.test old mode 100755 new mode 100644 diff --git a/mysql-wsrep-5.6/mysql-test/t/myisam.test b/mysql-wsrep-5.6/mysql-test/t/myisam.test index 835889c9..1ea7bc11 100644 --- a/mysql-wsrep-5.6/mysql-test/t/myisam.test +++ b/mysql-wsrep-5.6/mysql-test/t/myisam.test @@ -1745,3 +1745,73 @@ CREATE TABLE t1 (f1 year(4), key k1(f1)) ENGINE=MYISAM; INSERT INTO t1 VALUES(0000),(0000); SELECT * FROM t1 FORCE INDEX(k1) WHERE f1 = 'lhsi'; DROP TABLE t1; + +--echo # +--echo # Bug 17156940 THE UPDATE AND SELECT BEHAVE DIFFERENTLY +--echo # UNDER THE SAME CONDITIONS. +--echo # + +CREATE TABLE t1 ( + col1 VARCHAR(255) DEFAULT NULL, + col1_id INT(11) DEFAULT NULL, + KEY col1 (col1), + KEY col1_id (col1_id) +) ENGINE=MyISAM; + +INSERT INTO t1 (col1, col1_id) VALUES + ('5cm', 10000), ('people', 10000), ('king', 10000), ('queen', 10000), + ('minister', 10000), ('servent', 13000); +INSERT INTO t1 (col1, col1_id) + SELECT col1, col1_id FROM t1 WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_id) + SELECT col1, col1_id FROM t1 WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_id) + SELECT col1, col1_id FROM t1 WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_id) VALUES + ('5cm ', 10000), ('5cm ', 10000); +SELECT col1, hex(col1), col1_id, count(*) from t1 + WHERE col1= '5cm' GROUP BY hex(col1), col1_id; +UPDATE t1 SET col1_id= 1414 WHERE col1= '5cm'; +SELECT count(*) FROM t1 WHERE col1= '5cm'; +SELECT count(*) FROM t1 WHERE col1_id= 1414; +DELETE FROM t1 WHERE col1= '5cm'; +SELECT count(*) FROM t1 WHERE col1= '5cm'; +DROP TABLE t1; + + +--echo # Test for multi column key. + +CREATE TABLE t1 ( + col1 VARCHAR(255) DEFAULT NULL, + col1_dummy VARCHAR(25) DEFAULT NULL, + col1_id INT(11) DEFAULT NULL, + col1_id_dummy INT(10) DEFAULT NULL, + + KEY col1 (col1, col1_dummy), + KEY col1_id (col1, col1_id_dummy) +) ENGINE=MyISAM; + +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) VALUES + ('5cm', '5cm' , 10000, 100), ('people', 'people', 10000, 100), + ('king', 'king' , 10000, 100), ('queen', 'queen', 10000, 100), + ('minister', 'minister', 10000, 100), ('servent', 'servent', 13000, 100); +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) + SELECT col1, col1_dummy, col1_id, col1_id_dummy FROM t1 + WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) + SELECT col1, col1_dummy, col1_id, col1_id_dummy FROM t1 + WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) + SELECT col1, col1_dummy, col1_id, col1_id_dummy FROM t1 + WHERE col1 <> '5cm'; +INSERT INTO t1 (col1, col1_dummy, col1_id, col1_id_dummy) VALUES + ('5cm ', '5cm ', 10000, 100), ('5cm ', '5cm ', 10000, 100); +SELECT col1, hex(col1), col1_id, count(*) from t1 WHERE col1= '5cm' + GROUP BY hex(col1), col1_id; +UPDATE t1 SET col1_id= 1414 WHERE col1= '5cm' AND col1_dummy= '5cm'; +SELECT count(*) FROM t1 WHERE col1= '5cm'; +SELECT count(*) FROM t1 WHERE col1_id= 1414; +DELETE FROM t1 WHERE col1= '5cm' AND col1_dummy= '5cm'; +SELECT count(*) FROM t1 WHERE col1= '5cm'; +DROP TABLE t1; + diff --git a/mysql-wsrep-5.6/mysql-test/t/mysql_upgrade.test b/mysql-wsrep-5.6/mysql-test/t/mysql_upgrade.test index 35d122d9..a5e8b5a2 100644 --- a/mysql-wsrep-5.6/mysql-test/t/mysql_upgrade.test +++ b/mysql-wsrep-5.6/mysql-test/t/mysql_upgrade.test @@ -149,5 +149,58 @@ SET PASSWORD FOR 'bug13586336'@'localhost' = OLD_PASSWORD('a'); --exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 DROP USER 'bug13586336'@'localhost'; +--echo # +--echo # Bug #20023823 BACKPORT THE FIX FOR MYSQL_INSTALL_DB/MYSQL_UPGRADE +--echo # ON NON-EMPTY PLUGIN COLUMN +--echo # + +--echo # Creating user with empty plugin and empty password +--echo # plugin should be changed to mysql_native_password after the update + +CREATE USER B20023823_empty@localhost; +GRANT ALL PRIVILEGES on *.* TO B20023823_empty@localhost; +update mysql.user set plugin='' WHERE user='B20023823_empty' + and host='localhost'; +flush privileges; +--echo # Creating user with default plugin, i.e. mysql_native_password +--echo # this plugin should not be changed during the upgrade + +CREATE USER B20023823_def@localhost IDENTIFIED BY 'test'; + +--echo # Creating user with 41 bytes hash pass (default) and setting its plugin +--echo # to empty string. Plugin should be set to mysql_native_password +--echo # after the upgrade is finished + +CREATE USER B20023823_41hash@localhost IDENTIFIED WITH mysql_native_password; +set session old_passwords=0; +set password for B20023823_41hash@localhost = password('test'); +update mysql.user set plugin='' WHERE user='B20023823_41hash' + and host='localhost'; +flush privileges; + +--echo # Creating user with 16 bytes hash pass and setting its plugin +--echo # to empty string. Plugin should be set to mysql_old_password +--echo # after the upgrade is finished + +CREATE USER B20023823_16hash@localhost identified with mysql_old_password; +set session old_passwords=1; +set password for B20023823_16hash@localhost = password('test'); +update mysql.user set plugin='' WHERE user='B20023823_16hash' + and host='localhost'; +flush privileges; +SELECT user, plugin from mysql.user; + +--echo # repair the user's plugin +--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 + +--echo # expect non-empty +SELECT user, plugin from mysql.user; + +--echo # cleanup +DROP USER B20023823_empty@localhost; +DROP USER B20023823_def@localhost; +DROP USER B20023823_41hash@localhost; +DROP USER B20023823_16hash@localhost; + --echo --echo End of tests diff --git a/mysql-wsrep-5.6/mysql-test/t/mysqlbinlog_debug.test b/mysql-wsrep-5.6/mysql-test/t/mysqlbinlog_debug.test new file mode 100644 index 00000000..94c19be1 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/mysqlbinlog_debug.test @@ -0,0 +1,24 @@ +# This file is created to add test cases for mysqlbinlog tool +# which can be executed only against debug compiled mysqlbinlog +# tool. + +--source include/mysqlbinlog_have_debug.inc +-- source include/have_binlog_format_statement.inc +-- source include/have_log_bin.inc + +--echo # +--echo # Bug#18742916 : MYSQLBINLOG --RAW DOES NOT CHECK FOR ERRORS +--echo # + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--error 1 +--exec $MYSQL_BINLOG -#d,simulate_result_file_write_error_for_FD_event --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT -r$MYSQLTEST_VARDIR/tmp/ master-bin.000001 2>&1 + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--error 1 +--exec $MYSQL_BINLOG -#d,simulate_result_file_write_error --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT -r$MYSQLTEST_VARDIR/tmp/ master-bin.000001 2>&1 +# Cleanup +--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000001 + +--echo +--echo End of tests diff --git a/mysql-wsrep-5.6/mysql-test/t/mysqlbinlog_mixed_or_statment.test b/mysql-wsrep-5.6/mysql-test/t/mysqlbinlog_mixed_or_statment.test new file mode 100644 index 00000000..c9f5c2e5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/mysqlbinlog_mixed_or_statment.test @@ -0,0 +1,44 @@ + +--source include/have_binlog_format_mixed_or_statement.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--echo # +--echo # Bug#18913551 - LOCK TABLES USES INCORRECT LOCK FOR IMPLICITLY USED +--echo # TABLES. +--echo # + +--enable_connect_log + +SET @org_concurrent_insert= @@global.concurrent_insert; +SET @@global.concurrent_insert=1; + +CREATE TABLE t1(a INT) ENGINE=MyISAM; +CREATE FUNCTION f1() RETURNS INT RETURN (SELECT MIN(a) FROM t1); +CREATE VIEW v1 AS (SELECT 1 FROM dual WHERE f1() = 1); + +LOCK TABLE v1 READ; + +connect (con1, localhost, root); +SET lock_wait_timeout=1; +--echo # With fix, con1 does not get lock on table "t1" so following insert +--echo # operation fails after waiting for "lock_wait_timeout" duration. +--error ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 VALUES (1); + +connection default; +UNLOCK TABLES; + +--echo # V1 should be empty here. +SELECT * FROM v1; + +# Cleanup +disconnect con1; +SET @@global.concurrent_insert= @org_concurrent_insert; +DROP TABLE t1; +DROP VIEW v1; +DROP FUNCTION f1; +--disable_connect_log + +#Wait till all disconnects are completed +--source include/wait_until_count_sessions.inc diff --git a/mysql-wsrep-5.6/mysql-test/t/mysqlcheck.test b/mysql-wsrep-5.6/mysql-test/t/mysqlcheck.test index ab351dc7..9a27a7d9 100644 --- a/mysql-wsrep-5.6/mysql-test/t/mysqlcheck.test +++ b/mysql-wsrep-5.6/mysql-test/t/mysqlcheck.test @@ -265,10 +265,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; CHECK TABLE bug47205 FOR UPGRADE; --echo # ALTER TABLE ... FORCE should rebuild the table ---echo # and therefore output "affected rows: 1" ---enable_info ALTER TABLE bug47205 FORCE; ---disable_info --echo # Table should now be ok CHECK TABLE bug47205 FOR UPGRADE; diff --git a/mysql-wsrep-5.6/mysql-test/t/mysqldump.test b/mysql-wsrep-5.6/mysql-test/t/mysqldump.test index 20db649c..efb3e839 100644 --- a/mysql-wsrep-5.6/mysql-test/t/mysqldump.test +++ b/mysql-wsrep-5.6/mysql-test/t/mysqldump.test @@ -2461,3 +2461,42 @@ SET @@global.general_log= @old_general_log_state; --echo # --echo # End of 5.1 tests --echo # + +--echo # +--echo #BUG#17477959 - VIEW COLUMNS EXCEED TABLE LIMITS +--echo # + +#Create a view with a large column name and number of columns. +let $colnum= 798; +let $str= 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit; +while ($colnum) +{ + let $str= 1 AS thisColumnContainsAVeryLongNameThatNearsThe64CharacterLimit$colnum, $str; + dec $colnum; +} +--eval CREATE VIEW v1 AS SELECT $str + +--exec $MYSQL_DUMP -uroot --all-databases > $MYSQLTEST_VARDIR/tmp/bug17477959.sql +#Reload of the dump fails without the patch +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug17477959.sql +#Cleanup. +--remove_file $MYSQLTEST_VARDIR/tmp/bug17477959.sql +DROP VIEW v1; + + +--echo # +--echo # End of 5.6 tests +--echo # + +--echo # +--echo # Bug #11752369 : MYSQLDUMP SHOULD CONVERT GEOMETRY COLUMNS TO HEX WITH +--echo # --HEX-BLOB OPTION + +CREATE DATABASE dump_gis; +USE dump_gis; +CREATE TABLE t1 (a GEOMETRY); +INSERT INTO t1 VALUES(GeomFromText('LineString(1 1, 2 1, 2 2, 1 2, 1 1)')); +SELECT HEX(a) FROM t1; +--exec $MYSQL_DUMP -necqt --compact --hex-blob dump_gis +DROP DATABASE dump_gis; + diff --git a/mysql-wsrep-5.6/mysql-test/t/openssl_1.test b/mysql-wsrep-5.6/mysql-test/t/openssl_1.test index 0993d0a5..960efee9 100644 --- a/mysql-wsrep-5.6/mysql-test/t/openssl_1.test +++ b/mysql-wsrep-5.6/mysql-test/t/openssl_1.test @@ -15,8 +15,8 @@ insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; @@ -214,7 +214,7 @@ DROP TABLE t1; # Common ciphers to openssl and yassl --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=DHE-RSA-AES256-SHA --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC3-SHA ---exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA +--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=AES256-SHA --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=RC4-SHA --disable_query_log --disable_result_log diff --git a/mysql-wsrep-5.6/mysql-test/t/outfile_loaddata.test b/mysql-wsrep-5.6/mysql-test/t/outfile_loaddata.test index 26760f9a..745c75cb 100644 --- a/mysql-wsrep-5.6/mysql-test/t/outfile_loaddata.test +++ b/mysql-wsrep-5.6/mysql-test/t/outfile_loaddata.test @@ -169,6 +169,8 @@ TRUNCATE t2; --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'Ñ' --remove_file $file SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; +SELECT * FROM t1; +SELECT * FROM t2; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --eval SELECT * FROM t1 INTO OUTFILE '$file' LINES STARTING BY 'Ñ' @@ -191,6 +193,8 @@ TRUNCATE t2; --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary LINES TERMINATED BY 'Ñ' --remove_file $file SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; +SELECT * FROM t1; +SELECT * FROM t2; --echo # Default (binary) charset: diff --git a/mysql-wsrep-5.6/mysql-test/t/parser.test b/mysql-wsrep-5.6/mysql-test/t/parser.test index 7b4f867e..f07d9683 100644 --- a/mysql-wsrep-5.6/mysql-test/t/parser.test +++ b/mysql-wsrep-5.6/mysql-test/t/parser.test @@ -804,3 +804,28 @@ STOP SLAVE ,,,,,,,,,,,,, io_thread, ,,,,,,,,,,,,,,,,,,, ; --error ER_PARSE_ERROR START TRANSACTION ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ; +--echo # +--echo # Bug#17075846 : unquoted file names for variable values are +--echo # accepted but parsed incorrectly +--echo # +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine=a.myisam; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = .a.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = a.b.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = `a`.MyISAM; +--error ER_WRONG_TYPE_FOR_VAR +SET default_storage_engine = `a`.`MyISAM`; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = "a.MYISAM"; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = 'a.MYISAM'; +--error ER_UNKNOWN_STORAGE_ENGINE +set default_storage_engine = `a.MYISAM`; +CREATE TABLE t1 (s VARCHAR(100)); +--ERROR ER_BAD_FIELD_ERROR +CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW +SET default_storage_engine = NEW.INNODB; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/t/partition_archive.test b/mysql-wsrep-5.6/mysql-test/t/partition_archive.test index c89b2920..1825d55d 100644 --- a/mysql-wsrep-5.6/mysql-test/t/partition_archive.test +++ b/mysql-wsrep-5.6/mysql-test/t/partition_archive.test @@ -126,3 +126,20 @@ show create table t1; select count(*) from t1; drop table t1; + +--echo # +--echo #BUG 18618561: FAILED ALTER TABLE ENGINE CHANGE WITH PARTITIONS +--echo # CORRUPTS FRM + +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= MYISAM PARTITION BY HASH(fld1) +PARTITIONS 5; +SHOW CREATE TABLE t1; + +--error ER_GET_ERRNO +ALTER TABLE t1 ENGINE= ARCHIVE; + +--echo #After the patch, the ENGINE is correctly displayed as MyISAM +SHOW CREATE TABLE t1; + +--echo #Cleanup. +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/t/partition_index_innodb.test b/mysql-wsrep-5.6/mysql-test/t/partition_index_innodb.test new file mode 100644 index 00000000..5528efcb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/partition_index_innodb.test @@ -0,0 +1,146 @@ +--source include/have_partition.inc +--source include/have_innodb_16k.inc + +--echo # +--echo # Bug#18167648: WRONG RESULTS WITH PARTITIONING, INDEX_MERGE AND NO PK +--echo # +CREATE TABLE t1 +(a smallint, + b smallint, + c smallint, + KEY a (a), + KEY b (b) +) ENGINE=InnoDB +PARTITION BY HASH(c) PARTITIONS 3; + +--echo # c will simulate DB_ROW_ID + force to chosen partition. +--echo # c is unique so we can identify rows in the test. +--echo # Fillers to make the optimizer choose index_merge_intersect/union: +INSERT INTO t1 VALUES (1,1,1), (1,1,1+3), (1,1,1+6), (1,1,1+9); +--echo # row N..N+3 +INSERT INTO t1 VALUES (1,2,1+12), (2,2,2+15), (2,2,2+18), (1,2,3+21); +--echo # More index matching rows for index_merge_intersect: N+4, N+5 +INSERT INTO t1 VALUES (2,2,1+24); +INSERT INTO t1 VALUES (2,1,1+27); +ANALYZE TABLE t1; + +SET @old_opt_switch = @@session.optimizer_switch; +SET SESSION optimizer_switch="index_merge=on"; +SET SESSION optimizer_switch="index_merge_intersection=on"; +SET SESSION optimizer_switch="index_merge_sort_union=off"; +SET SESSION optimizer_switch="index_merge_union=off"; +if ($use_optimizer_trace) +{ +SET SESSION optimizer_trace="enabled=on"; +} +EXPLAIN SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2 AND c > 0 AND c < 100; +if ($use_optimizer_trace) +{ +SELECT TRACE FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +} +# Before fix: +# Index start of scan (ha_partition::handle_ordered_index_scan) +# 0xNNN is the DB_ROW_ID, kind of internal global auto increment. +# a reads row N+4 (0x208) from p1 c = 25 +# a reads row N+1 (0x205) from p2 c = 17 +# a returns row N+4, c = 25 (All same, first insert, no cmp of ref/DB_ROW_ID!) +# b reads row N+3 (0x207) from p0 c = 24 +# b reads row N (0x204) from p1 c = 13 +# b reads row N+1 (0x205) from p2 c = 17 +# b returns row N+3, c = 24 (All same, first insert, no cmp of ref/DB_ROW_ID!) +# b skips to next (0x207 < 0x208) +# b finds no more rows in p0. +# b returns row from p2 (0x205) c = 17 +# b skips to next row (0x205 < 0x208) +# b reads row N+2 (0x206) from p2 c = 20 +# b skips to next row (0x206 < 0x208) +# b finds no more rows in p2. +# b return row from p1 (0x204) c = 13 +# b skips to next row (0x204 < 0x208) +# b reads row N+4 (0x208) from p1 c = 25 +# a == b Match found! +# Fetches whole row for 0x208 (really p1 + 0x208) -> (2,2,25) +# Continues with next a: +# a reads row N+5 (0x209) from p1 c = 28 +# No more match... + +SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2 AND c > 0 AND c < 100; +EXPLAIN PARTITIONS SELECT a,b,c FROM t1 WHERE a = 2 AND b = 2 AND c IN (13,25,28); +SELECT a,b,c FROM t1 WHERE a = 2 AND b = 2 AND c IN (13,25,28); +SET SESSION optimizer_switch="index_merge_intersection=off"; +SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2 AND c > 0 AND c < 100; +EXPLAIN SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2 AND c > 0 AND c < 100; + +--echo # Adding more fillers to get index_merge_union +INSERT INTO t1 VALUES (1,1,1+30), (1,1,1+33), (1,1,1+36), (1,1,1+39), +(1,1,1+42), (1,1,1+45), (1,1,1+48), (1,1,1+51), (1,1,1+54), (1,1,1+57), +(1,1,1+60), (1,1,1+63), (1,1,1+66), (1,1,1+69), (1,1,1+72), (1,1,1+75), +(1,1,1+78); +ANALYZE TABLE t1; +SET SESSION optimizer_switch="index_merge_union=on"; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +if ($use_optimizer_trace) +{ +SELECT TRACE FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +} +# First there where a bug where index_init() was called with sorted=false :( +# Before fix of secondary sort in ha_partition: +# b reads row N+3 (0x207) from p0 c = 24 +# b reads row N (0x204) from p1 c = 13 +# b reads row N+1 (0x205) from p2 c = 17 +# b returns row N+3, c = 24 (All same, first insert, no cmp of ref/DB_ROW_ID!) +# a reads row N+4 (0x208) from p1 c = 25 +# a reads row N+1 (0x205) from p2 c = 17 +# a returns row N+4, c = 25 (All same, first insert, no cmp of ref/DB_ROW_ID!) + +# first row from both indexes done, first is b, 0x207 c = 24 +# Get next from b +# b finds no more rows in p0. +# b returns row from p2 (0x205) c = 17 +# Fetching whole row for (0x207) c = 24 (1,2,24) and sends it +# b reads row N+2 (0x206) from p2 c = 20 +# b returns row from p2 (0x206) c = 20 +# No duplicate (0x206 != 0x208) +# Fetching whole row for (0x205) c = 17 (2,2,17) and sends it +# b finds no more rows in p2 +# b returns row from p1 (0x204) c = 13 +# No duplicate (0x205 != 0x206) +# Fetching whole row for (0x206) c = 20 (2,2,20) and sends it +# b reads row N+4 (0x208) from p1 c = 25 +# b returns row from p1 (0x208) c = 25 +# No duplicate (0x204 != 0x206) +# Fetching whole row for (0x204) c = 13 (1,2,13) and sends it +# Fetching whole row for (0x208) c = 25 (2,2,25) +# a reads row N+5 (0x209) from p1 c = 28 +# a returns row from p1 (0x209) c = 28 +# Duplicate (0x209 == 0x209) +# a returns row from p2 (0x205) +# Fetching whole row for (0x209) c = 28 (2,1,28) +# a reads row N+2 (0x206) from p2 c = 20 +# Fetching whole row for (0x205) c = 17 (2,2,17) +# Fetching whole row for (0x206) c = 20 (2,2,20) + +SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +SET SESSION optimizer_switch="index_merge_union=off"; +SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; + +--echo Insert a few more rows to trigger sort_union +INSERT INTO t1 VALUES (1,1,1+81), (1,1,1+84), (1,1,1+87), (1,1,1+90), +(1,1,1+93); +ANALYZE TABLE t1; +SET SESSION optimizer_switch="index_merge_sort_union=on"; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +if ($use_optimizer_trace) +{ +SELECT TRACE FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SET SESSION optimizer_trace="enabled=off"; +} +--echo # Not affected, added for completeness... +SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +SET SESSION optimizer_switch="index_merge_sort_union=off"; +SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; + +SET @@session.optimizer_switch = @old_opt_switch; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/t/partition_index_myisam.test b/mysql-wsrep-5.6/mysql-test/t/partition_index_myisam.test new file mode 100644 index 00000000..a6fb3eee --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/partition_index_myisam.test @@ -0,0 +1,113 @@ +--source include/have_partition.inc + +--echo # +--echo # Bug#18167648: WRONG RESULTS WITH PARTITIONING, INDEX_MERGE AND NO PK +--echo # +CREATE TABLE t1 ( + a smallint, + b smallint, + c smallint, + KEY a (a), + KEY b (b) +) ENGINE = MyISAM +PARTITION BY HASH (c) PARTITIONS 3; +CREATE TABLE t2 (a tinyint) ENGINE = MyISAM; +INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13), +(14),(15),(16); + +SET SESSION optimizer_switch="index_merge=on"; +SET SESSION optimizer_switch="index_merge_intersection=on"; +SET SESSION optimizer_switch="index_merge_union=off"; +SET SESSION optimizer_switch="index_merge_sort_union=off"; + +INSERT INTO t1 VALUES (1,1,0), (1,1,0), (2,1,0), (2,2,1), (1,1,1), (2,2,4); +--echo # Add some rows to make the index_merge_intersect possible +INSERT INTO t1 SELECT 1,1,0 FROM t2 A, t2 B; +INSERT INTO t1 SELECT 1,1,1 FROM t2 A, t2 B; +INSERT INTO t1 SELECT 1,1,2 FROM t2 A, t2 B LIMIT 68; + +SELECT COUNT(*) FROM t1; +ANALYZE TABLE t1; + +# For plan debugging +let $use_optimizer_trace=0; +if ($use_optimizer_trace) +{ +SET optimizer_trace="enabled=on"; +} +EXPLAIN SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2; +if ($use_optimizer_trace) +{ +SELECT TRACE FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +} +--echo # Before fix: +--echo # (p0 - partition 0, R3 - 3rd record in that partition = offset) +--echo # Make 'a' read p0-R3, p1-R1, p1-R3 +--echo # Make 'b' read p1-R1, p1-R3 +--echo # 'b' will skip p1-R1 since R3 is bigger than R1. +# b reads first row from p1 (0x0) +# b returns 0x0 from p1 +# a reads 3rd row from p0 (0xe) +# a read first row from p1 (0x0) +# a returns 0xe from p0 +# b skips (0xe from p0 > 0x0 from p1) +# b reads 3rd row from p1 (0xe) +# b returns 0xe from p1 +# a skips (0xe from p1 > 0xe from p0) +# a returns 0x0 from p1 +# a reads 3rd row from p1 (0xe) +# a returns 0xe from p1 +# MATCH! (0xe from p1 == 0xe from p1) +SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2; + +SET @old_opt_switch = @@session.optimizer_switch; +SET SESSION optimizer_switch="index_merge_intersection=off"; +--echo # Without index_merge_intersection +SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2; +EXPLAIN SELECT a,b,c FROM t1 WHERE b = 2 AND a = 2; + +SET SESSION optimizer_switch="index_merge_union=on"; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +if ($use_optimizer_trace) +{ +SELECT TRACE FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +} +# First there where a bug where index_init() was called with sorted=false :( +# Before fix of secondary sort in ha_partition: +# b reads first row from p1 (0x0) +# b returns 0x0 from p1 +# a reads 3rd row from p0 (0xe) +# a read first row from p1 (0x0) +# a returns 0xe from p0 +# b < a in priority queue +# b reads 3rd row from p1 (0xe) +# b returns 0xe from p1 +# Fetch row 0x0 from p1 (2,2,1) +# a returns 0x0 frop p1 +# Fetch row 0xe from p0 (2,1,0), but is filtered away from evaluate_join_record +# a reads 3rd from from p1 (0xe) +# a returns 0xe from p1 +# Fetch row 0x0 from p1 (2,2,1) (Dup, doh). +# Fetch row 0xe from p1 (2,2,4) + +SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +SET SESSION optimizer_switch="index_merge_union=off"; +SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b = 2 OR a = 2) AND c > 0 AND c < 100; + +SET SESSION optimizer_switch="index_merge_sort_union=on"; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +if ($use_optimizer_trace) +{ +SELECT TRACE FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SET SESSION optimizer_trace="enabled=off"; +} +--echo # Not affected, added for completeness... +# Verified that it does not demand sorted results, index_init(sorted=false)! +SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +SET SESSION optimizer_switch="index_merge_sort_union=off"; +SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; +EXPLAIN SELECT a,b,c FROM t1 WHERE (b >= 2 OR a >= 2) AND c > 0 AND c < 100; + +SET @@session.optimizer_switch = @old_opt_switch; +DROP TABLE t1, t2; diff --git a/mysql-wsrep-5.6/mysql-test/t/partition_innodb.test b/mysql-wsrep-5.6/mysql-test/t/partition_innodb.test index 217a6566..2de03d60 100644 --- a/mysql-wsrep-5.6/mysql-test/t/partition_innodb.test +++ b/mysql-wsrep-5.6/mysql-test/t/partition_innodb.test @@ -683,3 +683,192 @@ ALTER TABLE t1 ADD UNIQUE KEY (b); SHOW CREATE TABLE t1; SELECT * FROM t1; DROP TABLE t1; + +--echo # +--echo # Bug#16943907: FLUSH TABLES FOR EXPORT: ASSERTION IN HA_PARTITION::EXTRA +--echo # +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; +FLUSH TABLES t1 FOR EXPORT; +--echo # List of files after EXPORT (should include a .cfg file for each part). +--replace_result #p# #P# +--list_files $MYSQLD_DATADIR/test/ t1* +UNLOCK TABLES; +--echo # List of files after UNLOCK (no .cfg files). +--replace_result #p# #P# +--list_files $MYSQLD_DATADIR/test/ t1* +--error ER_ILLEGAL_HA +ALTER TABLE t1 DISCARD TABLESPACE; +--error ER_ILLEGAL_HA +ALTER TABLE t1 IMPORT TABLESPACE; +DROP TABLE t1; +USE test; + +--echo # +--echo # Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT +--echo # Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE +--echo # +CREATE TABLE t1 +(a INT, + b INT, + PRIMARY KEY (a)) + ENGINE = InnoDB + PARTITION BY HASH (a) PARTITIONS 3; + START TRANSACTION WITH CONSISTENT SNAPSHOT; + --connect (con1, localhost, root,,) + --echo # con1 + ALTER TABLE t1 ADD INDEX idx1 (b); + --connection default + --echo # con default + --error ER_TABLE_DEF_CHANGED + SELECT b FROM t1 WHERE b = 0; + --error ER_TABLE_DEF_CHANGED + SELECT b FROM t1 WHERE b = 0; + --disconnect con1 + DROP TABLE t1; + +--echo # Same test without partitioning +CREATE TABLE t1 +(a INT, + b INT, + PRIMARY KEY (a)) + ENGINE = InnoDB; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +--echo # con1 +--connect (con1, localhost, root,,) +ALTER TABLE t1 ADD INDEX idx1 (b); +--connection default +--echo # con default +--error ER_TABLE_DEF_CHANGED +SELECT b FROM t1 WHERE b = 0; +--error ER_TABLE_DEF_CHANGED +SELECT b FROM t1 WHERE b = 0; +--disconnect con1 +DROP TABLE t1; + +--echo Bug 17896265 PARTITIONED TABLE HAS MISPLACED ROWS, AFTER INPLACE ALTER + +#Check basic Interchange +CREATE TABLE t1 ( +f1 INT(11) NOT NULL, +f2 INT(11) NOT NULL +) +ENGINE=InnoDB +PARTITION BY KEY (f1,f2) PARTITIONS 2; +INSERT INTO t1 VALUES (9585,5); +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t1 CHANGE f1 f1 INT AFTER f2, ALGORITHM=INPLACE; + +# Check when interchanging columns do not change the order +CREATE TABLE t2 ( +f1 INT(11) NOT NULL, +f2 INT(11) NOT NULL, +f3 INT(11) NOT NULL, +f4 INT(11) NOT NULL +) +ENGINE=InnoDB +PARTITION BY KEY (f2,f3) PARTITIONS 2; +INSERT INTO t2 VALUES (10,9585,5,20); + +ALTER TABLE t2 CHANGE f3 f3 INT AFTER f4, ALGORITHM=INPLACE; +# Check if row is in the wrong partition! +CHECK TABLE t2; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t2 CHANGE f3 f3 INT AFTER f1, ALGORITHM=INPLACE; + +#Bring back to original position +ALTER TABLE t2 CHANGE f4 f4 INT AFTER f3, ALGORITHM=INPLACE; +CHECK TABLE t2; + +#Change the column order of field which are not part of KEY +ALTER TABLE t2 CHANGE f1 f1 INT AFTER f4, ALGORITHM=INPLACE; +CHECK TABLE t2; + +#now order is f2,f3,f4,f1 +ALTER TABLE t2 CHANGE f1 f1 INT AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t2; + +#now order is f2,f1,f3,f4 +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t2 CHANGE f2 f2 INT AFTER f4, ALGORITHM=INPLACE; + +#check if Range partition is effected +CREATE TABLE t3 (f1 INT,f2 INT) ENGINE=INNODB +PARTITION BY RANGE(f1) ( +PARTITION p0 VALUES LESS THAN (100), +PARTITION p1 VALUES LESS THAN (200), +PARTITION p2 VALUES LESS THAN (600), +PARTITION p3 VALUES LESS THAN MAXVALUE +); +insert into t3 values (90,120); +insert into t3 values (120,300); +ALTER TABLE t3 CHANGE f1 f1 int AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t3; + +#check with hash partitions +CREATE TABLE t4 ( +f1 INT(11) NOT NULL, +f2 INT(11) NOT NULL +) +ENGINE=InnoDB +PARTITION BY HASH (MOD(f1,f2)) PARTITIONS 2; +INSERT INTO t4 VALUES (9585,5); +ALTER TABLE t4 CHANGE f1 f1 INT AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t4; + +#Check with column partitioning +CREATE TABLE t5 ( + f1 INT, + f2 INT +) +ENGINE=InnoDB +PARTITION BY RANGE COLUMNS(f1,f2) ( + PARTITION p0 VALUES LESS THAN (10000,12), + PARTITION p1 VALUES LESS THAN (MAXVALUE, MAXVALUE) +); + +INSERT INTO t5 VALUES (1,20000); +ALTER TABLE t5 CHANGE f1 f1 INT AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t5; + +#Check with column partitioning and subpartition +CREATE TABLE t6 ( + a INT, + b INT +) +ENGINE=InnoDB +PARTITION BY RANGE COLUMNS(a,b) +SUBPARTITION BY KEY(a,b) +SUBPARTITIONS 2 ( + PARTITION p0 VALUES LESS THAN (10000,12), + PARTITION p1 VALUES LESS THAN (MAXVALUE, MAXVALUE) +); +INSERT INTO t6 VALUES (9585,5); + +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t6 CHANGE a a INT AFTER b, ALGORITHM=INPLACE; + +#check when the columns are not adjacent +CREATE TABLE t7 ( +f1 INT(11) NOT NULL, +f2 INT(11) NOT NULL, +f3 INT(11) NOT NULL, +f4 INT(11) NOT NULL, +f5 INT(11) NOT NULL + +) +ENGINE=InnoDB +PARTITION BY KEY (f1,f5) PARTITIONS 2; +INSERT INTO t7 VALUES (9585,10,20,10,5); + +ALTER TABLE t7 CHANGE f5 f5 INT AFTER f3, ALGORITHM=INPLACE; +CHECK TABLE t7; + +ALTER TABLE t7 CHANGE f5 f5 INT AFTER f2, ALGORITHM=INPLACE; +CHECK TABLE t7; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t7 CHANGE f1 f1 INT AFTER f4, ALGORITHM=INPLACE; + +DROP TABLE t1,t2,t3,t4,t5,t6,t7; diff --git a/mysql-wsrep-5.6/mysql-test/t/partition_pruning.test b/mysql-wsrep-5.6/mysql-test/t/partition_pruning.test index a772b12f..fae9dda0 100644 --- a/mysql-wsrep-5.6/mysql-test/t/partition_pruning.test +++ b/mysql-wsrep-5.6/mysql-test/t/partition_pruning.test @@ -1535,3 +1535,51 @@ explain partitions select * from t1 where a between 10 and 13; explain partitions select * from t1 where a between 10 and 10+33; drop table t0, t1; + +--echo # +--echo # Bug#71095: Wrong results with PARTITION BY LIST COLUMNS() +--echo # +CREATE TABLE t1 +(c1 int, + c2 int, + c3 int, + c4 int, + PRIMARY KEY (c1,c2)) +PARTITION BY LIST COLUMNS (c2) +(PARTITION p1 VALUES IN (1,2), + PARTITION p2 VALUES IN (3,4)); +INSERT INTO t1 VALUES (1, 1, 1, 1), (2, 3, 1, 1); +INSERT INTO t1 VALUES (1, 2, 1, 1), (2, 4, 1, 1); +SELECT * FROM t1 WHERE c1 = 1 AND c2 < 1; +SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 1; +SELECT * FROM t1 WHERE c1 = 1 AND c2 = 1; +SELECT * FROM t1 WHERE c1 = 1 AND c2 >= 1; +SELECT * FROM t1 WHERE c1 = 1 AND c2 > 1; +SELECT * FROM t1 WHERE c1 = 1 AND c2 < 3; +SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 3; +SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 3; +SELECT * FROM t1 WHERE c1 = 2 AND c2 = 3; +SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 3; +SELECT * FROM t1 WHERE c1 = 2 AND c2 > 3; +SELECT * FROM t1 WHERE c1 = 2 AND c2 < 4; +SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 4; +SELECT * FROM t1 WHERE c1 = 2 AND c2 = 4; +SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 4; +SELECT * FROM t1 WHERE c1 = 2 AND c2 > 4; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 < 1; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 1; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 = 1; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 >= 1; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 > 1; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 < 3; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 3; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 3; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 = 3; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 3; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 > 3; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 < 4; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 4; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 = 4; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 >= 4; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 > 4; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/t/plugin.test b/mysql-wsrep-5.6/mysql-test/t/plugin.test index 544a22cd..de68d360 100644 --- a/mysql-wsrep-5.6/mysql-test/t/plugin.test +++ b/mysql-wsrep-5.6/mysql-test/t/plugin.test @@ -1,5 +1,7 @@ +# --source include/not_windows_embedded.inc --source include/have_example_plugin.inc +--source include/have_debug_sync.inc --error ER_UNKNOWN_STORAGE_ENGINE CREATE TABLE t1(a int) ENGINE=EXAMPLE; @@ -160,3 +162,118 @@ SET SESSION example_double_thdvar = 1000.51; SELECT @@SESSION.example_double_thdvar; UNINSTALL PLUGIN example; + +--echo # +--echo # BUG#18008907 - DEADLOCK BETWEEN MYSQL_CHANGE_USER(), SHOW VARIABLES AND INSTALL PLUGIN +--echo # + +--enable_connect_log + +delimiter |; + +CREATE PROCEDURE p_install() +BEGIN + INSTALL PLUGIN no_such_plugin SONAME 'no_such_object'; +END +| + +CREATE PROCEDURE p_show_vars() +BEGIN + SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES; +END| + +delimiter ;| + +connect(con1, localhost, root,,); + +--echo # Case 18008907_1: Deadlock situation cause by +--echo # con1: has LOCK_system_variables_hash and waits on LOCK_plugin AND +--echo # default: has LOCK_plugin and waits on LOCK_system_variables_hash. +--echo # +SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL install_plugin WAIT_FOR cont_show_vars'; +--send call p_show_vars(); + +connection default; +SET DEBUG_SYNC='now WAIT_FOR install_plugin'; +SET DEBUG_SYNC='acquired_LOCK_plugin SIGNAL cont_show_vars'; +--send call p_install(); + +connection con1; +# Without fix, reap will hang. +--replace_column 1 # +--reap; +SET DEBUG_SYNC='RESET'; + +connection default; +--replace_regex /(Can\'t open shared library).*$/\1/ +--error ER_CANT_OPEN_LIBRARY +--reap; +SET DEBUG_SYNC='RESET'; + +--echo # Case 18008907_2: Deadlock situation caused by +--echo # default: has LOCK_system_variables_hash and waits on LOCK_global_system_variables, +--echo # con1: has LOCK_plugin and waits on LOCK_system_variables_hash AND +--echo # con2: has LOCK_global_system_variables and waits on LOCK_plugin. + +SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL install_plugin WAIT_FOR nothing TIMEOUT 10'; +--send call p_show_vars(); + +connection con1; +SET DEBUG_SYNC='now WAIT_FOR install_plugin'; +SET DEBUG_SYNC='acquired_LOCK_plugin SIGNAL create_connection WAIT_FOR nothing TIMEOUT 10'; +--send call p_install(); + +connect(con2, localhost, root,,); +SET DEBUG_SYNC='now WAIT_FOR create_connection'; +# Without fix, deadlock situation will occur on timeout of debug_syncs in +# default and con1. Because of this, change_user operation hangs. +change_user; + +connection con1; +--replace_regex /(Can\'t open shared library).*$/\1/ +--error ER_CANT_OPEN_LIBRARY +--reap; + +connection default; +--replace_column 1 # +--reap; +disconnect con2; + +--echo # Case 18008907_3: Testing Concurrent "Show Variables" and "Plugin Uninstall" operations. + +#Installing plugin +--replace_regex /\.dll/.so/ +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; + +connection con1; +#Acquiring LOCK_system_variables_hash and LOCK_plugin_delete +SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL uninstall_plugin WAIT_FOR go'; +--send call p_show_vars(); + +connect(con2, localhost, root,,); +SET DEBUG_SYNC='now WAIT_FOR uninstall_plugin'; +--send UNINSTALL PLUGIN example; + +connection default; +#Plugin Uninstall operation will wait until show variables operations releases LOCK_plugin_delete. +let $wait_condition= SELECT count(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE INFO='UNINSTALL PLUGIN example' and + STATE='System lock'; +--source include/wait_condition.inc +SET DEBUG_SYNC='now SIGNAL go'; + +connection con1; +--replace_column 1 # +--reap + +connection con2; +--reap + +connection default; +DROP PROCEDURE p_show_vars; +DROP PROCEDURE p_install; +SET DEBUG_SYNC='RESET'; +disconnect con1; +disconnect con2; + +--disable_connect_log diff --git a/mysql-wsrep-5.6/mysql-test/t/plugin_auth.test b/mysql-wsrep-5.6/mysql-test/t/plugin_auth.test index 85570d71..fb550ae8 100644 --- a/mysql-wsrep-5.6/mysql-test/t/plugin_auth.test +++ b/mysql-wsrep-5.6/mysql-test/t/plugin_auth.test @@ -621,3 +621,37 @@ DROP USER bug12818542_dest@localhost; --echo End of 5.5 tests + +--echo # +--echo # Bug #18057562: PROXY USERS LOCKED OUT WHEN UNDERLYING PROXIED USER +--echo # PASSWORD IS EXPIRED +--echo # + +--echo # Restart server with disconnect_on_expired_password OFF; + +let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +--exec echo "wait" > $restart_file +--shutdown_server 10 +--source include/wait_until_disconnected.inc +--exec echo "restart:--disconnect_on_expired_password=0" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +CREATE USER 'empl_external'@'localhost' IDENTIFIED WITH test_plugin_server AS 'employee'; +CREATE USER 'employee'@'localhost' IDENTIFIED BY 'passkey'; +GRANT PROXY ON 'employee'@'localhost' TO 'empl_external'@'localhost'; + +--echo # Expiring the proxied user's password +ALTER USER employee@localhost PASSWORD EXPIRE; + +--echo # Connecting with the proxied user and executing a query after the +--echo # proxied user's password is expired +--error 1, ER_MUST_CHANGE_PASSWORD +--exec $MYSQL -S $MASTER_MYSOCK -u employee --password=passkey -e "SELECT current_user();SELECT user();" 2>&1 + +--echo # Connecting with the proxy user and executing a query after the proxied +--echo # user's password is expired. Here we are not supposed to get error. +--exec $MYSQL -S $MASTER_MYSOCK -u empl_external $PLUGIN_AUTH_OPT --password=employee -e "SELECT current_user();SELECT user();" 2>&1 + +#Cleanup +DROP USER 'empl_external'@'localhost', 'employee'@'localhost'; diff --git a/mysql-wsrep-5.6/mysql-test/t/query_cache.test b/mysql-wsrep-5.6/mysql-test/t/query_cache.test index d679b909..a8a6df3c 100644 --- a/mysql-wsrep-5.6/mysql-test/t/query_cache.test +++ b/mysql-wsrep-5.6/mysql-test/t/query_cache.test @@ -1403,5 +1403,56 @@ CREATE TABLE t1 (f1 blob); SELECT COUNT(*) FROM (SELECT * FROM t1 ) tt; DROP TABLE t1; SET GLOBAL query_cache_size= @qc; + + --echo # +--echo #BUG 18710853: QUERY CACHE NOT INVALIDATED ON CASCADE DELETE IF DB NAME HAS +--echo # SPECIAL SYMBOLS + +SET @query_cache_size.saved = @@query_cache_size; +SET GLOBAL query_cache_size = 1024*1024; + +CREATE DATABASE `db-db`; +CREATE TABLE `db-db`.`t$1` (fld1 INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE `db-db`.`t$2` (fld1 INT PRIMARY KEY, fld2 INT, +CONSTRAINT t2_fk FOREIGN KEY (fld2) REFERENCES `db-db`.`t$1` (fld1) ON +DELETE CASCADE) ENGINE=InnoDB; +CREATE TABLE `db-db`.`t$3` (fld1 INT PRIMARY KEY, fld2 INT, +CONSTRAINT t3_fk FOREIGN KEY (fld2) REFERENCES `db-db`.`t$1` (fld1) ON +UPDATE CASCADE) ENGINE=InnoDB; + +INSERT INTO `db-db`.`t$1` VALUES (100); +INSERT INTO `db-db`.`t$1` VALUES (300); +INSERT INTO `db-db`.`t$2` VALUES (1, 100); +INSERT INTO `db-db`.`t$3` VALUES (2, 300); + +SELECT * FROM `db-db`.`t$2`; +SELECT * FROM `db-db`.`t$3`; + +DELETE FROM `db-db`.`t$1` WHERE fld1= 100; +UPDATE `db-db`.`t$1` SET fld1= 200 WHERE fld1= 300; +--echo #After fix the number of the records returned with the +--echo #query cache and without the query cache are the same. +SELECT * FROM `db-db`.`t$2`; +SELECT SQL_NO_CACHE * FROM `db-db`.`t$2`; + +SELECT * FROM `db-db`.`t$3`; +SELECT SQL_NO_CACHE * FROM `db-db`.`t$3`; + +--echo #Test case added for code coverage, invalidation +--echo #triggered at the SQL layer. + +CREATE TABLE `db-db`.`t$4` (fld1 INT PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO `db-db`.`t$4` VALUES (100); + +SELECT * FROM `db-db`.`t$4`; +INSERT INTO `db-db`.`t$4` VALUES (200); +SELECT * FROM `db-db`.`t$4`; +SELECT SQL_NO_CACHE * FROM `db-db`.`t$4`; + +--echo #cleanup +DROP DATABASE `db-db`; +SET GLOBAL query_cache_size = @query_cache_size.saved; + +--echo # diff --git a/mysql-wsrep-5.6/mysql-test/t/show_processlist.test b/mysql-wsrep-5.6/mysql-test/t/show_processlist.test new file mode 100644 index 00000000..b5ea531d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/show_processlist.test @@ -0,0 +1,62 @@ +############################################################################### +--echo Bug#17283409 4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS, SHOW PROCESSLIST, +--echo SHOW BINLOGS +# After the fix for bug 17283409, We allow new connections while processing +# 'SHOW PROCESSLIST' command. This test script is to prove that even though we +# allow new connections to come in, 'SHOW PROCESSLIST' will not consider them, +# hence there is no worry of 'SHOW PROCESSLIST' going into a infinite loop if +# new connections are coming in continously. +############################################################################### +--source include/have_debug_sync.inc +--source include/count_sessions.inc +--enable_connect_log +connect(connection1,localhost,root,,test,$MASTER_MYPORT,); +--connection default +SET DEBUG_SYNC='before_copying_threads SIGNAL parked1 WAIT_FOR go'; +--send SHOW PROCESSLIST +--connection connection1 +echo "Wait_for parked1"; +SET DEBUG_SYNC='now WAIT_FOR parked1'; +connect(connection2,localhost,root,,test,$MASTER_MYPORT,); +connect(connection3,localhost,root,,test,$MASTER_MYPORT,); +SET DEBUG_SYNC='now SIGNAL go'; + +--connection default +# We are yet to copy threads when connection 2 and connection 3 joined the +# system. So this will show all 4 connections ( default + connection 1,2,3). +--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info> +--reap + +# Test 2: To prove that connections which joined after copying thread will not +# be entertained +SET DEBUG_SYNC='after_copying_threads SIGNAL parked1 WAIT_FOR go'; +--send SHOW PROCESSLIST + +--connection connection1 +echo "Wait_for parked1"; +SET DEBUG_SYNC='now WAIT_FOR parked1'; +connect(connection4,localhost,root,,test,$MASTER_MYPORT,); +connect(connection5,localhost,root,,test,$MASTER_MYPORT,); +SET DEBUG_SYNC='now SIGNAL go'; +--connection default +# This will show 4 connections only ( default + connection 1,2,3 ). Connections +# (connection4, connection 5) which entered after reading the first element +# from the iterator will not be processed by show processlist. +--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info> +--reap + +#Now try the command once again. +# This will show 6 connections ( default + connection 1,2,3,4,5 ) +--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info> +SHOW PROCESSLIST; + +--echo "Cleanup" +# Reset DEBUG_SYNC +SET DEBUG_SYNC='RESET'; +--disconnect connection1 +--disconnect connection2 +--disconnect connection3 +--disconnect connection4 +--disconnect connection5 +--disable_connect_log +--source include/wait_until_count_sessions.inc diff --git a/mysql-wsrep-5.6/mysql-test/t/sp_validation.test b/mysql-wsrep-5.6/mysql-test/t/sp_validation.test index 8f1d5dba..fbdd95a3 100644 --- a/mysql-wsrep-5.6/mysql-test/t/sp_validation.test +++ b/mysql-wsrep-5.6/mysql-test/t/sp_validation.test @@ -1698,7 +1698,6 @@ CALL p1(); --echo CALL p2(); --echo ---error ER_BAD_FIELD_ERROR UPDATE t2 SET a = 30; --echo diff --git a/mysql-wsrep-5.6/mysql-test/t/temp_pool-master.opt b/mysql-wsrep-5.6/mysql-test/t/temp_pool-master.opt new file mode 100644 index 00000000..c9f8d7bd --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/temp_pool-master.opt @@ -0,0 +1 @@ +--tmpdir=$MYSQLTEST_VARDIR/tmp diff --git a/mysql-wsrep-5.6/mysql-test/t/temp_pool.test b/mysql-wsrep-5.6/mysql-test/t/temp_pool.test new file mode 100644 index 00000000..a300962f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/t/temp_pool.test @@ -0,0 +1,33 @@ +--source include/linux.inc +--source include/not_embedded.inc + +--echo # +--echo # BUG#11747548:DETECT ORPHAN TEMP-POOL FILES, AND HANDLE GRACEFULLY. +--echo # + +--echo #Set up. +CREATE TABLE pid_table(pid_no INT); +CREATE TABLE t1 (a BLOB); +INSERT INTO t1 VALUES (1), (2); + +--echo #Create MYD and MYI files for intrinsic temp table. +--let $pid_file=`SELECT @@pid_file` +--replace_result $pid_file pid_file +--eval LOAD DATA LOCAL INFILE '$pid_file' INTO TABLE pid_table +--let $temp_file_MYD= `SELECT CONCAT('#sql_', LCASE(HEX(pid_no)), '_0', '.MYD') FROM pid_table` +--let $temp_file_MYI= `SELECT CONCAT('#sql_', LCASE(HEX(pid_no)), '_0', '.MYI') FROM pid_table` +--write_file $MYSQLTEST_VARDIR/tmp/$temp_file_MYD +EOF +--write_file $MYSQLTEST_VARDIR/tmp/$temp_file_MYI +EOF + +--echo #Reports an error since the temp file already exists. +--replace_regex /.*Can't create\/write *.*/Can't create or write to file/ +--error 1 +SELECT a FROM t1 ORDER BY rand(1); + +--echo #With patch, the query executes successfully. +SELECT a FROM t1 ORDER BY rand(1); + +--echo #cleanup +DROP TABLE t1, pid_table; diff --git a/mysql-wsrep-5.6/mysql-test/t/temporal_literal.test b/mysql-wsrep-5.6/mysql-test/t/temporal_literal.test index efdc5e28..6d2c2f29 100644 --- a/mysql-wsrep-5.6/mysql-test/t/temporal_literal.test +++ b/mysql-wsrep-5.6/mysql-test/t/temporal_literal.test @@ -190,3 +190,31 @@ SELECT * FROM t1 WHERE a BETWEEN DATE'2001-01-01' AND DATE'2002-01-01'; SELECT DATE'2001-01-01' FROM t1 GROUP BY DATE'2001-01-01'; DROP TABLE t1; +--echo # +--echo # BUG #16812821: INCONSISTANT RESULTS WHEN ODBC DATE FORMAT IS USED +--echo # +CREATE TABLE t1(c1 INT, c2 DATE, c3 TIME, c4 TIMESTAMP); +CREATE TABLE t2(c11 INT, C12 INT); +INSERT INTO t1 VALUES (1, '2014-01-02', '01:01:01', '2014-01-02 01:01:01'), + (2, '2014-01-04', '01:01:01', '2014-01-02 01:01:01'); +INSERT INTO t2 VALUES (3, 4), (5, 6); +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 + WHERE c2 BETWEEN {d'2014-01-01'} AND {d'2014-01-05'}; + +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 + WHERE c3 BETWEEN {t'01:01:01'} AND {t'01:01:05'}; + +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 + WHERE c4 BETWEEN {ts'2014-01-01 01:01:01'} AND {ts'2014-01-05 01:01:01'}; + +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 + WHERE c2 BETWEEN DATE'2014-01-01' AND DATE'2014-01-05'; + +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 + WHERE c3 BETWEEN TIME'01:01:01' AND TIME'01:01:05'; + +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c11 + WHERE c4 BETWEEN TIMESTAMP'2014-01-01 01:01:01' + AND TIMESTAMP'2014-01-05 01:01:01'; + +DROP TABLE t1, t2; diff --git a/mysql-wsrep-5.6/mysql-test/t/trigger.test b/mysql-wsrep-5.6/mysql-test/t/trigger.test index eac083b0..1624b122 100644 --- a/mysql-wsrep-5.6/mysql-test/t/trigger.test +++ b/mysql-wsrep-5.6/mysql-test/t/trigger.test @@ -2637,4 +2637,34 @@ INSERT INTO t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); DROP TRIGGER t2_ai; DROP TABLE t1, t2, t3; +--echo # +--echo # Bug#18596756 - FAILED PREPARING OF TRIGGER ON TRUNCATED TABLES CAUSE +--echo # ERROR 1054. +--echo # + +CREATE TABLE t1(id INT); +CREATE TABLE t2(id INT); + +CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW + SET NEW.id= (SELECT * FROM t2); + +INSERT INTO t2 VALUES(0); +INSERT INTO t1 VALUES(0); + +TRUNCATE TABLE t2; + +INSERT INTO t2 VALUES(0); +#Without the fix, trigger fired for following INSERT operation reports +#"ER_BAD_FIELD_ERROR" error. +INSERT INTO t1 VALUES(0); + +DROP TABLE t2; + +--error ER_NO_SUCH_TABLE +#Without the fix, trigger fired for following INSERT operation reports +#"ER_BAD_FIELD_ERROR" error also here. +INSERT INTO t1 VALUES(0); + +DROP TABLE t1; + --echo End of 6.0 tests. diff --git a/mysql-wsrep-5.6/mysql-test/t/type_temporal_fractional.test b/mysql-wsrep-5.6/mysql-test/t/type_temporal_fractional.test index 00abb840..e2cd520a 100644 --- a/mysql-wsrep-5.6/mysql-test/t/type_temporal_fractional.test +++ b/mysql-wsrep-5.6/mysql-test/t/type_temporal_fractional.test @@ -7677,4 +7677,151 @@ SELECT SECOND(-4.99999999991e0); SELECT SECOND(TRUNCATE('5',180)); +--echo # +--echo # Bug#17080703 INCONSISTENT DATETIME CONVERSIONS WITH FRACTIONAL SECONDS +--echo # + +--echo # Test for TIMESTAMP datatype. +SELECT TIMESTAMP '20130710010203'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '201307100102031'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '2013071001020312'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '20130710010203123'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '201307100102031234'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '2013071001020312345'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '20130710010203123456'; + +--echo # Test non decimal point as delimiter for fractional seconds. +--error ER_WRONG_VALUE +SELECT TIMESTAMP '2013:07:10 01:02:03:04'; + +--echo # Test for invalid seconds >= 60 properly separated by decimal point with fractions. +--error ER_WRONG_VALUE +SELECT TIMESTAMP '2013:07:10 01.02.131'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '2013:07:10 01.02.131.2'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '2013:07:10 01.02.0312.3'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '2013.07.10 01.02.131.23456'; + +--error ER_WRONG_VALUE +SELECT TIMESTAMP '201307100102031.'; +--error ER_WRONG_VALUE +SELECT TIMESTAMP '2012071001021.1'; + + +--echo # Test for valid seconds properly separated by decimal point with fractions. +SELECT TIMESTAMP '2013:07:10 01.02.0.31'; +SELECT TIMESTAMP '20130710010203.'; + + +--echo # Test for valid seconds properly separated by decimal point with fractions. +SELECT TIMESTAMP '20130710010203.1'; +SELECT TIMESTAMP '20130710010203.12'; +SELECT TIMESTAMP '20130710010203.123'; +SELECT TIMESTAMP '20130710010203.1234'; +SELECT TIMESTAMP '20130710010203.12345'; +SELECT TIMESTAMP '20130710010203.123456'; +SELECT TIMESTAMP '20130710010203.1234567'; + +--echo # Test for valid time literals in insert operation. +CREATE TABLE t(key1 INT UNIQUE, col TIMESTAMP(6)); +INSERT INTO t VALUES (1, '20130710010203.1'), (2, '20130710010203.12'), (3, '20130710010203.123'), (4, '20130710010203.1234'), +(5,'20130710010203.12345'), (6, '20130710010203.123456'), (7, '201207100102'); +SELECT * FROM t ORDER BY key1; +DELETE FROM t; + +--echo # Test for invalid time literals in insert operation. +INSERT INTO t VALUES (1, '201307100102031'), (2, '2013071001020312'), (3, '20130710010203123'), (4, '201307100102031234'), +(5, '2013071001020312345'), (6, '20130710010203123456'), (7, '2013:07:10 01.02.031'), (8, '2013:07:10 01.02.031.2'), +(9, '2013:07:10 01.02.0312.3'), (10, '2012071001021.1'), (11, '2012071001021'); +SELECT * FROM t ORDER BY key1; +DROP TABLE t; + +--echo # Test for DATETIME datatype. + +--echo # Test for valid time literals in insert operation. +CREATE TABLE t(key1 INT UNIQUE, col DATETIME(6)); +INSERT INTO t VALUES (1, '20130710010203.1'), (2, '20130710010203.12'), (3, '20130710010203.123'), (4, '20130710010203.1234'), +(5, '20130710010203.12345'), (6, '20130710010203.123456'), (7, '201207100102'); +SELECT * FROM t ORDER BY key1; +DELETE FROM t; +--echo # Test for invalid time literals in insert operation. +INSERT INTO t VALUES (1, '201307100102031'), (2, '2013071001020312'), (3, '20130710010203123'), (4, '201307100102031234'), +(5, '2013071001020312345'), (6, '20130710010203123456'), (7, '2013:07:10 01.02.031'), (8, '2013:07:10 01.02.031.2'), +(9, '2013:07:10 01.02.0312.3'), (10, '2012071001021.1'), (11, '2012071001021'); +SELECT * FROM t ORDER BY key1; +DROP TABLE t; + +--echo # Test for TIME datatype. +SELECT TIME '010203'; +SELECT TIME '1010203'; +SELECT TIME '01010203'; + +--error ER_WRONG_VALUE +SELECT TIME '10102031'; +--error ER_WRONG_VALUE +SELECT TIME '101020312'; +--error ER_WRONG_VALUE +SELECT TIME '1010203123'; +--error ER_WRONG_VALUE +SELECT TIME '10102031234'; +--error ER_WRONG_VALUE +SELECT TIME '101020312345'; +--error ER_WRONG_VALUE +SELECT TIME '1010203123456'; + +--echo # Test non decimal point as delimiter for fractional seconds. +--error ER_WRONG_VALUE +SELECT TIME '01:02:03:04'; + +--echo # Test for invalid seconds >= 60 properly separated by decimal point with fractions. +--error ER_WRONG_VALUE +SELECT TIME '01:02:131'; +--error ER_WRONG_VALUE +SELECT TIME '01:02:131.2'; +--error ER_WRONG_VALUE +SELECT TIME '01:02:0312.3'; +--error ER_WRONG_VALUE +SELECT TIME '01:02:131.23456'; + +--error ER_WRONG_VALUE +SELECT TIME '11102031.'; + +--echo # Test for valid seconds properly separated by decimal point with fractions. +SELECT TIME '01:02:0.31'; +SELECT TIME '010203.'; + +--echo # Test for valid seconds properly separated by decimal point with fractions. +SELECT TIME '110203.1'; +SELECT TIME '010203.12'; +SELECT TIME '010203.123'; +SELECT TIME '010203.1234'; +SELECT TIME '010203.12345'; +SELECT TIME '010203.123456'; +SELECT TIME '010203.1234567'; + +SELECT TIME '01021.1'; + +--echo # Test for valid time literals in insert operation. +CREATE TABLE t(key1 INT UNIQUE, col TIME(6)); +INSERT INTO t VALUES (1, '010203.1'), (2, '010203.12'), (3, '010203.123'), (4, '010203.1234'), +(5, '010203.12345'), (6, '010203.123456'), (7, '0203.123456'), (8, '03.123456'), (9, '0.123456'); +SELECT * FROM t ORDER BY key1; +DELETE FROM t; + +--echo # Test for invalid time literals in insert operation. +INSERT INTO t VALUES (1, '0102031'), (2, '01020312'), (3, '010203123'), (4, '0102031234'), +(5, '01020312345'), (6, '010203123456'), (7, '01:02:031'), (8, '01:02:031.2'), +(9, '01:02:0312.3'); +SELECT * FROM t ORDER BY key1; +DROP TABLE t; + + --echo # End of 5.6 tests diff --git a/mysql-wsrep-5.6/mysql-test/t/union.test b/mysql-wsrep-5.6/mysql-test/t/union.test index 8c56e1e7..d5a73fb9 100644 --- a/mysql-wsrep-5.6/mysql-test/t/union.test +++ b/mysql-wsrep-5.6/mysql-test/t/union.test @@ -1226,3 +1226,33 @@ SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a DESC LIM SELECT(SELECT 1 AS a ORDER BY a) AS dev; SELECT(SELECT 1 AS a LIMIT 1) AS dev; SELECT(SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev; + +--echo # +--echo # Bug #17059925 : UNIONS COMPUTES ROWS_EXAMINED INCORRECTLY +--echo # + +## Save current state of slow log variables +SET @old_slow_query_log= @@global.slow_query_log; +SET @old_log_output= @@global.log_output; +SET @old_long_query_time= @@long_query_time; +SET GLOBAL log_output= "TABLE"; +SET GLOBAL slow_query_log= ON; +SET SESSION long_query_time= 0; + +CREATE TABLE t17059925 (a INT); +CREATE TABLE t2 (b INT); +CREATE TABLE t3 (c INT); +INSERT INTO t17059925 VALUES (1), (2), (3); +INSERT INTO t2 VALUES (4), (5), (6); +INSERT INTO t3 VALUES (7), (8), (9); +TRUNCATE table mysql.slow_log; +--sorted_result +SELECT * FROM t17059925 UNION SELECT * FROM t2 UNION SELECT * FROM t3; +SELECT sql_text, rows_examined FROM mysql.slow_log WHERE sql_text LIKE '%SELECT%t17059925%'; +DROP TABLE t17059925, t2, t3; + +## Reset to initial values +SET @@long_query_time= @old_long_query_time; +SET @@global.log_output= @old_log_output; +SET @@global.slow_query_log= @old_slow_query_log; + diff --git a/mysql-wsrep-5.6/mysql-test/t/view.test b/mysql-wsrep-5.6/mysql-test/t/view.test index 5f8a5e98..06e326e7 100644 --- a/mysql-wsrep-5.6/mysql-test/t/view.test +++ b/mysql-wsrep-5.6/mysql-test/t/view.test @@ -4318,6 +4318,43 @@ DROP VIEW v_t1; DROP TABLE t1; +--echo # +--echo # BUG#14117018 - MYSQL SERVER CREATES INVALID VIEW DEFINITION +--echo # BUG#18405221 - SHOW CREATE VIEW OUTPUT INCORRECT +--echo # + +CREATE VIEW v1 AS (SELECT '' FROM DUAL); +CREATE VIEW v2 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL + (SELECT '' FROM DUAL); +CREATE VIEW v3 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL + (SELECT '' FROM DUAL) UNION ALL + (SELECT '' FROM DUAL); +CREATE VIEW v4 AS (SELECT 'BUG#14117018' AS col1 FROM DUAL) UNION ALL + (SELECT '' AS col2 FROM DUAL) UNION ALL + (SELECT '' FROM DUAL); + +--echo # Name for the column in select1 is set properly with or +--echo # without this fix. +SHOW CREATE VIEW v1; + +--echo # Name for the column in select2 is set with this fix. +--echo # Without this fix, name would not have set for the +--echo # columns in select2. +SHOW CREATE VIEW v2; + +--echo # Name for the field item in select2 & select3 is set with this fix. +--echo # Without this fix, name would not have set for the +--echo # columns in select2 & select3. +SHOW CREATE VIEW v3; + +--echo # Name for the field item in select3 is set with this fix. +--echo # Without this fix, name would not have set for the +--echo # columns in select3. +SHOW CREATE VIEW v4; + +DROP VIEW v1, v2, v3, v4; + + # 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 diff --git a/mysql-wsrep-5.6/mysql-test/t/windows.test b/mysql-wsrep-5.6/mysql-test/t/windows.test index b7d31948..617daba6 100644 --- a/mysql-wsrep-5.6/mysql-test/t/windows.test +++ b/mysql-wsrep-5.6/mysql-test/t/windows.test @@ -98,3 +98,19 @@ deallocate prepare abc; SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'socket'; + +--echo # +--echo # Bug#16581605: REPLACE.EXE UTILITY IS BROKEN IN 5.5 +--echo # + +# Creating a temporary text file. +--write_file $MYSQL_TMP_DIR/bug16581605.txt +abc +def +EOF + +#REPLACE.EXE UTILITY will work fine after the fix. +--exec $REPLACE abc xyz < $MYSQL_TMP_DIR/bug16581605.txt + +#Cleanup +remove_file $MYSQL_TMP_DIR/bug16581605.txt; diff --git a/mysql-wsrep-5.6/mysql-test/valgrind.supp b/mysql-wsrep-5.6/mysql-test/valgrind.supp index 6f0042ea..f77ec761 100644 --- a/mysql-wsrep-5.6/mysql-test/valgrind.supp +++ b/mysql-wsrep-5.6/mysql-test/valgrind.supp @@ -1,4 +1,4 @@ -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, Oracle and/or 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 @@ -497,200 +497,6 @@ fun:dlopen* } -# -# BUG#45630 -# Suppress valgrind failures within nptl_pthread_exit_hack_handler on Ubuntu 9.04, x86 (but not amd64) -# - -{ - Mem loss within nptl_pthread_exit_hack_handler 1 - Memcheck:Leak - fun:malloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler - fun:start_thread - fun:clone -} - -{ - Mem loss within nptl_pthread_exit_hack_handler 2 - Memcheck:Leak - fun:malloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler - fun:start_thread - fun:clone -} - -{ - Mem loss within nptl_pthread_exit_hack_handler 3 - Memcheck:Leak - fun:calloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler - fun:start_thread - fun:clone -} - -{ - Mem loss within nptl_pthread_exit_hack_handler 4 - Memcheck:Leak - fun:malloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler - fun:start_thread -} - -{ - Mem loss within nptl_pthread_exit_hack_handler 5 - Memcheck:Leak - fun:calloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler - fun:start_thread -} - -# suppressions for glibc 2.6.1 64 bit - -{ - Mem loss within nptl_pthread_exit_hack_handler 6 - Memcheck:Leak - fun:malloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - obj:*/libc-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler -} - -{ - Mem loss within nptl_pthread_exit_hack_handler 7 - Memcheck:Leak - fun:malloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - obj:*/libc-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler - fun:start_thread - fun:clone -} - -{ - Mem loss within nptl_pthread_exit_hack_handler 8 - Memcheck:Leak - fun:calloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - obj:*/libc-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler - fun:start_thread - fun:clone -} - -{ - Mem loss within nptl_pthread_exit_hack_handler 8 - Memcheck:Leak - fun:calloc - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/ld-*.so - obj:*/libc-*.so - obj:*/ld-*.so - obj:*/libc-*.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind - fun:__pthread_unwind - fun:pthread_exit - fun:nptl_pthread_exit_hack_handler -} - # # Pthread doesn't free all thread specific memory before program exists # @@ -1045,6 +851,34 @@ fun:SSL_COMP_get_compression_methods fun:SSL_library_init } + +{ + OpenSSL still reachable. + Memcheck:Leak + fun:malloc + fun:CRYPTO_malloc + fun:engine_cleanup_add_last + fun:ENGINE_add +} + +{ + OpenSSL still reachable. + Memcheck:Leak + fun:malloc + fun:CRYPTO_malloc + fun:sk_new + fun:engine_cleanup_add_last + fun:ENGINE_add +} + +{ + OpenSSL still reachable. + Memcheck:Leak + fun:malloc + fun:CRYPTO_malloc + fun:ENGINE_new +} + { BUG#14801497 CONDITIONAL JUMP OR MOVE DEPENDS ON UNINITIALISED VALUE(S) IN CREATE_TMP_TABLE Memcheck:Cond diff --git a/mysql-wsrep-5.6/mysys/CMakeLists.txt b/mysql-wsrep-5.6/mysys/CMakeLists.txt index a258698b..cc8a083e 100644 --- a/mysql-wsrep-5.6/mysys/CMakeLists.txt +++ b/mysql-wsrep-5.6/mysys/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,7 +25,6 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c my_compress.c my_copy.c my_create.c my_delete.c my_div.c my_error.c my_file.c my_fopen.c my_fstream.c my_gethwaddr.c my_getsystime.c my_getwd.c my_compare.c my_init.c - my_isnan.c my_lib.c my_lock.c my_malloc.c my_mess.c my_mkdir.c my_mmap.c my_once.c my_open.c my_pread.c my_pthread.c my_quick.c my_read.c my_redel.c my_rename.c my_seek.c my_sleep.c @@ -77,7 +76,6 @@ TARGET_LINK_LIBRARIES(queues mysys) SET_TARGET_PROPERTIES(queues PROPERTIES COMPILE_FLAGS "-DMAIN") ADD_TEST(queues_test queues) -INSTALL_DEBUG_SYMBOLS(mysys) IF(MSVC) INSTALL_DEBUG_TARGET(mysys DESTINATION ${INSTALL_LIBDIR}/debug) ENDIF() diff --git a/mysql-wsrep-5.6/mysys/mf_arr_appstr.c b/mysql-wsrep-5.6/mysys/mf_arr_appstr.c index 0238d4c8..71d4ad0a 100644 --- a/mysql-wsrep-5.6/mysys/mf_arr_appstr.c +++ b/mysql-wsrep-5.6/mysys/mf_arr_appstr.c @@ -1,4 +1,5 @@ /* Copyright (C) 2007 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 diff --git a/mysql-wsrep-5.6/mysys/mf_iocache2.c b/mysql-wsrep-5.6/mysys/mf_iocache2.c index 5ea0115a..6cbde4d0 100644 --- a/mysql-wsrep-5.6/mysys/mf_iocache2.c +++ b/mysql-wsrep-5.6/mysys/mf_iocache2.c @@ -408,6 +408,13 @@ process_flags: if (my_b_write(info, (uchar*) par, length2)) goto err; } + else if (*fmt == 'c') /* char type parameter */ + { + char par[2]; + par[0] = va_arg(args, int); + if (my_b_write(info, (uchar*) par, 1)) + goto err; + } else if (*fmt == 'b') /* Sized buffer parameter, only precision makes sense */ { char *par = va_arg(args, char *); diff --git a/mysql-wsrep-5.6/mysys/mf_qsort2.c b/mysql-wsrep-5.6/mysys/mf_qsort2.c index 0e84c9da..f54cdac9 100644 --- a/mysql-wsrep-5.6/mysys/mf_qsort2.c +++ b/mysql-wsrep-5.6/mysys/mf_qsort2.c @@ -1,4 +1,5 @@ /* Copyright (C) 2000 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 diff --git a/mysql-wsrep-5.6/mysys/mf_same.c b/mysql-wsrep-5.6/mysys/mf_same.c index e96ec5aa..ed3b7434 100644 --- a/mysql-wsrep-5.6/mysys/mf_same.c +++ b/mysql-wsrep-5.6/mysys/mf_same.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2001, 2007 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 diff --git a/mysql-wsrep-5.6/mysys/mf_soundex.c b/mysql-wsrep-5.6/mysys/mf_soundex.c index cd808219..c32c454f 100644 --- a/mysql-wsrep-5.6/mysys/mf_soundex.c +++ b/mysql-wsrep-5.6/mysys/mf_soundex.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2002, 2004, 2007 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 diff --git a/mysql-wsrep-5.6/mysys/mf_wcomp.c b/mysql-wsrep-5.6/mysys/mf_wcomp.c index 787702d5..5e4a6891 100644 --- a/mysql-wsrep-5.6/mysys/mf_wcomp.c +++ b/mysql-wsrep-5.6/mysys/mf_wcomp.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2003, 2004 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 diff --git a/mysql-wsrep-5.6/mysys/mulalloc.c b/mysql-wsrep-5.6/mysys/mulalloc.c index d7dff87a..91360543 100644 --- a/mysql-wsrep-5.6/mysys/mulalloc.c +++ b/mysql-wsrep-5.6/mysys/mulalloc.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2002, 2003, 2007 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 diff --git a/mysql-wsrep-5.6/mysys/my_alarm.c b/mysql-wsrep-5.6/mysys/my_alarm.c index df3ebbee..fb36d69a 100644 --- a/mysql-wsrep-5.6/mysys/my_alarm.c +++ b/mysql-wsrep-5.6/mysys/my_alarm.c @@ -1,4 +1,5 @@ /* Copyright (C) 2000 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 diff --git a/mysql-wsrep-5.6/mysys/my_crc32.c b/mysql-wsrep-5.6/mysys/my_crc32.c index 9c337182..2893d35a 100644 --- a/mysql-wsrep-5.6/mysys/my_crc32.c +++ b/mysql-wsrep-5.6/mysys/my_crc32.c @@ -1,4 +1,5 @@ /* Copyright (c) 2003, 2004 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 diff --git a/mysql-wsrep-5.6/mysys/my_div.c b/mysql-wsrep-5.6/mysys/my_div.c index 65c62ff8..808f0a96 100644 --- a/mysql-wsrep-5.6/mysys/my_div.c +++ b/mysql-wsrep-5.6/mysys/my_div.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2002, 2004, 2007 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 diff --git a/mysql-wsrep-5.6/mysys/my_fopen.c b/mysql-wsrep-5.6/mysys/my_fopen.c index 20a2afae..dc640a07 100644 --- a/mysql-wsrep-5.6/mysys/my_fopen.c +++ b/mysql-wsrep-5.6/mysys/my_fopen.c @@ -120,7 +120,10 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream) FILE_SHARE_DELETE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) + { + _close(fd); return NULL; + } if ((handle_fd= _open_osfhandle((intptr_t)osfh, _O_APPEND | _O_TEXT)) == -1) diff --git a/mysql-wsrep-5.6/mysys/my_fstream.c b/mysql-wsrep-5.6/mysys/my_fstream.c index 4950052c..263d8ba8 100644 --- a/mysql-wsrep-5.6/mysys/my_fstream.c +++ b/mysql-wsrep-5.6/mysys/my_fstream.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags) DBUG_ENTER("my_fwrite"); DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", (long) stream, (long) Buffer, (uint) Count, MyFlags)); + DBUG_EXECUTE_IF("simulate_fwrite_error", DBUG_RETURN(-1);); #if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM) errors=0; diff --git a/mysql-wsrep-5.6/mysys/my_getpagesize.c b/mysql-wsrep-5.6/mysys/my_getpagesize.c index 45887171..f459ec3b 100644 --- a/mysql-wsrep-5.6/mysys/my_getpagesize.c +++ b/mysql-wsrep-5.6/mysys/my_getpagesize.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000-2003, 2006 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 diff --git a/mysql-wsrep-5.6/mysys/my_handler_errors.h b/mysql-wsrep-5.6/mysys/my_handler_errors.h index fb166c37..f3d43acb 100644 --- a/mysql-wsrep-5.6/mysys/my_handler_errors.h +++ b/mysql-wsrep-5.6/mysys/my_handler_errors.h @@ -93,7 +93,8 @@ static const char *handler_error_messages[]= "InnoDB is in read only mode", "FTS query exceeds result cache memory limit", "Temporary file write failure", - "Operation not allowed when innodb_forced_recovery > 0" + "Operation not allowed when innodb_forced_recovery > 0", + "Too many words in a FTS phrase or proximity search" }; extern void my_handler_error_register(void); diff --git a/mysql-wsrep-5.6/mysys/my_libwrap.c b/mysql-wsrep-5.6/mysys/my_libwrap.c index 9ccdf53a..28081f64 100644 --- a/mysql-wsrep-5.6/mysys/my_libwrap.c +++ b/mysql-wsrep-5.6/mysys/my_libwrap.c @@ -1,4 +1,5 @@ /* Copyright (c) 2003, 2006 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 diff --git a/mysql-wsrep-5.6/mysys/my_memmem.c b/mysql-wsrep-5.6/mysys/my_memmem.c index 26cb6ad9..e15dedfd 100644 --- a/mysql-wsrep-5.6/mysys/my_memmem.c +++ b/mysql-wsrep-5.6/mysys/my_memmem.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2006, 2007 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 diff --git a/mysql-wsrep-5.6/mysys/my_pread.c b/mysql-wsrep-5.6/mysys/my_pread.c index 9020f541..c36893f3 100644 --- a/mysql-wsrep-5.6/mysys/my_pread.c +++ b/mysql-wsrep-5.6/mysys/my_pread.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, } /* my_pread */ -/* +/** Write a chunk of bytes to a file at a given position SYNOPSIOS @@ -129,25 +129,36 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, to set the position in the file back to the original position if the system doesn't support pwrite() - RETURN - (size_t) -1 Error - # Number of bytes read + if (MyFlags & (MY_NABP | MY_FNABP)) + @returns + 0 if Count == 0 + On succes, 0 + On failure, (size_t)-1 == MY_FILE_ERROR + + otherwise + @returns + 0 if Count == 0 + On success, the number of bytes written. + On partial success (if less than Count bytes could be written), + the actual number of bytes written. + On failure, (size_t)-1 == MY_FILE_ERROR */ size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags) { - size_t writtenbytes, written; - uint errors; + size_t writtenbytes; + size_t sum_written= 0; + uint errors= 0; + const size_t initial_count= Count; DBUG_ENTER("my_pwrite"); DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d", Filedes, offset, Buffer, (ulong)Count, MyFlags)); - errors= 0; - written= 0; for (;;) { + errno= 0; #if !defined (HAVE_PREAD) && !defined (_WIN32) int error; writtenbytes= (size_t) -1; @@ -163,11 +174,14 @@ size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count, writtenbytes= pwrite(Filedes, Buffer, Count, offset); #endif if(writtenbytes == Count) + { + sum_written+= writtenbytes; break; + } my_errno= errno; if (writtenbytes != (size_t) -1) { - written+= writtenbytes; + sum_written+= writtenbytes; Buffer+= writtenbytes; Count-= writtenbytes; offset+= writtenbytes; @@ -185,24 +199,37 @@ size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count, errors++; continue; } - if ((writtenbytes && writtenbytes != (size_t) -1) || my_errno == EINTR) - continue; /* Retry */ + if (writtenbytes != 0 && writtenbytes != (size_t) -1) + continue; + else if (my_errno == EINTR) + { + continue; /* Retry */ + } + else if (writtenbytes == 0 && !errors++) /* Retry once */ + { + /* We may come here if the file quota is exeeded */ + continue; + } #endif - if (MyFlags & (MY_NABP | MY_FNABP)) + break; /* Return bytes written */ + } + if (MyFlags & (MY_NABP | MY_FNABP)) + { + if (sum_written == initial_count) + DBUG_RETURN(0); /* Want only errors, not bytes written */ + if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) { - if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) - { - char errbuf[MYSYS_STRERROR_SIZE]; - my_error(EE_WRITE, MYF(ME_BELL | ME_WAITTANG), my_filename(Filedes), - my_errno, my_strerror(errbuf, sizeof(errbuf), my_errno)); - } - DBUG_RETURN(MY_FILE_ERROR); /* Error on read */ + char errbuf[MYSYS_STRERROR_SIZE]; + my_error(EE_WRITE, MYF(ME_BELL | ME_WAITTANG), my_filename(Filedes), + my_errno, my_strerror(errbuf, sizeof(errbuf), my_errno)); } - else - break; /* Return bytes written */ + DBUG_RETURN(MY_FILE_ERROR); } DBUG_EXECUTE_IF("check", my_seek(Filedes, -1, SEEK_SET, MYF(0));); - if (MyFlags & (MY_NABP | MY_FNABP)) - DBUG_RETURN(0); /* Want only errors */ - DBUG_RETURN(writtenbytes+written); /* purecov: inspected */ + + if (sum_written == 0) + DBUG_RETURN(MY_FILE_ERROR); + + DBUG_RETURN(sum_written); + } /* my_pwrite */ diff --git a/mysql-wsrep-5.6/mysys/my_pthread.c b/mysql-wsrep-5.6/mysys/my_pthread.c index 81d1f2af..6de19c55 100644 --- a/mysql-wsrep-5.6/mysys/my_pthread.c +++ b/mysql-wsrep-5.6/mysys/my_pthread.c @@ -28,8 +28,6 @@ #define SCHED_POLICY SCHED_OTHER #endif -uint thd_lib_detected= 0; - /* To allow use of pthread_getspecific with two arguments */ #ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC diff --git a/mysql-wsrep-5.6/mysys/my_redel.c b/mysql-wsrep-5.6/mysys/my_redel.c index 8ba1229a..142491f3 100644 --- a/mysql-wsrep-5.6/mysys/my_redel.c +++ b/mysql-wsrep-5.6/mysys/my_redel.c @@ -75,19 +75,11 @@ end: int my_copystat(const char *from, const char *to, int MyFlags) { - struct stat statbuf; + MY_STAT statbuf; - if (stat(from, &statbuf)) - { - my_errno=errno; - if (MyFlags & (MY_FAE+MY_WME)) - { - char errbuf[MYSYS_STRERROR_SIZE]; - my_error(EE_STAT, MYF(ME_BELL+ME_WAITTANG), from, - errno, my_strerror(errbuf, sizeof(errbuf), errno)); - } + if (my_stat(from, &statbuf, MyFlags) == NULL) return -1; /* Can't get stat on input file */ - } + if ((statbuf.st_mode & S_IFMT) != S_IFREG) return 1; diff --git a/mysql-wsrep-5.6/mysys/my_sync.c b/mysql-wsrep-5.6/mysys/my_sync.c index 778ce6c2..7212d776 100644 --- a/mysql-wsrep-5.6/mysys/my_sync.c +++ b/mysql-wsrep-5.6/mysys/my_sync.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +90,11 @@ int my_sync(File fd, myf my_flags) if (after_sync_wait) (*after_sync_wait)(); if ((my_flags & MY_IGNORE_BADFD) && - (er == EBADF || er == EINVAL || er == EROFS)) + (er == EBADF || er == EINVAL || er == EROFS +#ifdef __APPLE__ + || er == ENOTSUP +#endif + )) { DBUG_PRINT("info", ("ignoring errno %d", er)); res= 0; diff --git a/mysql-wsrep-5.6/mysys/my_thr_init.c b/mysql-wsrep-5.6/mysys/my_thr_init.c index 26540fda..6d561503 100644 --- a/mysql-wsrep-5.6/mysys/my_thr_init.c +++ b/mysql-wsrep-5.6/mysys/my_thr_init.c @@ -44,25 +44,7 @@ pthread_mutexattr_t my_errorcheck_mutexattr; #ifdef _MSC_VER static void install_sigabrt_handler(); #endif -#ifdef TARGET_OS_LINUX -/* - Dummy thread spawned in my_thread_global_init() below to avoid - race conditions in NPTL pthread_exit code. -*/ - -static pthread_handler_t -nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) -{ - /* Do nothing! */ - pthread_exit(0); - return 0; -} - -#endif /* TARGET_OS_LINUX */ - - -static uint get_thread_lib(void); /** True if @c my_thread_global_init() has been called. */ static my_bool my_thread_global_init_done= 0; @@ -179,35 +161,6 @@ my_bool my_thread_global_init(void) if (my_thread_init()) return 1; - thd_lib_detected= get_thread_lib(); - -#ifdef TARGET_OS_LINUX - /* - BUG#24507: Race conditions inside current NPTL pthread_exit() - implementation. - - To avoid a possible segmentation fault during concurrent - executions of pthread_exit(), a dummy thread is spawned which - initializes internal variables of pthread lib. See bug description - for a full explanation. - - TODO: Remove this code when fixed versions of glibc6 are in common - use. - */ - if (thd_lib_detected == THD_LIB_NPTL) - { - pthread_t dummy_thread; - pthread_attr_t dummy_thread_attr; - - pthread_attr_init(&dummy_thread_attr); - pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_JOINABLE); - - if (pthread_create(&dummy_thread,&dummy_thread_attr, - nptl_pthread_exit_hack_handler, NULL) == 0) - (void)pthread_join(dummy_thread, NULL); - } -#endif /* TARGET_OS_LINUX */ - mysql_mutex_init(key_THR_LOCK_lock, &THR_LOCK_lock, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_THR_LOCK_myisam, &THR_LOCK_myisam, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_THR_LOCK_myisam_mmap, &THR_LOCK_myisam_mmap, MY_MUTEX_INIT_FAST); @@ -313,6 +266,9 @@ my_bool my_thread_init(void) struct st_my_thread_var *tmp; my_bool error=0; + if (!my_thread_global_init_done) + return 1; /* cannot proceed with unintialized library */ + #ifdef EXTRA_DEBUG_THREADS fprintf(stderr,"my_thread_init(): thread_id: 0x%lx\n", (ulong) pthread_self()); @@ -487,21 +443,6 @@ extern void **my_thread_var_dbug() #endif /* DBUG_OFF */ -static uint get_thread_lib(void) -{ -#ifdef _CS_GNU_LIBPTHREAD_VERSION - char buff[64]; - - confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff)); - - if (!strncasecmp(buff, "NPTL", 4)) - return THD_LIB_NPTL; - if (!strncasecmp(buff, "linuxthreads", 12)) - return THD_LIB_LT; -#endif - return THD_LIB_OTHER; -} - #ifdef _WIN32 /* In Visual Studio 2005 and later, default SIGABRT handler will overwrite diff --git a/mysql-wsrep-5.6/mysys/my_wincond.c b/mysql-wsrep-5.6/mysys/my_wincond.c index ac15f054..15131f8d 100644 --- a/mysql-wsrep-5.6/mysys/my_wincond.c +++ b/mysql-wsrep-5.6/mysys/my_wincond.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,26 +344,4 @@ int pthread_attr_destroy(pthread_attr_t *connect_att) return 0; } -/**************************************************************************** -** Fix localtime_r() to be a bit safer -****************************************************************************/ - -struct tm *localtime_r(const time_t *timep,struct tm *tmp) -{ - if (*timep == (time_t) -1) /* This will crash win32 */ - { - memset(tmp, 0, sizeof(*tmp)); - } - else - { - struct tm *res=localtime(timep); - if (!res) /* Wrong date */ - { - memset(tmp, 0, sizeof(*tmp)); /* Keep things safe */ - return 0; - } - *tmp= *res; - } - return tmp; -} #endif /* __WIN__ */ diff --git a/mysql-wsrep-5.6/mysys/my_write.c b/mysql-wsrep-5.6/mysys/my_write.c index b08fc18f..7335f960 100644 --- a/mysql-wsrep-5.6/mysys/my_write.c +++ b/mysql-wsrep-5.6/mysys/my_write.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,16 +18,33 @@ #include <errno.h> - /* Write a chunk of bytes to a file */ +/** + Write a chunk of bytes to a file + if (MyFlags & (MY_NABP | MY_FNABP)) + @returns + 0 if Count == 0 + On succes, 0 + On failure, (size_t)-1 == MY_FILE_ERROR + + otherwise + @returns + 0 if Count == 0 + On success, the number of bytes written. + On partial success (if less than Count bytes could be written), + the actual number of bytes written. + On failure, (size_t)-1 == MY_FILE_ERROR +*/ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags) { - size_t writtenbytes, written; - uint errors; + size_t writtenbytes; + size_t sum_written= 0; + uint errors= 0; + const size_t initial_count= Count; + DBUG_ENTER("my_write"); DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d", Filedes, Buffer, (ulong) Count, MyFlags)); - errors= 0; written= 0; /* The behavior of write(fd, buf, 0) is not portable */ if (unlikely(!Count)) @@ -37,6 +54,7 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags) { DBUG_SET("+d,simulate_file_write_error");}); for (;;) { + errno= 0; #ifdef _WIN32 writtenbytes= my_win_write(Filedes, Buffer, Count); #else @@ -48,10 +66,13 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags) writtenbytes= (size_t) -1; }); if (writtenbytes == Count) + { + sum_written+= writtenbytes; break; + } if (writtenbytes != (size_t) -1) { /* Safeguard */ - written+= writtenbytes; + sum_written+= writtenbytes; Buffer+= writtenbytes; Count-= writtenbytes; } @@ -72,39 +93,37 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags) continue; } - if ((writtenbytes == 0 || writtenbytes == (size_t) -1)) + if (writtenbytes != 0 && writtenbytes != (size_t) -1) + continue; /* Retry if something written */ + else if (my_errno == EINTR) { - if (my_errno == EINTR) - { - DBUG_PRINT("debug", ("my_write() was interrupted and returned %ld", - (long) writtenbytes)); - continue; /* Interrupted */ - } - - if (!writtenbytes && !errors++) /* Retry once */ - { - /* We may come here if the file quota is exeeded */ - errno= EFBIG; /* Assume this is the error */ - continue; - } + DBUG_PRINT("debug", ("my_write() was interrupted and returned %ld", + (long) writtenbytes)); + continue; /* Interrupted, retry */ } - else - continue; /* Retry */ -#endif - if (MyFlags & (MY_NABP | MY_FNABP)) + else if (writtenbytes == 0 && !errors++) /* Retry once */ { - if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) - { - char errbuf[MYSYS_STRERROR_SIZE]; - my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG), my_filename(Filedes), - my_errno, my_strerror(errbuf, sizeof(errbuf), my_errno)); - } - DBUG_RETURN(MY_FILE_ERROR); /* Error on read */ + /* We may come here if the file quota is exeeded */ + continue; } - else - break; /* Return bytes written */ +#endif + break; } if (MyFlags & (MY_NABP | MY_FNABP)) - DBUG_RETURN(0); /* Want only errors */ - DBUG_RETURN(writtenbytes+written); + { + if (sum_written == initial_count) + DBUG_RETURN(0); /* Want only errors, not bytes written */ + if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) + { + char errbuf[MYSYS_STRERROR_SIZE]; + my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG), my_filename(Filedes), + my_errno, my_strerror(errbuf, sizeof(errbuf), my_errno)); + } + DBUG_RETURN(MY_FILE_ERROR); + } + + if (sum_written == 0) + DBUG_RETURN(MY_FILE_ERROR); + + DBUG_RETURN(sum_written); } /* my_write */ diff --git a/mysql-wsrep-5.6/mysys/ptr_cmp.c b/mysql-wsrep-5.6/mysys/ptr_cmp.c index 6f9ab13c..156bd4da 100644 --- a/mysql-wsrep-5.6/mysys/ptr_cmp.c +++ b/mysql-wsrep-5.6/mysys/ptr_cmp.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,6 +41,16 @@ static int native_compare(size_t *length, unsigned char **a, unsigned char **b) #else /* __sun */ +/** + Special case for ORDER BY / GROUP BY CHAR(0) NOT NULL + */ +static +int ptr_compare_zero_length(size_t *compare_length __attribute__((unused)), + uchar **a __attribute__((unused)), + uchar **b __attribute__((unused))) +{ + return 0; +} static int ptr_compare(size_t *compare_length, uchar **a, uchar **b); static int ptr_compare_0(size_t *compare_length, uchar **a, uchar **b); static int ptr_compare_1(size_t *compare_length, uchar **a, uchar **b); @@ -58,6 +68,8 @@ qsort2_cmp get_ptr_compare (size_t size __attribute__((unused))) #else qsort2_cmp get_ptr_compare (size_t size) { + if (size == 0) + return (qsort2_cmp) ptr_compare_zero_length; if (size < 4) return (qsort2_cmp) ptr_compare; switch (size & 3) { @@ -85,6 +97,7 @@ static int ptr_compare(size_t *compare_length, uchar **a, uchar **b) reg3 int length= *compare_length; reg1 uchar *first,*last; + DBUG_ASSERT(length > 0); first= *a; last= *b; while (--length) { diff --git a/mysql-wsrep-5.6/mysys/test_dir.c b/mysql-wsrep-5.6/mysys/test_dir.c index da2cb6f6..f8df541c 100644 --- a/mysql-wsrep-5.6/mysys/test_dir.c +++ b/mysql-wsrep-5.6/mysys/test_dir.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2006, 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 diff --git a/mysql-wsrep-5.6/mysys/test_xml.c b/mysql-wsrep-5.6/mysys/test_xml.c index e993ea20..87967197 100644 --- a/mysql-wsrep-5.6/mysys/test_xml.c +++ b/mysql-wsrep-5.6/mysys/test_xml.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2002 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 diff --git a/mysql-wsrep-5.6/mysys/thr_alarm.c b/mysql-wsrep-5.6/mysys/thr_alarm.c index 90b69cc1..3a628b80 100644 --- a/mysql-wsrep-5.6/mysys/thr_alarm.c +++ b/mysql-wsrep-5.6/mysys/thr_alarm.c @@ -80,16 +80,8 @@ void init_thr_alarm(uint max_alarms) sigfillset(&full_signal_set); /* Neaded to block signals */ mysql_mutex_init(key_LOCK_alarm, &LOCK_alarm, MY_MUTEX_INIT_FAST); mysql_cond_init(key_COND_alarm, &COND_alarm, NULL); - if (thd_lib_detected == THD_LIB_LT) - thr_client_alarm= SIGALRM; - else - thr_client_alarm= SIGUSR1; -#ifndef USE_ALARM_THREAD - if (thd_lib_detected != THD_LIB_LT) -#endif - { - my_sigset(thr_client_alarm, thread_alarm); - } + thr_client_alarm= SIGUSR1; + my_sigset(thr_client_alarm, thread_alarm); sigemptyset(&s); sigaddset(&s, THR_SERVER_ALARM); alarm_thread=pthread_self(); @@ -106,11 +98,6 @@ void init_thr_alarm(uint max_alarms) } #elif defined(USE_ONE_SIGNAL_HAND) pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */ - if (thd_lib_detected == THD_LIB_LT) - { - my_sigset(thr_client_alarm, process_alarm); /* Linuxthreads */ - pthread_sigmask(SIG_UNBLOCK, &s, NULL); - } #else my_sigset(THR_SERVER_ALARM, process_alarm); pthread_sigmask(SIG_UNBLOCK, &s, NULL); @@ -294,18 +281,6 @@ sig_handler process_alarm(int sig __attribute__((unused))) This must be first as we can't call DBUG inside an alarm for a normal thread */ - if (thd_lib_detected == THD_LIB_LT && - !pthread_equal(pthread_self(),alarm_thread)) - { -#if defined(MAIN) && !defined(__bsdi__) - printf("thread_alarm in process_alarm\n"); fflush(stdout); -#endif -#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY - my_sigset(thr_client_alarm, process_alarm); /* int. thread system calls */ -#endif - return; - } - /* We have to do do the handling of the alarm in a sub function, because otherwise we would get problems with two threads calling diff --git a/mysql-wsrep-5.6/mysys_ssl/CMakeLists.txt b/mysql-wsrep-5.6/mysys_ssl/CMakeLists.txt index 174d91f4..bcf8177a 100644 --- a/mysql-wsrep-5.6/mysys_ssl/CMakeLists.txt +++ b/mysql-wsrep-5.6/mysys_ssl/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,6 +34,17 @@ IF(WITH_SSL STREQUAL "bundled" AND HAVE_VISIBILITY_HIDDEN) PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") ENDIF() +IF(WITH_SSL STREQUAL "bundled") + SET(MYSYS_AES_IMPLEMENTATION my_aes_yassl.cc) + if (HAVE_VISIBILITY_HIDDEN) + SET_SOURCE_FILES_PROPERTIES( + my_aes_yassl.cc + PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") + ENDIF() +ELSE() + SET(MYSYS_AES_IMPLEMENTATION my_aes_openssl.cc) +ENDIF() + SET(MYSYS_SSL_SOURCES crypt_genhash_impl.cc my_default.cc @@ -44,13 +55,13 @@ SET(MYSYS_SSL_SOURCES my_md5.cc my_rnd.cc my_murmur3.cc + ${MYSYS_AES_IMPLEMENTATION} ) ADD_CONVENIENCE_LIBRARY(mysys_ssl ${MYSYS_SSL_SOURCES}) TARGET_LINK_LIBRARIES(mysys_ssl dbug strings ${SSL_LIBRARIES} ${ZLIB_LIBRARY}) DTRACE_INSTRUMENT(mysys_ssl) -INSTALL_DEBUG_SYMBOLS(mysys_ssl) IF(MSVC) INSTALL_DEBUG_TARGET(mysys_ssl DESTINATION ${INSTALL_LIBDIR}/debug) ENDIF() diff --git a/mysql-wsrep-5.6/mysys_ssl/my_aes.cc b/mysql-wsrep-5.6/mysys_ssl/my_aes.cc index 17bbb209..f5ebe8bd 100644 --- a/mysql-wsrep-5.6/mysys_ssl/my_aes.cc +++ b/mysql-wsrep-5.6/mysys_ssl/my_aes.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. This 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,284 +17,43 @@ #include <my_global.h> #include <m_string.h> #include <my_aes.h> +#include "my_aes_impl.h" -#if defined(HAVE_YASSL) -#include "aes.hpp" -#include "openssl/ssl.h" -#elif defined(HAVE_OPENSSL) -#include <openssl/aes.h> -#include <openssl/evp.h> -#include <openssl/err.h> -/* - EVP_aes_xxx() function name generator. - - The following two macros accept - len - key length (AES_KEY_LENGTH) & - mode - aes mode of operation, always ecb; -*/ -#define EVP_AES_TYPE_FN(len, mode) EVP_aes_ ## len ## _ ## mode() -#define EVP_AES_TYPE(len, mode) EVP_AES_TYPE_FN(len, mode) -#endif - -enum encrypt_dir { MY_AES_ENCRYPT, MY_AES_DECRYPT }; - -#define MY_AES_BLOCK_SIZE 16 /* Block size in bytes */ - -/* If bad data discovered during decoding */ -#define AES_BAD_DATA -1 /** - This is internal function just keeps joint code of Key generation - - SYNOPSIS - my_aes_create_key() - @param key [in] Key to use for real key creation - @param key_length [in] Length of the key - @param rkey [out] Real key (used by OpenSSL/YaSSL) - - @return - 0 Ok - -1 Error; Note: The current impementation never returns this + Transforms an arbitrary long key into a fixed length AES key + + AES keys are of fixed length. This routine takes an arbitrary long key + iterates over it in AES key length increment and XORs the bytes with the + AES key buffer being prepared. + The bytes from the last incomplete iteration are XORed to the start + of the key until their depletion. + Needed since crypto function routines expect a fixed length key. + + @param key [in] Key to use for real key creation + @param key_length [in] Length of the key + @param rkey [out] Real key (used by OpenSSL/YaSSL) + @param opmode [out] encryption mode */ -static int my_aes_create_key(const char *key, int key_length, uint8 *rkey) +void my_aes_create_key(const unsigned char *key, uint key_length, + uint8 *rkey, enum my_aes_opmode opmode) { - uint8 *rkey_end= rkey + AES_KEY_LENGTH / 8; /* Real key boundary */ + const uint key_size= my_aes_opmode_key_sizes[opmode] / 8; + uint8 *rkey_end; /* Real key boundary */ uint8 *ptr; /* Start of the real key*/ - const char *sptr; /* Start of the working key */ - const char *key_end= key + key_length; /* Working key boundary*/ + uint8 *sptr; /* Start of the working key */ + uint8 *key_end= ((uint8 *)key) + key_length; /* Working key boundary*/ - memset(rkey, 0, AES_KEY_LENGTH / 8); /* Set initial key */ + rkey_end= rkey + key_size; - for (ptr= rkey, sptr= key; sptr < key_end; ptr ++, sptr ++) + memset(rkey, 0, key_size); /* Set initial key */ + + for (ptr= rkey, sptr= (uint8 *)key; sptr < key_end; ptr++, sptr++) { if (ptr == rkey_end) /* Just loop over tmp_key until we used all key */ ptr= rkey; - *ptr ^= (uint8) *sptr; - } -#ifdef AES_USE_KEY_BITS - /* - This block is intended to allow more weak encryption if application - build with libmysqld needs to correspond to export regulations - It should be never used in normal distribution as does not give - any speed improvement. - To get worse security define AES_USE_KEY_BITS to number of bits - you want key to be. It should be divisible by 8 - - WARNING: Changing this value results in changing of enryption for - all key lengths so altering this value will result in impossibility - to decrypt data encrypted with previous value - */ -#define AES_USE_KEY_BYTES (AES_USE_KEY_BITS/8) - /* - To get weaker key we use first AES_USE_KEY_BYTES bytes of created key - and cyclically copy them until we created all required key length - */ - for (ptr= rkey+AES_USE_KEY_BYTES, sptr=rkey ; ptr < rkey_end; - ptr ++, sptr ++) - { - if (sptr == rkey + AES_USE_KEY_BYTES) - sptr= rkey; - *ptr= *sptr; + *ptr^= *sptr; } -#endif - return 0; } - - -/** - Crypt buffer with AES encryption algorithm. - - SYNOPSIS - my_aes_encrypt() - @param source [in] Pointer to data for encryption - @param source_length [in] Size of encryption data - @param dest [out] Buffer to place encrypted data (must be large enough) - @param key [in] Key to be used for encryption - @param key_length [in] Length of the key. Will handle keys of any length - - @return - >= 0 Size of encrypted data - < 0 Error -*/ - -int my_aes_encrypt(const char* source, int source_length, char* dest, - const char* key, int key_length) -{ -#if defined(HAVE_YASSL) - TaoCrypt::AES_ECB_Encryption enc; - /* 128 bit block used for padding */ - uint8 block[MY_AES_BLOCK_SIZE]; - int num_blocks; /* number of complete blocks */ - int i; -#elif defined(HAVE_OPENSSL) - EVP_CIPHER_CTX ctx; - int u_len, f_len; -#endif - - /* The real key to be used for encryption */ - uint8 rkey[AES_KEY_LENGTH / 8]; - int rc; /* result codes */ - - if ((rc= my_aes_create_key(key, key_length, rkey))) - return rc; - -#if defined(HAVE_YASSL) - enc.SetKey((const TaoCrypt::byte *) rkey, AES_KEY_LENGTH / 8); - - num_blocks = source_length / MY_AES_BLOCK_SIZE; - - for (i = num_blocks; i > 0; i--) /* Encode complete blocks */ - { - enc.Process((TaoCrypt::byte *) dest, (const TaoCrypt::byte *) source, - MY_AES_BLOCK_SIZE); - source += MY_AES_BLOCK_SIZE; - dest += MY_AES_BLOCK_SIZE; - } - - /* Encode the rest. We always have incomplete block */ - char pad_len = MY_AES_BLOCK_SIZE - (source_length - - MY_AES_BLOCK_SIZE * num_blocks); - memcpy(block, source, 16 - pad_len); - memset(block + MY_AES_BLOCK_SIZE - pad_len, pad_len, pad_len); - - enc.Process((TaoCrypt::byte *) dest, (const TaoCrypt::byte *) block, - MY_AES_BLOCK_SIZE); - - return MY_AES_BLOCK_SIZE * (num_blocks + 1); -#elif defined(HAVE_OPENSSL) - - EVP_CIPHER_CTX_init(&ctx); - - if (! EVP_EncryptInit_ex(&ctx, EVP_AES_TYPE(AES_KEY_LENGTH, ecb), NULL, - (const unsigned char *) rkey, NULL)) - goto aes_error; /* Error */ - if (! EVP_EncryptUpdate(&ctx, (unsigned char *) dest, &u_len, - (unsigned const char *) source, source_length)) - goto aes_error; /* Error */ - if (! EVP_EncryptFinal(&ctx, (unsigned char *) dest + u_len, &f_len)) - goto aes_error; /* Error */ - - EVP_CIPHER_CTX_cleanup(&ctx); - return u_len + f_len; - -aes_error: - /* need to explicitly clean up the error if we want to ignore it */ - ERR_clear_error(); - EVP_CIPHER_CTX_cleanup(&ctx); - return AES_BAD_DATA; -#endif -} - - -/** - DeCrypt buffer with AES encryption algorithm. - - SYNOPSIS - my_aes_decrypt() - @param source [in] Pointer to data for decryption - @param source_length [in] Size of encrypted data - @param dest [out] Buffer to place decrypted data (must - be large enough) - @param key [in] Key to be used for decryption - @param key_length [in] Length of the key. Will handle keys of any length - - @return - >= 0 Size of encrypted data - < 0 Error -*/ - -int my_aes_decrypt(const char *source, int source_length, char *dest, - const char *key, int key_length) -{ -#if defined(HAVE_YASSL) - TaoCrypt::AES_ECB_Decryption dec; - /* 128 bit block used for padding */ - uint8 block[MY_AES_BLOCK_SIZE]; - int num_blocks; /* Number of complete blocks */ - int i; -#elif defined(HAVE_OPENSSL) - EVP_CIPHER_CTX ctx; - int u_len, f_len; -#endif - - /* The real key to be used for decryption */ - uint8 rkey[AES_KEY_LENGTH / 8]; - int rc; /* Result codes */ - - if ((rc= my_aes_create_key(key, key_length, rkey))) - return rc; - -#if defined(HAVE_YASSL) - dec.SetKey((const TaoCrypt::byte *) rkey, AES_KEY_LENGTH / 8); - - num_blocks = source_length / MY_AES_BLOCK_SIZE; - - if ((source_length != num_blocks * MY_AES_BLOCK_SIZE) || num_blocks == 0 ) - /* Input size has to be even and at least one block */ - return AES_BAD_DATA; - - /* Decode all but last blocks */ - for (i = num_blocks - 1; i > 0; i--) - { - dec.Process((TaoCrypt::byte *) dest, (const TaoCrypt::byte *) source, - MY_AES_BLOCK_SIZE); - source += MY_AES_BLOCK_SIZE; - dest += MY_AES_BLOCK_SIZE; - } - - dec.Process((TaoCrypt::byte *) block, (const TaoCrypt::byte *) source, - MY_AES_BLOCK_SIZE); - - /* Use last char in the block as size */ - uint pad_len = (uint) (uchar) block[MY_AES_BLOCK_SIZE - 1]; - - if (pad_len > MY_AES_BLOCK_SIZE) - return AES_BAD_DATA; - /* We could also check whole padding but we do not really need this */ - - memcpy(dest, block, MY_AES_BLOCK_SIZE - pad_len); - return MY_AES_BLOCK_SIZE * num_blocks - pad_len; -#elif defined(HAVE_OPENSSL) - - EVP_CIPHER_CTX_init(&ctx); - - if (! EVP_DecryptInit_ex(&ctx, EVP_AES_TYPE(AES_KEY_LENGTH, ecb), NULL, - (const unsigned char *) rkey, NULL)) - goto aes_error; /* Error */ - if (! EVP_DecryptUpdate(&ctx, (unsigned char *) dest, &u_len, - (unsigned const char *) source, source_length)) - goto aes_error; /* Error */ - if (! EVP_DecryptFinal_ex(&ctx, (unsigned char *) dest + u_len, &f_len)) - goto aes_error; /* Error */ - - EVP_CIPHER_CTX_cleanup(&ctx); - return u_len + f_len; - -aes_error: - /* need to explicitly clean up the error if we want to ignore it */ - ERR_clear_error(); - EVP_CIPHER_CTX_cleanup(&ctx); - return AES_BAD_DATA; -#endif -} - - -/** - Get size of buffer which will be large enough for encrypted data - - SYNOPSIS - my_aes_get_size() - @param source_length [in] Length of data to be encrypted - - @return - Size of buffer required to store encrypted data -*/ - -int my_aes_get_size(int source_length) -{ - return MY_AES_BLOCK_SIZE * (source_length / MY_AES_BLOCK_SIZE) - + MY_AES_BLOCK_SIZE; -} - diff --git a/mysql-wsrep-5.6/mysys_ssl/my_aes_impl.h b/mysql-wsrep-5.6/mysys_ssl/my_aes_impl.h new file mode 100644 index 00000000..2e18b2ea --- /dev/null +++ b/mysql-wsrep-5.6/mysys_ssl/my_aes_impl.h @@ -0,0 +1,31 @@ +/* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + + +/** Maximum supported key kength */ +#define MAX_AES_KEY_LENGTH 256 + +/* TODO: remove in a future version */ +/* Guard against using an old export control restriction #define */ +#ifdef AES_USE_KEY_BITS +#error AES_USE_KEY_BITS not supported +#endif + +extern uint *my_aes_opmode_key_sizes; + + +void my_aes_create_key(const unsigned char *key, uint key_length, + uint8 *rkey, enum my_aes_opmode opmode); + diff --git a/mysql-wsrep-5.6/mysys_ssl/my_aes_openssl.cc b/mysql-wsrep-5.6/mysys_ssl/my_aes_openssl.cc new file mode 100644 index 00000000..fa3c0162 --- /dev/null +++ b/mysql-wsrep-5.6/mysys_ssl/my_aes_openssl.cc @@ -0,0 +1,213 @@ +/* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public 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> +#include <m_string.h> +#include <my_aes.h> +#include "my_aes_impl.h" + +#include <openssl/aes.h> +#include <openssl/evp.h> +#include <openssl/err.h> + + +/* keep in sync with enum my_aes_opmode in my_aes.h */ +const char *my_aes_opmode_names[]= +{ + "aes-128-ecb", + "aes-192-ecb", + "aes-256-ecb", + "aes-128-cbc", + "aes-192-cbc", + "aes-256-cbc", + "aes-128-cfb1", + "aes-192-cfb1", + "aes-256-cfb1", + "aes-128-cfb8", + "aes-192-cfb8", + "aes-256-cfb8", + "aes-128-cfb128", + "aes-192-cfb128", + "aes-256-cfb128", + "aes-128-ofb", + "aes-192-ofb", + "aes-256-ofb", + NULL /* needed for the type enumeration */ +}; + + +/* keep in sync with enum my_aes_opmode in my_aes.h */ +static uint my_aes_opmode_key_sizes_impl[]= +{ + 128 /* aes-128-ecb */, + 192 /* aes-192-ecb */, + 256 /* aes-256-ecb */, + 128 /* aes-128-cbc */, + 192 /* aes-192-cbc */, + 256 /* aes-256-cbc */, + 128 /* aes-128-cfb1 */, + 192 /* aes-192-cfb1 */, + 256 /* aes-256-cfb1 */, + 128 /* aes-128-cfb8 */, + 192 /* aes-192-cfb8 */, + 256 /* aes-256-cfb8 */, + 128 /* aes-128-cfb128 */, + 192 /* aes-192-cfb128 */, + 256 /* aes-256-cfb128 */, + 128 /* aes-128-ofb */, + 192 /* aes-192-ofb */, + 256 /* aes-256-ofb */ +}; + +uint *my_aes_opmode_key_sizes= my_aes_opmode_key_sizes_impl; + + + +static const EVP_CIPHER * +aes_evp_type(const my_aes_opmode mode) +{ + switch (mode) + { + case my_aes_128_ecb: return EVP_aes_128_ecb(); + case my_aes_128_cbc: return EVP_aes_128_cbc(); + case my_aes_128_cfb1: return EVP_aes_128_cfb1(); + case my_aes_128_cfb8: return EVP_aes_128_cfb8(); + case my_aes_128_cfb128: return EVP_aes_128_cfb128(); + case my_aes_128_ofb: return EVP_aes_128_ofb(); + case my_aes_192_ecb: return EVP_aes_192_ecb(); + case my_aes_192_cbc: return EVP_aes_192_cbc(); + case my_aes_192_cfb1: return EVP_aes_192_cfb1(); + case my_aes_192_cfb8: return EVP_aes_192_cfb8(); + case my_aes_192_cfb128: return EVP_aes_192_cfb128(); + case my_aes_192_ofb: return EVP_aes_192_ofb(); + case my_aes_256_ecb: return EVP_aes_256_ecb(); + case my_aes_256_cbc: return EVP_aes_256_cbc(); + case my_aes_256_cfb1: return EVP_aes_256_cfb1(); + case my_aes_256_cfb8: return EVP_aes_256_cfb8(); + case my_aes_256_cfb128: return EVP_aes_256_cfb128(); + case my_aes_256_ofb: return EVP_aes_256_ofb(); + default: return NULL; + } +} + + +int my_aes_encrypt(const unsigned char *source, uint32 source_length, + unsigned char *dest, + const unsigned char *key, uint32 key_length, + enum my_aes_opmode mode, const unsigned char *iv) +{ + EVP_CIPHER_CTX ctx; + const EVP_CIPHER *cipher= aes_evp_type(mode); + int u_len, f_len; + /* The real key to be used for encryption */ + unsigned char rkey[MAX_AES_KEY_LENGTH / 8]; + my_aes_create_key(key, key_length, rkey, mode); + + if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) + return MY_AES_BAD_DATA; + + if (!EVP_EncryptInit(&ctx, cipher, rkey, iv)) + goto aes_error; /* Error */ + if (!EVP_CIPHER_CTX_set_padding(&ctx, 1)) + goto aes_error; /* Error */ + if (!EVP_EncryptUpdate(&ctx, dest, &u_len, source, source_length)) + goto aes_error; /* Error */ + + if (!EVP_EncryptFinal(&ctx, dest + u_len, &f_len)) + goto aes_error; /* Error */ + + EVP_CIPHER_CTX_cleanup(&ctx); + return u_len + f_len; + +aes_error: + /* need to explicitly clean up the error if we want to ignore it */ + ERR_clear_error(); + EVP_CIPHER_CTX_cleanup(&ctx); + return MY_AES_BAD_DATA; +} + + +int my_aes_decrypt(const unsigned char *source, uint32 source_length, + unsigned char *dest, + const unsigned char *key, uint32 key_length, + enum my_aes_opmode mode, const unsigned char *iv) +{ + + EVP_CIPHER_CTX ctx; + const EVP_CIPHER *cipher= aes_evp_type(mode); + int u_len, f_len; + + /* The real key to be used for decryption */ + unsigned char rkey[MAX_AES_KEY_LENGTH / 8]; + + my_aes_create_key(key, key_length, rkey, mode); + if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) + return MY_AES_BAD_DATA; + + EVP_CIPHER_CTX_init(&ctx); + + if (!EVP_DecryptInit(&ctx, aes_evp_type(mode), rkey, iv)) + goto aes_error; /* Error */ + if (!EVP_CIPHER_CTX_set_padding(&ctx, 1)) + goto aes_error; /* Error */ + if (!EVP_DecryptUpdate(&ctx, dest, &u_len, source, source_length)) + goto aes_error; /* Error */ + if (!EVP_DecryptFinal_ex(&ctx, dest + u_len, &f_len)) + goto aes_error; /* Error */ + + EVP_CIPHER_CTX_cleanup(&ctx); + return u_len + f_len; + +aes_error: + /* need to explicitly clean up the error if we want to ignore it */ + ERR_clear_error(); + EVP_CIPHER_CTX_cleanup(&ctx); + return MY_AES_BAD_DATA; +} + + +int my_aes_get_size(uint32 source_length, my_aes_opmode opmode) +{ + const EVP_CIPHER *cipher= aes_evp_type(opmode); + size_t block_size; + + block_size= EVP_CIPHER_block_size(cipher); + + return block_size > 1 ? + block_size * (source_length / block_size) + block_size : + source_length; +} + +/** + Return true if the AES cipher and block mode requires an IV + + SYNOPSIS + my_aes_needs_iv() + @param mode encryption mode + + @retval TRUE IV needed + @retval FALSE IV not needed +*/ + +my_bool my_aes_needs_iv(my_aes_opmode opmode) +{ + const EVP_CIPHER *cipher= aes_evp_type(opmode); + int iv_length; + + iv_length= EVP_CIPHER_iv_length(cipher); + DBUG_ASSERT(iv_length == 0 || iv_length == MY_AES_IV_SIZE); + return iv_length != 0 ? TRUE : FALSE; +} + diff --git a/mysql-wsrep-5.6/mysys_ssl/my_aes_yassl.cc b/mysql-wsrep-5.6/mysys_ssl/my_aes_yassl.cc new file mode 100644 index 00000000..f20d132a --- /dev/null +++ b/mysql-wsrep-5.6/mysys_ssl/my_aes_yassl.cc @@ -0,0 +1,240 @@ +/* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public 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> +#include <m_string.h> +#include <my_aes.h> +#include "my_aes_impl.h" + +#include "aes.hpp" +#include "openssl/ssl.h" +/** AES block size is fixed to be 128 bits for CBC and ECB */ +#define MY_AES_BLOCK_SIZE 16 + + +/* keep in sync with enum my_aes_opmode in my_aes.h */ +const char *my_aes_opmode_names[]= +{ + "aes-128-ecb", + "aes-192-ecb", + "aes-256-ecb", + "aes-128-cbc", + "aes-192-cbc", + "aes-256-cbc", + NULL /* needed for the type enumeration */ +}; + + +/* keep in sync with enum my_aes_opmode in my_aes.h */ +static uint my_aes_opmode_key_sizes_impl[]= +{ + 128 /* aes-128-ecb */, + 192 /* aes-192-ecb */, + 256 /* aes-256-ecb */, + 128 /* aes-128-cbc */, + 192 /* aes-192-cbc */, + 256 /* aes-256-cbc */, +}; + +uint *my_aes_opmode_key_sizes= my_aes_opmode_key_sizes_impl; + + +template <TaoCrypt::CipherDir DIR> +class MyCipherCtx +{ +public: + MyCipherCtx(enum my_aes_opmode mode) : m_mode(mode) + { + switch (m_mode) + { + case my_aes_128_ecb: + case my_aes_192_ecb: + case my_aes_256_ecb: + m_need_iv= false; + break; + default: + m_need_iv= true; + break; + } + } + + bool SetKey(const unsigned char *key, uint block_size, + const unsigned char *iv) + { + if (m_need_iv) + { + if (!iv) + return TRUE; + cbc.SetKey(key, block_size, iv); + } + else + ecb.SetKey(key, block_size); + return false; + } + + void Process(unsigned char *dest, const unsigned char * source, + uint block_size) + { + if (m_need_iv) + cbc.Process(dest, source, block_size); + else + ecb.Process(dest, source, block_size); + } + + bool needs_iv() const + { + return m_need_iv; + } + +private: + /* we initialize the two classes to avoid dynamic allocation */ + TaoCrypt::BlockCipher<DIR, TaoCrypt::AES, TaoCrypt::ECB> ecb; + TaoCrypt::BlockCipher<DIR, TaoCrypt::AES, TaoCrypt::CBC> cbc; + enum my_aes_opmode m_mode; + bool m_need_iv; +}; + + +int my_aes_encrypt(const unsigned char *source, uint32 source_length, + unsigned char *dest, + const unsigned char *key, uint32 key_length, + enum my_aes_opmode mode, const unsigned char *iv) +{ + MyCipherCtx<TaoCrypt::ENCRYPTION> enc(mode); + + /* 128 bit block used for padding */ + unsigned char block[MY_AES_BLOCK_SIZE]; + uint num_blocks; /* number of complete blocks */ + uint i; + /* predicted real key size */ + const uint key_size= my_aes_opmode_key_sizes[mode] / 8; + /* The real key to be used for encryption */ + unsigned char rkey[MAX_AES_KEY_LENGTH / 8]; + + my_aes_create_key(key, key_length, rkey, mode); + + if (enc.SetKey(rkey, key_size, iv)) + return MY_AES_BAD_DATA; + + num_blocks= source_length / MY_AES_BLOCK_SIZE; + + /* Encode all complete blocks */ + for (i = num_blocks; i > 0; + i--, source+= MY_AES_BLOCK_SIZE, dest+= MY_AES_BLOCK_SIZE) + enc.Process(dest, source, MY_AES_BLOCK_SIZE); + + /* + Re-implement standard PKCS padding for the last block. + Pad the last incomplete data block (even if empty) with bytes + equal to the size of extra padding stored into that last packet. + This also means that there will always be one more block, + even if the source data size is dividable by the AES block size. + */ + unsigned char pad_len= + MY_AES_BLOCK_SIZE - (source_length - MY_AES_BLOCK_SIZE * num_blocks); + memcpy(block, source, MY_AES_BLOCK_SIZE - pad_len); + memset(block + MY_AES_BLOCK_SIZE - pad_len, pad_len, pad_len); + + enc.Process(dest, block, MY_AES_BLOCK_SIZE); + + /* we've added a block */ + num_blocks+= 1; + + return (int) (MY_AES_BLOCK_SIZE * num_blocks); +} + + +int my_aes_decrypt(const unsigned char *source, uint32 source_length, + unsigned char *dest, + const unsigned char *key, uint32 key_length, + enum my_aes_opmode mode, const unsigned char *iv) +{ + MyCipherCtx<TaoCrypt::DECRYPTION> dec(mode); + /* 128 bit block used for padding */ + uint8 block[MY_AES_BLOCK_SIZE]; + uint32 num_blocks; /* Number of complete blocks */ + int i; + /* predicted real key size */ + const uint key_size= my_aes_opmode_key_sizes[mode] / 8; + /* The real key to be used for decryption */ + unsigned char rkey[MAX_AES_KEY_LENGTH / 8]; + + my_aes_create_key(key, key_length, rkey, mode); + dec.SetKey(rkey, key_size, iv); + + num_blocks= source_length / MY_AES_BLOCK_SIZE; + + /* + Input size has to be a multiple of the AES block size. + And, due to the standard PKCS padding, at least one block long. + */ + if ((source_length != num_blocks * MY_AES_BLOCK_SIZE) || num_blocks == 0) + return MY_AES_BAD_DATA; + + /* Decode all but the last block */ + for (i= num_blocks - 1; i > 0; + i--, source+= MY_AES_BLOCK_SIZE, dest+= MY_AES_BLOCK_SIZE) + dec.Process(dest, source, MY_AES_BLOCK_SIZE); + + /* unwarp the standard PKCS padding */ + dec.Process(block, source, MY_AES_BLOCK_SIZE); + + /* Use last char in the block as size */ + uint8 pad_len = block[MY_AES_BLOCK_SIZE - 1]; + + if (pad_len > MY_AES_BLOCK_SIZE) + return MY_AES_BAD_DATA; + /* We could also check whole padding but we do not really need this */ + + memcpy(dest, block, MY_AES_BLOCK_SIZE - pad_len); + return MY_AES_BLOCK_SIZE * num_blocks - pad_len; +} + +/** + Get size of buffer which will be large enough for encrypted data + + SYNOPSIS + my_aes_get_size() + @param source_length [in] Length of data to be encrypted + @param mode encryption mode + + @return Size of buffer required to store encrypted data +*/ + +int my_aes_get_size(uint32 source_length, my_aes_opmode opmode) +{ + return MY_AES_BLOCK_SIZE * (source_length / MY_AES_BLOCK_SIZE) + + MY_AES_BLOCK_SIZE; +} + + +/** + Return true if the AES cipher and block mode requires an IV + + SYNOPSIS + my_aes_needs_iv() + @param mode encryption mode + + @retval TRUE IV needed + @retval FALSE IV not needed +*/ + +my_bool my_aes_needs_iv(my_aes_opmode opmode) +{ + MyCipherCtx<TaoCrypt::ENCRYPTION> enc(opmode); + + return enc.needs_iv() ? TRUE : FALSE; +} + diff --git a/mysql-wsrep-5.6/mysys_ssl/my_default.cc b/mysql-wsrep-5.6/mysys_ssl/my_default.cc index 2782352b..6712b79c 100644 --- a/mysql-wsrep-5.6/mysys_ssl/my_default.cc +++ b/mysql-wsrep-5.6/mysys_ssl/my_default.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,7 +107,6 @@ static char my_defaults_file_buffer[FN_REFLEN]; static char my_defaults_extra_file_buffer[FN_REFLEN]; static char my_login_file[FN_REFLEN]; -static char my_key[LOGIN_KEY_LEN]; static my_bool defaults_already_read= FALSE; @@ -155,7 +154,6 @@ static int search_default_file_with_ext(Process_option_func func, const char *dir, const char *ext, const char *config_file, int recursion_level); static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file); -static int check_file_permissions(const char *file_name); /** @@ -1145,6 +1143,7 @@ static char *remove_end_comment(char *ptr) static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file) { uchar cipher[4096], len_buf[MAX_CIPHER_STORE_LEN]; + static unsigned char my_key[LOGIN_KEY_LEN]; int length= 0, cipher_len= 0; if (is_login_file) @@ -1153,7 +1152,7 @@ static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file) { /* Move past unused bytes. */ mysql_file_fseek(file, 4, SEEK_SET, MYF(MY_WME)); - if (mysql_file_fread(file, (uchar *) my_key, LOGIN_KEY_LEN, + if (mysql_file_fread(file, my_key, LOGIN_KEY_LEN, MYF(MY_WME)) != LOGIN_KEY_LEN) return 0; } @@ -1169,8 +1168,8 @@ static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file) return 0; mysql_file_fread(file, cipher, cipher_len, MYF(MY_WME)); - if ((length= my_aes_decrypt((const char *) cipher, cipher_len, str, - my_key, LOGIN_KEY_LEN)) < 0) + if ((length= my_aes_decrypt(cipher, cipher_len, (unsigned char *) str, + my_key, LOGIN_KEY_LEN, my_aes_128_ecb, NULL)) < 0) { /* Attempt to decrypt failed. */ return 0; @@ -1460,7 +1459,7 @@ int my_default_get_login_file(char *file_name, size_t file_name_size) 1 - Failed to stat. 2 - Success. */ -static int check_file_permissions(const char *file_name) +int check_file_permissions(const char *file_name) { #if !defined(__WIN__) MY_STAT stat_info; diff --git a/mysql-wsrep-5.6/mysys_ssl/my_getopt.cc b/mysql-wsrep-5.6/mysys_ssl/my_getopt.cc index 0cd374ab..3eefa78f 100644 --- a/mysql-wsrep-5.6/mysys_ssl/my_getopt.cc +++ b/mysql-wsrep-5.6/mysys_ssl/my_getopt.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +38,6 @@ static void init_one_value(const struct my_option *, void *, longlong); static void fini_one_value(const struct my_option *, void *, longlong); static int setval(const struct my_option *, void *, char *, my_bool); static char *check_struct_option(char *cur_arg, char *key_name); -static void print_cmdline_password_warning(); static my_bool get_bool_argument(const struct my_option *opts, const char *argument, bool *error); @@ -656,7 +655,7 @@ done: * if password string is specified on the command line. */ -static void print_cmdline_password_warning() +void print_cmdline_password_warning() { static my_bool password_warning_announced= FALSE; diff --git a/mysql-wsrep-5.6/mysys_ssl/my_rnd.cc b/mysql-wsrep-5.6/mysys_ssl/my_rnd.cc index 5d300644..19fd37ed 100644 --- a/mysql-wsrep-5.6/mysys_ssl/my_rnd.cc +++ b/mysql-wsrep-5.6/mysys_ssl/my_rnd.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. This 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,47 +53,63 @@ double my_rnd(struct rand_struct *rand_st) return (((double) rand_st->seed1) / rand_st->max_value_dbl); } + + /** - Generate a random number using the OpenSSL/yaSSL supplied - random number generator if available. +Fill a buffer with random bytes using the SSL library routines - @param rand_st [INOUT] Structure used for number generation - only if none of the SSL libraries are - available. +@param buffer [OUT] Buffer to receive the random data +@param buffer_size [IN] sizeof the the buffer - @retval Generated random number. +@retval 1 error ocurred. +@retval 0 OK */ - -double my_rnd_ssl(struct rand_struct *rand_st) +int +my_rand_buffer(unsigned char *buffer, size_t buffer_size) { -#if defined(HAVE_YASSL) || defined(HAVE_OPENSSL) int rc; - unsigned int res; - #if defined(HAVE_YASSL) /* YaSSL */ - rc= yaSSL::RAND_bytes((unsigned char *) &res, sizeof (unsigned int)); + rc= yaSSL::RAND_bytes(buffer, buffer_size); if (!rc) - return my_rnd(rand_st); -#else /* OpenSSL */ - rc= RAND_bytes((unsigned char *) &res, sizeof (unsigned int)); + return 1; +#elif defined(HAVE_OPENSSL) + rc= RAND_bytes(buffer, buffer_size); if (!rc) { ERR_clear_error(); - return my_rnd(rand_st); + return 1; } -#endif /* HAVE_YASSL */ +#else /* no SSL */ +#error not using an SSL library not supported +#endif + return 0; +} - return (double)res / (double)UINT_MAX; -#else /* !defined(HAVE_YASSL) && !defined(HAVE_OPENSSL) */ +/** + Generate a random number using the OpenSSL/yaSSL supplied + random number generator if available. + + @param rand_st [INOUT] Structure used for number generation + only if none of the SSL libraries are + available. + + @retval Generated random number. +*/ - return my_rnd(rand_st); +double my_rnd_ssl(struct rand_struct *rand_st) +{ + unsigned int res; -#endif /* defined(HAVE_YASSL) || defined(HAVE_OPENSSL) */ + if (my_rand_buffer((unsigned char *) &res, sizeof(res))) + return my_rnd(rand_st); + + return (double)res / (double)UINT_MAX; } + #ifdef __cplusplus } #endif diff --git a/mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs b/mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs index 58d990c6..0ccd30f6 100644 --- a/mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs +++ b/mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs @@ -2,7 +2,7 @@ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <!-- - 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 @@ -30,7 +30,7 @@ <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, 2014, Oracle and/or its affiliates. All rights reserved." /> + <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> diff --git a/mysql-wsrep-5.6/packaging/deb-precise/changelog b/mysql-wsrep-5.6/packaging/deb-precise/changelog new file mode 100644 index 00000000..cc3855f6 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/changelog @@ -0,0 +1,25 @@ +mysql-community (5.6.20-1ubuntu12.04) precise; 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 + + -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 26 Jun 2014 16:13:30 +0530 + +mysql-community (5.6.19-1ubuntu12.04) precise; 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-1ubuntu12.04) precise; 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-precise/compat b/mysql-wsrep-5.6/packaging/deb-precise/compat new file mode 100644 index 00000000..45a4fb75 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/compat @@ -0,0 +1 @@ +8 diff --git a/mysql-wsrep-5.6/packaging/deb-precise/control b/mysql-wsrep-5.6/packaging/deb-precise/control new file mode 100644 index 00000000..b6f6bb2c --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/control @@ -0,0 +1,188 @@ +Source: mysql-community +Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com> +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 + +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}), + ${shlibs:Depends}, ${misc:Depends} +Recommends: mysql-community-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 +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 +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-enterprise-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 +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}), + ${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 +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-enterprise-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-precise/copyright b/mysql-wsrep-5.6/packaging/deb-precise/copyright new file mode 100644 index 00000000..482a6765 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/copyright @@ -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-precise/extra/apparmor-profile b/mysql-wsrep-5.6/packaging/deb-precise/extra/apparmor-profile new file mode 100644 index 00000000..4785613b --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/extra/apparmor-profile @@ -0,0 +1,42 @@ +# 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 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 w, + +# 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-precise/extra/my.cnf b/mysql-wsrep-5.6/packaging/deb-precise/extra/my.cnf new file mode 100644 index 00000000..a2b2fd8d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/extra/my.cnf @@ -0,0 +1,57 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/extra/mysql_embedded.1 b/mysql-wsrep-5.6/packaging/deb-precise/extra/mysql_embedded.1 new file mode 100644 index 00000000..735c4e05 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/extra/mysql_embedded.1 @@ -0,0 +1 @@ +.so man1/mysql.1 diff --git a/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.dirs b/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.dirs new file mode 100644 index 00000000..2772b113 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.dirs @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/libmysqlclient-dev.install b/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.install new file mode 100644 index 00000000..6794f18c --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient-dev.install @@ -0,0 +1,29 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/libmysqlclient18.install b/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient18.install new file mode 100644 index 00000000..cdfdaa60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/libmysqlclient18.install @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/libmysqld-dev.install b/mysql-wsrep-5.6/packaging/deb-precise/libmysqld-dev.install new file mode 100644 index 00000000..f2b59fcb --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/libmysqld-dev.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-client.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-client.install new file mode 100644 index 00000000..0a24793e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-client.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-common.dirs b/mysql-wsrep-5.6/packaging/deb-precise/mysql-common.dirs new file mode 100644 index 00000000..a3b0c16a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-common.dirs @@ -0,0 +1,16 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-common.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-common.install new file mode 100644 index 00000000..f1cd29cc --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-common.install @@ -0,0 +1,30 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/INSTALL-BINARY +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-precise/mysql-community-bench.dirs b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.dirs new file mode 100644 index 00000000..9d0acf49 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.dirs @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-community-bench.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.install new file mode 100644 index 00000000..8aa8be6f --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-bench.install @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-community-client.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-client.install new file mode 100644 index 00000000..c6a27ce6 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-client.install @@ -0,0 +1,60 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-community-server.config b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.config new file mode 100644 index 00000000..dd0cbc4e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.config @@ -0,0 +1,92 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-enterprise-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 + + 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 +fi diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.dirs b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.dirs new file mode 100644 index 00000000..f677b6f3 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.dirs @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-community-server.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.install new file mode 100644 index 00000000..e8e3c548 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.install @@ -0,0 +1,82 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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-precise/mysql-community-server.mysql.init b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.mysql.init new file mode 100755 index 00000000..61d0a73b --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.mysql.init @@ -0,0 +1,139 @@ +#!/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, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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_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 + 'start') + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 1 ]; + then + log_action_msg "A MySQL Server is already started" + else + MYSQLRUN=/var/run/mysqld + 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 &" + for i in 1 2 3 4 5 6; + do + sleep 1 + echo -n . + done + echo + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 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') + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 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') + PSCOUNT=$(get_pcount) + if [ ${PSCOUNT} -gt 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-precise/mysql-community-server.postinst b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.postinst new file mode 100644 index 00000000..e9da0b7a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.postinst @@ -0,0 +1,102 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 700 ${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} +USE mysql; +UPDATE user SET password=PASSWORD("${PASSWD}") WHERE user='root'; +DELETE FROM user WHERE user=''; +${RMTESTDB} +FLUSH PRIVILEGES; +EOF + mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL + PASSWD="" + rm -f ${SQL} + fi + 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-precise/mysql-community-server.postrm b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.postrm new file mode 100644 index 00000000..f16ea32a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.postrm @@ -0,0 +1,154 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-community-server.preinst b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.preinst new file mode 100644 index 00000000..cfbfaa60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.preinst @@ -0,0 +1,123 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 /nowhere --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} + 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-precise/mysql-community-server.prerm b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.prerm new file mode 100644 index 00000000..40c5c551 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.prerm @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-community-server.templates b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.templates new file mode 100644 index 00000000..37468eb8 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-server.templates @@ -0,0 +1,41 @@ +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-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 +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-precise/mysql-community-source.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-source.install new file mode 100644 index 00000000..326c5dfb --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-source.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/ +# legal +usr/share/doc/mysql-community-source/COPYING +usr/share/doc/mysql-community-source/README diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.dirs b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.dirs new file mode 100644 index 00000000..4e6ba01a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.dirs @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/mysql-test diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.install new file mode 100644 index 00000000..b685e83d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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-precise/mysql-community-test.links b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.links new file mode 100644 index 00000000..585eaf60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-community-test.links @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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 diff --git a/mysql-wsrep-5.6/packaging/deb-precise/mysql-server.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-server.install new file mode 100644 index 00000000..07f36ef5 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-server.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/mysql-testsuite.install b/mysql-wsrep-5.6/packaging/deb-precise/mysql-testsuite.install new file mode 100644 index 00000000..6a6e5f50 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/mysql-testsuite.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-precise/patches/fix-man-page-links.patch b/mysql-wsrep-5.6/packaging/deb-precise/patches/fix-man-page-links.patch new file mode 100644 index 00000000..004ccdf7 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/patches/fix-man-page-links.patch @@ -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-precise/patches/fix-mysql_install_db.patch b/mysql-wsrep-5.6/packaging/deb-precise/patches/fix-mysql_install_db.patch new file mode 100644 index 00000000..6f036688 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/patches/fix-mysql_install_db.patch @@ -0,0 +1,167 @@ +From: Terje Røsten <terje.rosten@oracle.com> +Description: Updates script to use existing my.cnf and not delete it if created from template +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 + 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,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 + } +-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/ ) + } + + # ---------------------------------------------------------------------- +-# Create database directories mysql & test ++# Create database directory mysql + # ---------------------------------------------------------------------- + + # FIXME The shell variant uses "mkdir -p": +@@ -654,7 +695,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 "/") +@@ -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", diff --git a/mysql-wsrep-5.6/packaging/deb-precise/patches/series b/mysql-wsrep-5.6/packaging/deb-precise/patches/series new file mode 100644 index 00000000..82859623 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/patches/series @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 diff --git a/mysql-wsrep-5.6/packaging/deb-precise/rules b/mysql-wsrep-5.6/packaging/deb-precise/rules new file mode 100755 index 00000000..bdd08b1c --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/rules @@ -0,0 +1,189 @@ +#!/usr/bin/make -f + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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=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_INNODB_MEMCACHED=1 \ + -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \ + -DINSTALL_LAYOUT=DEB + + cat CMakeCache.txt + touch $@ + +override_dh_auto_build: + @echo "RULES.$@" + $(MAKE) -j1 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 + # 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 + # add missing man pages + install -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 + # 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 + # add apparmor profile + install -D -m 644 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 + # 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 + # 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 + touch $@ + +override_dh_installinit: + @echo "RULES.$@" + dh_installinit --name=mysql -- defaults 19 21 + dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld + touch $@ diff --git a/mysql-wsrep-5.6/packaging/deb-precise/source/format b/mysql-wsrep-5.6/packaging/deb-precise/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/mysql-wsrep-5.6/packaging/deb-precise/source/include-binaries b/mysql-wsrep-5.6/packaging/deb-precise/source/include-binaries new file mode 100644 index 00000000..ba9d2b4e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/source/include-binaries @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 and libmysqld-debug.a +debian/extra/server-binary +debian/extra/embedded-server diff --git a/mysql-wsrep-5.6/packaging/deb-precise/watch b/mysql-wsrep-5.6/packaging/deb-precise/watch new file mode 100644 index 00000000..c45c5e3e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-precise/watch @@ -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-trusty/changelog b/mysql-wsrep-5.6/packaging/deb-trusty/changelog new file mode 100644 index 00000000..38416213 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/changelog @@ -0,0 +1,25 @@ +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 + + -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 26 Jun 2014 16:13: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-trusty/compat b/mysql-wsrep-5.6/packaging/deb-trusty/compat new file mode 100644 index 00000000..45a4fb75 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/compat @@ -0,0 +1 @@ +8 diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/control b/mysql-wsrep-5.6/packaging/deb-trusty/control new file mode 100644 index 00000000..f79a5592 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/control @@ -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 (>= 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 + +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}), + ${shlibs:Depends}, ${misc:Depends} +Recommends: mysql-community-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 +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 +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-enterprise-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 +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}), + ${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 +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-enterprise-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-trusty/copyright b/mysql-wsrep-5.6/packaging/deb-trusty/copyright new file mode 100644 index 00000000..482a6765 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/copyright @@ -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-trusty/extra/apparmor-profile b/mysql-wsrep-5.6/packaging/deb-trusty/extra/apparmor-profile new file mode 100644 index 00000000..4785613b --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/extra/apparmor-profile @@ -0,0 +1,42 @@ +# 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 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 w, + +# 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-trusty/extra/my.cnf b/mysql-wsrep-5.6/packaging/deb-trusty/extra/my.cnf new file mode 100644 index 00000000..a2b2fd8d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/extra/my.cnf @@ -0,0 +1,57 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/extra/mysql_embedded.1 b/mysql-wsrep-5.6/packaging/deb-trusty/extra/mysql_embedded.1 new file mode 100644 index 00000000..735c4e05 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/extra/mysql_embedded.1 @@ -0,0 +1 @@ +.so man1/mysql.1 diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient-dev.install b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient-dev.install new file mode 100644 index 00000000..6794f18c --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient-dev.install @@ -0,0 +1,29 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/libmysqlclient18.install b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient18.install new file mode 100644 index 00000000..cdfdaa60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqlclient18.install @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/libmysqld-dev.install b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqld-dev.install new file mode 100644 index 00000000..f2b59fcb --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/libmysqld-dev.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-client.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-client.install new file mode 100644 index 00000000..0a24793e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-client.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-common.dirs b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.dirs new file mode 100644 index 00000000..a3b0c16a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.dirs @@ -0,0 +1,16 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-common.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.install new file mode 100644 index 00000000..f1cd29cc --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-common.install @@ -0,0 +1,30 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/INSTALL-BINARY +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-trusty/mysql-community-bench.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-bench.install new file mode 100644 index 00000000..8aa8be6f --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-bench.install @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-community-client.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-client.install new file mode 100644 index 00000000..c6a27ce6 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-client.install @@ -0,0 +1,60 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-community-server.config b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.config new file mode 100644 index 00000000..dd0cbc4e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.config @@ -0,0 +1,92 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-enterprise-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 + + 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 +fi diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.dirs b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.dirs new file mode 100644 index 00000000..f677b6f3 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.dirs @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-community-server.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.install new file mode 100644 index 00000000..e8e3c548 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.install @@ -0,0 +1,82 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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-trusty/mysql-community-server.mysql.init b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.mysql.init new file mode 100755 index 00000000..61d0a73b --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.mysql.init @@ -0,0 +1,139 @@ +#!/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, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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_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 + 'start') + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 1 ]; + then + log_action_msg "A MySQL Server is already started" + else + MYSQLRUN=/var/run/mysqld + 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 &" + for i in 1 2 3 4 5 6; + do + sleep 1 + echo -n . + done + echo + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 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') + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 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') + PSCOUNT=$(get_pcount) + if [ ${PSCOUNT} -gt 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-trusty/mysql-community-server.postinst b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.postinst new file mode 100644 index 00000000..e9da0b7a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.postinst @@ -0,0 +1,102 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 700 ${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} +USE mysql; +UPDATE user SET password=PASSWORD("${PASSWD}") WHERE user='root'; +DELETE FROM user WHERE user=''; +${RMTESTDB} +FLUSH PRIVILEGES; +EOF + mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL + PASSWD="" + rm -f ${SQL} + fi + 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-trusty/mysql-community-server.postrm b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.postrm new file mode 100644 index 00000000..f16ea32a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.postrm @@ -0,0 +1,154 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-community-server.preinst b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.preinst new file mode 100644 index 00000000..cfbfaa60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.preinst @@ -0,0 +1,123 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 /nowhere --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} + 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-trusty/mysql-community-server.prerm b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.prerm new file mode 100644 index 00000000..40c5c551 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.prerm @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-community-server.templates b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.templates new file mode 100644 index 00000000..37468eb8 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-server.templates @@ -0,0 +1,41 @@ +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-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 +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-trusty/mysql-community-source.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-source.install new file mode 100644 index 00000000..326c5dfb --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-source.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/ +# legal +usr/share/doc/mysql-community-source/COPYING +usr/share/doc/mysql-community-source/README diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.install new file mode 100644 index 00000000..b685e83d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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-trusty/mysql-community-test.links b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.links new file mode 100644 index 00000000..585eaf60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-community-test.links @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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 diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/mysql-server.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-server.install new file mode 100644 index 00000000..07f36ef5 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-server.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/mysql-testsuite.install b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-testsuite.install new file mode 100644 index 00000000..6a6e5f50 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/mysql-testsuite.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-trusty/patches/fix-man-page-links.patch b/mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-man-page-links.patch new file mode 100644 index 00000000..004ccdf7 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-man-page-links.patch @@ -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-trusty/patches/fix-mysql_install_db.patch b/mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-mysql_install_db.patch new file mode 100644 index 00000000..6f036688 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/patches/fix-mysql_install_db.patch @@ -0,0 +1,167 @@ +From: Terje Røsten <terje.rosten@oracle.com> +Description: Updates script to use existing my.cnf and not delete it if created from template +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 + 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,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 + } +-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/ ) + } + + # ---------------------------------------------------------------------- +-# Create database directories mysql & test ++# Create database directory mysql + # ---------------------------------------------------------------------- + + # FIXME The shell variant uses "mkdir -p": +@@ -654,7 +695,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 "/") +@@ -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", diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/patches/series b/mysql-wsrep-5.6/packaging/deb-trusty/patches/series new file mode 100644 index 00000000..82859623 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/patches/series @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/rules b/mysql-wsrep-5.6/packaging/deb-trusty/rules new file mode 100755 index 00000000..bdd08b1c --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/rules @@ -0,0 +1,189 @@ +#!/usr/bin/make -f + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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=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_INNODB_MEMCACHED=1 \ + -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \ + -DINSTALL_LAYOUT=DEB + + cat CMakeCache.txt + touch $@ + +override_dh_auto_build: + @echo "RULES.$@" + $(MAKE) -j1 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 + # 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 + # add missing man pages + install -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 + # 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 + # add apparmor profile + install -D -m 644 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 + # 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 + # 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 + touch $@ + +override_dh_installinit: + @echo "RULES.$@" + dh_installinit --name=mysql -- defaults 19 21 + dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld + touch $@ diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/source/format b/mysql-wsrep-5.6/packaging/deb-trusty/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/source/include-binaries b/mysql-wsrep-5.6/packaging/deb-trusty/source/include-binaries new file mode 100644 index 00000000..ba9d2b4e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/source/include-binaries @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 and libmysqld-debug.a +debian/extra/server-binary +debian/extra/embedded-server diff --git a/mysql-wsrep-5.6/packaging/deb-trusty/watch b/mysql-wsrep-5.6/packaging/deb-trusty/watch new file mode 100644 index 00000000..c45c5e3e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-trusty/watch @@ -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-wheezy/changelog b/mysql-wsrep-5.6/packaging/deb-wheezy/changelog new file mode 100644 index 00000000..36b9849e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/changelog @@ -0,0 +1,25 @@ +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 + + -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 26 Jun 2014 16:13: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-wheezy/compat b/mysql-wsrep-5.6/packaging/deb-wheezy/compat new file mode 100644 index 00000000..45a4fb75 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/compat @@ -0,0 +1 @@ +8 diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/control b/mysql-wsrep-5.6/packaging/deb-wheezy/control new file mode 100644 index 00000000..16a25634 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/control @@ -0,0 +1,188 @@ +Source: mysql-community +Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com> +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 + +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}), + ${shlibs:Depends}, ${misc:Depends} +Recommends: mysql-community-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 +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 +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-enterprise-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 +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}), + ${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 +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-enterprise-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-wheezy/copyright b/mysql-wsrep-5.6/packaging/deb-wheezy/copyright new file mode 100644 index 00000000..482a6765 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/copyright @@ -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-wheezy/extra/my.cnf b/mysql-wsrep-5.6/packaging/deb-wheezy/extra/my.cnf new file mode 100644 index 00000000..a2b2fd8d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/extra/my.cnf @@ -0,0 +1,57 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/extra/mysql_embedded.1 b/mysql-wsrep-5.6/packaging/deb-wheezy/extra/mysql_embedded.1 new file mode 100644 index 00000000..735c4e05 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/extra/mysql_embedded.1 @@ -0,0 +1 @@ +.so man1/mysql.1 diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.dirs b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.dirs new file mode 100644 index 00000000..2772b113 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.dirs @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/libmysqlclient-dev.install b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.install new file mode 100644 index 00000000..6794f18c --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient-dev.install @@ -0,0 +1,29 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/libmysqlclient18.install b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient18.install new file mode 100644 index 00000000..cdfdaa60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqlclient18.install @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/libmysqld-dev.install b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqld-dev.install new file mode 100644 index 00000000..f2b59fcb --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/libmysqld-dev.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-client.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-client.install new file mode 100644 index 00000000..0a24793e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-client.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-common.dirs b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.dirs new file mode 100644 index 00000000..a3b0c16a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.dirs @@ -0,0 +1,16 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-common.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.install new file mode 100644 index 00000000..f1cd29cc --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-common.install @@ -0,0 +1,30 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/INSTALL-BINARY +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-wheezy/mysql-community-bench.dirs b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.dirs new file mode 100644 index 00000000..9d0acf49 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.dirs @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-community-bench.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.install new file mode 100644 index 00000000..8aa8be6f --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-bench.install @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-community-client.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-client.install new file mode 100644 index 00000000..c6a27ce6 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-client.install @@ -0,0 +1,60 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-community-server.config b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.config new file mode 100644 index 00000000..dd0cbc4e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.config @@ -0,0 +1,92 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-enterprise-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 + + 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 +fi diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.dirs b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.dirs new file mode 100644 index 00000000..f677b6f3 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.dirs @@ -0,0 +1,19 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-community-server.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.install new file mode 100644 index 00000000..e8e3c548 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.install @@ -0,0 +1,82 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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-wheezy/mysql-community-server.mysql.init b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.mysql.init new file mode 100755 index 00000000..61d0a73b --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.mysql.init @@ -0,0 +1,139 @@ +#!/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, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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_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 + 'start') + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 1 ]; + then + log_action_msg "A MySQL Server is already started" + else + MYSQLRUN=/var/run/mysqld + 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 &" + for i in 1 2 3 4 5 6; + do + sleep 1 + echo -n . + done + echo + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 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') + PSCOUNT=$(get_pcount) + if [ "${PSCOUNT}" -gt 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') + PSCOUNT=$(get_pcount) + if [ ${PSCOUNT} -gt 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-wheezy/mysql-community-server.postinst b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.postinst new file mode 100644 index 00000000..e9da0b7a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.postinst @@ -0,0 +1,102 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 700 ${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} +USE mysql; +UPDATE user SET password=PASSWORD("${PASSWD}") WHERE user='root'; +DELETE FROM user WHERE user=''; +${RMTESTDB} +FLUSH PRIVILEGES; +EOF + mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL + PASSWD="" + rm -f ${SQL} + fi + 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-wheezy/mysql-community-server.postrm b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.postrm new file mode 100644 index 00000000..f16ea32a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.postrm @@ -0,0 +1,154 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-community-server.preinst b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.preinst new file mode 100644 index 00000000..cfbfaa60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.preinst @@ -0,0 +1,123 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 /nowhere --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} + 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-wheezy/mysql-community-server.prerm b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.prerm new file mode 100644 index 00000000..40c5c551 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.prerm @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-community-server.templates b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.templates new file mode 100644 index 00000000..37468eb8 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-server.templates @@ -0,0 +1,41 @@ +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-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 +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-wheezy/mysql-community-source.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-source.install new file mode 100644 index 00000000..326c5dfb --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-source.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/ +# legal +usr/share/doc/mysql-community-source/COPYING +usr/share/doc/mysql-community-source/README diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.dirs b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.dirs new file mode 100644 index 00000000..4e6ba01a --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.dirs @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/mysql-test diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.install new file mode 100644 index 00000000..b685e83d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.install @@ -0,0 +1,20 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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-wheezy/mysql-community-test.links b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.links new file mode 100644 index 00000000..585eaf60 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-community-test.links @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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 diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-server.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-server.install new file mode 100644 index 00000000..07f36ef5 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-server.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/mysql-testsuite.install b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-testsuite.install new file mode 100644 index 00000000..6a6e5f50 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/mysql-testsuite.install @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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-wheezy/patches/fix-man-page-links.patch b/mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-man-page-links.patch new file mode 100644 index 00000000..004ccdf7 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-man-page-links.patch @@ -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-wheezy/patches/fix-mysql_install_db.patch b/mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-mysql_install_db.patch new file mode 100644 index 00000000..6f036688 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/patches/fix-mysql_install_db.patch @@ -0,0 +1,167 @@ +From: Terje Røsten <terje.rosten@oracle.com> +Description: Updates script to use existing my.cnf and not delete it if created from template +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 + 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,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 + } +-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/ ) + } + + # ---------------------------------------------------------------------- +-# Create database directories mysql & test ++# Create database directory mysql + # ---------------------------------------------------------------------- + + # FIXME The shell variant uses "mkdir -p": +@@ -654,7 +695,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 "/") +@@ -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", diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/patches/series b/mysql-wsrep-5.6/packaging/deb-wheezy/patches/series new file mode 100644 index 00000000..82859623 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/patches/series @@ -0,0 +1,17 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/rules b/mysql-wsrep-5.6/packaging/deb-wheezy/rules new file mode 100755 index 00000000..3bdc3312 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/rules @@ -0,0 +1,186 @@ +#!/usr/bin/make -f + +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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/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=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_INNODB_MEMCACHED=1 \ + -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \ + -DINSTALL_LAYOUT=DEB + + cat CMakeCache.txt + touch $@ + +override_dh_auto_build: + @echo "RULES.$@" + $(MAKE) -j1 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 + # 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 + # add missing man pages + install -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 + # 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 + # 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 + # 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 + # 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 + touch $@ + +override_dh_installinit: + @echo "RULES.$@" + dh_installinit --name=mysql -- defaults 19 21 + touch $@ diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/source/format b/mysql-wsrep-5.6/packaging/deb-wheezy/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/source/include-binaries b/mysql-wsrep-5.6/packaging/deb-wheezy/source/include-binaries new file mode 100644 index 00000000..ba9d2b4e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/source/include-binaries @@ -0,0 +1,18 @@ +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 and libmysqld-debug.a +debian/extra/server-binary +debian/extra/embedded-server diff --git a/mysql-wsrep-5.6/packaging/deb-wheezy/watch b/mysql-wsrep-5.6/packaging/deb-wheezy/watch new file mode 100644 index 00000000..c45c5e3e --- /dev/null +++ b/mysql-wsrep-5.6/packaging/deb-wheezy/watch @@ -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/rpm-fedora/CMakeLists.txt b/mysql-wsrep-5.6/packaging/rpm-fedora/CMakeLists.txt index 2745b298..63dc7d1d 100644 --- a/mysql-wsrep-5.6/packaging/rpm-fedora/CMakeLists.txt +++ b/mysql-wsrep-5.6/packaging/rpm-fedora/CMakeLists.txt @@ -28,8 +28,7 @@ IF(UNIX) FOREACH(fedfile my.cnf my_config.h mysql_config.sh mysqld.service mysql-systemd-start mysql.conf - mysql-5.6.14-mysql-install.patch mysql-5.6-libmysqlclient-symbols.patch - mysql-embedded-check.c) + mysql-5.6.16-mysql-install.patch mysql-5.6-libmysqlclient-symbols.patch) CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY) ENDFOREACH() ENDIF() diff --git a/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6-libmysqlclient-symbols.patch b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6-libmysqlclient-symbols.patch index bd0383e1..e16e65a0 100644 --- a/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6-libmysqlclient-symbols.patch +++ b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6-libmysqlclient-symbols.patch @@ -1,7 +1,7 @@ -=== modified file 'libmysql/libmysql.c' ---- libmysql/libmysql.c revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ libmysql/libmysql.c 2013-06-27 09:26:38 +0000 -@@ -4905,3 +4905,603 @@ my_bool STDCALL mysql_read_query_result( +diff -rup old/libmysql/libmysql.c new/libmysql/libmysql.c +--- old/libmysql/libmysql.c 2013-11-04 20:15:10.000000000 +0100 ++++ new/libmysql/libmysql.c 2014-01-14 12:10:27.148374504 +0100 +@@ -4898,3 +4898,612 @@ my_bool STDCALL mysql_read_query_result( return (*mysql->methods->read_query_result)(mysql); } @@ -32,8 +32,7 @@ +SYM_16(mysql_autocommit); + + -+my_bool STDCALL symver16_mysql_change_user(MYSQL *mysql, const char *user, -+ const char *passwd, const char *db) ++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); +} @@ -109,6 +108,7 @@ +} +SYM_16(mysql_fetch_field_direct); + ++ +MYSQL_FIELD * STDCALL symver16_mysql_fetch_fields(MYSQL_RES *res) +{ + return mysql_fetch_fields(res); @@ -254,6 +254,7 @@ +} +SYM_16(mysql_next_result); + ++ +int STDCALL symver16_mysql_ping(MYSQL *mysql) +{ + return mysql_ping(mysql); @@ -604,11 +605,18 @@ +} +SYM_16(mysql_real_connect); + ++/*****/ ++ ++my_bool symver16_my_init(void) ++{ ++ return my_init(); ++} ++SYM_16(my_init); ++ +#endif - -=== modified file 'libmysql/libmysql.ver.in' ---- libmysql/libmysql.ver.in revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ libmysql/libmysql.ver.in 2013-05-14 10:38:22 +0000 +diff -rup old/libmysql/libmysql.ver.in new/libmysql/libmysql.ver.in +--- old/libmysql/libmysql.ver.in 2013-11-04 20:15:10.000000000 +0100 ++++ new/libmysql/libmysql.ver.in 2014-01-14 12:10:27.148374504 +0100 @@ -1 +1,136 @@ -libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; }; +libmysqlclient_16 @@ -747,11 +755,10 @@ + #mysql_client_errors; + *; +} libmysqlclient_16; - -=== modified file 'mysys/charset.c' ---- mysys/charset.c revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ mysys/charset.c 2013-05-16 06:43:42 +0000 -@@ -1030,3 +1030,20 @@ size_t escape_quotes_for_mysql(CHARSET_I +diff -rup old/mysys/charset.c new/mysys/charset.c +--- old/mysys/charset.c 2013-11-04 20:15:10.000000000 +0100 ++++ new/mysys/charset.c 2014-01-14 12:10:27.197377417 +0100 +@@ -1040,3 +1040,20 @@ size_t escape_quotes_for_mysql(CHARSET_I *to= 0; return overflow ? (ulong)~0 : (ulong) (to - to_start); } @@ -772,91 +779,49 @@ +} + +#endif - -=== modified file 'mysys/my_init.c' ---- mysys/my_init.c revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ mysys/my_init.c 2013-05-16 06:43:58 +0000 -@@ -551,3 +551,16 @@ void my_init_mysys_psi_keys() - } - #endif /* HAVE_PSI_INTERFACE */ - -+#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") -+ -+my_bool symver16_my_init(void) -+{ -+ return my_init(); -+} -+SYM_16(my_init); -+ -+#endif - -=== modified file 'mysys_ssl/my_default.cc' ---- mysys_ssl/my_default.cc revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ mysys_ssl/my_default.cc 2013-06-27 08:56:34 +0000 -@@ -1497,3 +1497,24 @@ static int check_file_permissions(const - return 2; /* Success */ +diff -rup old/sql/net_serv.cc new/sql/net_serv.cc +--- old/sql/net_serv.cc 2013-11-04 20:15:10.000000000 +0100 ++++ new/sql/net_serv.cc 2014-01-14 12:10:27.252380688 +0100 +@@ -1047,3 +1047,15 @@ void my_net_set_write_timeout(NET *net, + DBUG_VOID_RETURN; } +#ifndef EMBEDDED_LIBRARY +C_MODE_START + -+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions -+ -+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16") -+ -+void symver16_free_defaults(char **argv) -+{ -+ return free_defaults(argv); -+} -+SYM_16(free_defaults); ++// Hack to provide Fedora symbols + -+int symver16_load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv) ++my_bool mysql_net_realloc(NET *net, size_t length) +{ -+ return load_defaults(conf_file, groups, argc, argv); ++ return net_realloc(net, length); +} -+SYM_16(load_defaults); + +C_MODE_END +#endif - -=== modified file 'mysys_ssl/my_getopt.cc' ---- mysys_ssl/my_getopt.cc revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ mysys_ssl/my_getopt.cc 2013-06-27 09:01:37 +0000 -@@ -1642,3 +1642,25 @@ void my_print_variables_ex(const struct - } - } +diff -rup old/sql/password.c new/sql/password.c +--- old/sql/password.c 2013-11-04 20:15:10.000000000 +0100 ++++ new/sql/password.c 2014-01-14 12:10:27.309384078 +0100 +@@ -584,3 +584,16 @@ void make_password_from_salt(char *to, c + octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE); } -+ + +#ifndef EMBEDDED_LIBRARY -+C_MODE_START + +// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions + +#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16") + -+int symver16_handle_options(int *argc, char ***argv, const struct my_option *longopts, my_get_one_option get_one_option) -+{ -+ return handle_options(argc, argv, longopts, get_one_option); -+} -+SYM_16(handle_options); -+ -+void symver16_my_print_help(const struct my_option *options) ++void symver16_my_make_scrambled_password(char *to, const char *password, size_t pass_len) +{ -+ return my_print_help(options); ++ my_make_scrambled_password(to, password, pass_len); +} -+SYM_16(my_print_help); ++SYM_16(my_make_scrambled_password); + -+C_MODE_END +#endif - -=== modified file 'sql-common/client.c' ---- sql-common/client.c revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ sql-common/client.c 2013-05-16 06:42:47 +0000 -@@ -4821,3 +4821,136 @@ static int clear_password_auth_client(MY +diff -rup old/sql-common/client.c new/sql-common/client.c +--- old/sql-common/client.c 2013-11-04 20:15:10.000000000 +0100 ++++ new/sql-common/client.c 2014-01-14 12:10:27.199377537 +0100 +@@ -4847,3 +4847,136 @@ static int clear_password_auth_client(MY return res ? CR_ERROR : CR_OK; } @@ -993,46 +958,3 @@ +SYM_16(mysql_store_result); + +#endif - -=== modified file 'sql/password.c' ---- sql/password.c revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ sql/password.c 2013-06-27 09:00:09 +0000 -@@ -584,3 +584,16 @@ void make_password_from_salt(char *to, c - 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 - -=== modified file 'sql/net_serv.cc' ---- sql/net_serv.cc revid:anil.toshniwal@oracle.com-20130507123124-75iqi1riiewnm0ab -+++ sql/net_serv.cc 2013-06-27 09:24:19 +0000 -@@ -1038,3 +1038,15 @@ void my_net_set_write_timeout(NET *net, - 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 --git a/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6.16-mysql-install.patch b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6.16-mysql-install.patch new file mode 100644 index 00000000..232687d3 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-5.6.16-mysql-install.patch @@ -0,0 +1,39 @@ +diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in +index 1fa5164..4aa49ca 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/rpm-fedora/mysql-systemd-start b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-systemd-start index 9cb2a25c..8670f889 100644 --- a/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-systemd-start +++ b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql-systemd-start @@ -8,10 +8,19 @@ # post mode : ping server until answer is received # +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 + echo $ret +} + 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=$(get_option mysqld datadir "/var/lib/mysql") + # Restore log, dir, perms and SELinux contexts [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 log=/var/log/mysqld.log @@ -35,9 +44,16 @@ pinger () { # Wait for ping to answer to signal startup completed, # might take a while in case of e.g. crash recovery # MySQL systemd service will timeout script if no answer + datadir=$(get_option mysqld datadir "/var/lib/mysql") + socket=$(get_option mysqld socket "$datadir/mysql.sock") + case $socket in + /*) adminsocket="$socket" ;; + *) adminsocket="$datadir/$socket" ;; + esac + while /bin/true ; do sleep 1 - mysqladmin ping >/dev/null 2>&1 && break + mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping >/dev/null 2>&1 && break done exit 0 } diff --git a/mysql-wsrep-5.6/packaging/rpm-fedora/mysql.spec.in b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql.spec.in index fd172551..f8bbd148 100644 --- a/mysql-wsrep-5.6/packaging/rpm-fedora/mysql.spec.in +++ b/mysql-wsrep-5.6/packaging/rpm-fedora/mysql.spec.in @@ -20,7 +20,6 @@ %global mysql_vendor Oracle and/or its affiliates %global mysqldatadir /var/lib/mysql -%global obs_ver @VERSION@ # By default, a build will include the bundeled "yaSSL" library for SSL. %{?with_ssl: %global ssl_option -DWITH_SSL=%{with_ssl}} @@ -28,7 +27,6 @@ # Regression tests may take a long time, override the default to skip them %{!?runselftest:%global runselftest 1} -%{!?without_systemd: %global systemd 1} %{!?with_debuginfo: %global nodebuginfo 1} %{!?product_suffix: %global product_suffix community} %{!?feature_set: %global feature_set community} @@ -36,15 +34,6 @@ %{!?compilation_comment_debug: %global compilation_comment_debug MySQL Community Server - Debug (GPL)} %{!?src_base: %global src_base mysql} -%if 0%{?fedora} > 18 -%global libmysqld_so_major 18 -%global libmysqld_so_long 18.1.0 -%else -%global libmysqld_so_major 0 -%global libmysqld_so_long 0.0.1 -%endif - - %global src_dir %{src_base}-%{version} # No debuginfo for now, ships /usr/sbin/mysqld-debug and libmysqlcliet-debug.a @@ -79,10 +68,9 @@ Source1: mysql-systemd-start Source2: mysqld.service Source3: mysql.conf Source4: my_config.h -Source5: mysql-embedded-check.c Source6: mysql_config.sh Patch0: mysql-5.6-libmysqlclient-symbols.patch -Patch1: mysql-5.6.14-mysql-install.patch +Patch1: mysql-5.6.16-mysql-install.patch BuildRequires: cmake BuildRequires: perl BuildRequires: time @@ -90,9 +78,7 @@ BuildRequires: libaio-devel BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: zlib-devel -%if 0%{?systemd} -BuildRequires: systemd-units -%endif +BuildRequires: systemd BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) # For rpm => 4.9 only: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering @@ -127,26 +113,23 @@ Requires: shadow-utils Requires: net-tools %if 0%{?commercial} Obsoletes: mysql-community-server < %{version}-%{release} -Requires: mysql-enterprise-client%{?_isa} = %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-client%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else Requires: mysql-community-client%{?_isa} = %{version}-%{release} Requires: mysql-community-common%{?_isa} = %{version}-%{release} %endif Obsoletes: mariadb-server -Obsoletes: community-mysql-server < %{obs_ver} -Obsoletes: mysql-server < %{obs_ver} +Obsoletes: mariadb-galera-server +Obsoletes: community-mysql-server < %{version}-%{release} +Obsoletes: mysql-server < %{version}-%{release} Provides: mysql-server = %{version}-%{release} Provides: mysql-server%{?_isa} = %{version}-%{release} -%if 0%{?systemd} +Provides: mysql-compat-server = %{version}-%{release} +Provides: mysql-compat-server%{?_isa} = %{version}-%{release} Requires(post): systemd Requires(preun): systemd Requires(postun): systemd -%else -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig -Requires(preun): /sbin/service -%endif %description server The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, @@ -174,13 +157,13 @@ Summary: MySQL database client applications and tools Group: Applications/Databases %if 0%{?commercial} Obsoletes: mysql-community-client < %{version}-%{release} -Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} %else Requires: mysql-community-libs%{?_isa} = %{version}-%{release} %endif Obsoletes: mariadb -Obsoletes: community-mysql < %{obs_ver} -Obsoletes: mysql < %{obs_ver} +Obsoletes: community-mysql < %{version}-%{release} +Obsoletes: mysql < %{version}-%{release} Provides: mysql = %{version}-%{release} Provides: mysql%{?_isa} = %{version}-%{release} @@ -188,15 +171,18 @@ Provides: mysql%{?_isa} = %{version}-%{release} This package contains the standard MySQL clients and administration tools. - %package common Summary: MySQL database common files for server and client libs Group: Applications/Databases %if 0%{?commercial} Obsoletes: mysql-community-common < %{version}-%{release} %endif -Obsoletes: community-mysql-common < %{obs_ver} -Obsoletes: mysql-common < %{obs_ver} +Obsoletes: mariadb-common +Obsoletes: mariadb-config +Obsoletes: mariadb-errmsg +Obsoletes: community-mysql-common < %{version}-%{release} +Obsoletes: community-mysql-errmsg < %{version}-%{release} +Obsoletes: mysql-common < %{version}-%{release} Provides: mysql-common = %{version}-%{release} Provides: mysql-common%{?_isa} = %{version}-%{release} @@ -209,14 +195,14 @@ MySQL database server, and MySQL embedded server. Summary: Test suite for the MySQL database server Group: Applications/Databases %if 0%{?commercial} -Requires: mysql-enterprise-server%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-server%{?_isa} = %{version}-%{release} Obsoletes: mysql-community-test < %{version}-%{release} %else Requires: mysql-community-server%{?_isa} = %{version}-%{release} %endif Obsoletes: mariadb-test -Obsoletes: community-mysql-test < %{obs_ver} -Obsoletes: mysql-test < %{obs_ver} +Obsoletes: community-mysql-test < %{version}-%{release} +Obsoletes: mysql-test < %{version}-%{release} Provides: mysql-test = %{version}-%{release} Provides: mysql-test%{?_isa} = %{version}-%{release} @@ -225,6 +211,25 @@ This package contains the MySQL regression test suite for MySQL database server. +%package bench +Summary: MySQL benchmark suite +Group: Applications/Databases +%if 0%{?commercial} +Obsoletes: mysql-community-bench < %{version}-%{release} +Requires: mysql-commercial-server%{?_isa} = %{version}-%{release} +%else +Requires: mysql-community-server%{?_isa} = %{version}-%{release} +%endif +Obsoletes: mariadb-bench +Obsoletes: community-mysql-bench < %{obs_ver} +Obsoletes: mysql-bench < %{obs_ver} +Provides: mysql-bench = %{version}-%{release} +Provides: mysql-bench%{?_isa} = %{version}-%{release} + +%description bench +This package contains the MySQL Benchmark Suite for MySQL database +server. + %package devel Summary: Development header files and libraries for MySQL database client applications Group: Applications/Databases @@ -249,13 +254,13 @@ Summary: Shared libraries for MySQL database client applications Group: Applications/Databases %if 0%{?commercial} Obsoletes: mysql-community-libs < %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else Requires: mysql-community-common%{?_isa} = %{version}-%{release} %endif Obsoletes: mariadb-libs -Obsoletes: community-mysql-libs < %{obs_ver} -Obsoletes: mysql-libs < %{obs_ver} +Obsoletes: community-mysql-libs < %{version}-%{release} +Obsoletes: mysql-libs < %{version}-%{release} Provides: mysql-libs = %{version}-%{release} Provides: mysql-libs%{?_isa} = %{version}-%{release} @@ -268,13 +273,13 @@ Summary: MySQL embedded library Group: Applications/Databases %if 0%{?commercial} Obsoletes: mysql-community-embedded < %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else Requires: mysql-community-common%{?_isa} = %{version}-%{release} %endif Obsoletes: mariadb-embedded -Obsoletes: community-mysql-embedded < %{obs_ver} -Obsoletes: mysql-embedded < %{obs_ver} +Obsoletes: community-mysql-embedded < %{version}-%{release} +Obsoletes: mysql-embedded < %{version}-%{release} Provides: mysql-embedded = %{version}-%{release} Provides: mysql-emdedded%{?_isa} = %{version}-%{release} @@ -295,30 +300,27 @@ Summary: Development header files and libraries for MySQL as an embeddabl Group: Applications/Databases %if 0%{?commercial} Obsoletes: mysql-community-embedded-devel < %{version}-%{release} -Requires: mysql-enterprise-devel%{?_isa} = %{version}-%{release} -Requires: mysql-enterprise-embedded%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-devel%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-embedded%{?_isa} = %{version}-%{release} %else Requires: mysql-community-devel%{?_isa} = %{version}-%{release} Requires: mysql-community-embedded%{?_isa} = %{version}-%{release} %endif Obsoletes: mariadb-embedded-devel -Obsoletes: community-mysql-embedded-devel < %{obs_ver} -Obsoletes: mysql-embedded-devel < %{obs_ver} +Obsoletes: community-mysql-embedded-devel < %{version}-%{release} +Obsoletes: mysql-embedded-devel < %{version}-%{release} Provides: mysql-embedded-devel = %{version}-%{release} Provides: mysql-embedded-devel%{?_isa} = %{version}-%{release} %description embedded-devel -This package contains files needed for developing applicatison using +This package contains files needed for developing applications using the embedded version of the MySQL server. %prep -%setup -T -a 0 -c -n %{src_dir} +%setup -q -T -a 0 -c -n %{src_dir} pushd %{src_dir} +%patch0 -p1 %patch1 -p1 -popd -cp -a %{src_dir} %{src_dir}-client -pushd %{src_dir}-client -%patch0 %build # Fail quickly and obviously if user tries to build as root @@ -331,26 +333,26 @@ if [ "x$(id -u)" = "x0" ] ; then fi %endif -export CFLAGS="%{optflags}" -export CXXFLAGS="%{optflags}" -export LDFLAGS="%{__global_ldflags}" - # Build debug versions of mysqld and libmysqld.a mkdir debug ( cd debug # Attempt to remove any optimisation flags from the debug build - CFLAGS=$(echo "${CFLAGS}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /') - CXXFLAGS=$(echo "${CFLAGS}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /') + optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /') cmake ../%{src_dir} \ -DBUILD_CONFIG=mysql_release \ -DINSTALL_LAYOUT=RPM \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_FLAGS="$optflags" \ + -DCMAKE_CXX_FLAGS="$optflags" \ -DWITH_INNODB_MEMCACHED=1 \ -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_debug}" \ -DMYSQL_SERVER_SUFFIX="%{?server_suffix}" @@ -366,54 +368,21 @@ mkdir release -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=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 - - - # Need to build libmysqld.so for distros - mkdir libmysqld/work - pushd libmysqld/work - - ar -x ../libmysqld.a - ar -x ../../extra/yassl/libyassl.a - %{__cc} $CFLAGS $LDFLAGS -DEMBEDDED_LIBRARY -shared -Wl,-soname,libmysqld.so.%{libmysqld_so_major} \ - -o libmysqld.so.%{libmysqld_so_long} *.o \ - -lpthread -laio -lcrypt -lssl -lcrypto -lz -lrt -lstdc++ -ldl -lm -lc - # Compile check - cp %{SOURCE5} . - ln -s libmysqld.so.%{libmysqld_so_long} libmysqld.so.%{libmysqld_so_major} - %{__cc} -I../../../mysql-%{version}/include -I../../include $CFLAGS \ - mysql-embedded-check.c libmysqld.so.%{libmysqld_so_major} - LD_LIBRARY_PATH=. ldd ./a.out -) - -# -mkdir client -( - pushd client - cmake ../%{src_dir}-client \ - -DBUILD_CONFIG=mysql_release \ - -DINSTALL_LAYOUT=RPM \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DWITH_INNODB_MEMCACHED=1 \ - -DINSTALL_LIBDIR="%{_lib}/mysql" \ - -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ - -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ - -DFEATURE_SET="%{feature_set}" \ - %{?ssl_option} \ - -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ - -DWITH_EMBEDDED_SERVER=ON \ - -DMYSQL_SERVER_SUFFIX="%{?server_suffix}" - echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG - make %{?_smp_mflags} VERBOSE=1 ) %install @@ -429,28 +398,18 @@ pushd $MBD/release make DESTDIR=%{buildroot} install popd -# Install modified client libs -rm -rf %{buildroot}%{_libdir}/mysql/libmysqlclient* -pushd $MBD/client/libmysql -make DESTDIR=%{buildroot} install -popd - # Install logrotate and autostart install -D -m 0644 $MBD/release/support-files/mysql-log-rotate %{buildroot}%{_sysconfdir}/logrotate.d/mysql install -D -m 0644 $MBD/release/packaging/rpm-fedora/my.cnf %{buildroot}%{_sysconfdir}/my.cnf +install -d %{buildroot}%{_sysconfdir}/my.cnf.d install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/mysql-systemd-start install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/mysqld.service install -D -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/tmpfiles.d/mysql.conf -# Make library links and fix _r symlinks +# 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 -install -m 0755 $MBD/release/libmysqld/work/libmysqld.so.%{libmysqld_so_long} \ - %{buildroot}%{_libdir}/mysql/libmysqld.so.%{libmysqld_so_long} -ln -s libmysqld.so.%{libmysqld_so_long} %{buildroot}%{_libdir}/mysql/libmysqld.so.%{libmysqld_so_major} -ln -s libmysqld.so.%{libmysqld_so_long} %{buildroot}%{_libdir}/mysql/libmysqld.so - # multiarch support %ifarch %{multiarchs} mv %{buildroot}/%{_includedir}/mysql/my_config.h \ @@ -484,8 +443,9 @@ pushd mysql-test ./mtr \ --mem --parallel=auto --force --retry=0 \ --mysqld=--binlog-format=mixed \ - --suite-timeout=720 --testcase-timeout=30 -rm -rf var/* + --suite-timeout=720 --testcase-timeout=30 \ + --clean-vardir +rm -r $(readlink var) var %endif %pre server @@ -495,34 +455,16 @@ rm -rf var/* %post server datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p') -/bin/chmod 0755 "$datadir" -/bin/touch /var/log/mysqld.log -%if 0%{?systemd} +/bin/chmod 0755 "$datadir" >/dev/null 2>&1 || : +/bin/touch /var/log/mysqld.log >/dev/null 2>&1 || : %systemd_post mysqld.service -/sbin/service mysqld enable >/dev/null 2>&1 || : -%else -/sbin/chkconfig --add mysqld -/usr/bin/mysql_install_db --datadir="$datadir" --user=mysql >/dev/null 2>&1 || : -%endif +/usr/bin/systemctl enable mysqld >/dev/null 2>&1 || : %preun server -%if 0%{?systemd} %systemd_preun mysqld.service -%else -if [ "$1" = 0 ]; then - /sbin/service mysqld stop >/dev/null 2>&1 || : - /sbin/chkconfig --del mysqld -fi -%endif %postun server -%if 0%{?systemd} %systemd_postun_with_restart mysqld.service -%else -if [ $1 -ge 1 ]; then - /sbin/service mysqld condrestart >/dev/null 2>&1 || : -fi -%endif %post libs -p /sbin/ldconfig @@ -557,7 +499,6 @@ fi %attr(644, root, root) %{_mandir}/man1/mysqlhotcopy.1* %attr(644, root, root) %{_mandir}/man1/mysqlman.1* %attr(644, root, root) %{_mandir}/man1/mysql.server.1* -%attr(644, root, root) %{_mandir}/man1/mysqltest.1* %attr(644, root, root) %{_mandir}/man1/mysql_tzinfo_to_sql.1* %attr(644, root, root) %{_mandir}/man1/mysql_zap.1* %attr(644, root, root) %{_mandir}/man1/mysqlbug.1* @@ -567,6 +508,7 @@ fi %attr(644, root, root) %{_mandir}/man1/resolveip.1* %config(noreplace) %{_sysconfdir}/my.cnf +%dir %{_sysconfdir}/my.cnf.d %attr(755, root, root) %{_bindir}/innochecksum %attr(755, root, root) %{_bindir}/my_print_defaults @@ -587,7 +529,6 @@ fi %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 @@ -597,7 +538,24 @@ fi %attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_sbindir}/mysqld-debug -%{_libdir}/mysql/plugin +%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 +%dir %{_libdir}/mysql/plugin/debug +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so +%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/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 %attr(644, root, root) %{_datadir}/mysql/fill_help_tables.sql %attr(644, root, root) %{_datadir}/mysql/mysql_system_tables.sql @@ -612,17 +570,14 @@ fi %attr(644, root, root) %{_datadir}/mysql/innodb_memcached_config.sql %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 -%else -%attr(755, root, root) %{_sysconfdir}/init.d/mysqld -%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/mysqld %files common %defattr(-, root, root, -) +%doc %{?license_files_server} %{_datadir}/mysql/charsets/ %{_datadir}/mysql/errmsg-utf8.txt %{_datadir}/mysql/bulgarian/ @@ -652,10 +607,9 @@ fi %files client %defattr(-, root, root, -) +%doc %{?license_files_server} %attr(755, root, root) %{_bindir}/msql2mysql %attr(755, root, root) %{_bindir}/mysql -%attr(755, root, root) %{_bindir}/mysql_config -%attr(755, root, root) %{_bindir}/mysql_config-%{__isa_bits} %attr(755, root, root) %{_bindir}/mysql_find_rows %attr(755, root, root) %{_bindir}/mysql_waitpid %attr(755, root, root) %{_bindir}/mysqlaccess @@ -668,6 +622,8 @@ fi %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 +%attr(755, root, root) %{_bindir}/mysql_config-%{__isa_bits} %attr(755, root, root) %{_bindir}/mysql_config_editor %attr(644, root, root) %{_mandir}/man1/msql2mysql.1* @@ -686,10 +642,11 @@ fi %files devel %defattr(-, root, root, -) -%attr(755, root, root) %{_bindir}/mysql_config -%attr(755, root, root) %{_bindir}/mysql_config-%{__isa_bits} +%doc %{?license_files_server} %attr(644, root, root) %{_mandir}/man1/comp_err.1* %attr(644, root, root) %{_mandir}/man1/mysql_config.1* +%attr(755, root, root) %{_bindir}/mysql_config +%attr(755, root, root) %{_bindir}/mysql_config-%{__isa_bits} %{_includedir}/mysql %{_datadir}/aclocal/mysql.m4 %{_libdir}/mysql/libmysqlclient.a @@ -700,35 +657,85 @@ fi %files libs %defattr(-, root, root, -) +%doc %{?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.* -%{_libdir}/mysql/libmysqlclient_r.so.* +%{_libdir}/mysql/libmysqlclient.so.18* +%{_libdir}/mysql/libmysqlclient_r.so.18* %files test %defattr(-, root, root, -) +%doc %{?license_files_server} %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 %attr(755, root, root) %{_bindir}/mysqltest_embedded + +%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so +%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini +%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so + %attr(644, root, root) %{_mandir}/man1/mysql_client_test.1* %attr(644, root, root) %{_mandir}/man1/mysql-stress-test.pl.1* %attr(644, root, root) %{_mandir}/man1/mysql-test-run.pl.1* %attr(644, root, root) %{_mandir}/man1/mysql_client_test_embedded.1* +%attr(644, root, root) %{_mandir}/man1/mysqltest.1* %attr(644, root, root) %{_mandir}/man1/mysqltest_embedded.1* +%files bench +%defattr(-, root, root, -) +%doc %{?license_files_server} +%{_datadir}/sql-bench + %files embedded %defattr(-, root, root, -) +%doc %{?license_files_server} +%dir %attr(755, root, root) %{_libdir}/mysql %attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf %attr(755, root, root) %{_libdir}/mysql/libmysqld.so.* %files embedded-devel %defattr(-, root, root, -) +%doc %{?license_files_server} %attr(644, root, root) %{_libdir}/mysql/libmysqld.a %attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a %attr(755, root, root) %{_libdir}/mysql/libmysqld.so %changelog +* Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.22-1 +- Add license info in each subpackage +- Remove systemd conditional +- Various clean up +- Add support for Fedora 21 +- Update to 5.6.22 + +* Wed Aug 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.21-1 +- Updated to 5.6.21 + +* Tue Jul 22 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.20-3 +- Provide mysql-compat-server dependencies + +* Thu Jul 10 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.20-2 +- Remove dtrace dependencies + +* Wed Jun 25 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.20-1 +- Add bench package + +* Fri Feb 07 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.17-1 +- 5.6.17 +- Enable shared libmysqld by cmake option + * Thu Jan 09 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.16-1 - Updated to 5.6.16 @@ -858,7 +865,7 @@ fi * 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}". +- Replace "/var/lib/mysql" by the spec file variable "%%{mysqldatadir}". * Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com> @@ -1118,7 +1125,7 @@ fi * Thu Nov 30 2006 Joerg Bruehe <joerg@mysql.com> -- Call "make install" using "benchdir_root=%{_datadir}", +- 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> @@ -1235,7 +1242,7 @@ fi - 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" +- Fixed %%packager name to "MySQL Production Engineering Team" * Mon Dec 05 2005 Joerg Bruehe <joerg@mysql.com> @@ -1292,7 +1299,7 @@ fi * 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> diff --git a/mysql-wsrep-5.6/packaging/rpm-oel/CMakeLists.txt b/mysql-wsrep-5.6/packaging/rpm-oel/CMakeLists.txt index bdc61c72..252573e8 100644 --- a/mysql-wsrep-5.6/packaging/rpm-oel/CMakeLists.txt +++ b/mysql-wsrep-5.6/packaging/rpm-oel/CMakeLists.txt @@ -28,9 +28,9 @@ IF(UNIX) FOREACH(fedfile my.cnf my_config.h mysql_config.sh mysqld.service mysql-systemd-start mysql.conf - mysql-5.6.14-mysql-install.patch + mysql-5.6.16-mysql-install.patch mysql.init filter-requires.sh filter-provides.sh - mysql-embedded-check.c mysql.init) + mysql-5.6-libmysqlclient-symbols.patch) CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY) ENDFOREACH() ENDIF() diff --git a/mysql-wsrep-5.6/packaging/rpm-oel/filter-requires.sh b/mysql-wsrep-5.6/packaging/rpm-oel/filter-requires.sh index 521eb0ca..3fdf4387 100755 --- a/mysql-wsrep-5.6/packaging/rpm-oel/filter-requires.sh +++ b/mysql-wsrep-5.6/packaging/rpm-oel/filter-requires.sh @@ -2,5 +2,5 @@ # /usr/lib/rpm/perl.req $* | -sed -e '/perl(hostnames)/d' -e '/perl(lib::mtr.*/d' -e '/perl(lib::v1.*/d' -e '/perl(mtr_.*/d' -e '/perl(My::.*/d' +sed -e '/perl(GD)/d' -e '/perl(hostnames)/d' -e '/perl(lib::mtr.*/d' -e '/perl(lib::v1.*/d' -e '/perl(mtr_.*/d' -e '/perl(My::.*/d' diff --git a/mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6-libmysqlclient-symbols.patch b/mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6-libmysqlclient-symbols.patch new file mode 100644 index 00000000..e16e65a0 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6-libmysqlclient-symbols.patch @@ -0,0 +1,960 @@ +diff -rup old/libmysql/libmysql.c new/libmysql/libmysql.c +--- old/libmysql/libmysql.c 2013-11-04 20:15:10.000000000 +0100 ++++ new/libmysql/libmysql.c 2014-01-14 12:10:27.148374504 +0100 +@@ -4898,3 +4898,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-04 20:15:10.000000000 +0100 ++++ new/libmysql/libmysql.ver.in 2014-01-14 12:10:27.148374504 +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-04 20:15:10.000000000 +0100 ++++ new/mysys/charset.c 2014-01-14 12:10:27.197377417 +0100 +@@ -1040,3 +1040,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-04 20:15:10.000000000 +0100 ++++ new/sql/net_serv.cc 2014-01-14 12:10:27.252380688 +0100 +@@ -1047,3 +1047,15 @@ void my_net_set_write_timeout(NET *net, + 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-04 20:15:10.000000000 +0100 ++++ new/sql/password.c 2014-01-14 12:10:27.309384078 +0100 +@@ -584,3 +584,16 @@ void make_password_from_salt(char *to, c + 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-04 20:15:10.000000000 +0100 ++++ new/sql-common/client.c 2014-01-14 12:10:27.199377537 +0100 +@@ -4847,3 +4847,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-oel/mysql-5.6.16-mysql-install.patch b/mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6.16-mysql-install.patch new file mode 100644 index 00000000..232687d3 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-oel/mysql-5.6.16-mysql-install.patch @@ -0,0 +1,39 @@ +diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in +index 1fa5164..4aa49ca 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/rpm-oel/mysql-systemd-start b/mysql-wsrep-5.6/packaging/rpm-oel/mysql-systemd-start index 9cb2a25c..8670f889 100644 --- a/mysql-wsrep-5.6/packaging/rpm-oel/mysql-systemd-start +++ b/mysql-wsrep-5.6/packaging/rpm-oel/mysql-systemd-start @@ -8,10 +8,19 @@ # post mode : ping server until answer is received # +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 + echo $ret +} + 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=$(get_option mysqld datadir "/var/lib/mysql") + # Restore log, dir, perms and SELinux contexts [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 log=/var/log/mysqld.log @@ -35,9 +44,16 @@ pinger () { # Wait for ping to answer to signal startup completed, # might take a while in case of e.g. crash recovery # MySQL systemd service will timeout script if no answer + datadir=$(get_option mysqld datadir "/var/lib/mysql") + socket=$(get_option mysqld socket "$datadir/mysql.sock") + case $socket in + /*) adminsocket="$socket" ;; + *) adminsocket="$datadir/$socket" ;; + esac + while /bin/true ; do sleep 1 - mysqladmin ping >/dev/null 2>&1 && break + mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping >/dev/null 2>&1 && break done exit 0 } diff --git a/mysql-wsrep-5.6/packaging/rpm-oel/mysql.init b/mysql-wsrep-5.6/packaging/rpm-oel/mysql.init index d6f8f023..79c8a8da 100644 --- a/mysql-wsrep-5.6/packaging/rpm-oel/mysql.init +++ b/mysql-wsrep-5.6/packaging/rpm-oel/mysql.init @@ -50,11 +50,15 @@ errlogfile="$result" get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid" mypidfile="$result" +case $socketfile in + /*) adminsocket="$socketfile" ;; + *) adminsocket="$datadir/$socketfile" ;; +esac 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` + RESPONSE=$(/usr/bin/mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping 2>&1) if [ $? = 0 ]; then # already running, do nothing action $"Starting $prog: " /bin/true @@ -107,7 +111,7 @@ start(){ ret=0 TIMEOUT="$STARTTIMEOUT" while [ $TIMEOUT -gt 0 ]; do - RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` && break + RESPONSE=$(/usr/bin/mysqladmin --no-defaults --socket="$adminsocket" --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." diff --git a/mysql-wsrep-5.6/packaging/rpm-oel/mysql.spec.in b/mysql-wsrep-5.6/packaging/rpm-oel/mysql.spec.in index 8ee53214..f14e7540 100644 --- a/mysql-wsrep-5.6/packaging/rpm-oel/mysql.spec.in +++ b/mysql-wsrep-5.6/packaging/rpm-oel/mysql.spec.in @@ -30,6 +30,7 @@ %{!?runselftest:%global runselftest 0} %{!?with_systemd: %global systemd 0} +%{?el7: %global systemd 1} %{!?with_debuginfo: %global nodebuginfo 1} %{!?product_suffix: %global product_suffix community} %{!?feature_set: %global feature_set community} @@ -37,9 +38,6 @@ %{!?compilation_comment_debug: %global compilation_comment_debug MySQL Community Server - Debug (GPL)} %{!?src_base: %global src_base mysql} -%global libmysqld_so_major 0 -%global libmysqld_so_long 0.0.1 - # Version for compat libs %if 0%{?rhel} == 5 %global compatver 5.0.96 @@ -66,7 +64,7 @@ %endif %endif -%global src_dir %{src_base}-@VERSION@ +%global src_dir %{src_base}-%{version} # No debuginfo for now, ships /usr/sbin/mysqld-debug and libmysqlcliet-debug.a %if 0%{?nodebuginfo} @@ -83,12 +81,11 @@ %global license_type GPLv2 %endif - Name: mysql-%{product_suffix} Summary: A very fast and reliable SQL database server Group: Applications/Databases Version: @VERSION@ -Release: 1%{?dist} +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. Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz URL: http://www.mysql.com/ @@ -99,26 +96,36 @@ Source2: mysqld.service Source3: mysql.conf Source4: my_config.h Source5: mysql_config.sh -Source6: mysql-embedded-check.c +%if 0%{?compatlib} Source7: %{compatsrc} +%endif Source90: filter-provides.sh Source91: filter-requires.sh -Patch0: mysql-5.6.14-mysql-install.patch +Patch0: mysql-5.6.16-mysql-install.patch +Patch1: mysql-5.6-libmysqlclient-symbols.patch BuildRequires: cmake BuildRequires: perl +%{?el7:BuildRequires: perl(Time::HiRes)} +%{?el7:BuildRequires: perl(Env)} BuildRequires: time BuildRequires: libaio-devel BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: zlib-devel %if 0%{?systemd} -BuildRequires: systemd-units +BuildRequires: systemd %endif BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +%if 0%{?rhel} > 6 +# 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)$ +%else # https://fedoraproject.org/wiki/EPEL:Packaging#Generic_Filtering_on_EPEL6 %global __perl_provides %{SOURCE90} %global __perl_requires %{SOURCE91} +%endif %description The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, @@ -147,16 +154,24 @@ Requires: procps Requires: shadow-utils Requires: net-tools %if 0%{?commercial} +Provides: MySQL-server-advanced%{?_isa} = %{version}-%{release} +Obsoletes: MySQL-server-advanced < %{version}-%{release} Obsoletes: mysql-community-server < %{version}-%{release} -Requires: mysql-enterprise-client%{?_isa} = %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-client%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else +Provides: MySQL-server%{?_isa} = %{version}-%{release} Requires: mysql-community-client%{?_isa} = %{version}-%{release} Requires: mysql-community-common%{?_isa} = %{version}-%{release} %endif +Obsoletes: MySQL-server < %{version}-%{release} Obsoletes: mysql-server < %{version}-%{release} +Obsoletes: mariadb-server +Obsoletes: mariadb-galera-server Provides: mysql-server = %{version}-%{release} Provides: mysql-server%{?_isa} = %{version}-%{release} +Provides: mysql-compat-server = %{version}-%{release} +Provides: mysql-compat-server%{?_isa} = %{version}-%{release} %if 0%{?systemd} Requires(post): systemd Requires(preun): systemd @@ -192,14 +207,21 @@ to run and administer a MySQL server. Summary: MySQL database client applications and tools Group: Applications/Databases %if 0%{?commercial} +Provides: MySQL-client-advanced%{?_isa} = %{version}-%{release} +Obsoletes: MySQL-client-advanced < %{version}-%{release} Obsoletes: mysql-community-client < %{version}-%{release} -Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} %else +Provides: MySQL-client%{?_isa} = %{version}-%{release} Requires: mysql-community-libs%{?_isa} = %{version}-%{release} %endif +Obsoletes: MySQL-client < %{version}-%{release} +Obsoletes: mariadb +%if 0%{?rhel} > 5 Obsoletes: mysql < %{version}-%{release} Provides: mysql = %{version}-%{release} Provides: mysql%{?_isa} = %{version}-%{release} +%endif %description client This package contains the standard MySQL clients and administration @@ -213,6 +235,7 @@ Obsoletes: mysql-community-common < %{version}-%{release} %endif Provides: mysql-common = %{version}-%{release} Provides: mysql-common%{?_isa} = %{version}-%{release} +%{?el5:Requires: mysql%{?_isa} = %{version}-%{release}} %description common This packages contains common files needed by MySQL client library, @@ -223,31 +246,59 @@ MySQL database server, and MySQL embedded server. Summary: Test suite for the MySQL database server Group: Applications/Databases %if 0%{?commercial} +Provides: MySQL-test-advanced%{?_isa} = %{version}-%{release} +Obsoletes: MySQL-test-advanced < %{version}-%{release} Obsoletes: mysql-community-test < %{version}-%{release} -Requires: mysql-enterprise-server%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-server%{?_isa} = %{version}-%{release} %else +Provides: MySQL-test%{?_isa} = %{version}-%{release} Requires: mysql-community-server%{?_isa} = %{version}-%{release} %endif +Obsoletes: MySQL-test < %{version}-%{release} Obsoletes: mysql-test < %{version}-%{release} +Obsoletes: mariadb-test Provides: mysql-test = %{version}-%{release} Provides: mysql-test%{?_isa} = %{version}-%{release} - %description test This package contains the MySQL regression test suite for MySQL database server. +%package bench +Summary: MySQL benchmark suite +Group: Applications/Databases +%if 0%{?commercial} +Obsoletes: mysql-community-bench < %{version}-%{release} +Requires: mysql-commercial-server%{?_isa} = %{version}-%{release} +%else +Requires: mysql-community-server%{?_isa} = %{version}-%{release} +%endif +Obsoletes: mariadb-bench +Obsoletes: community-mysql-bench < %{version}-%{release} +Obsoletes: mysql-bench < %{version}-%{release} +Provides: mysql-bench = %{version}-%{release} +Provides: mysql-bench%{?_isa} = %{version}-%{release} + +%description bench +This package contains the MySQL Benchmark Suite for MySQL database +server. + %package devel Summary: Development header files and libraries for MySQL database client applications Group: Applications/Databases %if 0%{?commercial} +Provides: MySQL-devel-advanced%{?_isa} = %{version}-%{release} +Obsoletes: MySQL-devel-advanced < %{version}-%{release} Obsoletes: mysql-community-devel < %{version}-%{release} -Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} %else +Provides: MySQL-devel%{?_isa} = %{version}-%{release} Requires: mysql-community-libs%{?_isa} = %{version}-%{release} %endif +Obsoletes: MySQL-devel < %{version}-%{release} Obsoletes: mysql-devel < %{version}-%{release} +Obsoletes: mariadb-devel Provides: mysql-devel = %{version}-%{release} Provides: mysql-devel%{?_isa} = %{version}-%{release} @@ -259,12 +310,17 @@ to develop MySQL client applications. Summary: Shared libraries for MySQL database client applications Group: Applications/Databases %if 0%{?commercial} +Provides: MySQL-shared-advanced%{?_isa} = %{version}-%{release} +Obsoletes: MySQL-shared-advanced < %{version}-%{release} Obsoletes: mysql-community-libs < %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else +Provides: MySQL-shared%{?_isa} = %{version}-%{release} Requires: mysql-community-common%{?_isa} = %{version}-%{release} %endif +Obsoletes: MySQL-shared < %{version}-%{release} Obsoletes: mysql-libs < %{version}-%{release} +Obsoletes: mariadb-libs Provides: mysql-libs = %{version}-%{release} Provides: mysql-libs%{?_isa} = %{version}-%{release} @@ -272,32 +328,52 @@ Provides: mysql-libs%{?_isa} = %{version}-%{release} This package contains the shared libraries for MySQL client applications. +%if 0%{?compatlib} %package libs-compat -Summary: Shared compat libraries for MySQL 5.1 database client applications +Summary: Shared compat libraries for MySQL %{compatver} database client applications Group: Applications/Databases Obsoletes: mysql-libs-compat < %{version}-%{release} Provides: mysql-libs-compat = %{version}-%{release} Provides: mysql-libs-compat%{?_isa} = %{version}-%{release} +%if 0%{?commercial} +Provides: MySQL-shared-compat-advanced%{?_isa} = %{version}-%{release} +Obsoletes: MySQL-shared-compat-advanced < %{version}-%{release} +Obsoletes: mysql-community-libs-compat < %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} +%else +Provides: MySQL-shared-compat%{?_isa} = %{version}-%{release} +Requires: mysql-community-libs%{?_isa} = %{version}-%{release} +%endif +Obsoletes: MySQL-shared-compat < %{version}-%{release} +%if 0%{?rhel} > 5 +Obsoletes: mysql-libs < %{version}-%{release} +%endif %description libs-compat -This package contains the shared compat libraries for MySQL 5.1 client +This package contains the shared compat libraries for MySQL %{compatver} client applications. +%endif %package embedded Summary: MySQL embedded library Group: Applications/Databases %if 0%{?commercial} +Provides: MySQL-embedded-advanced%{?_isa} = %{version}-%{release} +Obsoletes: MySQL-embedded-advanced < %{version}-%{release} Obsoletes: mysql-community-embedded < %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else +Provides: MySQL-embedded%{?_isa} = %{version}-%{release} Requires: mysql-community-common%{?_isa} = %{version}-%{release} %endif +Obsoletes: mariadb-embedded +Obsoletes: MySQL-embedded < %{version}-%{release} Obsoletes: mysql-embedded < %{version}-%{release} Provides: mysql-embedded = %{version}-%{release} Provides: mysql-emdedded%{?_isa} = %{version}-%{release} %description embedded -This package contains the mysql server as an embedded library. +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 @@ -313,24 +389,52 @@ Summary: Development header files and libraries for MySQL as an embeddabl Group: Applications/Databases %if 0%{?commercial} Obsoletes: mysql-community-embedded-devel < %{version}-%{release} -Requires: mysql-enterprise-devel%{?_isa} = %{version}-%{release} -Requires: mysql-enterprise-embedded%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-devel%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-embedded%{?_isa} = %{version}-%{release} %else Requires: mysql-community-devel%{?_isa} = %{version}-%{release} Requires: mysql-community-embedded%{?_isa} = %{version}-%{release} %endif +Obsoletes: mariadb-embedded-devel Obsoletes: mysql-embedded-devel < %{version}-%{release} Provides: mysql-embedded-devel = %{version}-%{release} Provides: mysql-embedded-devel%{?_isa} = %{version}-%{release} %description embedded-devel -This package contains files needed for developing applicatison using +This package contains files needed for developing applications using the embedded version of the MySQL server. +%if 0%{?rhel} == 5 +%package -n mysql +Summary: Convenience package for easy upgrades of MySQL package set +Group: Applications/Databases +%if 0%{?commercial} +Requires: mysql-commercial-client%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs-compat%{?_isa} = %{version}-%{release} +%else +Requires: mysql-community-client%{?_isa} = %{version}-%{release} +Requires: mysql-community-libs%{?_isa} = %{version}-%{release} +Requires: mysql-community-libs-compat%{?_isa} = %{version}-%{release} +%endif + +%description -n mysql +This package has as sole purpose to require other MySQL packages such +that upgrades will be more convenient. + +Technical background: this is done to reflect the fact that mysql +package has been split into several subpackages. +%endif + %prep +%if 0%{?compatlib} %setup -q -T -a 0 -a 7 -c -n %{src_dir} -cd %{src_dir} +%else +%setup -q -T -a 0 -c -n %{src_dir} +%endif # 0%{?compatlib} +pushd %{src_dir} %patch0 -p1 +%{?el7:%patch1 -p1} %build # Fail quickly and obviously if user tries to build as root @@ -343,6 +447,7 @@ if [ "x$(id -u)" = "x0" ] ; then fi %endif +%if 0%{?compatlib} # Build compat libs ( export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv" @@ -367,7 +472,8 @@ pushd mysql-%{compatver} --with-plugin-innobase \ --with-plugin-innodb_plugin \ --with-plugin-partition \ -%else +%endif +%if 0%{?rhel} == 5 --with-openssl \ --with-bench \ -with-innodb \ @@ -380,26 +486,28 @@ pushd mysql-%{compatver} make %{?_smp_mflags} popd ) - -export CFLAGS="%{optflags}" -export CXXFLAGS="%{optflags}" +%endif # 0%{?compatlib} # Build debug versions of mysqld and libmysqld.a mkdir debug ( cd debug # Attempt to remove any optimisation flags from the debug build - CFLAGS=$(echo "${CFLAGS}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /') - CXXFLAGS=$(echo "${CFLAGS}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /') + optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /') cmake ../%{src_dir} \ -DBUILD_CONFIG=mysql_release \ -DINSTALL_LAYOUT=RPM \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_FLAGS="$optflags" \ + -DCMAKE_CXX_FLAGS="$optflags" \ -DWITH_INNODB_MEMCACHED=1 \ -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_debug}" \ -DMYSQL_SERVER_SUFFIX="%{?server_suffix}" @@ -415,37 +523,25 @@ mkdir release -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=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 - -# Need to build libmysqld.so for distros -mkdir libmysqld/work -pushd libmysqld/work - -ar -x ../libmysqld.a -[ -e ../../extra/yassl/libyassl.a ] && ar -x ../../extra/yassl/libyassl.a - -%{__cc} $CFLAGS $LDFLAGS -DEMBEDDED_LIBRARY -shared -Wl,-soname,libmysqld.so.%{libmysqld_so_major} \ - -o libmysqld.so.%{libmysqld_so_long} *.o \ - -lpthread -laio -lcrypt -lssl -lcrypto -lz -lrt -lstdc++ -ldl -lm -lc - -# Compile check -cp %{SOURCE6} . -ln -s libmysqld.so.%{libmysqld_so_long} libmysqld.so.%{libmysqld_so_major} -%{__cc} -I../../../%{src_dir}/include -I../../include $CFLAGS \ - mysql-embedded-check.c libmysqld.so.%{libmysqld_so_major} -LD_LIBRARY_PATH=. ldd ./a.out ) %install +%if 0%{?compatlib} # Install compat libs for dir in libmysql libmysql_r ; do pushd mysql-%{compatver}/$dir @@ -453,6 +549,7 @@ for dir in libmysql libmysql_r ; do popd done rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient{,_r}.{a,la,so} +%endif # 0%{?compatlib} MBD=$RPM_BUILD_DIR/%{src_dir} @@ -468,6 +565,7 @@ make DESTDIR=%{buildroot} install # Install logrotate and autostart install -D -m 0644 $MBD/release/support-files/mysql-log-rotate %{buildroot}%{_sysconfdir}/logrotate.d/mysql install -D -m 0644 $MBD/release/packaging/rpm-oel/my.cnf %{buildroot}%{_sysconfdir}/my.cnf +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 @@ -476,13 +574,7 @@ install -D -m 0755 $MBD/release/packaging/rpm-oel/mysql.init %{buildroot}%{_sysc %endif install -D -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/tmpfiles.d/mysql.conf -install -m 0755 $MBD/release/libmysqld/work/libmysqld.so.%{libmysqld_so_long} \ - %{buildroot}%{_libdir}/mysql/libmysqld.so.%{libmysqld_so_long} -ln -s libmysqld.so.%{libmysqld_so_long} %{buildroot}%{_libdir}/mysql/libmysqld.so.%{libmysqld_so_major} -ln -s libmysqld.so.%{libmysqld_so_long} %{buildroot}%{_libdir}/mysql/libmysqld.so - - -# Make library links +# 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 @@ -521,8 +613,9 @@ pushd mysql-test ./mtr \ --mem --parallel=auto --force --retry=0 \ --mysqld=--binlog-format=mixed \ - --suite-timeout=720 --testcase-timeout=30 -rm -rf var/* + --suite-timeout=720 --testcase-timeout=30 \ + --clean-vardir +rm -r $(readlink var) var %endif %pre server @@ -532,11 +625,11 @@ rm -rf var/* %post server datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p') -/bin/chmod 0755 "$datadir" -/bin/touch /var/log/mysqld.log +/bin/chmod 0755 "$datadir" >/dev/null 2>&1 || : +/bin/touch /var/log/mysqld.log >/dev/null 2>&1 || : %if 0%{?systemd} %systemd_post mysqld.service -/sbin/service mysqld enable >/dev/null 2>&1 || : +/usr/bin/systemctl enable mysqld >/dev/null 2>&1 || : %else /sbin/chkconfig --add mysqld %endif @@ -564,9 +657,11 @@ fi %postun libs -p /sbin/ldconfig +%if 0%{?compatlib} %post libs-compat -p /sbin/ldconfig %postun libs-compat -p /sbin/ldconfig +%endif %post embedded -p /sbin/ldconfig @@ -607,6 +702,7 @@ fi %attr(644, root, root) %{_mandir}/man1/resolveip.1* %config(noreplace) %{_sysconfdir}/my.cnf +%dir %{_sysconfdir}/my.cnf.d %attr(755, root, root) %{_bindir}/innochecksum %attr(755, root, root) %{_bindir}/my_print_defaults @@ -638,8 +734,49 @@ fi %attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_sbindir}/mysqld-debug -%{_libdir}/mysql/plugin +%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 +%dir %{_libdir}/mysql/plugin/debug +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so +%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/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 + +%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so +%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini +%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so +%if 0%{?commercial} +%attr(755, root, root) %{_libdir}/mysql/plugin/audit_log.so +%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/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 +%endif %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 @@ -654,7 +791,7 @@ 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}/mysql.service +%attr(644, root, root) %{_unitdir}/mysqld.service %else %attr(755, root, root) %{_sysconfdir}/init.d/mysqld %endif @@ -664,6 +801,7 @@ fi %files common %defattr(-, root, root, -) +%doc %{?license_files_server} %{_datadir}/mysql/charsets/ %{_datadir}/mysql/errmsg-utf8.txt %{_datadir}/mysql/bulgarian/ @@ -693,6 +831,7 @@ fi %files client %defattr(-, root, root, -) +%doc %{?license_files_server} %attr(755, root, root) %{_bindir}/msql2mysql %attr(755, root, root) %{_bindir}/mysql %attr(755, root, root) %{_bindir}/mysql_find_rows @@ -727,6 +866,7 @@ fi %files devel %defattr(-, root, root, -) +%doc %{?license_files_server} %attr(644, root, root) %{_mandir}/man1/comp_err.1* %attr(644, root, root) %{_mandir}/man1/mysql_config.1* %attr(755, root, root) %{_bindir}/mysql_config @@ -741,22 +881,27 @@ fi %files libs %defattr(-, root, root, -) +%doc %{?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.18* %{_libdir}/mysql/libmysqlclient_r.so.18* +%if 0%{?compatlib} %files libs-compat %defattr(-, root, root, -) +%doc %{?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 +%endif %files test %defattr(-, root, root, -) +%doc %{?license_files_server} %attr(-, root, root) %{_datadir}/mysql-test %attr(755, root, root) %{_bindir}/mysql_client_test %attr(755, root, root) %{_bindir}/mysql_client_test_embedded @@ -767,19 +912,75 @@ fi %attr(644, root, root) %{_mandir}/man1/mysql_client_test_embedded.1* %attr(644, root, root) %{_mandir}/man1/mysqltest_embedded.1* +%files bench +%defattr(-, root, root, -) +%doc %{?license_files_server} +%{_datadir}/sql-bench + %files embedded %defattr(-, root, root, -) +%doc %{?license_files_server} %dir %attr(755, root, root) %{_libdir}/mysql %attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf -%attr(644, root, root) %{_libdir}/mysql/libmysqld.so.* +%attr(755, root, root) %{_libdir}/mysql/libmysqld.so.* %files embedded-devel %defattr(-, root, root, -) +%doc %{?license_files_server} %attr(644, root, root) %{_libdir}/mysql/libmysqld.a %attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a %attr(755, root, root) %{_libdir}/mysql/libmysqld.so +%if 0%{?rhel} == 5 +%files -n mysql +%defattr(-, root, root, -) +%doc %{?license_files_server} +%endif + %changelog +* Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.22-1 +- Add license info in each subpackage + +* Tue Jul 22 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.20-4 +- Provide mysql-compat-server dependencies + +* Tue Jul 08 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.20-3 +- Remove perl(GD) and dtrace dependencies + +* Thu Jun 26 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.20-2 +- Resolve embedded-devel conflict issue + +* Wed Jun 25 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.20-1 +- Add bench package +- Enable dtrace + +* Tue May 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.18-2 +- Disable dtrace for el7 + +* Thu Apr 24 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.18-1 +- Updated for 5.6.18 + +* Mon Apr 07 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.17-6 +- Fix Cflags for el7 + +* Mon Mar 31 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.17-5 +- Support for enterprise packages +- Upgrade from MySQL-* packages + +* Fri Mar 14 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.17-4 +- Resolve mysql conflict with mysql-community-client + +* Wed Mar 12 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.17-3 +- Resolve conflict with mysql-libs-compat + +* Thu Mar 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.17-2 +- Resolve conflict issues during upgrade + +* Fri Feb 07 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.17-1 +- 5.6.17 +- Add support for el7 (with systemd enabled) +- Enable shared libmysqld by cmake option + * Thu Jan 09 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.16-1 - Updated to 5.6.16 diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/CMakeLists.txt b/mysql-wsrep-5.6/packaging/rpm-sles/CMakeLists.txt new file mode 100644 index 00000000..b5ffaa15 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/CMakeLists.txt @@ -0,0 +1,28 @@ +# 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 + + +IF(UNIX) + SET(prefix ${CMAKE_INSTALL_PREFIX}) + SET(SPECFILENAME "mysql.spec") + # Left in current directory, to be taken during build + CONFIGURE_FILE(mysql.spec.in ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY) + FOREACH(fedfile my.cnf my_config.h mysql.init + mysqld.service mysql-systemd-start mysql.conf + filter-requires.sh filter-provides.sh) + CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY) + ENDFOREACH() +ENDIF() + diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/filter-provides.sh b/mysql-wsrep-5.6/packaging/rpm-sles/filter-provides.sh new file mode 100644 index 00000000..bc166bd8 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/filter-provides.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# + +/usr/lib/rpm/perl.prov $* | +sed -e '/perl(hostnames)/d' -e '/perl(lib::mtr.*/d' -e '/perl(lib::v1.*/d' -e '/perl(mtr_.*/d' -e '/perl(My::.*/d' + diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/filter-requires.sh b/mysql-wsrep-5.6/packaging/rpm-sles/filter-requires.sh new file mode 100644 index 00000000..3fdf4387 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/filter-requires.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# + +/usr/lib/rpm/perl.req $* | +sed -e '/perl(GD)/d' -e '/perl(hostnames)/d' -e '/perl(lib::mtr.*/d' -e '/perl(lib::v1.*/d' -e '/perl(mtr_.*/d' -e '/perl(My::.*/d' + diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/my.cnf b/mysql-wsrep-5.6/packaging/rpm-sles/my.cnf new file mode 100644 index 00000000..972db938 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/my.cnf @@ -0,0 +1,31 @@ +# For advice on how to change settings please see +# http://dev.mysql.com/doc/refman/5.6/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 +datadir=/var/lib/mysql +socket=/var/lib/mysql/mysql.sock + +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +# Recommended in standard MySQL setup +sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES + +[mysqld_safe] +log-error=/var/log/mysql/mysqld.log +pid-file=/var/run/mysql/mysqld.pid diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/my_config.h b/mysql-wsrep-5.6/packaging/rpm-sles/my_config.h new file mode 100644 index 00000000..75dc5e1d --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/my_config.h @@ -0,0 +1,30 @@ +/* + * Fedora supports multi arch: having 32 and 64 versions of MySQL + * installed at the same time. my_config.h will differ due arch + * dependent defs creating a file conflict. We move arch specific + * headers to arch specific file names and include the correct arch + * specific file by installing this generic file. + * + */ + +#if defined(__i386__) +#include "my_config_i386.h" +#elif defined(__ia64__) +#include "my_config_ia64.h" +#elif defined(__powerpc__) +#include "my_config_ppc.h" +#elif defined(__powerpc64__) +#include "my_config_ppc64.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" +#elif defined(__x86_64__) +#include "my_config_x86_64.h" +#else +#error "This MySQL devel package does not work your architecture?" +#endif diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/mysql-systemd-start b/mysql-wsrep-5.6/packaging/rpm-sles/mysql-systemd-start new file mode 100644 index 00000000..dc151e03 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/mysql-systemd-start @@ -0,0 +1,66 @@ +#! /bin/bash +# +# Scripts to run by MySQL systemd service +# +# Needed argument: pre | post +# +# pre mode : try to run mysql_install_db and fix perms and SELinux contexts +# post mode : ping server until answer is received +# + +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') + + # Restore log, dir, perms and SELinux contexts + [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + log=/var/log/mysqld.log + [ -e $log ] || touch $log + chmod 0640 $log + chown mysql:mysql $log || exit 1 + if [ -x /usr/sbin/restorecon ]; then + /usr/sbin/restorecon "$datadir" + /usr/sbin/restorecon $log + fi + + # If special mysql dir is in place, skip db install + [ -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 +} + +pinger () { + # Wait for ping to answer to signal startup completed, + # might take a while in case of e.g. crash recovery + # MySQL systemd service will timeout script if no answer + ret=1 + while /bin/true ; do + sleep 1 + 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 +} + +# main +case $1 in + "pre") install_db ;; + "post") pinger ;; +esac + +exit 0 + diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/mysql.conf b/mysql-wsrep-5.6/packaging/rpm-sles/mysql.conf new file mode 100644 index 00000000..74cd5f83 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/mysql.conf @@ -0,0 +1 @@ +d /var/run/mysqld 0755 mysql mysql - diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/mysql.init b/mysql-wsrep-5.6/packaging/rpm-sles/mysql.init new file mode 100644 index 00000000..b44637c8 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/mysql.init @@ -0,0 +1,252 @@ +#! /bin/bash +# +# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public 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 Database start/stop script + +# chkconfig: - 64 36 +# description: MySQL Database +# processname: mysqld +# config: /etc/my.cnf +# pidfile: /var/run/mysql/mysqld.pid + +# Comments to support LSB init script conventions +### BEGIN INIT INFO +# Provides: mysql +# Required-Start: $network $remote_fs +# Required-Stop: $network $remote_fs +# Default-Start: 3 5 +# Default-Stop: 0 1 6 +# Short-Description: MySQL Database +# Description: MySQL Database +### END INIT INFO + +# +# https://en.opensuse.org/openSUSE:Packaging_init_scripts#Exit_Status_Codes +# + +[ -e /etc/rc.status ] && . /etc/rc.status + +rc_reset + +STARTTIMEOUT=180 +STOPTIMEOUT=60 +PROG=/usr/bin/mysqld_safe + +[ -e /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql + +# Lock directory +lockfile=/var/lock/subsys/mysql + +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 + echo $ret +} + +datadir=$(get_option mysqld datadir "/var/lib/mysql") +socket=$(get_option mysqld socket "$datadir/mysql.sock") +pidfile=$(get_option mysqld_safe pid-file "/var/run/mysql/mysqld.pid") +logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log") + +install_db () { + # Note: something different than datadir=/var/lib/mysql requires + # SELinux policy changes (in enforcing mode) + datadir=$(get_option mysqld datadir "/var/lib/mysql") + logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log") + + # Restore log, dir, perms and SELinux contexts + [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || return 1 + + [ -e $logfile ] || touch $logfile || return 1 + chmod 0640 $logfile + chown mysql:mysql $logfile || return 1 + if [ -x /usr/sbin/restorecon ]; then + /usr/sbin/restorecon "$datadir" + /usr/sbin/restorecon $logfile + fi + + # If special mysql dir is in place, skip db install + [ -d "$datadir/mysql" ] && return 0 + + # Create initial db + /usr/bin/mysql_install_db --datadir="$datadir" --rpm --user=mysql --keep-my-cnf + return $? +} + +# Wait for ping to answer to signal startup completed, +# might take a while in case of e.g. crash recovery +pinger () { + mysqld_safe_pid=$1 + timer=$STARTTIMEOUT + ret=0 + while [ $timer -gt 0 ]; do + sleep 1 + mysqladmin --no-defaults --socket="$socket" ping >/dev/null 2>&1 && break + timer=$(expr $timer - 1) + + # Check if mysqld_safe is still alive, if not there is no hope + if ! kill -0 $mysqld_safe_pid >/dev/null 2>&1 ; then + ret=1 + break + fi + done + + # Did we timeout? + if [ $timer = 0 ]; then + echo "MySQL Database start up timeout after ${STARTTIMEOUT}s" + ret=1 + fi + return $ret +} + +# Check if mysqld is running +chk_running () { + ret=0 + if [ -e "$pidfile" ]; then + pid=$(cat "$pidfile") || ret=4 + else + ret=7 + fi + + # Check if $pid is a mysqld pid + if [ $ret -eq 0 ]; then + [ -L "/proc/$pid/exe" ] || ret=7 + fi + + if [ $ret -eq 0 ]; then + exec=$(readlink "/proc/$pid/exe") || ret=7 + fi + + if [ $ret -eq 0 ]; then + [ "x$(basename $exec)" = "xmysqld" ] || ret=7 + fi + return $ret +} + +start () { + if chk_running && mysqladmin --no-defaults --socket="$socket" ping >/dev/null 2>&1 ; then + echo -n "Starting service MySQL:" + rc_reset ; rc_status -v ; rc_exit + fi + + if ! install_db; then + echo -n "MySQL Database could not initialize data directory:" + rc_failed 6 ; rc_status -v ; rc_exit + fi + + $PROG --basedir=/usr --datadir="$datadir" --pid-file="$pidfile" >/dev/null 2>&1 & + if pinger $! ; then + echo -n "Starting service MySQL:" + touch $lockfile + rc_reset + else + echo -n "Failed to start service MySQL:" + rc_failed 3 + fi + rc_status -v +} + +stop () { + chk_running + ret=$? + if [ $ret -ne 0 ]; then + echo -n "Shutting down service MySQL:" + rc_reset ; rc_status -v ; return 0 + fi + + # chk_running has verified this works + pid=$(cat "$pidfile") + + # We use a signal to avoid having to know the root password + # Send single kill command and then wait + if kill $pid >/dev/null 2>&1; then + timer=$STOPTIMEOUT + while [ $timer -gt 0 ]; do + kill -0 $pid >/dev/null 2>&1 || break + sleep 1 + timer=$(expr $timer - 1) + done + else + echo -n "Shutting down service MySQL:" + rc_failed 4 ; rc_status -v ; rc_exit + fi + + if [ $timer -eq 0 ]; then + echo -n "Failed to stop service MySQL:" + rc_failed 1 + else + rm -f $lockfile + rm -f "$socketfile" + echo -n "Shutting down service MySQL:" + rc_reset + fi + rc_status -v +} + +restart () { + stop + start +} + +reload () { + ret=0 + if chk_running && mysqladmin --no-defaults --socket="$socket" ping >/dev/null 2>&1 ; then + pid=$(cat "$pidfile") + kill -HUP $pid >/dev/null 2>&1 + echo -n "Reloading service MySQL:" + rc_reset + else + echo -n "Reloading of service MySQL failed:" + rc_failed 7 + fi + rc_status -v +} + +condrestart () { + if chk_running && mysqladmin --no-defaults --socket="$socket" ping >/dev/null 2>&1 ; then + restart + fi +} + +status () { + echo -n "Checking for service MySQL:" + checkproc mysqld + rc_status -v +} + +case "$1" in + start ) start ;; + stop ) stop ;; + restart) restart ;; + status ) status ;; + condrestart ) condrestart ;; + reload|force-reload) reload ;; + + *) echo $"Usage: $0 {start|stop|restart|condrestart|status|reload|force-reload}"; exit 1 ;; +esac + +rc_exit + + + + + diff --git a/mysql-wsrep-5.6/packaging/rpm-sles/mysql.spec.in b/mysql-wsrep-5.6/packaging/rpm-sles/mysql.spec.in new file mode 100644 index 00000000..77d23b33 --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/mysql.spec.in @@ -0,0 +1,1660 @@ +# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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 + +# By default, a build will include the bundeled "yaSSL" library for SSL. +%{?with_ssl: %global ssl_option -DWITH_SSL=%{with_ssl}} + +# Regression tests may take a long time, override the default to skip them +%{!?runselftest:%global runselftest 0} + +%{!?with_systemd: %global systemd 0} +%{!?with_debuginfo: %global nodebuginfo 1} +%{!?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} + +# multiarch +%global multiarchs ppc %{power64} %{ix86} x86_64 %{sparc} + +# No debuginfo for now, ships /usr/sbin/mysqld-debug and libmysqlcliet-debug.a +%if 0%{?nodebuginfo} +%global _enable_debug_package 0 +%global debug_package %{nil} +%global __os_install_post /usr/lib/rpm/brp-compress %{nil} +%endif + +%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 + +%if 0%{?sles_version} == 011 +%global dist .sles11 +%global sles11 1 +%endif + +Name: mysql-%{product_suffix} +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. +Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz +URL: http://www.mysql.com/ +Packager: MySQL Release Engineering <mysql-build@oss.oracle.com> +Vendor: %{mysql_vendor} +Source1: mysql-systemd-start +Source2: mysqld.service +Source3: mysql.conf +Source4: my_config.h +Source90: filter-provides.sh +Source91: filter-requires.sh +BuildRequires: cmake +BuildRequires: perl +BuildRequires: libaio-devel +BuildRequires: ncurses-devel +BuildRequires: openssl-devel +BuildRequires: zlib-devel +%if 0%{?systemd} +BuildRequires: systemd +%endif +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +%if 0%{?rhel} > 6 +# 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)$ +%else +# https://fedoraproject.org/wiki/EPEL:Packaging#Generic_Filtering_on_EPEL6 +%global __perl_provides %{SOURCE90} +%global __perl_requires %{SOURCE91} +%endif + +%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 server +Summary: A very fast and reliable SQL database server +Group: Applications/Databases +Requires: coreutils +Requires: grep +Requires: procps +Requires: shadow-utils +Requires: net-tools +Requires: perl-base +%if 0%{?commercial} +Provides: MySQL-server-advanced = %{version}-%{release} +Obsoletes: MySQL-server-advanced < %{version}-%{release} +Obsoletes: mysql-community-server < %{version}-%{release} +Requires: mysql-commercial-client = %{version}-%{release} +Requires: mysql-commercial-common = %{version}-%{release} +%else +Provides: MySQL-server = %{version}-%{release} +Requires: mysql-community-client = %{version}-%{release} +Requires: mysql-community-common = %{version}-%{release} +%endif +Obsoletes: MySQL-server < %{version}-%{release} +Obsoletes: mysql < %{version}-%{release} +Obsoletes: mysql-tools < %{version}-%{release} +Obsoletes: mariadb-server +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 +%else +PreReq: insserv +PreReq: sed +PreReq: pwdutils +%endif +Conflicts: otherproviders(mysql) +Conflicts: otherproviders(mysql-debug) +Conflicts: otherproviders(mysql-tools) + +%description 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 +%{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. + +%package client +Summary: MySQL database client applications and tools +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-client-advanced = %{version}-%{release} +Obsoletes: MySQL-client-advanced < %{version}-%{release} +Obsoletes: mysql-community-client < %{version}-%{release} +Requires: mysql-commercial-libs = %{version}-%{release} +%else +Provides: MySQL-client = %{version}-%{release} +Requires: mysql-community-libs = %{version}-%{release} +%endif +Obsoletes: MySQL-client < %{version}-%{release} +Provides: mysql-client = %{version}-%{release} +Obsoletes: mysql-client < %{version}-%{release} +Obsoletes: mariadb +Conflicts: otherproviders(mysql-client) + +%description client +This package contains the standard MySQL clients and administration +tools. + +%package common +Summary: MySQL database common files for server and client libs +Group: Applications/Databases +%if 0%{?commercial} +Obsoletes: mysql-community-common < %{version}-%{release} +%endif +Provides: mysql-common = %{version}-%{release} + +%description common +This packages contains common files needed by MySQL client library, +MySQL database server, and MySQL embedded server. + + +%package test +Summary: Test suite for the MySQL database server +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-test-advanced = %{version}-%{release} +Obsoletes: MySQL-test-advanced < %{version}-%{release} +Obsoletes: mysql-community-test < %{version}-%{release} +Requires: mysql-commercial-server = %{version}-%{release} +%else +Provides: MySQL-test = %{version}-%{release} +Requires: mysql-community-server = %{version}-%{release} +%endif +Obsoletes: MySQL-test < %{version}-%{release} +Obsoletes: mysql-test < %{version}-%{release} +Obsoletes: mariadb-test +Provides: mysql-test = %{version}-%{release} +Conflicts: otherproviders(mysql-test) + +%description test +This package contains the MySQL regression test suite for MySQL +database server. + + +%package bench +Summary: MySQL benchmark suite +Group: Applications/Databases +%if 0%{?commercial} +Obsoletes: mysql-community-bench < %{version}-%{release} +Requires: mysql-commercial-server = %{version}-%{release} +%else +Requires: mysql-community-server = %{version}-%{release} +%endif +Obsoletes: mariadb-bench +Obsoletes: community-mysql-bench < %{version}-%{release} +Obsoletes: mysql-bench < %{version}-%{release} +Provides: mysql-bench = %{version}-%{release} +Conflicts: otherproviders(mysql-bench) + +%description bench +This package contains the MySQL Benchmark Suite for MySQL database +server. + +%package devel +Summary: Development header files and libraries for MySQL database client applications +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-devel-advanced = %{version}-%{release} +Obsoletes: MySQL-devel-advanced < %{version}-%{release} +Obsoletes: mysql-community-devel < %{version}-%{release} +Requires: mysql-commercial-libs = %{version}-%{release} +%else +Provides: MySQL-devel = %{version}-%{release} +Requires: mysql-community-libs = %{version}-%{release} +%endif +Obsoletes: MySQL-devel < %{version}-%{release} +Obsoletes: mysql-devel < %{version}-%{release} +Obsoletes: mariadb-devel +Obsoletes: libmysqlclient-devel < %{version}-%{release} +Provides: mysql-devel = %{version}-%{release} +Provides: libmysqlclient-devel = %{version}-%{release} + +%description devel +This package contains the development header files and libraries necessary +to develop MySQL client applications. + +%package libs +Summary: Shared libraries for MySQL database client applications +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-shared-advanced = %{version}-%{release} +Obsoletes: MySQL-shared-advanced < %{version}-%{release} +Obsoletes: mysql-community-libs < %{version}-%{release} +Requires: mysql-commercial-common = %{version}-%{release} +%else +Provides: MySQL-shared = %{version}-%{release} +Requires: mysql-community-common = %{version}-%{release} +%endif +Obsoletes: MySQL-shared < %{version}-%{release} +Obsoletes: mysql-libs < %{version}-%{release} +Obsoletes: mariadb-libs +Obsoletes: libmysqlclient18 < %{version}-%{release} +Obsoletes: libmysqlclient_r18 < %{version}-%{release} +Provides: mysql-libs = %{version}-%{release} +Provides: libmysqlclient18 = %{version}-%{release} +Provides: libmysqlclient_r18 = %{version}-%{release} + +%description libs +This package contains the shared libraries for MySQL client +applications. + +%package embedded +Summary: MySQL embedded library +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-embedded-advanced = %{version}-%{release} +Obsoletes: MySQL-embedded-advanced < %{version}-%{release} +Obsoletes: mysql-community-embedded < %{version}-%{release} +Requires: mysql-commercial-common = %{version}-%{release} +%else +Provides: MySQL-embedded = %{version}-%{release} +Requires: mysql-community-common = %{version}-%{release} +%endif +Obsoletes: mariadb-embedded +Obsoletes: MySQL-embedded < %{version}-%{release} +Obsoletes: mysql-embedded < %{version}-%{release} +Provides: mysql-embedded = %{version}-%{release} + +%description embedded +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/ + +%package embedded-devel +Summary: Development header files and libraries for MySQL as an embeddable library +Group: Applications/Databases +%if 0%{?commercial} +Obsoletes: mysql-community-embedded-devel < %{version}-%{release} +Requires: mysql-commercial-devel = %{version}-%{release} +Requires: mysql-commercial-embedded = %{version}-%{release} +%else +Requires: mysql-community-devel = %{version}-%{release} +Requires: mysql-community-embedded = %{version}-%{release} +%endif +Obsoletes: mariadb-embedded-devel +Obsoletes: mysql-embedded-devel < %{version}-%{release} +Provides: mysql-embedded-devel = %{version}-%{release} + +%description embedded-devel +This package contains files needed for developing applications using +the embedded version of the MySQL server. + +%prep +%setup -q -T -a 0 -c -n %{src_dir} +pushd %{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 debug versions of mysqld and libmysqld.a +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/ /') + cmake ../%{src_dir} \ + -DBUILD_CONFIG=mysql_release \ + -DINSTALL_LAYOUT=RPM \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_FLAGS="$optflags" \ + -DCMAKE_CXX_FLAGS="$optflags" \ + -DWITH_INNODB_MEMCACHED=1 \ + -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_debug}" \ + -DMYSQL_SERVER_SUFFIX="%{?server_suffix}" + echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG + make %{?_smp_mflags} VERBOSE=1 +) + +# 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=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 +) + +%install +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 all binaries +cd $MBD/release +make DESTDIR=%{buildroot} install + +# Install logrotate and autostart +install -D -m 0644 $MBD/release/support-files/mysql-log-rotate %{buildroot}%{_sysconfdir}/logrotate.d/mysql +install -D -m 0644 $MBD/release/packaging/rpm-sles/my.cnf %{buildroot}%{_sysconfdir}/my.cnf +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 +%else +install -D -m 0755 $MBD/release/packaging/rpm-sles/mysql.init %{buildroot}%{_sysconfdir}/init.d/mysql +%endif +install -D -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/tmpfiles.d/mysql.conf + +# Make library links +install -d -m 0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d +echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf + +# multiarch support +%ifarch %{multiarchs} +mv %{buildroot}/%{_includedir}/mysql/my_config.h \ + %{buildroot}/%{_includedir}/mysql/my_config_%{_arch}.h +install -p -m 0644 %{SOURCE4} %{buildroot}/%{_includedir}/mysql/my_config.h +%endif + +# Remove files pages we explicitly do not want to package +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 +%if 0%{?systemd} +rm -rf %{buildroot}%{_sysconfdir}/init.d/mysql +%endif +rm -rf %{buildroot}%{_bindir}/mysql_embedded +rm -rf %{buildroot}%{_bindir}/mysql_setpermission +rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1* + +# rcmysql symlink +install -d %{buildroot}%{_sbindir} +ln -sf %{_initrddir}/mysql %{buildroot}%{_sbindir}/rcmysql + +%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 server +/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 || : + +%post server +datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p') +/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 || : +%else +/sbin/insserv /etc/init.d/mysql +%endif + +%preun server +%if 0%{?systemd} +%systemd_preun mysqld.service +%else +if [ "$1" -eq 0 ]; then + /usr/sbin/rcmysql stop >/dev/null 2>&1 || : + /sbin/insserv /etc/init.d +fi +%endif + +%postun server +%if 0%{?systemd} +%systemd_postun_with_restart mysqld.service +%else +if [ $1 -ge 1 ]; then + /usr/sbin/rcmysql condrestart >/dev/null 2>&1 || : +fi +%endif + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%if 0%{?compatlib} +%post libs-compat -p /sbin/ldconfig + +%postun libs-compat -p /sbin/ldconfig +%endif + +%post embedded -p /sbin/ldconfig + +%postun embedded -p /sbin/ldconfig + +%files server +%defattr(-, root, root, -) +%doc %{?license_files_server} %{src_dir}/Docs/ChangeLog +%doc %{src_dir}/Docs/INFO_SRC* +%doc release/Docs/INFO_BIN* +%doc release/support-files/my-default.cnf +%attr(644, root, root) %{_mandir}/man1/innochecksum.1* +%attr(644, root, root) %{_mandir}/man1/my_print_defaults.1* +%attr(644, root, root) %{_mandir}/man1/myisam_ftdump.1* +%attr(644, root, root) %{_mandir}/man1/myisamchk.1* +%attr(644, root, root) %{_mandir}/man1/myisamlog.1* +%attr(644, root, root) %{_mandir}/man1/myisampack.1* +%attr(644, root, root) %{_mandir}/man1/mysql_convert_table_format.1* +%attr(644, root, root) %{_mandir}/man1/mysql_fix_extensions.1* +%attr(644, root, root) %{_mandir}/man8/mysqld.8* +%attr(644, root, root) %{_mandir}/man1/mysqld_multi.1* +%attr(644, root, root) %{_mandir}/man1/mysqld_safe.1* +%attr(644, root, root) %{_mandir}/man1/mysqldumpslow.1* +%attr(644, root, root) %{_mandir}/man1/mysql_install_db.1* +%attr(644, root, root) %{_mandir}/man1/mysql_plugin.1* +%attr(644, root, root) %{_mandir}/man1/mysql_secure_installation.1* +%attr(644, root, root) %{_mandir}/man1/mysql_upgrade.1* +%attr(644, root, root) %{_mandir}/man1/mysqlhotcopy.1* +%attr(644, root, root) %{_mandir}/man1/mysqlman.1* +%attr(644, root, root) %{_mandir}/man1/mysql.server.1* +%attr(644, root, root) %{_mandir}/man1/mysqltest.1* +%attr(644, root, root) %{_mandir}/man1/mysql_tzinfo_to_sql.1* +%attr(644, root, root) %{_mandir}/man1/mysql_zap.1* +%attr(644, root, root) %{_mandir}/man1/mysqlbug.1* +%attr(644, root, root) %{_mandir}/man1/perror.1* +%attr(644, root, root) %{_mandir}/man1/replace.1* +%attr(644, root, root) %{_mandir}/man1/resolve_stack_dump.1* +%attr(644, root, root) %{_mandir}/man1/resolveip.1* + +%config(noreplace) %{_sysconfdir}/my.cnf +%dir %{_sysconfdir}/my.cnf.d + +%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_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 +%if 0%{?systemd} +%attr(755, root, root) %{_bindir}/mysql-systemd-start +%endif +%attr(755, root, root) %{_sbindir}/mysqld +%attr(755, root, root) %{_sbindir}/mysqld-debug +%attr(755, root, root) %{_sbindir}/rcmysql + +%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 +%dir %{_libdir}/mysql/plugin/debug +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so +%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/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 +%if 0%{?commercial} +%attr(755, root, root) %{_libdir}/mysql/plugin/audit_log.so +%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/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 +%endif +%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/my-*.cnf +%attr(644, root, root) %{_datadir}/mysql/mysql-log-rotate +%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 +%attr(644, root, root) %{_prefix}/lib/tmpfiles.d/mysql.conf +%if 0%{?systemd} +%attr(644, root, root) %{_unitdir}/mysqld.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 + +%files common +%defattr(-, root, root, -) +%doc %{?license_files_server} +%{_datadir}/mysql/charsets/ +%{_datadir}/mysql/errmsg-utf8.txt +%{_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/ + +%files client +%defattr(-, root, root, -) +%doc %{?license_files_server} +%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 +%attr(755, root, root) %{_bindir}/mysql_config_editor + +%attr(644, root, root) %{_mandir}/man1/msql2mysql.1* +%attr(644, root, root) %{_mandir}/man1/mysql.1* +%attr(644, root, root) %{_mandir}/man1/mysql_find_rows.1* +%attr(644, root, root) %{_mandir}/man1/mysql_waitpid.1* +%attr(644, root, root) %{_mandir}/man1/mysqlaccess.1* +%attr(644, root, root) %{_mandir}/man1/mysqladmin.1* +%attr(644, root, root) %{_mandir}/man1/mysqlbinlog.1* +%attr(644, root, root) %{_mandir}/man1/mysqlcheck.1* +%attr(644, root, root) %{_mandir}/man1/mysqldump.1* +%attr(644, root, root) %{_mandir}/man1/mysqlimport.1* +%attr(644, root, root) %{_mandir}/man1/mysqlshow.1* +%attr(644, root, root) %{_mandir}/man1/mysqlslap.1* +%attr(644, root, root) %{_mandir}/man1/mysql_config_editor.1* + +%files devel +%defattr(-, root, root, -) +%doc %{?license_files_server} +%attr(644, root, root) %{_mandir}/man1/comp_err.1* +%attr(644, root, root) %{_mandir}/man1/mysql_config.1* +%attr(755, root, root) %{_bindir}/mysql_config +%{_includedir}/mysql +%{_datadir}/aclocal/mysql.m4 +%{_libdir}/mysql/libmysqlclient.a +%{_libdir}/mysql/libmysqlclient_r.a +%{_libdir}/mysql/libmysqlservices.a +%{_libdir}/mysql/libmysqlclient_r.so +%{_libdir}/mysql/libmysqlclient.so + +%files libs +%defattr(-, root, root, -) +%doc %{?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.18* +%{_libdir}/mysql/libmysqlclient_r.so.18* + +%if 0%{?compatlib} +%files libs-compat +%defattr(-, root, root, -) +%doc %{?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 +%endif + +%files test +%defattr(-, root, root, -) +%doc %{?license_files_server} +%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 +%attr(755, root, root) %{_bindir}/mysqltest_embedded + +%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so +%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini +%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so + +%attr(644, root, root) %{_mandir}/man1/mysql_client_test.1* +%attr(644, root, root) %{_mandir}/man1/mysql-stress-test.pl.1* +%attr(644, root, root) %{_mandir}/man1/mysql-test-run.pl.1* +%attr(644, root, root) %{_mandir}/man1/mysql_client_test_embedded.1* +%attr(644, root, root) %{_mandir}/man1/mysqltest.1* +%attr(644, root, root) %{_mandir}/man1/mysqltest_embedded.1* + +%files bench +%defattr(-, root, root, -) +%doc %{?license_files_server} +%{_datadir}/sql-bench + +%files embedded +%defattr(-, root, root, -) +%doc %{?license_files_server} +%dir %attr(755, root, root) %{_libdir}/mysql +%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf +%attr(755, root, root) %{_libdir}/mysql/libmysqld.so.* + +%files embedded-devel +%defattr(-, root, root, -) +%doc %{?license_files_server} +%attr(644, root, root) %{_libdir}/mysql/libmysqld.a +%attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a +%attr(755, root, root) %{_libdir}/mysql/libmysqld.so + +%changelog +* Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.22-1 +- Backport to 5.6.22 + +* Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.6-0.2.m16 +- Include boost sources +- Add license info in each subpackage + +* Tue Sep 02 2014 Bjorn Munch <bjorn.munch@oracle.com> - 5.7.6-0.1.m16 +- Updated for 5.7.6 + +* Mon Sep 01 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.5-0.2.m15 +- Added openssl_udf.so plugin to commercial packages + +* Mon Jun 30 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.7.5-0.1.m15 +- Port to SLES + +* 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-sles/mysqld.service b/mysql-wsrep-5.6/packaging/rpm-sles/mysqld.service new file mode 100644 index 00000000..78ef3bff --- /dev/null +++ b/mysql-wsrep-5.6/packaging/rpm-sles/mysqld.service @@ -0,0 +1,48 @@ +# +# Simple MySQL systemd service file +# +# systemd supports lots of fancy features, look here (and linked docs) for a full list: +# http://www.freedesktop.org/software/systemd/man/systemd.exec.html +# +# Note: this file ( /usr/lib/systemd/system/mysql.service ) +# will be overwritten on package upgrade, please copy the file to +# +# /etc/systemd/system/mysql.service +# +# to make needed changes. +# +# systemd-delta can be used to check differences between the two mysql.service files. +# + +[Unit] +Description=MySQL Community Server +After=network.target +After=syslog.target + +[Install] +WantedBy=multi-user.target +Alias=mysql.service + +[Service] +User=mysql +Group=mysql + +# Execute pre and post scripts as root +PermissionsStartOnly=true + +# Needed to create system tables etc. +ExecStartPre=/usr/bin/mysql-systemd-start pre + +# Start main service +ExecStart=/usr/bin/mysqld_safe + +# Don't signal startup success before a ping works +ExecStartPost=/usr/bin/mysql-systemd-start post + +# Give up if ping don't get an answer +TimeoutSec=600 + +Restart=always +PrivateTmp=false + + diff --git a/mysql-wsrep-5.6/packaging/solaris/CMakeLists.txt b/mysql-wsrep-5.6/packaging/solaris/CMakeLists.txt index dee0ecf4..6a0e2638 100644 --- a/mysql-wsrep-5.6/packaging/solaris/CMakeLists.txt +++ b/mysql-wsrep-5.6/packaging/solaris/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,6 +17,10 @@ # Any files in this directory are auxiliary files for Solaris "pkg" packages. # They will be configured during "pkg" creation, not during (binary) build. +IF(NOT CMAKE_SYSTEM_NAME MATCHES "SunOS") + RETURN() +ENDIF() + # Currently, this expands to "support-files/" in most layouts, # but to "/usr/share/mysql/" in a RPM. # It is important not to pollute "/usr/bin". diff --git a/mysql-wsrep-5.6/plugin/auth/CMakeLists.txt b/mysql-wsrep-5.6/plugin/auth/CMakeLists.txt index 60da08e3..1648d4e7 100644 --- a/mysql-wsrep-5.6/plugin/auth/CMakeLists.txt +++ b/mysql-wsrep-5.6/plugin/auth/CMakeLists.txt @@ -29,7 +29,9 @@ MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c MODULE_ONLY) CHECK_CXX_SOURCE_COMPILES( -"#define _GNU_SOURCE +"#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include <sys/socket.h> int main() { struct ucred cred; diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/CMakeLists.txt b/mysql-wsrep-5.6/plugin/innodb_memcached/CMakeLists.txt index 0e360077..7b3805bc 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/CMakeLists.txt +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,4 +17,6 @@ IF(WITH_INNODB_MEMCACHED AND UNIX) ADD_SUBDIRECTORY(innodb_memcache) ENDIF() -INSTALL_SCRIPT("${CMAKE_SOURCE_DIR}/plugin/innodb_memcached/innodb_memcache/scripts/innodb_memcached_config.sql" DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server) +INSTALL(FILES "${CMAKE_SOURCE_DIR}/plugin/innodb_memcached/innodb_memcache/scripts/innodb_memcached_config.sql" + DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt index 03326588..11a1276b 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,7 +32,7 @@ SET(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_SHARED_LIBRARY_C_FLAGS} -I${CMAK # If current CMAKE_C_FLAGS is with Werror, turn it off to compile successfully IF(CMAKE_C_FLAGS MATCHES "-Werror") - STRING(REGEX REPLACE "-Werror" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + STRING(REGEX REPLACE "-Werror( |$)" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") # Turn -Wdeclaration-after-statement off to reduce the number of warnings STRING(REGEX REPLACE "-Wdeclaration-after-statement" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") ENDIF(CMAKE_C_FLAGS MATCHES "-Werror") diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached.c b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached.c index 09a0b0d4..6c740f23 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached.c +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached.c @@ -141,6 +141,7 @@ do { \ #endif /* HAVE_GCC_ATOMIC_BUILTINS */ volatile sig_atomic_t memcached_shutdown; +volatile sig_atomic_t memcached_initialized; /* * We keep the current time of day in a global variable that's updated by a @@ -4042,6 +4043,12 @@ static inline char* process_get_command(conn *c, token_t *tokens, size_t ntokens token_t *key_token = &tokens[KEY_TOKEN]; assert(c != NULL); + /* We temporarily block the mgets commands till wl6650 checked in. */ + if ((key_token + 1)->length > 0) { + out_string(c, "We temporarily don't support multiple get option."); + return NULL; + } + do { while(key_token->length != 0) { @@ -6747,6 +6754,11 @@ bool shutdown_complete(void) { return(memcached_shutdown == 2); } + +bool init_complete(void) +{ + return(memcached_initialized == 1); +} #endif static EXTENSION_LOGGER_DESCRIPTOR* get_logger(void) @@ -7072,6 +7084,7 @@ int main (int argc, char **argv) { #endif /* INNODB_MEMCACHED */ memcached_shutdown = 0; + memcached_initialized = 0; if (!sanitycheck()) { return(NULL); @@ -7924,6 +7937,8 @@ int main (int argc, char **argv) { /* Drop privileges no longer needed */ drop_privileges(); + memcached_initialized = 1; + /* enter the event loop */ event_base_loop(main_base, 0); @@ -7947,6 +7962,7 @@ func_exit: free(settings.inter); memcached_shutdown = 2; + memcached_initialized = 2; return EXIT_SUCCESS; } diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc index 03ed22c9..18ed28be 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -91,11 +91,24 @@ static int daemon_memcached_plugin_deinit(void *p) struct mysql_memcached_context* con = NULL; int loop_count = 0; + /* If memcached plugin is still initializing, wait for a + while.*/ + while (!init_complete() && loop_count < 15 ) { + sleep(1); + loop_count++; + } + + if (!init_complete()) { + fprintf(stderr," InnoDB_Memcached: Memcached plugin is still" + " initializing. Can't shut down it.\n"); + return(0); + } if (!shutdown_complete()) { shutdown_server(); } + loop_count = 0; while (!shutdown_complete() && loop_count < 25) { sleep(2); loop_count++; diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.h b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.h index 8cdc97e8..5ea7e876 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.h +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.h @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -51,6 +51,8 @@ void shutdown_server(void); bool shutdown_complete(void); +bool init_complete(void); + # ifdef __cplusplus } # endif diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/include/memcached/protocol_binary.h b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/include/memcached/protocol_binary.h index d5fc448c..b9578e55 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/include/memcached/protocol_binary.h +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/include/memcached/protocol_binary.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (c) <2008>, Sun Microsystems, Inc. + * Use is subject to license terms * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/CMakeLists.txt b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/CMakeLists.txt index 633a1750..b2063d32 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/CMakeLists.txt +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/plugin/innodb_memcached/innodb_memcache # If current CMAKE_C_FLAGS is with Werror, turn it off to compile successfully IF(CMAKE_C_FLAGS MATCHES "-Werror") - STRING(REGEX REPLACE "-Werror" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + STRING(REGEX REPLACE "-Werror( |$)" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") # Turn -Wdeclaration-after-statement off to reduce the number of warnings STRING(REGEX REPLACE "-Wdeclaration-after-statement" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") ENDIF(CMAKE_C_FLAGS MATCHES "-Werror") diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c index 3db010be..14e2fa77 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -1208,17 +1208,11 @@ innodb_api_set_tpl( value_len, table); } else { - err = ib_cb_col_set_value( + err = innodb_api_setup_field_value( tpl, meta_info->extra_col_info[col_to_set].field_id, - value, value_len, need_cpy); - - if (table) { - handler_rec_setup_str( - table, - col_info[col_to_set].field_id, - value, value_len); - } + &meta_info->extra_col_info[col_to_set], + (char*)value, value_len, table, need_cpy); } } else { err = innodb_api_setup_field_value( @@ -1599,6 +1593,7 @@ innodb_api_arithmetic( /* If the return message is not success or record not found, just exit */ if (err != DB_SUCCESS && err != DB_RECORD_NOT_FOUND) { + *out_result = 0; goto func_exit; } @@ -1640,10 +1635,24 @@ innodb_api_arithmetic( } before_len = result.extra_col_value[column_used].value_len; - before_val = result.extra_col_value[column_used].value_str; + if (result.extra_col_value[column_used].is_str) { + before_val = result.extra_col_value[column_used].value_str; + if (before_val) { + value = strtoull(before_val, &end_ptr, 10); + } + } else { + value = result.extra_col_value[column_used].value_int; + } } else { before_len = result.col_value[MCI_COL_VALUE].value_len; - before_val = result.col_value[MCI_COL_VALUE].value_str; + if (result.col_value[MCI_COL_VALUE].is_str) { + before_val = result.col_value[MCI_COL_VALUE].value_str; + if (before_val) { + value = strtoull(before_val, &end_ptr, 10); + } + } else { + value = result.col_value[MCI_COL_VALUE].value_int; + } column_used = UPDATE_ALL_VAL_COL; } @@ -1654,10 +1663,6 @@ innodb_api_arithmetic( errno = 0; - if (before_val) { - value = strtoull(before_val, &end_ptr, 10); - } - if (errno == ERANGE) { ret = ENGINE_EINVAL; goto func_exit; diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c index d02a1a49..949dbd4d 100644 --- a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c +++ b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c @@ -1,6 +1,6 @@ /*********************************************************************** -Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -791,10 +791,16 @@ have_conn: read_crsr = conn_data->read_crsr; if (lock_mode == IB_LOCK_TABLE_X) { - assert(!conn_data->crsr_trx); - - conn_data->crsr_trx = ib_cb_trx_begin( - engine->trx_level, true, false); + if(!conn_data->crsr_trx) { + conn_data->crsr_trx = ib_cb_trx_begin( + engine->trx_level, true, false); + } else { + /* Write cursor transaction exists. + Reuse this transaction.*/ + assert(ib_cb_trx_start(conn_data->crsr_trx, + engine->trx_level, + true, false, NULL)); + } err = innodb_api_begin( engine, @@ -1514,7 +1520,7 @@ innodb_get( ib_err_t err = DB_SUCCESS; mci_item_t* result = NULL; ENGINE_ERROR_CODE err_ret = ENGINE_SUCCESS; - innodb_conn_data_t* conn_data; + innodb_conn_data_t* conn_data = NULL; meta_cfg_info_t* meta_info = innodb_eng->meta_info; int option_length; const char* option_delimiter; @@ -1779,6 +1785,13 @@ func_exit: } err_exit: + + /* If error return, memcached will not call InnoDB Memcached's + callback function "innodb_release" to reset the result_in_use + value. So we reset it here */ + if (err_ret != ENGINE_SUCCESS && conn_data) { + conn_data->result_in_use = false; + } return(err_ret); } @@ -1945,14 +1958,14 @@ innodb_arithmetic( return(ENGINE_NOT_STORED); } - innodb_api_arithmetic(innodb_eng, conn_data, key, nkey, delta, - increment, cas, exptime, create, initial, - result); + err_ret = innodb_api_arithmetic(innodb_eng, conn_data, key, nkey, + delta, increment, cas, exptime, + create, initial, result); innodb_api_cursor_reset(innodb_eng, conn_data, CONN_OP_WRITE, true); - return(ENGINE_SUCCESS); + return(err_ret); } /*******************************************************************//** diff --git a/mysql-wsrep-5.6/plugin/semisync/semisync.cc b/mysql-wsrep-5.6/plugin/semisync/semisync.cc index 022773ee..4a80360b 100644 --- a/mysql-wsrep-5.6/plugin/semisync/semisync.cc +++ b/mysql-wsrep-5.6/plugin/semisync/semisync.cc @@ -1,5 +1,6 @@ /* Copyright (C) 2007 Google Inc. Copyright (C) 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 diff --git a/mysql-wsrep-5.6/plugin/semisync/semisync.h b/mysql-wsrep-5.6/plugin/semisync/semisync.h index 900ce5d8..5d8753d0 100644 --- a/mysql-wsrep-5.6/plugin/semisync/semisync.h +++ b/mysql-wsrep-5.6/plugin/semisync/semisync.h @@ -1,5 +1,6 @@ /* Copyright (C) 2007 Google Inc. Copyright (C) 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 diff --git a/mysql-wsrep-5.6/plugin/semisync/semisync_master.cc b/mysql-wsrep-5.6/plugin/semisync/semisync_master.cc index 50343e19..d84c5580 100644 --- a/mysql-wsrep-5.6/plugin/semisync/semisync_master.cc +++ b/mysql-wsrep-5.6/plugin/semisync/semisync_master.cc @@ -17,6 +17,10 @@ #include "semisync_master.h" +#if defined(ENABLED_DEBUG_SYNC) +#include "debug_sync.h" +#include "sql_class.h" +#endif #define TIME_THOUSAND 1000 #define TIME_MILLION 1000000 @@ -485,13 +489,26 @@ void ReplSemiSyncMaster::remove_slave() /* Only switch off if semi-sync is enabled and is on */ if (getMasterEnabled() && is_on()) { - /* If user has chosen not to wait if no semi-sync slave available - and the last semi-sync slave exits, turn off semi-sync on master - immediately. + /* If user has chosen not to wait or if the server is shutting down if no + semi-sync slave available and the last semi-sync slave exits, turn off + semi-sync on master immediately. */ - if (!rpl_semi_sync_master_wait_no_slave && - rpl_semi_sync_master_clients == 0) + if (rpl_semi_sync_master_clients == 0 && + (!rpl_semi_sync_master_wait_no_slave || abort_loop)) + { + if (abort_loop) + { + if (commit_file_name_inited_ && reply_file_name_inited_) + { + int cmp = ActiveTranx::compare(reply_file_name_, reply_file_pos_ , + commit_file_name_, commit_file_pos_); + if (cmp < 0) + sql_print_warning("SEMISYNC: Forced shutdown. Some updates might " + "not be replicated."); + } + } switch_off(); + } } unlock(); } @@ -623,7 +640,11 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name, 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(); @@ -716,6 +737,13 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name, * when replication has progressed far enough, we will release * these waiting threads. */ + if (abort_loop && rpl_semi_sync_master_clients == 0 && is_on()) + { + sql_print_warning("SEMISYNC: Forced shutdown. Some updates might " + "not be replicated."); + switch_off(); + break; + } rpl_semi_sync_master_wait_sessions++; if (trace_level_ & kTraceDetail) @@ -762,7 +790,6 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name, } } - l_end: /* At this point, the binlog file and position of this transaction must have been removed from ActiveTranx. @@ -770,7 +797,7 @@ int ReplSemiSyncMaster::commitTrx(const char* trx_wait_binlog_name, assert(!getMasterEnabled() || !active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name, trx_wait_binlog_pos)); - + l_end: /* Update the status counter. */ if (is_on()) rpl_semi_sync_master_yes_transactions++; diff --git a/mysql-wsrep-5.6/plugin/semisync/semisync_master_plugin.cc b/mysql-wsrep-5.6/plugin/semisync/semisync_master_plugin.cc index ecbd6b7c..f89eb10a 100644 --- a/mysql-wsrep-5.6/plugin/semisync/semisync_master_plugin.cc +++ b/mysql-wsrep-5.6/plugin/semisync/semisync_master_plugin.cc @@ -76,13 +76,18 @@ int repl_semi_binlog_dump_start(Binlog_transmit_param *param, { /* One more semi-sync slave */ repl_semisync.add_slave(); - + /* Tell server it will observe the transmission.*/ + param->set_observe_flag(); + /* Let's assume this semi-sync slave has already received all binlog events before the filename and position it requests. */ repl_semisync.reportReplyBinlog(param->server_id, log_file, log_pos); } + else + param->set_dont_observe_flag(); + sql_print_information("Start %s binlog_dump to slave (server_id: %d), pos(%s, %lu)", semi_sync_slave ? "semi-sync" : "asynchronous", param->server_id, log_file, (unsigned long)log_pos); diff --git a/mysql-wsrep-5.6/plugin/semisync/semisync_slave_plugin.cc b/mysql-wsrep-5.6/plugin/semisync/semisync_slave_plugin.cc index 5d373fa0..f96116eb 100644 --- a/mysql-wsrep-5.6/plugin/semisync/semisync_slave_plugin.cc +++ b/mysql-wsrep-5.6/plugin/semisync/semisync_slave_plugin.cc @@ -1,5 +1,6 @@ /* Copyright (C) 2007 Google Inc. Copyright (C) 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 diff --git a/mysql-wsrep-5.6/scripts/CMakeLists.txt b/mysql-wsrep-5.6/scripts/CMakeLists.txt index 5dc0c694..c043f078 100644 --- a/mysql-wsrep-5.6/scripts/CMakeLists.txt +++ b/mysql-wsrep-5.6/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -89,9 +89,9 @@ ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") # Strip maintainer mode options if necessary - STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS + STRING(REPLACE "${MY_C_WARNING_FLAGS}" "" CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELWITHDEBINFO}") - STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS + STRING(REPLACE "${MY_CXX_WARNING_FLAGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) SET(CFLAGS "${CFLAGS} -arch ${ARCH}") @@ -99,21 +99,12 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") ENDFOREACH() ELSE() # Strip maintainer mode options if necessary - STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS + STRING(REPLACE "${MY_C_WARNING_FLAGS}" "" CFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") - STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS + STRING(REPLACE "${MY_CXX_WARNING_FLAGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") ENDIF() -FOREACH(WFLAG - "-Wno-null-conversion" - "-Wno-unused-parameter" - "-Wno-unused-private-field" - ) - STRING(REPLACE "${WFLAG}" "" CFLAGS "${CFLAGS}") - STRING(REPLACE "${WFLAG}" "" CXXFLAGS "${CXXFLAGS}") -ENDFOREACH() - IF(UNIX) # FIND_PROC and CHECK_PID are used by mysqld_safe IF(CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -234,11 +225,17 @@ SET(libexecdir ${prefix}/${INSTALL_SBINDIR}) SET(scriptdir ${prefix}/${INSTALL_BINDIR}) SET(datadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) +SET(libsubdir ${INSTALL_LIBDIR}) SET(pkgincludedir ${prefix}/${INSTALL_INCLUDEDIR}) SET(pkglibdir ${prefix}/${INSTALL_LIBDIR}) SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR}) SET(localstatedir ${MYSQL_DATADIR}) +SET(RPATH_OPTION "") +IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + SET(RPATH_OPTION "-R$pkglibdir") +ENDIF() + # some scripts use @TARGET_LINUX@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET(TARGET_LINUX "true") @@ -323,6 +320,9 @@ IF(WIN32) INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT Server_Scripts) ENDFOREACH() ELSE() + # 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) # On Unix, most of the files end up in the bin directory SET(mysql_config_COMPONENT COMPONENT Development) SET(BIN_SCRIPTS diff --git a/mysql-wsrep-5.6/scripts/fill_help_tables.sql b/mysql-wsrep-5.6/scripts/fill_help_tables.sql index 64c0309b..fda0b9c4 100644 --- a/mysql-wsrep-5.6/scripts/fill_help_tables.sql +++ b/mysql-wsrep-5.6/scripts/fill_help_tables.sql @@ -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 @@ -13,11 +13,13 @@ -- 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. +-- 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: 2014-01-14 +-- File generation date: 2015-01-16 -- MySQL series: 5.6 --- Document repository revision: 37361 +-- 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 @@ -25,2165 +27,2218 @@ -- mysql -u root -p mysql < file_name -set names 'utf8'; +SET NAMES 'utf8'; -delete from help_topic; -delete from help_category; -delete from help_keyword; -delete from help_relation; +TRUNCATE TABLE help_topic; +TRUNCATE TABLE help_category; +TRUNCATE TABLE help_keyword; +TRUNCATE TABLE help_relation; -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,'WKT',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (4,'Numeric Functions',39,''); -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,'MBR',35,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (7,'Control flow functions',39,''); -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,'Comparison operators',39,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (20,'Bit Functions',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,''); +START TRANSACTION; -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. (Multi-byte 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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.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/geometry-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/geometry-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,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 (12,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 owner of the routine or have\nSELECT access to the mysql.proc table. If you do not have privileges\nfor the routine itself, the value displayed for the Create Procedure or\nCreate 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 (13,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 (14,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (15,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 (16,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 (17,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 (18,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 (19,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (20,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 (21,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 (22,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 (23,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (24,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 (25,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 (26,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 (27,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 (28,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (29,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 (30,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 (31,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\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 (32,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 (33,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 (34,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 (35,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 (36,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 (37,7,'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 (38,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 (39,35,'SPATIAL','For MyISAM tables, MySQL can create spatial indexes using syntax\nsimilar to that for creating regular indexes, but extended with the\nSPATIAL keyword. Currently, columns in spatial indexes must be declared\nNOT NULL. The following examples demonstrate how to create spatial\nindexes:\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\nFor MyISAM tables, SPATIAL INDEX creates an R-tree index. For storage\nengines that support nonspatial indexing of spatial columns, the engine\ncreates a B-tree index. A B-tree index on spatial values will be useful\nfor exact-value lookups, 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 (40,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 (41,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 (42,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 (43,19,'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 (44,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 (45,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 (46,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 (47,19,'<=','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 (48,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 (49,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 are not updated. Rows for which columns are 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 (50,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 (51,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 (52,40,'DROP INDEX','Syntax:\nDROP INDEX 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 (53,4,'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 (54,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 (55,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (56,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 (57,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 (58,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 (59,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 (60,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 (61,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 (62,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 (63,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 (64,9,'HELP_DATE','This help information was generated from the MySQL 5.6 Reference Manual\non: 2014-01-14\n','',''); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (65,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 (66,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 (67,4,'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 (68,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 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 (69,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 (70,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 (71,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (72,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 (73,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\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 (74,38,'CHAR_LENGTH','Syntax:\nCHAR_LENGTH(str)\n\nReturns the length of the string str, measured in characters. A\nmulti-byte character counts as a single character. This means that for\na string containing five 2-byte characters, LENGTH() returns 10,\nwhereas CHAR_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 (75,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 (76,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 (77,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.\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 (78,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 (79,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 (80,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 (81,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (82,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (83,19,'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 (84,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (85,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 (86,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 (87,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 (88,4,'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, note that the sequences of values produced by RAND(3) is the\nsame both places where it occurs.\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 (89,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 (90,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 (91,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 (92,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 (93,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 (94,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 (95,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 (96,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 (97,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\nmulti-byte 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 (98,27,'KILL','Syntax:\nKILL [CONNECTION | QUERY] thread_id\n\nEach connection to mysqld runs in a separate thread. You can see which\nthreads are running with the SHOW PROCESSLIST statement and kill a\nthread with the KILL thread_id statement.\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 thread_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 (99,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (100,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 (101,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (102,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 (103,6,'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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (104,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 (105,9,'HELP_VERSION','This help information was generated from the MySQL 5.6 Reference Manual\non: 2014-01-14 (revision: 37361)\n\nThis information applies to MySQL 5.6 through 5.6.17.\n','',''); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (106,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 (107,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 (108,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\nhttp://dev.mysql.com/doc/refman/5.6/en/create-logfile-group.html).\nMultiple tablespaces may 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 128M.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug #29186)\n\nWhen setting EXTENT_SIZE or INITIAL_SIZE (either or both), you may\noptionally follow the number with a one-letter abbreviation for an\norder of magnitude, similar to those used in my.cnf. Generally, this is\none of the letters M (for megabytes) or G (for gigabytes).\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 (109,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 (110,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 (111,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 BY [PASSWORD] \'password\'\n | IDENTIFIED WITH auth_plugin [AS \'auth_string\']\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 (112,6,'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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (113,19,'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 (114,4,'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 (115,40,'CREATE INDEX','Syntax:\nCREATE [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 (116,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 (117,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (118,20,'<<','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 (119,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 (120,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 (121,4,'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 (122,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 (123,35,'GEOMETRY','MySQL provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Currently,\nspatial columns are supported for MyISAM, InnoDB, NDB, and ARCHIVE\ntables. See also the annotations about spatial indexes under [HELP\nSPATIAL].\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 (124,20,'&','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 (125,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 (126,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 (127,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 (128,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 (129,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 (130,38,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multi-byte 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 multi-byte 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 (131,37,'ENVELOPE','Envelope(g)\n\nReturns the Minimum Bounding Rectangle (MBR) for the geometry value g.\nThe result is returned as a Polygon value.\n\nThe polygon is defined by the corner points 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/geometry-property-functions.html\n\n','mysql> SELECT AsText(Envelope(GeomFromText(\'LineString(1 1,2 2)\')));\n+-------------------------------------------------------+\n| AsText(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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (132,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 (133,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/geometry-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (134,4,'- 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 (135,3,'WKT DEFINITION','The Well-Known Text (WKT) representation of Geometry is designed to\nexchange geometry data in ASCII form. For a Backus-Naur grammar that\nspecifies the formal production rules for writing WKT values, see the\nOpenGIS specification document referenced in\nhttp://dev.mysql.com/doc/refman/5.6/en/spatial-extensions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-format.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/gis-wkt-format.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (136,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 (137,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 (138,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 (139,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 (140,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 (141,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 (142,4,'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 (143,4,'- 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 (144,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 (145,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 (146,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 (147,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 (148,4,'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 (149,4,'/','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 (150,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 (151,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 (152,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (153,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 (154,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (155,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 (156,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 (157,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 (158,19,'>=','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 (159,4,'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 (160,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (161,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 (162,32,'SYSDATE','Syntax:\nSYSDATE()\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\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 (163,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 (164,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/functions-to-convert-geometries-between-formats.html\n\n','SELECT AsBinary(g) FROM geom;\n','http://dev.mysql.com/doc/refman/5.6/en/functions-to-convert-geometries-between-formats.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (165,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 (166,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 (167,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 (168,6,'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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (169,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 (170,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 (171,17,'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 (172,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:\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 (173,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 (174,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 (175,19,'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 (176,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 (177,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (178,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 (179,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (180,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 (181,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 (182,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 (183,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 (184,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 (185,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 (186,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (187,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 (188,19,'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 (189,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (190,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 (191,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 (192,6,'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/functions-for-testing-spatial-relations-between-geometric-objects.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), MBRContains(@g2,@g1);\n----------------------+----------------------+\n| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |\n+----------------------+----------------------+\n| 1 | 0 |\n+----------------------+----------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (193,4,'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 (194,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 (195,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 (196,3,'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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (197,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 (198,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 (199,19,'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 (200,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 (201,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 (202,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 (203,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 (204,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 (205,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (206,20,'>>','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 (207,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 (208,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 (209,6,'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/functions-for-testing-spatial-relations-between-geometric-objects.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/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (210,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 (211,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 (212,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 (213,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (214,21,'CHECKSUM TABLE','Syntax:\nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]\n\nCHECKSUM TABLE reports a checksum for the contents of a table. You can\nuse this statement to verify that the contents are the same before and\nafter a backup, rollback, or other operation that is intended to put\nthe data back to a known state. This statement requires the SELECT\nprivilege 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 (215,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (216,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (217,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 (218,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 (219,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 (220,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 (221,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. Note that the period argument P is not a\ndate 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 (222,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 (223,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 (224,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 (225,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 (226,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (227,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 (228,3,'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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (229,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 (230,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 (231,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 (232,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 (233,19,'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 (234,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 (235,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 (236,20,'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 (237,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (238,4,'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 (239,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 autocommit is 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 (240,4,'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 (241,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\nPrior to MySQL 5.6.1, this function is unimplemented.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/functions-that-create-new-geometries-from-existing-ones.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-that-create-new-geometries-from-existing-ones.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (242,19,'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 (243,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 (244,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 (245,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 (246,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 (247,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 (248,40,'CREATE TABLE','Syntax:\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n (create_definition,...)\n [table_options]\n [partition_options]\n\nOr:\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n [(create_definition,...)]\n [table_options]\n [partition_options]\n select_statement\n\nOr:\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\n | TIMESTAMP\n | DATETIME\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 (249,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 (250,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 (251,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 (252,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 (253,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 an existing MySQL user\naccount. When the read_only system variable is enabled, the SUPER\nprivilege is required to use SET PASSWORD, in addition to whatever\nother privileges might be required.\n\nIf the password is specified using the PASSWORD() or OLD_PASSWORD()\nfunction, the cleartext (unencrypted) password should be given as the\nargument to the function, which hashes the password and returns the\nencrypted password string. If the password is specified without using\neither function, it should be the already encrypted password value as a\nliteral string. In all cases, the encrypted password string must be in\nthe format required by the authentication method used for the account.\n\nWith no FOR user clause, this statement sets the password for the\ncurrent user. (To see which account the server authenticated you as,\ninvoke the CURRENT_USER() function.) Any client who successfully\nconnects to the server using a nonanonymous account can change the\npassword for that account.\n\nWith a FOR user clause, this statement sets the password for the named\nuser. You must have the UPDATE privilege for the mysql database to do\nthis. The user account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.6/en/account-names.html. The user\nvalue should be given as \'user_name\'@\'host_name\', where \'user_name\' and\n\'host_name\' are exactly as listed in the User and Host columns of the\nmysql.user table row. (If you specify only a user name, a host name of\n\'%\' is used.) For example, to set the password for an account with User\nand Host column values of \'bob\' and \'%.example.org\', write the\nstatement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.example.org\' = PASSWORD(\'cleartext password\');\n\nThat is equivalent to the following statements:\n\nUPDATE mysql.user SET Password=PASSWORD(\'cleartext password\')\n WHERE User=\'bob\' AND Host=\'%.example.org\';\nFLUSH PRIVILEGES;\n\nAnother way to set the password is to use GRANT:\n\nGRANT USAGE ON *.* TO \'bob\'@\'%.example.org\' IDENTIFIED BY \'cleartext password\';\n\nThe old_passwords system variable value determines the hashing method\nused by PASSWORD(). If you specify the password using that function and\nSET PASSWORD rejects the password as not being in the correct format,\nit may be necessary to set old_passwords to change the hashing method.\nFor descriptions of the permitted values, 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/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 (254,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 (255,7,'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 (256,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (257,4,'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 (258,4,'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 (259,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 (260,4,'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 (261,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 (262,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.\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 (263,12,'AES_DECRYPT','Syntax:\nAES_DECRYPT(crypt_str,key_str)\n\nThis function decrypts data using the official AES (Advanced Encryption\nStandard) algorithm. For more information, see the description of\nAES_ENCRYPT().\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 (264,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 (265,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 (266,13,'GLENGTH','GLength(ls)\n\nReturns as a double-precision number the length of the LineString value\nls in its associated spatial reference.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (267,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 (268,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 (269,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 (270,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 (271,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 (272,17,'GTID_SUBSET','Syntax:\nGTID_SUBSET(subset,set)\n\nGiven two sets of global transaction IDs subset and set, returns true\nif all GTIDs in subset are also in set. Returns false otherwise.\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 (273,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 (274,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 (275,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 (276,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 (277,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 (278,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 (279,20,'^','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 (280,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 (281,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 (282,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 (283,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 (284,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\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 (285,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 (286,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 (287,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 (288,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (289,7,'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 (290,4,'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 (291,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 (292,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 (293,3,'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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (294,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 (295,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 (296,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 (297,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 (298,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 (299,7,'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 (300,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 (301,19,'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 (302,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 (303,19,'=','=\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 (304,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 (305,37,'BOUNDARY','Boundary(g)\n\nReturns a geometry that is the closure of the combinatorial boundary of\nthe geometry value g.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (306,10,'CREATE USER','Syntax:\nCREATE USER user_specification\n [, user_specification] ...\n\nuser_specification:\n user\n [\n IDENTIFIED BY [PASSWORD] \'password\'\n | IDENTIFIED WITH auth_plugin [AS \'auth_string\']\n ]\n\nThe CREATE USER statement creates new MySQL accounts. To use it, you\nmust have the global CREATE USER privilege or the INSERT privilege for\nthe mysql database. For each account, CREATE USER creates a new row in\nthe mysql.user table and assigns the account no privileges. An error\noccurs if the account already exists.\n\nFor CREATE USER statements that do not specify an IDENTIFIED WITH\nauth_plugin clause, the server associates the account with the default\nauthentication plugin. As of MySQL 5.6.6, this is the plugin named by\nthe --default-authentication-plugin option at server startup, or\nmysql_native_password if that option is not used. Before 5.6.6, the\ndefault plugin is mysql_native_password. For information about\nauthentication plugins, see\nhttp://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html.\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 user specification may indicate how the user should authenticate\nwhen connecting to the server:\n\no To enable the user to connect with no password (which is insecure),\n include no IDENTIFIED BY clause:\n\nCREATE USER \'jeffrey\'@\'localhost\';\n\n In this case, the account uses the default authentication plugin and\n clients must provide no password.\n\no To assign a password, use IDENTIFIED BY with the literal plaintext\n password value:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\n The account uses the default authentication plugin and clients must\n match the given password.\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 account uses the default authentication plugin and the has must\n be in the format required by that plugin. Clients must match the\n given password.\n\no To authenticate the account using a specific authentication plugin,\n use IDENTIFIED WITH, where auth_plugin is the plugin name. It can be\n an unquoted name or a quoted string literal. \'auth_string\' is an\n optional quoted string literal to pass to the plugin. The plugin\n interprets the meaning of the string, so its format is plugin\n specific. Consult the documentation for a given plugin for\n information about the authentication string values it accepts.\n\nCREATE USER \'jeffrey\'@\'localhost\'\nIDENTIFIED WITH my_auth_plugin;\n\n For connections that use this account, the server invokes the named\n plugin and clients must provide credentials as required for the\n authentication method that the plugin implements. If the server\n cannot find the plugin, either at account-creation time or connect\n time, an error occurs.\n\nThe IDENTIFIED BY and IDENTIFIED WITH clauses are mutually exclusive,\nso at most one of them can be specified for a given user.\n\nFor additional information about setting passwords, see\nhttp://dev.mysql.com/doc/refman/5.6/en/assigning-passwords.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 (307,25,'POINT','Point(x,y)\n\nConstructs a Point using its coordinates.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (308,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 (309,19,'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 (310,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.\n\no 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 (311,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 (312,6,'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 (313,25,'GEOMETRYCOLLECTION','GeometryCollection(g1,g2,...)\n\nConstructs a GeometryCollection.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (314,4,'*','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 (315,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 (316,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (317,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 (318,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 (319,3,'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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (320,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (321,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 multi-byte\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 (322,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 (323,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 (324,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 (325,19,'<=>','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 (326,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 (327,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. Returns 1 if the lock was obtained\nsuccessfully, 0 if the attempt timed out (for example, because another\nclient has previously locked the name), or NULL if an error occurred\n(such as running out of memory or the thread was killed with mysqladmin\nkill). If you have a lock obtained with GET_LOCK(), it is released when\nyou execute RELEASE_LOCK(), execute a new GET_LOCK(), or your\nconnection terminates (either normally or abnormally). Locks obtained\nwith GET_LOCK() do not interact with transactions. That is, committing\na transaction does not release any such locks obtained during the\ntransaction.\n\nThis function 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 by one client, GET_LOCK() blocks any request by another\nclient for a lock with the same name. This enables clients that agree\non a given lock name to use the name to perform cooperative advisory\nlocking. But be aware that it also enables a client that is not among\nthe set of cooperating clients to lock a name, either inadvertently or\ndeliberately, and thus prevent any of the cooperating clients from\nlocking that name. One way to reduce the likelihood of this is to use\nlock names that are database-specific or application-specific. For\nexample, use lock names of the form db_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 (328,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 (329,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 (330,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 (331,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 the\nFROM_BASE64() function.\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 (332,4,'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 (333,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 3 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 (334,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 (335,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 (336,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 (337,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 (338,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 (339,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 (340,27,'SHOW SLAVE HOSTS','Syntax:\nSHOW SLAVE HOSTS\n\nDisplays a list of replication slaves currently registered with the\nmaster.\n\nThe list is displayed on any server (not just the master server). The\noutput looks like this:\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 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\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 the slave server is listening on.\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.\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 (341,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.html#innodb\n -performance-ro-txn 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 (342,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 (343,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 (344,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 (345,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 (346,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 multi-byte\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 (347,20,'~','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 (348,4,'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 (349,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 (350,4,'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 (351,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 (352,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 (353,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 (354,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 (355,4,'%','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 (356,3,'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/functions-to-convert-geometries-between-formats.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/functions-to-convert-geometries-between-formats.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (357,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 (358,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 (359,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (360,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 (361,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 (362,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 for\n MASTER_PASSWORD causes an error (Bug #13427949).\n\n Currently, a password used for a replication slave account is\n effectively limited to 32 characters in length; the password can be\n longer, but any excess characters are truncated. This is not due to\n any limit imposed by the MySQL Server generally, but rather is an\n issue specific to MySQL Replication. (For more information, see Bug\n #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. In this case, the\ncoordinates represented by MASTER_LOG_FILE and MASTER_LOG_POS are not\nused, and global transaction identifiers are used instead. Thus the use\nof either or both of these options together with MASTER_AUTO_POSITION\ncauses 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\nIf a CHANGE MASTER TO statement is issued without any IGNORE_SERVER_IDS\noption, any existing list is preserved; RESET SLAVE also has no effect\non the server ID list. To clear the list of ignored servers, it is\nnecessary to use the option with an empty list:\n\nCHANGE MASTER TO IGNORE_SERVER_IDS = ();\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 to the slave, you can run\nCHANGE MASTER TO MASTER_LOG_FILE=\'log_name\', MASTER_LOG_POS=log_pos on\nthe 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 (363,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 (364,4,'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 (365,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (366,3,'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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (367,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 (368,19,'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 (369,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 (370,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 (371,4,'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 (372,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 (373,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 (374,19,'<','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 (375,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 (376,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 (377,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 (378,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. To use it,\nyou must have the global CREATE USER privilege or the UPDATE privilege\nfor the mysql database. An error occurs if any old account does not\nexist or any new account exists. Each account name uses the format\ndescribed in http://dev.mysql.com/doc/refman/5.6/en/account-names.html.\nFor 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 (379,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (380,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 default to 128M (128\nmegabytes). You may optionally follow size with a one-letter\nabbreviation for an order of magnitude, similar to those used in\nmy.cnf. Generally, this is one of the letters M (for megabytes) or G\n(for gigabytes).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug #29186)\n\nThe minimum permitted value for INITIAL_SIZE is 1M. (Bug #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 (381,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 (382,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 (383,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 (384,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 (385,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 (386,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (387,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 (388,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 (389,3,'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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (390,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 (391,4,'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 (392,4,'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 (393,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 (394,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 (395,4,'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 (396,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 (397,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 (398,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 (399,4,'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 (400,4,'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 (401,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 (402,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 (403,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.\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 (404,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 (405,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 (406,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (407,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\nYYformat, 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 (408,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 (409,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 (410,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 multi-byte 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 (411,6,'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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (412,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 (413,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 (414,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 (415,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 (416,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 (417,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 (418,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 (419,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 (420,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 (421,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 (422,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 (423,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 (424,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 (425,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 (426,2,'AREA','Area(poly)\n\nReturns as a double-precision number the area of the Polygon value\npoly, as measured in its spatial reference system.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-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 Area(GeomFromText(@poly));\n+---------------------------+\n| Area(GeomFromText(@poly)) |\n+---------------------------+\n| 4 |\n+---------------------------+\n','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (427,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 USER, PASSWORD, or both. (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 both the slave SQL thread to process and the slave I/O thread to\nfetch transactions until both of them have reached the first\ntransaction whose GTID is listed in the gtid_set. START SLAVE UNTIL\nSQL_AFTER_GTIDS causes the slave threads to process all transactions\nuntil the last transaction in the gtid_set has been processed by both\nthreads. In other words, START SLAVE UNTIL SQL_BEFORE_GTIDS causes the\nslave SQL to process and I/O threads to fetch all transactions\noccurring before the first GTID in the gtid_set is reached, and START\nSLAVE UNTIL SQL_AFTER_GTIDS causes the slave threads to handle all\ntransactions, including those whose GTIDs are found in gtid_set, until\neach has encountered a transaction whose GTID is not part of the set.\nSQL_BEFORE_GTIDS and SQL_AFTER_GTIDS each support the SQL_THREAD and\nIO_THREAD options.\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 IO_THREAD UNTIL SQL_AFTER_GTIDS =\n3E11FA47-71CA-11E1-9E33-C80AA9429562:11-56, on the other hand, would\ncause the slave I/O 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 I/O\nthread.\n\nWith neither the SQL_THREAD option nor the IO_THREAD option, the\nprevious statement would cause the slave SQL thread to execute all\ntransactions originating from this master, including all transactions\nwith sequence numbers 11 through 56, and then to stop without\nprocessing any additional transactions. The same command would also\ncause the slave I/O thread to start. When the SQL thread reaches the\ncondition, it is stopped. In other words, START SLAVE UNTIL\nSQL_BEFORE_GTIDS has the same effect as START SLAVE SQL_THREAD,\nIO_THREAD UNTIL SQL_BEFORE_GTIDS; the slave SQL thread and slave I/O\nthread are each started, and the SQL thread continues executing\ntransactions until the stop condition for that thread is met.\n(Similarly, START SLAVE UNTIL SQL_AFTER_GTIDS is effectively the same\nas START SLAVE SQL_THREAD, IO_THREAD UNTIL SQL_AFTER_GTIDS.)\n\nPrior to MySQL 5.6.14, SQL_AFTER_GTIDS did not stop the slave once the\nindicated transaction waa 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 (428,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 (429,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. To use this statement, you must have the global CREATE USER\nprivilege or the DELETE privilege for the mysql database. Each account\nname 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 (430,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 (431,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/geometry-property-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (432,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 (433,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 (434,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (435,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 (436,6,'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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (437,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 (438,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 (439,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 (440,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 (441,4,'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 (442,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 (443,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 (444,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 (445,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (446,4,'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 (447,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 (448,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 (449,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 (450,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 (451,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 (452,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\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 UNIV_DEBUG\n was defined at MySQL compilation time (for example, in include/univ.i\n in the InnoDB part of the MySQL source tree). If UNIV_DEBUG was not\n defined, the statement displays only the os_waits value. In the\n latter case (without UNIV_DEBUG), the information on which the output\n is based is insufficient to distinguish regular mutexes and mutexes\n that protect rw-locks (which permit multiple readers or a single\n writer). Consequently, the output may appear to contain multiple rows\n for the 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 binlog 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 (453,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 (454,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 (455,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 (456,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 (457,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 (458,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 (459,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 (460,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 (461,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 (462,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 (463,19,'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 (464,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 (465,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 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 (466,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 (467,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 (468,3,'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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (469,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 (470,10,'ALTER USER','Syntax:\nALTER USER user_specification\n [, 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\nThe 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\nAfter an account\'s password has been expired, all operations performed\nin subsequent connections to the server using the account result in an\nerror until the user issues a SET PASSWORD statement to establish a new\naccount 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 also 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 connections for the account remain under\nrestriction. Clients using the account must disconnect and reconnect\nbefore statements can be executed successfully.\n\nIt is possible after password expiration to "reset" a password by using\nSET PASSWORD to set it to its current value. As a matter of good\npolicy, it is preferable 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 (471,4,'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 (472,17,'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 (473,38,'LENGTH','Syntax:\nLENGTH(str)\n\nReturns the length of the string str, measured in bytes. A multi-byte\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 (474,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 (475,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (476,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 (477,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 (478,20,'|','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 (479,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 (480,3,'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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (481,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 (482,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 (483,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 change 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 (484,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 character set indicated by the character_set_database system\nvariable is used to interpret the information in the file. SET NAMES\nand the setting of character_set_client do not affect interpretation of\ninput. If the contents of the input file use a character set that\ndiffers from the default, it is usually preferable to specify the\ncharacter set of the file by using the CHARACTER SET clause. A\ncharacter 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, input rows that duplicate an existing row on a\n unique key value are skipped.\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 (485,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 (486,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 (487,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 (488,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 (489,12,'PASSWORD','Syntax:\nPASSWORD(str)\n\nCalculates and returns a hashed password string from the cleartext\npassword str and returns 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 PASSWORD() (as well as for the IDENTIFIED BY clause of the\nCREATE USER and GRANT statements).\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\');\n+-------------------------------------------+\n| PASSWORD(\'mypass\') |\n+-------------------------------------------+\n| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |\n+-------------------------------------------+\n\nmysql> SET old_passwords = 1;\nmysql> SELECT PASSWORD(\'mypass\');\n+--------------------+\n| PASSWORD(\'mypass\') |\n+--------------------+\n| 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 (490,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 (491,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/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (492,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 (493,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/functions-for-testing-spatial-relations-between-geometric-objects.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/functions-for-testing-spatial-relations-between-geometric-objects.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (494,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\nXA START xid starts an XA transaction with the given xid value. Each XA\ntransaction 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 (495,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 (496,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 (497,12,'AES_ENCRYPT','Syntax:\nAES_ENCRYPT(str,key_str)\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 allows various key\nsizes. These functions implement AES with a 128-bit key length, but you\ncan extend them to 256 bits by modifying the source. The key length is\na trade off between performance and security.\n\nAES_ENCRYPT() encrypts the string str using a key key_str and returns a\nbinary string containing the encrypted output. AES_DECRYPT() decrypts\nthe encrypted string crypt_str using a key key_str and returns the\noriginal plaintext string. If either argument is NULL, the results of\nthese functions are also 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\nThe most secure way to pass a key to the key_str argument is to create\na truly random 128-bit value and pass it as a binary value. For\nexample:\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\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 (498,4,'+','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 (499,17,'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','','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 (500,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 (501,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 (502,4,'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 (503,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (504,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 (505,37,'GEOMETRYTYPE','GeometryType(g)\n\nReturns as a binary string the name of the geometry type of which the\ngeometry instance g is a member. The name corresponds to one of the\ninstantiable Geometry subclasses.\n\nURL: http://dev.mysql.com/doc/refman/5.6/en/geometry-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/geometry-property-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (506,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 (507,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 (508,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 (509,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 (510,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 (511,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/creating-spatial-values.html\n\n','','http://dev.mysql.com/doc/refman/5.6/en/creating-spatial-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (512,40,'ALTER TABLE','Syntax:\nALTER [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\nPartitioning-related clauses for ALTER TABLE can be used with\npartitioned tables for repartitioning, for adding, dropping, merging,\nand splitting partitions, and for performing partitioning maintenance.\nIt is possible for an ALTER TABLE statement to contain a PARTITION BY\nor REMOVE PARTITIONING clause in an addition to other alter\nspecifications, but the PARTITION BY or REMOVE PARTITIONING clause must\nbe specified last after any other specifications. The ADD PARTITION,\nDROP PARTITION, COALESCE PARTITION, REORGANIZE 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, see\nhttp://dev.mysql.com/doc/refman/5.6/en/alter-table-partition-operations\n.html.\n\nFollowing the table name, specify the alterations to be made. If none\nare given, ALTER TABLE does nothing.\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 (513,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 (514,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 (515,19,'>','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 (516,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-performance.html#innodb-p\nersistent-stats and\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 (517,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 (518,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 (519,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 128M (128 megabytes). You may optionally follow this integer\nvalue with a one-letter abbreviation for an order of magnitude, similar\nto those used in my.cnf. Generally, this is one of the letters M (for\nmegabytes) or G (for 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 4G.\n(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 (520,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 (521,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 (522,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 (523,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 (524,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 multi-byte\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 (525,4,'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 (526,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 (527,19,'!=','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 (528,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 (529,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 (530,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 (531,4,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians. (Note that\nÏ 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 (532,19,'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 (533,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.17-standard\'\n','http://dev.mysql.com/doc/refman/5.6/en/information-functions.html'); +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_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,'STARTS'); -insert into help_keyword (help_keyword_id,name) values (9,'MASTER_SSL_CA'); -insert into help_keyword (help_keyword_id,name) values (10,'NCHAR'); -insert into help_keyword (help_keyword_id,name) values (11,'ONLY'); -insert into help_keyword (help_keyword_id,name) values (12,'COLUMNS'); -insert into help_keyword (help_keyword_id,name) values (13,'COMPLETION'); -insert into help_keyword (help_keyword_id,name) values (14,'WORK'); -insert into help_keyword (help_keyword_id,name) values (15,'DATETIME'); -insert into help_keyword (help_keyword_id,name) values (16,'MODE'); -insert into help_keyword (help_keyword_id,name) values (17,'OPEN'); -insert into help_keyword (help_keyword_id,name) values (18,'INTEGER'); -insert into help_keyword (help_keyword_id,name) values (19,'ESCAPE'); -insert into help_keyword (help_keyword_id,name) values (20,'VALUE'); -insert into help_keyword (help_keyword_id,name) values (21,'MASTER_SSL_VERIFY_SERVER_CERT'); -insert into help_keyword (help_keyword_id,name) values (22,'SQL_BIG_RESULT'); -insert into help_keyword (help_keyword_id,name) values (23,'DROP'); -insert into help_keyword (help_keyword_id,name) values (24,'GEOMETRYCOLLECTIONFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (25,'EVENTS'); -insert into help_keyword (help_keyword_id,name) values (26,'MONTH'); -insert into help_keyword (help_keyword_id,name) values (27,'PROFILES'); -insert into help_keyword (help_keyword_id,name) values (28,'DUPLICATE'); -insert into help_keyword (help_keyword_id,name) values (29,'REPLICATION'); -insert into help_keyword (help_keyword_id,name) values (30,'UNLOCK'); -insert into help_keyword (help_keyword_id,name) values (31,'STATS_PERSISTENT'); -insert into help_keyword (help_keyword_id,name) values (32,'INNODB'); -insert into help_keyword (help_keyword_id,name) values (33,'YEAR_MONTH'); -insert into help_keyword (help_keyword_id,name) values (34,'SUBJECT'); -insert into help_keyword (help_keyword_id,name) values (35,'MASTER_RETRY_COUNT'); -insert into help_keyword (help_keyword_id,name) values (36,'PREPARE'); -insert into help_keyword (help_keyword_id,name) values (37,'LOCK'); -insert into help_keyword (help_keyword_id,name) values (38,'NDB'); -insert into help_keyword (help_keyword_id,name) values (39,'CHECK'); -insert into help_keyword (help_keyword_id,name) values (40,'FULL'); -insert into help_keyword (help_keyword_id,name) values (41,'INT4'); -insert into help_keyword (help_keyword_id,name) values (42,'BY'); -insert into help_keyword (help_keyword_id,name) values (43,'NO'); -insert into help_keyword (help_keyword_id,name) values (44,'MINUTE'); -insert into help_keyword (help_keyword_id,name) values (45,'PARTITION'); -insert into help_keyword (help_keyword_id,name) values (46,'DATA'); -insert into help_keyword (help_keyword_id,name) values (47,'DAY'); -insert into help_keyword (help_keyword_id,name) values (48,'SHARE'); -insert into help_keyword (help_keyword_id,name) values (49,'REAL'); -insert into help_keyword (help_keyword_id,name) values (50,'SEPARATOR'); -insert into help_keyword (help_keyword_id,name) values (51,'MESSAGE_TEXT'); -insert into help_keyword (help_keyword_id,name) values (52,'MASTER_HEARTBEAT_PERIOD'); -insert into help_keyword (help_keyword_id,name) values (53,'DELETE'); -insert into help_keyword (help_keyword_id,name) values (54,'ON'); -insert into help_keyword (help_keyword_id,name) values (55,'COLUMN_NAME'); -insert into help_keyword (help_keyword_id,name) values (56,'CONNECTION'); -insert into help_keyword (help_keyword_id,name) values (57,'CLOSE'); -insert into help_keyword (help_keyword_id,name) values (58,'MASTER_SSL_CRLPATH'); -insert into help_keyword (help_keyword_id,name) values (59,'X509'); -insert into help_keyword (help_keyword_id,name) values (60,'USE'); -insert into help_keyword (help_keyword_id,name) values (61,'SUBCLASS_ORIGIN'); -insert into help_keyword (help_keyword_id,name) values (62,'WHERE'); -insert into help_keyword (help_keyword_id,name) values (63,'PRIVILEGES'); -insert into help_keyword (help_keyword_id,name) values (64,'SPATIAL'); -insert into help_keyword (help_keyword_id,name) values (65,'EVENT'); -insert into help_keyword (help_keyword_id,name) values (66,'SUPER'); -insert into help_keyword (help_keyword_id,name) values (67,'SQL_BUFFER_RESULT'); -insert into help_keyword (help_keyword_id,name) values (68,'IGNORE'); -insert into help_keyword (help_keyword_id,name) values (69,'SHA2'); -insert into help_keyword (help_keyword_id,name) values (70,'QUICK'); -insert into help_keyword (help_keyword_id,name) values (71,'SIGNED'); -insert into help_keyword (help_keyword_id,name) values (72,'SECURITY'); -insert into help_keyword (help_keyword_id,name) values (73,'AUTOEXTEND_SIZE'); -insert into help_keyword (help_keyword_id,name) values (74,'NDBCLUSTER'); -insert into help_keyword (help_keyword_id,name) values (75,'POLYGONFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (76,'FALSE'); -insert into help_keyword (help_keyword_id,name) values (77,'LEVEL'); -insert into help_keyword (help_keyword_id,name) values (78,'FORCE'); -insert into help_keyword (help_keyword_id,name) values (79,'BINARY'); -insert into help_keyword (help_keyword_id,name) values (80,'TO'); -insert into help_keyword (help_keyword_id,name) values (81,'CHANGE'); -insert into help_keyword (help_keyword_id,name) values (82,'CURRENT_USER'); -insert into help_keyword (help_keyword_id,name) values (83,'HOUR_MINUTE'); -insert into help_keyword (help_keyword_id,name) values (84,'UPDATE'); -insert into help_keyword (help_keyword_id,name) values (85,'PRESERVE'); -insert into help_keyword (help_keyword_id,name) values (86,'TABLE_NAME'); -insert into help_keyword (help_keyword_id,name) values (87,'INTO'); -insert into help_keyword (help_keyword_id,name) values (88,'FEDERATED'); -insert into help_keyword (help_keyword_id,name) values (89,'VARYING'); -insert into help_keyword (help_keyword_id,name) values (90,'MAX_SIZE'); -insert into help_keyword (help_keyword_id,name) values (91,'HOUR_SECOND'); -insert into help_keyword (help_keyword_id,name) values (92,'SQL_AFTER_GTIDS'); -insert into help_keyword (help_keyword_id,name) values (93,'VARIABLE'); -insert into help_keyword (help_keyword_id,name) values (94,'ROLLBACK'); -insert into help_keyword (help_keyword_id,name) values (95,'PROCEDURE'); -insert into help_keyword (help_keyword_id,name) values (96,'TIMESTAMP'); -insert into help_keyword (help_keyword_id,name) values (97,'IMPORT'); -insert into help_keyword (help_keyword_id,name) values (98,'AGAINST'); -insert into help_keyword (help_keyword_id,name) values (99,'CHECKSUM'); -insert into help_keyword (help_keyword_id,name) values (100,'SQL_BEFORE_GTIDS'); -insert into help_keyword (help_keyword_id,name) values (101,'COUNT'); -insert into help_keyword (help_keyword_id,name) values (102,'LONGBINARY'); -insert into help_keyword (help_keyword_id,name) values (103,'THEN'); -insert into help_keyword (help_keyword_id,name) values (104,'INSERT'); -insert into help_keyword (help_keyword_id,name) values (105,'ENGINES'); -insert into help_keyword (help_keyword_id,name) values (106,'HANDLER'); -insert into help_keyword (help_keyword_id,name) values (107,'PORT'); -insert into help_keyword (help_keyword_id,name) values (108,'DAY_SECOND'); -insert into help_keyword (help_keyword_id,name) values (109,'EXISTS'); -insert into help_keyword (help_keyword_id,name) values (110,'MUTEX'); -insert into help_keyword (help_keyword_id,name) values (111,'HELP_DATE'); -insert into help_keyword (help_keyword_id,name) values (112,'RELEASE'); -insert into help_keyword (help_keyword_id,name) values (113,'BOOLEAN'); -insert into help_keyword (help_keyword_id,name) values (114,'MOD'); -insert into help_keyword (help_keyword_id,name) values (115,'DEFAULT'); -insert into help_keyword (help_keyword_id,name) values (116,'TYPE'); -insert into help_keyword (help_keyword_id,name) values (117,'NO_WRITE_TO_BINLOG'); -insert into help_keyword (help_keyword_id,name) values (118,'OPTIMIZE'); -insert into help_keyword (help_keyword_id,name) values (119,'SQLSTATE'); -insert into help_keyword (help_keyword_id,name) values (120,'RESET'); -insert into help_keyword (help_keyword_id,name) values (121,'CLASS_ORIGIN'); -insert into help_keyword (help_keyword_id,name) values (122,'INSTALL'); -insert into help_keyword (help_keyword_id,name) values (123,'ITERATE'); -insert into help_keyword (help_keyword_id,name) values (124,'DO'); -insert into help_keyword (help_keyword_id,name) values (125,'BIGINT'); -insert into help_keyword (help_keyword_id,name) values (126,'SET'); -insert into help_keyword (help_keyword_id,name) values (127,'ISSUER'); -insert into help_keyword (help_keyword_id,name) values (128,'DATE'); -insert into help_keyword (help_keyword_id,name) values (129,'STATUS'); -insert into help_keyword (help_keyword_id,name) values (130,'FULLTEXT'); -insert into help_keyword (help_keyword_id,name) values (131,'COMMENT'); -insert into help_keyword (help_keyword_id,name) values (132,'MASTER_CONNECT_RETRY'); -insert into help_keyword (help_keyword_id,name) values (133,'INNER'); -insert into help_keyword (help_keyword_id,name) values (134,'RELAYLOG'); -insert into help_keyword (help_keyword_id,name) values (135,'STOP'); -insert into help_keyword (help_keyword_id,name) values (136,'MASTER_LOG_FILE'); -insert into help_keyword (help_keyword_id,name) values (137,'MRG_MYISAM'); -insert into help_keyword (help_keyword_id,name) values (138,'PRECISION'); -insert into help_keyword (help_keyword_id,name) values (139,'REQUIRE'); -insert into help_keyword (help_keyword_id,name) values (140,'TRAILING'); -insert into help_keyword (help_keyword_id,name) values (141,'PARTITIONS'); -insert into help_keyword (help_keyword_id,name) values (142,'LONG'); -insert into help_keyword (help_keyword_id,name) values (143,'OPTION'); -insert into help_keyword (help_keyword_id,name) values (144,'REORGANIZE'); -insert into help_keyword (help_keyword_id,name) values (145,'ELSE'); -insert into help_keyword (help_keyword_id,name) values (146,'DEALLOCATE'); -insert into help_keyword (help_keyword_id,name) values (147,'IO_THREAD'); -insert into help_keyword (help_keyword_id,name) values (148,'CASE'); -insert into help_keyword (help_keyword_id,name) values (149,'CIPHER'); -insert into help_keyword (help_keyword_id,name) values (150,'STATS_AUTO_RECALC'); -insert into help_keyword (help_keyword_id,name) values (151,'CONTINUE'); -insert into help_keyword (help_keyword_id,name) values (152,'FROM'); -insert into help_keyword (help_keyword_id,name) values (153,'READ'); -insert into help_keyword (help_keyword_id,name) values (154,'LEFT'); -insert into help_keyword (help_keyword_id,name) values (155,'ELSEIF'); -insert into help_keyword (help_keyword_id,name) values (156,'MINUTE_SECOND'); -insert into help_keyword (help_keyword_id,name) values (157,'COMPACT'); -insert into help_keyword (help_keyword_id,name) values (158,'DEC'); -insert into help_keyword (help_keyword_id,name) values (159,'FOR'); -insert into help_keyword (help_keyword_id,name) values (160,'WARNINGS'); -insert into help_keyword (help_keyword_id,name) values (161,'MIN_ROWS'); -insert into help_keyword (help_keyword_id,name) values (162,'STRING'); -insert into help_keyword (help_keyword_id,name) values (163,'CONDITION'); -insert into help_keyword (help_keyword_id,name) values (164,'ROW_COUNT'); -insert into help_keyword (help_keyword_id,name) values (165,'ENCLOSED'); -insert into help_keyword (help_keyword_id,name) values (166,'FUNCTION'); -insert into help_keyword (help_keyword_id,name) values (167,'AGGREGATE'); -insert into help_keyword (help_keyword_id,name) values (168,'NUMBER'); -insert into help_keyword (help_keyword_id,name) values (169,'FIELDS'); -insert into help_keyword (help_keyword_id,name) values (170,'INT3'); -insert into help_keyword (help_keyword_id,name) values (171,'ARCHIVE'); -insert into help_keyword (help_keyword_id,name) values (172,'AVG_ROW_LENGTH'); -insert into help_keyword (help_keyword_id,name) values (173,'ADD'); -insert into help_keyword (help_keyword_id,name) values (174,'KILL'); -insert into help_keyword (help_keyword_id,name) values (175,'FLOAT4'); -insert into help_keyword (help_keyword_id,name) values (176,'TABLESPACE'); -insert into help_keyword (help_keyword_id,name) values (177,'VIEW'); -insert into help_keyword (help_keyword_id,name) values (178,'ALGORITHM'); -insert into help_keyword (help_keyword_id,name) values (179,'REPEATABLE'); -insert into help_keyword (help_keyword_id,name) values (180,'INFILE'); -insert into help_keyword (help_keyword_id,name) values (181,'HELP_VERSION'); -insert into help_keyword (help_keyword_id,name) values (182,'ORDER'); -insert into help_keyword (help_keyword_id,name) values (183,'MASTER_SSL_CRL'); -insert into help_keyword (help_keyword_id,name) values (184,'USING'); -insert into help_keyword (help_keyword_id,name) values (185,'CONSTRAINT_CATALOG'); -insert into help_keyword (help_keyword_id,name) values (186,'MIDDLEINT'); -insert into help_keyword (help_keyword_id,name) values (187,'GRANT'); -insert into help_keyword (help_keyword_id,name) values (188,'UNSIGNED'); -insert into help_keyword (help_keyword_id,name) values (189,'DECIMAL'); -insert into help_keyword (help_keyword_id,name) values (190,'GEOMETRYFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (191,'INDEXES'); -insert into help_keyword (help_keyword_id,name) values (192,'DEFAULT_AUTH'); -insert into help_keyword (help_keyword_id,name) values (193,'FOREIGN'); -insert into help_keyword (help_keyword_id,name) values (194,'CACHE'); -insert into help_keyword (help_keyword_id,name) values (195,'HOSTS'); -insert into help_keyword (help_keyword_id,name) values (196,'MYSQL_ERRNO'); -insert into help_keyword (help_keyword_id,name) values (197,'COMMIT'); -insert into help_keyword (help_keyword_id,name) values (198,'SCHEMAS'); -insert into help_keyword (help_keyword_id,name) values (199,'LEADING'); -insert into help_keyword (help_keyword_id,name) values (200,'SNAPSHOT'); -insert into help_keyword (help_keyword_id,name) values (201,'CONSTRAINT_NAME'); -insert into help_keyword (help_keyword_id,name) values (202,'DECLARE'); -insert into help_keyword (help_keyword_id,name) values (203,'LOAD'); -insert into help_keyword (help_keyword_id,name) values (204,'SQL_CACHE'); -insert into help_keyword (help_keyword_id,name) values (205,'CONVERT'); -insert into help_keyword (help_keyword_id,name) values (206,'DYNAMIC'); -insert into help_keyword (help_keyword_id,name) values (207,'COLLATE'); -insert into help_keyword (help_keyword_id,name) values (208,'POLYGONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (209,'BYTE'); -insert into help_keyword (help_keyword_id,name) values (210,'GLOBAL'); -insert into help_keyword (help_keyword_id,name) values (211,'LINESTRINGFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (212,'WHEN'); -insert into help_keyword (help_keyword_id,name) values (213,'HAVING'); -insert into help_keyword (help_keyword_id,name) values (214,'AS'); -insert into help_keyword (help_keyword_id,name) values (215,'STARTING'); -insert into help_keyword (help_keyword_id,name) values (216,'RELOAD'); -insert into help_keyword (help_keyword_id,name) values (217,'AUTOCOMMIT'); -insert into help_keyword (help_keyword_id,name) values (218,'REVOKE'); -insert into help_keyword (help_keyword_id,name) values (219,'GRANTS'); -insert into help_keyword (help_keyword_id,name) values (220,'OUTER'); -insert into help_keyword (help_keyword_id,name) values (221,'CURSOR_NAME'); -insert into help_keyword (help_keyword_id,name) values (222,'EXPIRE'); -insert into help_keyword (help_keyword_id,name) values (223,'SQL_AFTER_MTS_GAPS'); -insert into help_keyword (help_keyword_id,name) values (224,'FLOOR'); -insert into help_keyword (help_keyword_id,name) values (225,'EXPLAIN'); -insert into help_keyword (help_keyword_id,name) values (226,'WITH'); -insert into help_keyword (help_keyword_id,name) values (227,'AFTER'); -insert into help_keyword (help_keyword_id,name) values (228,'STD'); -insert into help_keyword (help_keyword_id,name) values (229,'CSV'); -insert into help_keyword (help_keyword_id,name) values (230,'DISABLE'); -insert into help_keyword (help_keyword_id,name) values (231,'UNINSTALL'); -insert into help_keyword (help_keyword_id,name) values (232,'OUTFILE'); -insert into help_keyword (help_keyword_id,name) values (233,'LOW_PRIORITY'); -insert into help_keyword (help_keyword_id,name) values (234,'FILE'); -insert into help_keyword (help_keyword_id,name) values (235,'NODEGROUP'); -insert into help_keyword (help_keyword_id,name) values (236,'SCHEMA'); -insert into help_keyword (help_keyword_id,name) values (237,'SONAME'); -insert into help_keyword (help_keyword_id,name) values (238,'POW'); -insert into help_keyword (help_keyword_id,name) values (239,'DUAL'); -insert into help_keyword (help_keyword_id,name) values (240,'MULTIPOINTFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (241,'INDEX'); -insert into help_keyword (help_keyword_id,name) values (242,'MULTIPOINTFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (243,'DEFINER'); -insert into help_keyword (help_keyword_id,name) values (244,'MASTER_BIND'); -insert into help_keyword (help_keyword_id,name) values (245,'REMOVE'); -insert into help_keyword (help_keyword_id,name) values (246,'EXTENDED'); -insert into help_keyword (help_keyword_id,name) values (247,'MULTILINESTRINGFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (248,'CROSS'); -insert into help_keyword (help_keyword_id,name) values (249,'CONTRIBUTORS'); -insert into help_keyword (help_keyword_id,name) values (250,'NATIONAL'); -insert into help_keyword (help_keyword_id,name) values (251,'GROUP'); -insert into help_keyword (help_keyword_id,name) values (252,'SHA'); -insert into help_keyword (help_keyword_id,name) values (253,'UNDO'); -insert into help_keyword (help_keyword_id,name) values (254,'IGNORE_SERVER_IDS'); -insert into help_keyword (help_keyword_id,name) values (255,'MASTER_AUTO_POSITION'); -insert into help_keyword (help_keyword_id,name) values (256,'ZEROFILL'); -insert into help_keyword (help_keyword_id,name) values (257,'CLIENT'); -insert into help_keyword (help_keyword_id,name) values (258,'MASTER_PASSWORD'); -insert into help_keyword (help_keyword_id,name) values (259,'OWNER'); -insert into help_keyword (help_keyword_id,name) values (260,'RELAY_LOG_FILE'); -insert into help_keyword (help_keyword_id,name) values (261,'TRUE'); -insert into help_keyword (help_keyword_id,name) values (262,'CHARACTER'); -insert into help_keyword (help_keyword_id,name) values (263,'MASTER_USER'); -insert into help_keyword (help_keyword_id,name) values (264,'SCHEMA_NAME'); -insert into help_keyword (help_keyword_id,name) values (265,'TABLE'); -insert into help_keyword (help_keyword_id,name) values (266,'ENGINE'); -insert into help_keyword (help_keyword_id,name) values (267,'INSERT_METHOD'); -insert into help_keyword (help_keyword_id,name) values (268,'CASCADE'); -insert into help_keyword (help_keyword_id,name) values (269,'RELAY_LOG_POS'); -insert into help_keyword (help_keyword_id,name) values (270,'SQL_CALC_FOUND_ROWS'); -insert into help_keyword (help_keyword_id,name) values (271,'UNION'); -insert into help_keyword (help_keyword_id,name) values (272,'MYISAM'); -insert into help_keyword (help_keyword_id,name) values (273,'LEAVE'); -insert into help_keyword (help_keyword_id,name) values (274,'MODIFY'); -insert into help_keyword (help_keyword_id,name) values (275,'MATCH'); -insert into help_keyword (help_keyword_id,name) values (276,'MASTER_LOG_POS'); -insert into help_keyword (help_keyword_id,name) values (277,'DISTINCTROW'); -insert into help_keyword (help_keyword_id,name) values (278,'DESC'); -insert into help_keyword (help_keyword_id,name) values (279,'TIME'); -insert into help_keyword (help_keyword_id,name) values (280,'NUMERIC'); -insert into help_keyword (help_keyword_id,name) values (281,'EXPANSION'); -insert into help_keyword (help_keyword_id,name) values (282,'CODE'); -insert into help_keyword (help_keyword_id,name) values (283,'CURSOR'); -insert into help_keyword (help_keyword_id,name) values (284,'GEOMETRYCOLLECTIONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (285,'CHAIN'); -insert into help_keyword (help_keyword_id,name) values (286,'LOGFILE'); -insert into help_keyword (help_keyword_id,name) values (287,'FLUSH'); -insert into help_keyword (help_keyword_id,name) values (288,'CREATE'); -insert into help_keyword (help_keyword_id,name) values (289,'DESCRIBE'); -insert into help_keyword (help_keyword_id,name) values (290,'EXTENT_SIZE'); -insert into help_keyword (help_keyword_id,name) values (291,'MAX_UPDATES_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (292,'INT2'); -insert into help_keyword (help_keyword_id,name) values (293,'PROCESSLIST'); -insert into help_keyword (help_keyword_id,name) values (294,'ENDS'); -insert into help_keyword (help_keyword_id,name) values (295,'LOGS'); -insert into help_keyword (help_keyword_id,name) values (296,'RECOVER'); -insert into help_keyword (help_keyword_id,name) values (297,'DISCARD'); -insert into help_keyword (help_keyword_id,name) values (298,'HEAP'); -insert into help_keyword (help_keyword_id,name) values (299,'RETURNED_SQLSTATE'); -insert into help_keyword (help_keyword_id,name) values (300,'EXCHANGE'); -insert into help_keyword (help_keyword_id,name) values (301,'SOUNDS'); -insert into help_keyword (help_keyword_id,name) values (302,'BETWEEN'); -insert into help_keyword (help_keyword_id,name) values (303,'MULTILINESTRINGFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (304,'REPAIR'); -insert into help_keyword (help_keyword_id,name) values (305,'PACK_KEYS'); -insert into help_keyword (help_keyword_id,name) values (306,'FAST'); -insert into help_keyword (help_keyword_id,name) values (307,'VALUES'); -insert into help_keyword (help_keyword_id,name) values (308,'CALL'); -insert into help_keyword (help_keyword_id,name) values (309,'GET'); -insert into help_keyword (help_keyword_id,name) values (310,'LOOP'); -insert into help_keyword (help_keyword_id,name) values (311,'VARCHARACTER'); -insert into help_keyword (help_keyword_id,name) values (312,'BEFORE'); -insert into help_keyword (help_keyword_id,name) values (313,'TRUNCATE'); -insert into help_keyword (help_keyword_id,name) values (314,'SHOW'); -insert into help_keyword (help_keyword_id,name) values (315,'ALL'); -insert into help_keyword (help_keyword_id,name) values (316,'REDUNDANT'); -insert into help_keyword (help_keyword_id,name) values (317,'USER_RESOURCES'); -insert into help_keyword (help_keyword_id,name) values (318,'PARTIAL'); -insert into help_keyword (help_keyword_id,name) values (319,'BINLOG'); -insert into help_keyword (help_keyword_id,name) values (320,'END'); -insert into help_keyword (help_keyword_id,name) values (321,'SECOND'); -insert into help_keyword (help_keyword_id,name) values (322,'AND'); -insert into help_keyword (help_keyword_id,name) values (323,'FLOAT8'); -insert into help_keyword (help_keyword_id,name) values (324,'PREV'); -insert into help_keyword (help_keyword_id,name) values (325,'HOUR'); -insert into help_keyword (help_keyword_id,name) values (326,'SELECT'); -insert into help_keyword (help_keyword_id,name) values (327,'DATABASES'); -insert into help_keyword (help_keyword_id,name) values (328,'OR'); -insert into help_keyword (help_keyword_id,name) values (329,'IDENTIFIED'); -insert into help_keyword (help_keyword_id,name) values (330,'WRAPPER'); -insert into help_keyword (help_keyword_id,name) values (331,'MASTER_SSL_CIPHER'); -insert into help_keyword (help_keyword_id,name) values (332,'SQL_SLAVE_SKIP_COUNTER'); -insert into help_keyword (help_keyword_id,name) values (333,'BOTH'); -insert into help_keyword (help_keyword_id,name) values (334,'BOOL'); -insert into help_keyword (help_keyword_id,name) values (335,'YEAR'); -insert into help_keyword (help_keyword_id,name) values (336,'MASTER_PORT'); -insert into help_keyword (help_keyword_id,name) values (337,'CONCURRENT'); -insert into help_keyword (help_keyword_id,name) values (338,'HELP'); -insert into help_keyword (help_keyword_id,name) values (339,'UNIQUE'); -insert into help_keyword (help_keyword_id,name) values (340,'TRIGGERS'); -insert into help_keyword (help_keyword_id,name) values (341,'PROCESS'); -insert into help_keyword (help_keyword_id,name) values (342,'OPTIONS'); -insert into help_keyword (help_keyword_id,name) values (343,'RESIGNAL'); -insert into help_keyword (help_keyword_id,name) values (344,'CONSISTENT'); -insert into help_keyword (help_keyword_id,name) values (345,'MASTER_SSL'); -insert into help_keyword (help_keyword_id,name) values (346,'DATE_ADD'); -insert into help_keyword (help_keyword_id,name) values (347,'MAX_CONNECTIONS_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (348,'LIKE'); -insert into help_keyword (help_keyword_id,name) values (349,'PLUGIN'); -insert into help_keyword (help_keyword_id,name) values (350,'FETCH'); -insert into help_keyword (help_keyword_id,name) values (351,'IN'); -insert into help_keyword (help_keyword_id,name) values (352,'COLUMN'); -insert into help_keyword (help_keyword_id,name) values (353,'DIAGNOSTICS'); -insert into help_keyword (help_keyword_id,name) values (354,'DUMPFILE'); -insert into help_keyword (help_keyword_id,name) values (355,'USAGE'); -insert into help_keyword (help_keyword_id,name) values (356,'EXECUTE'); -insert into help_keyword (help_keyword_id,name) values (357,'MEMORY'); -insert into help_keyword (help_keyword_id,name) values (358,'CEIL'); -insert into help_keyword (help_keyword_id,name) values (359,'QUERY'); -insert into help_keyword (help_keyword_id,name) values (360,'MASTER_HOST'); -insert into help_keyword (help_keyword_id,name) values (361,'LINES'); -insert into help_keyword (help_keyword_id,name) values (362,'PLUGIN_DIR'); -insert into help_keyword (help_keyword_id,name) values (363,'SQL_THREAD'); -insert into help_keyword (help_keyword_id,name) values (364,'SERVER'); -insert into help_keyword (help_keyword_id,name) values (365,'MAX_QUERIES_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (366,'MASTER_SSL_CERT'); -insert into help_keyword (help_keyword_id,name) values (367,'MULTIPOLYGONFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (368,'TRANSACTION'); -insert into help_keyword (help_keyword_id,name) values (369,'DAY_MINUTE'); -insert into help_keyword (help_keyword_id,name) values (370,'STDDEV'); -insert into help_keyword (help_keyword_id,name) values (371,'DATE_SUB'); -insert into help_keyword (help_keyword_id,name) values (372,'REBUILD'); -insert into help_keyword (help_keyword_id,name) values (373,'GEOMETRYFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (374,'INT1'); -insert into help_keyword (help_keyword_id,name) values (375,'RENAME'); -insert into help_keyword (help_keyword_id,name) values (376,'PARSER'); -insert into help_keyword (help_keyword_id,name) values (377,'RIGHT'); -insert into help_keyword (help_keyword_id,name) values (378,'ALTER'); -insert into help_keyword (help_keyword_id,name) values (379,'MAX_ROWS'); -insert into help_keyword (help_keyword_id,name) values (380,'SOCKET'); -insert into help_keyword (help_keyword_id,name) values (381,'STRAIGHT_JOIN'); -insert into help_keyword (help_keyword_id,name) values (382,'NATURAL'); -insert into help_keyword (help_keyword_id,name) values (383,'VARIABLES'); -insert into help_keyword (help_keyword_id,name) values (384,'ESCAPED'); -insert into help_keyword (help_keyword_id,name) values (385,'SHA1'); -insert into help_keyword (help_keyword_id,name) values (386,'KEY_BLOCK_SIZE'); -insert into help_keyword (help_keyword_id,name) values (387,'PASSWORD'); -insert into help_keyword (help_keyword_id,name) values (388,'OFFSET'); -insert into help_keyword (help_keyword_id,name) values (389,'CHAR'); -insert into help_keyword (help_keyword_id,name) values (390,'NEXT'); -insert into help_keyword (help_keyword_id,name) values (391,'ERRORS'); -insert into help_keyword (help_keyword_id,name) values (392,'SQL_LOG_BIN'); -insert into help_keyword (help_keyword_id,name) values (393,'TEMPORARY'); -insert into help_keyword (help_keyword_id,name) values (394,'COMMITTED'); -insert into help_keyword (help_keyword_id,name) values (395,'SQL_SMALL_RESULT'); -insert into help_keyword (help_keyword_id,name) values (396,'UPGRADE'); -insert into help_keyword (help_keyword_id,name) values (397,'XA'); -insert into help_keyword (help_keyword_id,name) values (398,'BEGIN'); -insert into help_keyword (help_keyword_id,name) values (399,'DELAY_KEY_WRITE'); -insert into help_keyword (help_keyword_id,name) values (400,'PROFILE'); -insert into help_keyword (help_keyword_id,name) values (401,'MEDIUM'); -insert into help_keyword (help_keyword_id,name) values (402,'INTERVAL'); -insert into help_keyword (help_keyword_id,name) values (403,'SSL'); -insert into help_keyword (help_keyword_id,name) values (404,'DAY_HOUR'); -insert into help_keyword (help_keyword_id,name) values (405,'NAME'); -insert into help_keyword (help_keyword_id,name) values (406,'REFERENCES'); -insert into help_keyword (help_keyword_id,name) values (407,'AES_ENCRYPT'); -insert into help_keyword (help_keyword_id,name) values (408,'STORAGE'); -insert into help_keyword (help_keyword_id,name) values (409,'ISOLATION'); -insert into help_keyword (help_keyword_id,name) values (410,'CEILING'); -insert into help_keyword (help_keyword_id,name) values (411,'EVERY'); -insert into help_keyword (help_keyword_id,name) values (412,'INT8'); -insert into help_keyword (help_keyword_id,name) values (413,'AUTHORS'); -insert into help_keyword (help_keyword_id,name) values (414,'STATS_SAMPLE_PAGES'); -insert into help_keyword (help_keyword_id,name) values (415,'RESTRICT'); -insert into help_keyword (help_keyword_id,name) values (416,'UNCOMMITTED'); -insert into help_keyword (help_keyword_id,name) values (417,'LINESTRINGFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (418,'IS'); -insert into help_keyword (help_keyword_id,name) values (419,'NOT'); -insert into help_keyword (help_keyword_id,name) values (420,'ANALYSE'); -insert into help_keyword (help_keyword_id,name) values (421,'DATAFILE'); -insert into help_keyword (help_keyword_id,name) values (422,'DES_KEY_FILE'); -insert into help_keyword (help_keyword_id,name) values (423,'SIGNAL'); -insert into help_keyword (help_keyword_id,name) values (424,'COMPRESSED'); -insert into help_keyword (help_keyword_id,name) values (425,'START'); -insert into help_keyword (help_keyword_id,name) values (426,'PLUGINS'); -insert into help_keyword (help_keyword_id,name) values (427,'SAVEPOINT'); -insert into help_keyword (help_keyword_id,name) values (428,'IF'); -insert into help_keyword (help_keyword_id,name) values (429,'ROWS'); -insert into help_keyword (help_keyword_id,name) values (430,'PRIMARY'); -insert into help_keyword (help_keyword_id,name) values (431,'PURGE'); -insert into help_keyword (help_keyword_id,name) values (432,'LAST'); -insert into help_keyword (help_keyword_id,name) values (433,'USER'); -insert into help_keyword (help_keyword_id,name) values (434,'EXIT'); -insert into help_keyword (help_keyword_id,name) values (435,'KEYS'); -insert into help_keyword (help_keyword_id,name) values (436,'LIMIT'); -insert into help_keyword (help_keyword_id,name) values (437,'KEY'); -insert into help_keyword (help_keyword_id,name) values (438,'MERGE'); -insert into help_keyword (help_keyword_id,name) values (439,'UNTIL'); -insert into help_keyword (help_keyword_id,name) values (440,'SQL_NO_CACHE'); -insert into help_keyword (help_keyword_id,name) values (441,'DELAYED'); -insert into help_keyword (help_keyword_id,name) values (442,'CONSTRAINT_SCHEMA'); -insert into help_keyword (help_keyword_id,name) values (443,'ANALYZE'); -insert into help_keyword (help_keyword_id,name) values (444,'CONSTRAINT'); -insert into help_keyword (help_keyword_id,name) values (445,'SERIAL'); -insert into help_keyword (help_keyword_id,name) values (446,'ACTION'); -insert into help_keyword (help_keyword_id,name) values (447,'WRITE'); -insert into help_keyword (help_keyword_id,name) values (448,'INITIAL_SIZE'); -insert into help_keyword (help_keyword_id,name) values (449,'SESSION'); -insert into help_keyword (help_keyword_id,name) values (450,'DATABASE'); -insert into help_keyword (help_keyword_id,name) values (451,'NULL'); -insert into help_keyword (help_keyword_id,name) values (452,'POWER'); -insert into help_keyword (help_keyword_id,name) values (453,'USE_FRM'); -insert into help_keyword (help_keyword_id,name) values (454,'TERMINATED'); -insert into help_keyword (help_keyword_id,name) values (455,'SLAVE'); -insert into help_keyword (help_keyword_id,name) values (456,'NVARCHAR'); -insert into help_keyword (help_keyword_id,name) values (457,'ASC'); -insert into help_keyword (help_keyword_id,name) values (458,'RETURN'); -insert into help_keyword (help_keyword_id,name) values (459,'OPTIONALLY'); -insert into help_keyword (help_keyword_id,name) values (460,'ENABLE'); -insert into help_keyword (help_keyword_id,name) values (461,'DIRECTORY'); -insert into help_keyword (help_keyword_id,name) values (462,'MAX_USER_CONNECTIONS'); -insert into help_keyword (help_keyword_id,name) values (463,'WHILE'); -insert into help_keyword (help_keyword_id,name) values (464,'LOCAL'); -insert into help_keyword (help_keyword_id,name) values (465,'DISTINCT'); -insert into help_keyword (help_keyword_id,name) values (466,'AES_DECRYPT'); -insert into help_keyword (help_keyword_id,name) values (467,'MASTER_SSL_KEY'); -insert into help_keyword (help_keyword_id,name) values (468,'NONE'); -insert into help_keyword (help_keyword_id,name) values (469,'TABLES'); -insert into help_keyword (help_keyword_id,name) values (470,'<>'); -insert into help_keyword (help_keyword_id,name) values (471,'EXPORT'); -insert into help_keyword (help_keyword_id,name) values (472,'RLIKE'); -insert into help_keyword (help_keyword_id,name) values (473,'TRIGGER'); -insert into help_keyword (help_keyword_id,name) values (474,'COLLATION'); -insert into help_keyword (help_keyword_id,name) values (475,'SHUTDOWN'); -insert into help_keyword (help_keyword_id,name) values (476,'HIGH_PRIORITY'); -insert into help_keyword (help_keyword_id,name) values (477,'BTREE'); -insert into help_keyword (help_keyword_id,name) values (478,'FIRST'); -insert into help_keyword (help_keyword_id,name) values (479,'COALESCE'); -insert into help_keyword (help_keyword_id,name) values (480,'WAIT'); -insert into help_keyword (help_keyword_id,name) values (481,'CATALOG_NAME'); -insert into help_keyword (help_keyword_id,name) values (482,'MASTER'); -insert into help_keyword (help_keyword_id,name) values (483,'FIXED'); -insert into help_keyword (help_keyword_id,name) values (484,'MULTIPOLYGONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (485,'ROW_FORMAT'); +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_relation (help_topic_id,help_keyword_id) values (0,0); -insert into help_relation (help_topic_id,help_keyword_id) values (448,0); -insert into help_relation (help_topic_id,help_keyword_id) values (250,1); -insert into help_relation (help_topic_id,help_keyword_id) values (127,2); -insert into help_relation (help_topic_id,help_keyword_id) values (239,3); -insert into help_relation (help_topic_id,help_keyword_id) values (270,4); -insert into help_relation (help_topic_id,help_keyword_id) values (333,4); -insert into help_relation (help_topic_id,help_keyword_id) values (484,4); -insert into help_relation (help_topic_id,help_keyword_id) values (311,5); -insert into help_relation (help_topic_id,help_keyword_id) values (476,6); -insert into help_relation (help_topic_id,help_keyword_id) values (311,6); -insert into help_relation (help_topic_id,help_keyword_id) values (59,7); -insert into help_relation (help_topic_id,help_keyword_id) values (311,8); -insert into help_relation (help_topic_id,help_keyword_id) values (362,9); -insert into help_relation (help_topic_id,help_keyword_id) values (230,10); -insert into help_relation (help_topic_id,help_keyword_id) values (341,11); -insert into help_relation (help_topic_id,help_keyword_id) values (239,11); -insert into help_relation (help_topic_id,help_keyword_id) values (494,11); -insert into help_relation (help_topic_id,help_keyword_id) values (442,12); -insert into help_relation (help_topic_id,help_keyword_id) values (276,12); -insert into help_relation (help_topic_id,help_keyword_id) values (248,12); -insert into help_relation (help_topic_id,help_keyword_id) values (484,12); -insert into help_relation (help_topic_id,help_keyword_id) values (512,12); -insert into help_relation (help_topic_id,help_keyword_id) values (476,13); -insert into help_relation (help_topic_id,help_keyword_id) values (311,13); -insert into help_relation (help_topic_id,help_keyword_id) values (341,14); -insert into help_relation (help_topic_id,help_keyword_id) values (126,15); -insert into help_relation (help_topic_id,help_keyword_id) values (310,16); -insert into help_relation (help_topic_id,help_keyword_id) values (448,16); -insert into help_relation (help_topic_id,help_keyword_id) values (13,17); -insert into help_relation (help_topic_id,help_keyword_id) values (335,17); -insert into help_relation (help_topic_id,help_keyword_id) values (442,17); -insert into help_relation (help_topic_id,help_keyword_id) values (63,17); -insert into help_relation (help_topic_id,help_keyword_id) values (265,18); -insert into help_relation (help_topic_id,help_keyword_id) values (59,18); -insert into help_relation (help_topic_id,help_keyword_id) values (204,19); -insert into help_relation (help_topic_id,help_keyword_id) values (509,20); -insert into help_relation (help_topic_id,help_keyword_id) values (270,20); -insert into help_relation (help_topic_id,help_keyword_id) values (201,20); -insert into help_relation (help_topic_id,help_keyword_id) values (318,20); -insert into help_relation (help_topic_id,help_keyword_id) values (387,20); -insert into help_relation (help_topic_id,help_keyword_id) values (362,21); -insert into help_relation (help_topic_id,help_keyword_id) values (448,22); -insert into help_relation (help_topic_id,help_keyword_id) values (519,23); -insert into help_relation (help_topic_id,help_keyword_id) values (282,23); -insert into help_relation (help_topic_id,help_keyword_id) values (385,23); -insert into help_relation (help_topic_id,help_keyword_id) values (412,23); -insert into help_relation (help_topic_id,help_keyword_id) values (6,23); -insert into help_relation (help_topic_id,help_keyword_id) values (223,23); -insert into help_relation (help_topic_id,help_keyword_id) values (401,23); -insert into help_relation (help_topic_id,help_keyword_id) values (482,23); -insert into help_relation (help_topic_id,help_keyword_id) values (280,23); -insert into help_relation (help_topic_id,help_keyword_id) values (52,23); -insert into help_relation (help_topic_id,help_keyword_id) values (146,23); -insert into help_relation (help_topic_id,help_keyword_id) values (361,23); -insert into help_relation (help_topic_id,help_keyword_id) values (219,23); -insert into help_relation (help_topic_id,help_keyword_id) values (429,23); -insert into help_relation (help_topic_id,help_keyword_id) values (512,23); -insert into help_relation (help_topic_id,help_keyword_id) values (320,24); -insert into help_relation (help_topic_id,help_keyword_id) values (227,25); -insert into help_relation (help_topic_id,help_keyword_id) values (70,25); -insert into help_relation (help_topic_id,help_keyword_id) values (96,25); -insert into help_relation (help_topic_id,help_keyword_id) values (203,26); -insert into help_relation (help_topic_id,help_keyword_id) values (48,27); -insert into help_relation (help_topic_id,help_keyword_id) values (318,28); -insert into help_relation (help_topic_id,help_keyword_id) values (111,29); -insert into help_relation (help_topic_id,help_keyword_id) values (26,30); -insert into help_relation (help_topic_id,help_keyword_id) values (248,31); -insert into help_relation (help_topic_id,help_keyword_id) values (442,32); -insert into help_relation (help_topic_id,help_keyword_id) values (248,32); -insert into help_relation (help_topic_id,help_keyword_id) values (203,33); -insert into help_relation (help_topic_id,help_keyword_id) values (111,34); -insert into help_relation (help_topic_id,help_keyword_id) values (362,35); -insert into help_relation (help_topic_id,help_keyword_id) values (25,36); -insert into help_relation (help_topic_id,help_keyword_id) values (385,36); -insert into help_relation (help_topic_id,help_keyword_id) values (494,36); -insert into help_relation (help_topic_id,help_keyword_id) values (26,37); -insert into help_relation (help_topic_id,help_keyword_id) values (52,37); -insert into help_relation (help_topic_id,help_keyword_id) values (448,37); -insert into help_relation (help_topic_id,help_keyword_id) values (115,37); -insert into help_relation (help_topic_id,help_keyword_id) values (512,37); -insert into help_relation (help_topic_id,help_keyword_id) values (248,38); -insert into help_relation (help_topic_id,help_keyword_id) values (224,39); -insert into help_relation (help_topic_id,help_keyword_id) values (248,39); -insert into help_relation (help_topic_id,help_keyword_id) values (512,39); -insert into help_relation (help_topic_id,help_keyword_id) values (442,40); -insert into help_relation (help_topic_id,help_keyword_id) values (276,40); -insert into help_relation (help_topic_id,help_keyword_id) values (165,40); -insert into help_relation (help_topic_id,help_keyword_id) values (248,40); -insert into help_relation (help_topic_id,help_keyword_id) values (504,40); -insert into help_relation (help_topic_id,help_keyword_id) values (265,41); -insert into help_relation (help_topic_id,help_keyword_id) values (333,42); -insert into help_relation (help_topic_id,help_keyword_id) values (33,42); -insert into help_relation (help_topic_id,help_keyword_id) values (248,42); -insert into help_relation (help_topic_id,help_keyword_id) values (49,42); -insert into help_relation (help_topic_id,help_keyword_id) values (111,42); -insert into help_relation (help_topic_id,help_keyword_id) values (448,42); -insert into help_relation (help_topic_id,help_keyword_id) values (484,42); -insert into help_relation (help_topic_id,help_keyword_id) values (306,42); -insert into help_relation (help_topic_id,help_keyword_id) values (449,42); -insert into help_relation (help_topic_id,help_keyword_id) values (512,42); -insert into help_relation (help_topic_id,help_keyword_id) values (518,43); -insert into help_relation (help_topic_id,help_keyword_id) values (248,43); -insert into help_relation (help_topic_id,help_keyword_id) values (203,44); -insert into help_relation (help_topic_id,help_keyword_id) values (0,45); -insert into help_relation (help_topic_id,help_keyword_id) values (270,45); -insert into help_relation (help_topic_id,help_keyword_id) values (333,45); -insert into help_relation (help_topic_id,help_keyword_id) values (33,45); -insert into help_relation (help_topic_id,help_keyword_id) values (248,45); -insert into help_relation (help_topic_id,help_keyword_id) values (318,45); -insert into help_relation (help_topic_id,help_keyword_id) values (448,45); -insert into help_relation (help_topic_id,help_keyword_id) values (484,45); -insert into help_relation (help_topic_id,help_keyword_id) values (512,45); -insert into help_relation (help_topic_id,help_keyword_id) values (250,46); -insert into help_relation (help_topic_id,help_keyword_id) values (248,46); -insert into help_relation (help_topic_id,help_keyword_id) values (116,46); -insert into help_relation (help_topic_id,help_keyword_id) values (484,46); -insert into help_relation (help_topic_id,help_keyword_id) values (203,47); -insert into help_relation (help_topic_id,help_keyword_id) values (448,48); -insert into help_relation (help_topic_id,help_keyword_id) values (420,49); -insert into help_relation (help_topic_id,help_keyword_id) values (59,49); -insert into help_relation (help_topic_id,help_keyword_id) values (449,50); -insert into help_relation (help_topic_id,help_keyword_id) values (509,51); -insert into help_relation (help_topic_id,help_keyword_id) values (201,51); -insert into help_relation (help_topic_id,help_keyword_id) values (172,51); -insert into help_relation (help_topic_id,help_keyword_id) values (362,52); -insert into help_relation (help_topic_id,help_keyword_id) values (518,53); -insert into help_relation (help_topic_id,help_keyword_id) values (33,53); -insert into help_relation (help_topic_id,help_keyword_id) values (248,53); -insert into help_relation (help_topic_id,help_keyword_id) values (476,54); -insert into help_relation (help_topic_id,help_keyword_id) values (0,54); -insert into help_relation (help_topic_id,help_keyword_id) values (518,54); -insert into help_relation (help_topic_id,help_keyword_id) values (311,54); -insert into help_relation (help_topic_id,help_keyword_id) values (509,55); -insert into help_relation (help_topic_id,help_keyword_id) values (201,55); -insert into help_relation (help_topic_id,help_keyword_id) values (172,55); -insert into help_relation (help_topic_id,help_keyword_id) values (98,56); -insert into help_relation (help_topic_id,help_keyword_id) values (248,56); -insert into help_relation (help_topic_id,help_keyword_id) values (34,57); -insert into help_relation (help_topic_id,help_keyword_id) values (63,57); -insert into help_relation (help_topic_id,help_keyword_id) values (362,58); -insert into help_relation (help_topic_id,help_keyword_id) values (111,59); -insert into help_relation (help_topic_id,help_keyword_id) values (108,60); -insert into help_relation (help_topic_id,help_keyword_id) values (36,60); -insert into help_relation (help_topic_id,help_keyword_id) values (0,60); -insert into help_relation (help_topic_id,help_keyword_id) values (509,61); -insert into help_relation (help_topic_id,help_keyword_id) values (201,61); -insert into help_relation (help_topic_id,help_keyword_id) values (172,61); -insert into help_relation (help_topic_id,help_keyword_id) values (33,62); -insert into help_relation (help_topic_id,help_keyword_id) values (49,62); -insert into help_relation (help_topic_id,help_keyword_id) values (63,62); -insert into help_relation (help_topic_id,help_keyword_id) values (107,63); -insert into help_relation (help_topic_id,help_keyword_id) values (137,63); -insert into help_relation (help_topic_id,help_keyword_id) values (111,63); -insert into help_relation (help_topic_id,help_keyword_id) values (115,64); -insert into help_relation (help_topic_id,help_keyword_id) values (512,64); -insert into help_relation (help_topic_id,help_keyword_id) values (476,65); -insert into help_relation (help_topic_id,help_keyword_id) values (311,65); -insert into help_relation (help_topic_id,help_keyword_id) values (412,65); -insert into help_relation (help_topic_id,help_keyword_id) values (194,65); -insert into help_relation (help_topic_id,help_keyword_id) values (111,66); -insert into help_relation (help_topic_id,help_keyword_id) values (448,67); -insert into help_relation (help_topic_id,help_keyword_id) values (0,68); -insert into help_relation (help_topic_id,help_keyword_id) values (333,68); -insert into help_relation (help_topic_id,help_keyword_id) values (448,68); -insert into help_relation (help_topic_id,help_keyword_id) values (318,68); -insert into help_relation (help_topic_id,help_keyword_id) values (49,68); -insert into help_relation (help_topic_id,help_keyword_id) values (484,68); -insert into help_relation (help_topic_id,help_keyword_id) values (512,68); -insert into help_relation (help_topic_id,help_keyword_id) values (298,69); -insert into help_relation (help_topic_id,help_keyword_id) values (246,70); -insert into help_relation (help_topic_id,help_keyword_id) values (224,70); -insert into help_relation (help_topic_id,help_keyword_id) values (33,70); -insert into help_relation (help_topic_id,help_keyword_id) values (126,71); -insert into help_relation (help_topic_id,help_keyword_id) values (111,72); -insert into help_relation (help_topic_id,help_keyword_id) values (108,73); -insert into help_relation (help_topic_id,help_keyword_id) values (248,74); -insert into help_relation (help_topic_id,help_keyword_id) values (55,75); -insert into help_relation (help_topic_id,help_keyword_id) values (256,75); -insert into help_relation (help_topic_id,help_keyword_id) values (208,76); -insert into help_relation (help_topic_id,help_keyword_id) values (239,77); -insert into help_relation (help_topic_id,help_keyword_id) values (0,78); -insert into help_relation (help_topic_id,help_keyword_id) values (27,79); -insert into help_relation (help_topic_id,help_keyword_id) values (150,79); -insert into help_relation (help_topic_id,help_keyword_id) values (126,79); -insert into help_relation (help_topic_id,help_keyword_id) values (150,80); -insert into help_relation (help_topic_id,help_keyword_id) values (510,80); -insert into help_relation (help_topic_id,help_keyword_id) values (362,80); -insert into help_relation (help_topic_id,help_keyword_id) values (362,81); -insert into help_relation (help_topic_id,help_keyword_id) values (512,81); -insert into help_relation (help_topic_id,help_keyword_id) values (476,82); -insert into help_relation (help_topic_id,help_keyword_id) values (311,82); -insert into help_relation (help_topic_id,help_keyword_id) values (203,83); -insert into help_relation (help_topic_id,help_keyword_id) values (518,84); -insert into help_relation (help_topic_id,help_keyword_id) values (448,84); -insert into help_relation (help_topic_id,help_keyword_id) values (318,84); -insert into help_relation (help_topic_id,help_keyword_id) values (49,84); -insert into help_relation (help_topic_id,help_keyword_id) values (476,85); -insert into help_relation (help_topic_id,help_keyword_id) values (311,85); -insert into help_relation (help_topic_id,help_keyword_id) values (509,86); -insert into help_relation (help_topic_id,help_keyword_id) values (201,86); -insert into help_relation (help_topic_id,help_keyword_id) values (172,86); -insert into help_relation (help_topic_id,help_keyword_id) values (414,87); -insert into help_relation (help_topic_id,help_keyword_id) values (270,87); -insert into help_relation (help_topic_id,help_keyword_id) values (448,87); -insert into help_relation (help_topic_id,help_keyword_id) values (318,87); -insert into help_relation (help_topic_id,help_keyword_id) values (248,88); -insert into help_relation (help_topic_id,help_keyword_id) values (144,89); -insert into help_relation (help_topic_id,help_keyword_id) values (108,90); -insert into help_relation (help_topic_id,help_keyword_id) values (203,91); -insert into help_relation (help_topic_id,help_keyword_id) values (427,92); -insert into help_relation (help_topic_id,help_keyword_id) values (330,93); -insert into help_relation (help_topic_id,help_keyword_id) values (341,94); -insert into help_relation (help_topic_id,help_keyword_id) values (510,94); -insert into help_relation (help_topic_id,help_keyword_id) values (494,94); -insert into help_relation (help_topic_id,help_keyword_id) values (12,95); -insert into help_relation (help_topic_id,help_keyword_id) values (482,95); -insert into help_relation (help_topic_id,help_keyword_id) values (442,95); -insert into help_relation (help_topic_id,help_keyword_id) values (235,95); -insert into help_relation (help_topic_id,help_keyword_id) values (183,95); -insert into help_relation (help_topic_id,help_keyword_id) values (448,95); -insert into help_relation (help_topic_id,help_keyword_id) values (104,95); -insert into help_relation (help_topic_id,help_keyword_id) values (170,95); -insert into help_relation (help_topic_id,help_keyword_id) values (523,95); -insert into help_relation (help_topic_id,help_keyword_id) values (360,96); -insert into help_relation (help_topic_id,help_keyword_id) values (60,96); -insert into help_relation (help_topic_id,help_keyword_id) values (484,97); -insert into help_relation (help_topic_id,help_keyword_id) values (512,97); -insert into help_relation (help_topic_id,help_keyword_id) values (310,98); -insert into help_relation (help_topic_id,help_keyword_id) values (214,99); -insert into help_relation (help_topic_id,help_keyword_id) values (248,99); -insert into help_relation (help_topic_id,help_keyword_id) values (427,100); -insert into help_relation (help_topic_id,help_keyword_id) values (302,101); -insert into help_relation (help_topic_id,help_keyword_id) values (231,101); -insert into help_relation (help_topic_id,help_keyword_id) values (428,101); -insert into help_relation (help_topic_id,help_keyword_id) values (405,102); -insert into help_relation (help_topic_id,help_keyword_id) values (50,103); -insert into help_relation (help_topic_id,help_keyword_id) values (37,103); -insert into help_relation (help_topic_id,help_keyword_id) values (21,103); -insert into help_relation (help_topic_id,help_keyword_id) values (109,104); -insert into help_relation (help_topic_id,help_keyword_id) values (318,104); -insert into help_relation (help_topic_id,help_keyword_id) values (522,104); -insert into help_relation (help_topic_id,help_keyword_id) values (169,104); -insert into help_relation (help_topic_id,help_keyword_id) values (442,105); -insert into help_relation (help_topic_id,help_keyword_id) values (403,105); -insert into help_relation (help_topic_id,help_keyword_id) values (421,106); -insert into help_relation (help_topic_id,help_keyword_id) values (63,106); -insert into help_relation (help_topic_id,help_keyword_id) values (250,107); -insert into help_relation (help_topic_id,help_keyword_id) values (203,108); -insert into help_relation (help_topic_id,help_keyword_id) values (343,109); -insert into help_relation (help_topic_id,help_keyword_id) values (280,109); -insert into help_relation (help_topic_id,help_keyword_id) values (311,109); -insert into help_relation (help_topic_id,help_keyword_id) values (412,109); -insert into help_relation (help_topic_id,help_keyword_id) values (361,109); -insert into help_relation (help_topic_id,help_keyword_id) values (6,109); -insert into help_relation (help_topic_id,help_keyword_id) values (401,109); -insert into help_relation (help_topic_id,help_keyword_id) values (442,110); -insert into help_relation (help_topic_id,help_keyword_id) values (452,110); -insert into help_relation (help_topic_id,help_keyword_id) values (64,111); -insert into help_relation (help_topic_id,help_keyword_id) values (341,112); -insert into help_relation (help_topic_id,help_keyword_id) values (510,112); -insert into help_relation (help_topic_id,help_keyword_id) values (494,112); -insert into help_relation (help_topic_id,help_keyword_id) values (310,113); -insert into help_relation (help_topic_id,help_keyword_id) values (277,113); -insert into help_relation (help_topic_id,help_keyword_id) values (67,114); -insert into help_relation (help_topic_id,help_keyword_id) values (355,114); -insert into help_relation (help_topic_id,help_keyword_id) values (270,115); -insert into help_relation (help_topic_id,help_keyword_id) values (343,115); -insert into help_relation (help_topic_id,help_keyword_id) values (248,115); -insert into help_relation (help_topic_id,help_keyword_id) values (367,115); -insert into help_relation (help_topic_id,help_keyword_id) values (116,115); -insert into help_relation (help_topic_id,help_keyword_id) values (318,115); -insert into help_relation (help_topic_id,help_keyword_id) values (387,115); -insert into help_relation (help_topic_id,help_keyword_id) values (512,115); -insert into help_relation (help_topic_id,help_keyword_id) values (512,116); -insert into help_relation (help_topic_id,help_keyword_id) values (246,117); -insert into help_relation (help_topic_id,help_keyword_id) values (181,117); -insert into help_relation (help_topic_id,help_keyword_id) values (324,117); -insert into help_relation (help_topic_id,help_keyword_id) values (516,117); -insert into help_relation (help_topic_id,help_keyword_id) values (324,118); -insert into help_relation (help_topic_id,help_keyword_id) values (512,118); -insert into help_relation (help_topic_id,help_keyword_id) values (509,119); -insert into help_relation (help_topic_id,help_keyword_id) values (201,119); -insert into help_relation (help_topic_id,help_keyword_id) values (284,120); -insert into help_relation (help_topic_id,help_keyword_id) values (326,120); -insert into help_relation (help_topic_id,help_keyword_id) values (147,120); -insert into help_relation (help_topic_id,help_keyword_id) values (86,120); -insert into help_relation (help_topic_id,help_keyword_id) values (509,121); -insert into help_relation (help_topic_id,help_keyword_id) values (201,121); -insert into help_relation (help_topic_id,help_keyword_id) values (172,121); -insert into help_relation (help_topic_id,help_keyword_id) values (483,122); -insert into help_relation (help_topic_id,help_keyword_id) values (72,123); -insert into help_relation (help_topic_id,help_keyword_id) values (476,124); -insert into help_relation (help_topic_id,help_keyword_id) values (311,124); -insert into help_relation (help_topic_id,help_keyword_id) values (73,124); -insert into help_relation (help_topic_id,help_keyword_id) values (528,124); -insert into help_relation (help_topic_id,help_keyword_id) values (121,125); -insert into help_relation (help_topic_id,help_keyword_id) values (185,126); -insert into help_relation (help_topic_id,help_keyword_id) values (330,126); -insert into help_relation (help_topic_id,help_keyword_id) values (270,126); -insert into help_relation (help_topic_id,help_keyword_id) values (343,126); -insert into help_relation (help_topic_id,help_keyword_id) values (333,126); -insert into help_relation (help_topic_id,help_keyword_id) values (509,126); -insert into help_relation (help_topic_id,help_keyword_id) values (201,126); -insert into help_relation (help_topic_id,help_keyword_id) values (262,126); -insert into help_relation (help_topic_id,help_keyword_id) values (116,126); -insert into help_relation (help_topic_id,help_keyword_id) values (318,126); -insert into help_relation (help_topic_id,help_keyword_id) values (512,126); -insert into help_relation (help_topic_id,help_keyword_id) values (442,126); -insert into help_relation (help_topic_id,help_keyword_id) values (248,126); -insert into help_relation (help_topic_id,help_keyword_id) values (49,126); -insert into help_relation (help_topic_id,help_keyword_id) values (341,126); -insert into help_relation (help_topic_id,help_keyword_id) values (518,126); -insert into help_relation (help_topic_id,help_keyword_id) values (102,126); -insert into help_relation (help_topic_id,help_keyword_id) values (448,126); -insert into help_relation (help_topic_id,help_keyword_id) values (253,126); -insert into help_relation (help_topic_id,help_keyword_id) values (484,126); -insert into help_relation (help_topic_id,help_keyword_id) values (111,127); -insert into help_relation (help_topic_id,help_keyword_id) values (394,128); -insert into help_relation (help_topic_id,help_keyword_id) values (75,128); -insert into help_relation (help_topic_id,help_keyword_id) values (126,128); -insert into help_relation (help_topic_id,help_keyword_id) values (203,128); -insert into help_relation (help_topic_id,help_keyword_id) values (442,129); -insert into help_relation (help_topic_id,help_keyword_id) values (432,129); -insert into help_relation (help_topic_id,help_keyword_id) values (452,129); -insert into help_relation (help_topic_id,help_keyword_id) values (122,129); -insert into help_relation (help_topic_id,help_keyword_id) values (38,129); -insert into help_relation (help_topic_id,help_keyword_id) values (183,129); -insert into help_relation (help_topic_id,help_keyword_id) values (338,129); -insert into help_relation (help_topic_id,help_keyword_id) values (119,129); -insert into help_relation (help_topic_id,help_keyword_id) values (248,130); -insert into help_relation (help_topic_id,help_keyword_id) values (115,130); -insert into help_relation (help_topic_id,help_keyword_id) values (512,130); -insert into help_relation (help_topic_id,help_keyword_id) values (108,131); -insert into help_relation (help_topic_id,help_keyword_id) values (476,131); -insert into help_relation (help_topic_id,help_keyword_id) values (311,131); -insert into help_relation (help_topic_id,help_keyword_id) values (248,131); -insert into help_relation (help_topic_id,help_keyword_id) values (115,131); -insert into help_relation (help_topic_id,help_keyword_id) values (362,132); -insert into help_relation (help_topic_id,help_keyword_id) values (0,133); -insert into help_relation (help_topic_id,help_keyword_id) values (227,134); -insert into help_relation (help_topic_id,help_keyword_id) values (292,135); -insert into help_relation (help_topic_id,help_keyword_id) values (362,136); -insert into help_relation (help_topic_id,help_keyword_id) values (248,137); -insert into help_relation (help_topic_id,help_keyword_id) values (420,138); -insert into help_relation (help_topic_id,help_keyword_id) values (111,139); -insert into help_relation (help_topic_id,help_keyword_id) values (507,140); -insert into help_relation (help_topic_id,help_keyword_id) values (141,141); -insert into help_relation (help_topic_id,help_keyword_id) values (405,142); -insert into help_relation (help_topic_id,help_keyword_id) values (137,143); -insert into help_relation (help_topic_id,help_keyword_id) values (111,143); -insert into help_relation (help_topic_id,help_keyword_id) values (512,144); -insert into help_relation (help_topic_id,help_keyword_id) values (50,145); -insert into help_relation (help_topic_id,help_keyword_id) values (37,145); -insert into help_relation (help_topic_id,help_keyword_id) values (385,146); -insert into help_relation (help_topic_id,help_keyword_id) values (292,147); -insert into help_relation (help_topic_id,help_keyword_id) values (427,147); -insert into help_relation (help_topic_id,help_keyword_id) values (50,148); -insert into help_relation (help_topic_id,help_keyword_id) values (37,148); -insert into help_relation (help_topic_id,help_keyword_id) values (111,149); -insert into help_relation (help_topic_id,help_keyword_id) values (248,150); -insert into help_relation (help_topic_id,help_keyword_id) values (421,151); -insert into help_relation (help_topic_id,help_keyword_id) values (227,152); -insert into help_relation (help_topic_id,help_keyword_id) values (442,152); -insert into help_relation (help_topic_id,help_keyword_id) values (507,152); -insert into help_relation (help_topic_id,help_keyword_id) values (33,152); -insert into help_relation (help_topic_id,help_keyword_id) values (70,152); -insert into help_relation (help_topic_id,help_keyword_id) values (448,152); -insert into help_relation (help_topic_id,help_keyword_id) values (341,153); -insert into help_relation (help_topic_id,help_keyword_id) values (239,153); -insert into help_relation (help_topic_id,help_keyword_id) values (26,153); -insert into help_relation (help_topic_id,help_keyword_id) values (494,153); -insert into help_relation (help_topic_id,help_keyword_id) values (63,153); -insert into help_relation (help_topic_id,help_keyword_id) values (0,154); -insert into help_relation (help_topic_id,help_keyword_id) values (21,155); -insert into help_relation (help_topic_id,help_keyword_id) values (203,156); -insert into help_relation (help_topic_id,help_keyword_id) values (248,157); -insert into help_relation (help_topic_id,help_keyword_id) values (372,158); -insert into help_relation (help_topic_id,help_keyword_id) values (442,159); -insert into help_relation (help_topic_id,help_keyword_id) values (421,159); -insert into help_relation (help_topic_id,help_keyword_id) values (181,159); -insert into help_relation (help_topic_id,help_keyword_id) values (357,159); -insert into help_relation (help_topic_id,help_keyword_id) values (448,159); -insert into help_relation (help_topic_id,help_keyword_id) values (485,159); -insert into help_relation (help_topic_id,help_keyword_id) values (442,160); -insert into help_relation (help_topic_id,help_keyword_id) values (428,160); -insert into help_relation (help_topic_id,help_keyword_id) values (248,161); -insert into help_relation (help_topic_id,help_keyword_id) values (59,162); -insert into help_relation (help_topic_id,help_keyword_id) values (357,163); -insert into help_relation (help_topic_id,help_keyword_id) values (172,164); -insert into help_relation (help_topic_id,help_keyword_id) values (484,165); -insert into help_relation (help_topic_id,help_keyword_id) values (300,166); -insert into help_relation (help_topic_id,help_keyword_id) values (442,166); -insert into help_relation (help_topic_id,help_keyword_id) values (432,166); -insert into help_relation (help_topic_id,help_keyword_id) values (282,166); -insert into help_relation (help_topic_id,help_keyword_id) values (59,166); -insert into help_relation (help_topic_id,help_keyword_id) values (170,166); -insert into help_relation (help_topic_id,help_keyword_id) values (482,166); -insert into help_relation (help_topic_id,help_keyword_id) values (211,166); -insert into help_relation (help_topic_id,help_keyword_id) values (373,166); -insert into help_relation (help_topic_id,help_keyword_id) values (219,166); -insert into help_relation (help_topic_id,help_keyword_id) values (383,166); -insert into help_relation (help_topic_id,help_keyword_id) values (59,167); -insert into help_relation (help_topic_id,help_keyword_id) values (172,168); -insert into help_relation (help_topic_id,help_keyword_id) values (442,169); -insert into help_relation (help_topic_id,help_keyword_id) values (484,169); -insert into help_relation (help_topic_id,help_keyword_id) values (139,170); -insert into help_relation (help_topic_id,help_keyword_id) values (248,171); -insert into help_relation (help_topic_id,help_keyword_id) values (248,172); -insert into help_relation (help_topic_id,help_keyword_id) values (512,172); -insert into help_relation (help_topic_id,help_keyword_id) values (108,173); -insert into help_relation (help_topic_id,help_keyword_id) values (519,173); -insert into help_relation (help_topic_id,help_keyword_id) values (39,173); -insert into help_relation (help_topic_id,help_keyword_id) values (512,173); -insert into help_relation (help_topic_id,help_keyword_id) values (98,174); -insert into help_relation (help_topic_id,help_keyword_id) values (351,175); -insert into help_relation (help_topic_id,help_keyword_id) values (108,176); -insert into help_relation (help_topic_id,help_keyword_id) values (519,176); -insert into help_relation (help_topic_id,help_keyword_id) values (223,176); -insert into help_relation (help_topic_id,help_keyword_id) values (512,176); -insert into help_relation (help_topic_id,help_keyword_id) values (506,177); -insert into help_relation (help_topic_id,help_keyword_id) values (280,177); -insert into help_relation (help_topic_id,help_keyword_id) values (92,177); -insert into help_relation (help_topic_id,help_keyword_id) values (52,178); -insert into help_relation (help_topic_id,help_keyword_id) values (115,178); -insert into help_relation (help_topic_id,help_keyword_id) values (512,178); -insert into help_relation (help_topic_id,help_keyword_id) values (239,179); -insert into help_relation (help_topic_id,help_keyword_id) values (333,180); -insert into help_relation (help_topic_id,help_keyword_id) values (484,180); -insert into help_relation (help_topic_id,help_keyword_id) values (105,181); -insert into help_relation (help_topic_id,help_keyword_id) values (33,182); -insert into help_relation (help_topic_id,help_keyword_id) values (448,182); -insert into help_relation (help_topic_id,help_keyword_id) values (49,182); -insert into help_relation (help_topic_id,help_keyword_id) values (512,182); -insert into help_relation (help_topic_id,help_keyword_id) values (449,182); -insert into help_relation (help_topic_id,help_keyword_id) values (362,183); -insert into help_relation (help_topic_id,help_keyword_id) values (0,184); -insert into help_relation (help_topic_id,help_keyword_id) values (51,184); -insert into help_relation (help_topic_id,help_keyword_id) values (33,184); -insert into help_relation (help_topic_id,help_keyword_id) values (509,185); -insert into help_relation (help_topic_id,help_keyword_id) values (201,185); -insert into help_relation (help_topic_id,help_keyword_id) values (172,185); -insert into help_relation (help_topic_id,help_keyword_id) values (139,186); -insert into help_relation (help_topic_id,help_keyword_id) values (137,187); -insert into help_relation (help_topic_id,help_keyword_id) values (111,187); -insert into help_relation (help_topic_id,help_keyword_id) values (420,188); -insert into help_relation (help_topic_id,help_keyword_id) values (265,188); -insert into help_relation (help_topic_id,help_keyword_id) values (372,188); -insert into help_relation (help_topic_id,help_keyword_id) values (126,188); -insert into help_relation (help_topic_id,help_keyword_id) values (277,188); -insert into help_relation (help_topic_id,help_keyword_id) values (351,188); -insert into help_relation (help_topic_id,help_keyword_id) values (328,188); -insert into help_relation (help_topic_id,help_keyword_id) values (90,189); -insert into help_relation (help_topic_id,help_keyword_id) values (59,189); -insert into help_relation (help_topic_id,help_keyword_id) values (126,189); -insert into help_relation (help_topic_id,help_keyword_id) values (480,190); -insert into help_relation (help_topic_id,help_keyword_id) values (442,191); -insert into help_relation (help_topic_id,help_keyword_id) values (427,192); -insert into help_relation (help_topic_id,help_keyword_id) values (518,193); -insert into help_relation (help_topic_id,help_keyword_id) values (250,193); -insert into help_relation (help_topic_id,help_keyword_id) values (248,193); -insert into help_relation (help_topic_id,help_keyword_id) values (512,193); -insert into help_relation (help_topic_id,help_keyword_id) values (414,194); -insert into help_relation (help_topic_id,help_keyword_id) values (61,194); -insert into help_relation (help_topic_id,help_keyword_id) values (86,194); -insert into help_relation (help_topic_id,help_keyword_id) values (340,195); -insert into help_relation (help_topic_id,help_keyword_id) values (442,195); -insert into help_relation (help_topic_id,help_keyword_id) values (509,196); -insert into help_relation (help_topic_id,help_keyword_id) values (201,196); -insert into help_relation (help_topic_id,help_keyword_id) values (172,196); -insert into help_relation (help_topic_id,help_keyword_id) values (341,197); -insert into help_relation (help_topic_id,help_keyword_id) values (494,197); -insert into help_relation (help_topic_id,help_keyword_id) values (442,198); -insert into help_relation (help_topic_id,help_keyword_id) values (93,198); -insert into help_relation (help_topic_id,help_keyword_id) values (507,199); -insert into help_relation (help_topic_id,help_keyword_id) values (341,200); -insert into help_relation (help_topic_id,help_keyword_id) values (494,200); -insert into help_relation (help_topic_id,help_keyword_id) values (509,201); -insert into help_relation (help_topic_id,help_keyword_id) values (201,201); -insert into help_relation (help_topic_id,help_keyword_id) values (172,201); -insert into help_relation (help_topic_id,help_keyword_id) values (421,202); -insert into help_relation (help_topic_id,help_keyword_id) values (357,202); -insert into help_relation (help_topic_id,help_keyword_id) values (485,202); -insert into help_relation (help_topic_id,help_keyword_id) values (367,202); -insert into help_relation (help_topic_id,help_keyword_id) values (414,203); -insert into help_relation (help_topic_id,help_keyword_id) values (484,203); -insert into help_relation (help_topic_id,help_keyword_id) values (448,204); -insert into help_relation (help_topic_id,help_keyword_id) values (126,205); -insert into help_relation (help_topic_id,help_keyword_id) values (458,205); -insert into help_relation (help_topic_id,help_keyword_id) values (248,206); -insert into help_relation (help_topic_id,help_keyword_id) values (343,207); -insert into help_relation (help_topic_id,help_keyword_id) values (248,207); -insert into help_relation (help_topic_id,help_keyword_id) values (116,207); -insert into help_relation (help_topic_id,help_keyword_id) values (468,208); -insert into help_relation (help_topic_id,help_keyword_id) values (514,209); -insert into help_relation (help_topic_id,help_keyword_id) values (330,210); -insert into help_relation (help_topic_id,help_keyword_id) values (239,210); -insert into help_relation (help_topic_id,help_keyword_id) values (102,210); -insert into help_relation (help_topic_id,help_keyword_id) values (443,210); -insert into help_relation (help_topic_id,help_keyword_id) values (338,210); -insert into help_relation (help_topic_id,help_keyword_id) values (503,211); -insert into help_relation (help_topic_id,help_keyword_id) values (50,212); -insert into help_relation (help_topic_id,help_keyword_id) values (37,212); -insert into help_relation (help_topic_id,help_keyword_id) values (448,213); -insert into help_relation (help_topic_id,help_keyword_id) values (0,214); -insert into help_relation (help_topic_id,help_keyword_id) values (26,214); -insert into help_relation (help_topic_id,help_keyword_id) values (448,214); -insert into help_relation (help_topic_id,help_keyword_id) values (484,215); -insert into help_relation (help_topic_id,help_keyword_id) values (111,216); -insert into help_relation (help_topic_id,help_keyword_id) values (341,217); -insert into help_relation (help_topic_id,help_keyword_id) values (137,218); -insert into help_relation (help_topic_id,help_keyword_id) values (442,219); -insert into help_relation (help_topic_id,help_keyword_id) values (363,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 (509,221); -insert into help_relation (help_topic_id,help_keyword_id) values (201,221); -insert into help_relation (help_topic_id,help_keyword_id) values (172,221); -insert into help_relation (help_topic_id,help_keyword_id) values (470,222); -insert into help_relation (help_topic_id,help_keyword_id) values (427,223); -insert into help_relation (help_topic_id,help_keyword_id) values (121,224); -insert into help_relation (help_topic_id,help_keyword_id) values (141,225); -insert into help_relation (help_topic_id,help_keyword_id) values (310,226); -insert into help_relation (help_topic_id,help_keyword_id) values (248,226); -insert into help_relation (help_topic_id,help_keyword_id) values (115,226); -insert into help_relation (help_topic_id,help_keyword_id) values (111,226); -insert into help_relation (help_topic_id,help_keyword_id) values (512,226); -insert into help_relation (help_topic_id,help_keyword_id) values (512,227); -insert into help_relation (help_topic_id,help_keyword_id) values (393,228); -insert into help_relation (help_topic_id,help_keyword_id) values (248,229); -insert into help_relation (help_topic_id,help_keyword_id) values (484,229); -insert into help_relation (help_topic_id,help_keyword_id) values (476,230); -insert into help_relation (help_topic_id,help_keyword_id) values (311,230); -insert into help_relation (help_topic_id,help_keyword_id) values (512,230); -insert into help_relation (help_topic_id,help_keyword_id) values (163,231); -insert into help_relation (help_topic_id,help_keyword_id) values (448,232); -insert into help_relation (help_topic_id,help_keyword_id) values (270,233); -insert into help_relation (help_topic_id,help_keyword_id) values (26,233); -insert into help_relation (help_topic_id,help_keyword_id) values (333,233); -insert into help_relation (help_topic_id,help_keyword_id) values (33,233); -insert into help_relation (help_topic_id,help_keyword_id) values (318,233); -insert into help_relation (help_topic_id,help_keyword_id) values (49,233); -insert into help_relation (help_topic_id,help_keyword_id) values (484,233); -insert into help_relation (help_topic_id,help_keyword_id) values (111,234); -insert into help_relation (help_topic_id,help_keyword_id) values (108,235); -insert into help_relation (help_topic_id,help_keyword_id) values (442,236); -insert into help_relation (help_topic_id,help_keyword_id) values (343,236); -insert into help_relation (help_topic_id,help_keyword_id) values (417,236); -insert into help_relation (help_topic_id,help_keyword_id) values (361,236); -insert into help_relation (help_topic_id,help_keyword_id) values (116,236); -insert into help_relation (help_topic_id,help_keyword_id) values (59,237); -insert into help_relation (help_topic_id,help_keyword_id) values (400,238); -insert into help_relation (help_topic_id,help_keyword_id) values (156,239); -insert into help_relation (help_topic_id,help_keyword_id) values (511,240); -insert into help_relation (help_topic_id,help_keyword_id) values (442,241); -insert into help_relation (help_topic_id,help_keyword_id) values (0,241); -insert into help_relation (help_topic_id,help_keyword_id) values (248,241); -insert into help_relation (help_topic_id,help_keyword_id) values (414,241); -insert into help_relation (help_topic_id,help_keyword_id) values (52,241); -insert into help_relation (help_topic_id,help_keyword_id) values (61,241); -insert into help_relation (help_topic_id,help_keyword_id) values (39,241); -insert into help_relation (help_topic_id,help_keyword_id) values (418,241); -insert into help_relation (help_topic_id,help_keyword_id) values (115,241); -insert into help_relation (help_topic_id,help_keyword_id) values (512,241); -insert into help_relation (help_topic_id,help_keyword_id) values (228,242); -insert into help_relation (help_topic_id,help_keyword_id) values (476,243); -insert into help_relation (help_topic_id,help_keyword_id) values (311,243); -insert into help_relation (help_topic_id,help_keyword_id) values (362,244); -insert into help_relation (help_topic_id,help_keyword_id) values (512,245); -insert into help_relation (help_topic_id,help_keyword_id) values (246,246); -insert into help_relation (help_topic_id,help_keyword_id) values (141,246); -insert into help_relation (help_topic_id,help_keyword_id) values (154,247); -insert into help_relation (help_topic_id,help_keyword_id) values (0,248); -insert into help_relation (help_topic_id,help_keyword_id) values (442,249); -insert into help_relation (help_topic_id,help_keyword_id) values (4,249); -insert into help_relation (help_topic_id,help_keyword_id) values (144,250); -insert into help_relation (help_topic_id,help_keyword_id) values (230,250); -insert into help_relation (help_topic_id,help_keyword_id) values (108,251); -insert into help_relation (help_topic_id,help_keyword_id) values (380,251); -insert into help_relation (help_topic_id,help_keyword_id) values (448,251); -insert into help_relation (help_topic_id,help_keyword_id) values (487,252); -insert into help_relation (help_topic_id,help_keyword_id) values (421,253); -insert into help_relation (help_topic_id,help_keyword_id) values (362,254); -insert into help_relation (help_topic_id,help_keyword_id) values (362,255); -insert into help_relation (help_topic_id,help_keyword_id) values (420,256); -insert into help_relation (help_topic_id,help_keyword_id) values (265,256); -insert into help_relation (help_topic_id,help_keyword_id) values (372,256); -insert into help_relation (help_topic_id,help_keyword_id) values (277,256); -insert into help_relation (help_topic_id,help_keyword_id) values (351,256); -insert into help_relation (help_topic_id,help_keyword_id) values (328,256); -insert into help_relation (help_topic_id,help_keyword_id) values (111,257); -insert into help_relation (help_topic_id,help_keyword_id) values (362,258); -insert into help_relation (help_topic_id,help_keyword_id) values (250,259); -insert into help_relation (help_topic_id,help_keyword_id) values (362,260); -insert into help_relation (help_topic_id,help_keyword_id) values (208,261); -insert into help_relation (help_topic_id,help_keyword_id) values (185,262); -insert into help_relation (help_topic_id,help_keyword_id) values (442,262); -insert into help_relation (help_topic_id,help_keyword_id) values (343,262); -insert into help_relation (help_topic_id,help_keyword_id) values (230,262); -insert into help_relation (help_topic_id,help_keyword_id) values (333,262); -insert into help_relation (help_topic_id,help_keyword_id) values (248,262); -insert into help_relation (help_topic_id,help_keyword_id) values (144,262); -insert into help_relation (help_topic_id,help_keyword_id) values (116,262); -insert into help_relation (help_topic_id,help_keyword_id) values (448,262); -insert into help_relation (help_topic_id,help_keyword_id) values (484,262); -insert into help_relation (help_topic_id,help_keyword_id) values (362,263); -insert into help_relation (help_topic_id,help_keyword_id) values (509,264); -insert into help_relation (help_topic_id,help_keyword_id) values (201,264); -insert into help_relation (help_topic_id,help_keyword_id) values (172,264); -insert into help_relation (help_topic_id,help_keyword_id) values (442,265); -insert into help_relation (help_topic_id,help_keyword_id) values (246,265); -insert into help_relation (help_topic_id,help_keyword_id) values (65,265); -insert into help_relation (help_topic_id,help_keyword_id) values (248,265); -insert into help_relation (help_topic_id,help_keyword_id) values (324,265); -insert into help_relation (help_topic_id,help_keyword_id) values (425,265); -insert into help_relation (help_topic_id,help_keyword_id) values (516,265); -insert into help_relation (help_topic_id,help_keyword_id) values (401,265); -insert into help_relation (help_topic_id,help_keyword_id) values (155,265); -insert into help_relation (help_topic_id,help_keyword_id) values (224,265); -insert into help_relation (help_topic_id,help_keyword_id) values (214,265); -insert into help_relation (help_topic_id,help_keyword_id) values (39,265); -insert into help_relation (help_topic_id,help_keyword_id) values (119,265); -insert into help_relation (help_topic_id,help_keyword_id) values (512,265); -insert into help_relation (help_topic_id,help_keyword_id) values (108,266); -insert into help_relation (help_topic_id,help_keyword_id) values (519,266); -insert into help_relation (help_topic_id,help_keyword_id) values (442,266); -insert into help_relation (help_topic_id,help_keyword_id) values (452,266); -insert into help_relation (help_topic_id,help_keyword_id) values (248,266); -insert into help_relation (help_topic_id,help_keyword_id) values (223,266); -insert into help_relation (help_topic_id,help_keyword_id) values (512,266); -insert into help_relation (help_topic_id,help_keyword_id) values (248,267); -insert into help_relation (help_topic_id,help_keyword_id) values (518,268); -insert into help_relation (help_topic_id,help_keyword_id) values (280,268); -insert into help_relation (help_topic_id,help_keyword_id) values (248,268); -insert into help_relation (help_topic_id,help_keyword_id) values (401,268); -insert into help_relation (help_topic_id,help_keyword_id) values (362,269); -insert into help_relation (help_topic_id,help_keyword_id) values (448,270); -insert into help_relation (help_topic_id,help_keyword_id) values (415,271); -insert into help_relation (help_topic_id,help_keyword_id) values (248,272); -insert into help_relation (help_topic_id,help_keyword_id) values (174,273); -insert into help_relation (help_topic_id,help_keyword_id) values (512,274); -insert into help_relation (help_topic_id,help_keyword_id) values (310,275); -insert into help_relation (help_topic_id,help_keyword_id) values (362,276); -insert into help_relation (help_topic_id,help_keyword_id) values (448,277); -insert into help_relation (help_topic_id,help_keyword_id) values (448,278); -insert into help_relation (help_topic_id,help_keyword_id) values (141,278); -insert into help_relation (help_topic_id,help_keyword_id) values (449,278); -insert into help_relation (help_topic_id,help_keyword_id) values (422,279); -insert into help_relation (help_topic_id,help_keyword_id) values (202,279); -insert into help_relation (help_topic_id,help_keyword_id) values (126,279); -insert into help_relation (help_topic_id,help_keyword_id) values (372,280); -insert into help_relation (help_topic_id,help_keyword_id) values (310,281); -insert into help_relation (help_topic_id,help_keyword_id) values (300,282); -insert into help_relation (help_topic_id,help_keyword_id) values (523,282); -insert into help_relation (help_topic_id,help_keyword_id) values (485,283); -insert into help_relation (help_topic_id,help_keyword_id) values (389,284); -insert into help_relation (help_topic_id,help_keyword_id) values (341,285); -insert into help_relation (help_topic_id,help_keyword_id) values (108,286); -insert into help_relation (help_topic_id,help_keyword_id) values (380,286); -insert into help_relation (help_topic_id,help_keyword_id) values (181,287); -insert into help_relation (help_topic_id,help_keyword_id) values (86,287); -insert into help_relation (help_topic_id,help_keyword_id) values (506,288); -insert into help_relation (help_topic_id,help_keyword_id) values (108,288); -insert into help_relation (help_topic_id,help_keyword_id) values (343,288); -insert into help_relation (help_topic_id,help_keyword_id) values (59,288); -insert into help_relation (help_topic_id,help_keyword_id) values (170,288); -insert into help_relation (help_topic_id,help_keyword_id) values (155,288); -insert into help_relation (help_topic_id,help_keyword_id) values (417,288); -insert into help_relation (help_topic_id,help_keyword_id) values (373,288); -insert into help_relation (help_topic_id,help_keyword_id) values (115,288); -insert into help_relation (help_topic_id,help_keyword_id) values (306,288); -insert into help_relation (help_topic_id,help_keyword_id) values (12,288); -insert into help_relation (help_topic_id,help_keyword_id) values (442,288); -insert into help_relation (help_topic_id,help_keyword_id) values (16,288); -insert into help_relation (help_topic_id,help_keyword_id) values (248,288); -insert into help_relation (help_topic_id,help_keyword_id) values (250,288); -insert into help_relation (help_topic_id,help_keyword_id) values (211,288); -insert into help_relation (help_topic_id,help_keyword_id) values (311,288); -insert into help_relation (help_topic_id,help_keyword_id) values (39,288); -insert into help_relation (help_topic_id,help_keyword_id) values (194,288); -insert into help_relation (help_topic_id,help_keyword_id) values (141,289); -insert into help_relation (help_topic_id,help_keyword_id) values (108,290); -insert into help_relation (help_topic_id,help_keyword_id) values (111,291); -insert into help_relation (help_topic_id,help_keyword_id) values (128,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 (504,293); -insert into help_relation (help_topic_id,help_keyword_id) values (311,294); -insert into help_relation (help_topic_id,help_keyword_id) values (27,295); -insert into help_relation (help_topic_id,help_keyword_id) values (442,295); -insert into help_relation (help_topic_id,help_keyword_id) values (150,295); -insert into help_relation (help_topic_id,help_keyword_id) values (494,296); -insert into help_relation (help_topic_id,help_keyword_id) values (512,297); -insert into help_relation (help_topic_id,help_keyword_id) values (248,298); -insert into help_relation (help_topic_id,help_keyword_id) values (172,299); -insert into help_relation (help_topic_id,help_keyword_id) values (512,300); -insert into help_relation (help_topic_id,help_keyword_id) values (459,301); -insert into help_relation (help_topic_id,help_keyword_id) values (83,302); -insert into help_relation (help_topic_id,help_keyword_id) values (319,303); -insert into help_relation (help_topic_id,help_keyword_id) values (246,304); -insert into help_relation (help_topic_id,help_keyword_id) values (512,304); -insert into help_relation (help_topic_id,help_keyword_id) values (248,305); -insert into help_relation (help_topic_id,help_keyword_id) values (224,306); -insert into help_relation (help_topic_id,help_keyword_id) values (270,307); -insert into help_relation (help_topic_id,help_keyword_id) values (318,307); -insert into help_relation (help_topic_id,help_keyword_id) values (437,308); -insert into help_relation (help_topic_id,help_keyword_id) values (172,309); -insert into help_relation (help_topic_id,help_keyword_id) values (187,310); -insert into help_relation (help_topic_id,help_keyword_id) values (144,311); -insert into help_relation (help_topic_id,help_keyword_id) values (150,312); -insert into help_relation (help_topic_id,help_keyword_id) values (425,313); -insert into help_relation (help_topic_id,help_keyword_id) values (512,313); -insert into help_relation (help_topic_id,help_keyword_id) values (107,314); -insert into help_relation (help_topic_id,help_keyword_id) values (300,314); -insert into help_relation (help_topic_id,help_keyword_id) values (185,314); -insert into help_relation (help_topic_id,help_keyword_id) values (302,314); -insert into help_relation (help_topic_id,help_keyword_id) values (432,314); -insert into help_relation (help_topic_id,help_keyword_id) values (4,314); -insert into help_relation (help_topic_id,help_keyword_id) values (335,314); -insert into help_relation (help_topic_id,help_keyword_id) values (155,314); -insert into help_relation (help_topic_id,help_keyword_id) values (7,314); -insert into help_relation (help_topic_id,help_keyword_id) values (403,314); -insert into help_relation (help_topic_id,help_keyword_id) values (338,314); -insert into help_relation (help_topic_id,help_keyword_id) values (119,314); -insert into help_relation (help_topic_id,help_keyword_id) values (12,314); -insert into help_relation (help_topic_id,help_keyword_id) values (442,314); -insert into help_relation (help_topic_id,help_keyword_id) values (276,314); -insert into help_relation (help_topic_id,help_keyword_id) values (443,314); -insert into help_relation (help_topic_id,help_keyword_id) values (48,314); -insert into help_relation (help_topic_id,help_keyword_id) values (122,314); -insert into help_relation (help_topic_id,help_keyword_id) values (18,314); -insert into help_relation (help_topic_id,help_keyword_id) values (340,314); -insert into help_relation (help_topic_id,help_keyword_id) values (165,314); -insert into help_relation (help_topic_id,help_keyword_id) values (194,314); -insert into help_relation (help_topic_id,help_keyword_id) values (227,314); -insert into help_relation (help_topic_id,help_keyword_id) values (24,314); -insert into help_relation (help_topic_id,help_keyword_id) values (452,314); -insert into help_relation (help_topic_id,help_keyword_id) values (93,314); -insert into help_relation (help_topic_id,help_keyword_id) values (523,314); -insert into help_relation (help_topic_id,help_keyword_id) values (259,314); -insert into help_relation (help_topic_id,help_keyword_id) values (27,314); -insert into help_relation (help_topic_id,help_keyword_id) values (417,314); -insert into help_relation (help_topic_id,help_keyword_id) values (526,314); -insert into help_relation (help_topic_id,help_keyword_id) values (418,314); -insert into help_relation (help_topic_id,help_keyword_id) values (96,314); -insert into help_relation (help_topic_id,help_keyword_id) values (38,314); -insert into help_relation (help_topic_id,help_keyword_id) values (211,314); -insert into help_relation (help_topic_id,help_keyword_id) values (183,314); -insert into help_relation (help_topic_id,help_keyword_id) values (428,314); -insert into help_relation (help_topic_id,help_keyword_id) values (70,314); -insert into help_relation (help_topic_id,help_keyword_id) values (363,314); -insert into help_relation (help_topic_id,help_keyword_id) values (504,314); -insert into help_relation (help_topic_id,help_keyword_id) values (284,315); -insert into help_relation (help_topic_id,help_keyword_id) values (415,315); -insert into help_relation (help_topic_id,help_keyword_id) values (137,315); -insert into help_relation (help_topic_id,help_keyword_id) values (448,315); -insert into help_relation (help_topic_id,help_keyword_id) values (111,315); -insert into help_relation (help_topic_id,help_keyword_id) values (248,316); -insert into help_relation (help_topic_id,help_keyword_id) values (181,317); -insert into help_relation (help_topic_id,help_keyword_id) values (248,318); -insert into help_relation (help_topic_id,help_keyword_id) values (70,319); -insert into help_relation (help_topic_id,help_keyword_id) values (444,319); -insert into help_relation (help_topic_id,help_keyword_id) values (37,320); -insert into help_relation (help_topic_id,help_keyword_id) values (50,320); -insert into help_relation (help_topic_id,help_keyword_id) values (182,320); -insert into help_relation (help_topic_id,help_keyword_id) values (21,320); -insert into help_relation (help_topic_id,help_keyword_id) values (494,320); -insert into help_relation (help_topic_id,help_keyword_id) values (187,320); -insert into help_relation (help_topic_id,help_keyword_id) values (127,320); -insert into help_relation (help_topic_id,help_keyword_id) values (528,320); -insert into help_relation (help_topic_id,help_keyword_id) values (203,321); -insert into help_relation (help_topic_id,help_keyword_id) values (83,322); -insert into help_relation (help_topic_id,help_keyword_id) values (176,322); -insert into help_relation (help_topic_id,help_keyword_id) values (420,323); -insert into help_relation (help_topic_id,help_keyword_id) values (63,324); -insert into help_relation (help_topic_id,help_keyword_id) values (203,325); -insert into help_relation (help_topic_id,help_keyword_id) values (270,326); -insert into help_relation (help_topic_id,help_keyword_id) values (448,326); -insert into help_relation (help_topic_id,help_keyword_id) values (318,326); -insert into help_relation (help_topic_id,help_keyword_id) values (169,326); -insert into help_relation (help_topic_id,help_keyword_id) values (141,326); -insert into help_relation (help_topic_id,help_keyword_id) values (442,327); -insert into help_relation (help_topic_id,help_keyword_id) values (93,327); -insert into help_relation (help_topic_id,help_keyword_id) values (79,328); -insert into help_relation (help_topic_id,help_keyword_id) values (333,329); -insert into help_relation (help_topic_id,help_keyword_id) values (111,329); -insert into help_relation (help_topic_id,help_keyword_id) values (306,329); -insert into help_relation (help_topic_id,help_keyword_id) values (250,330); -insert into help_relation (help_topic_id,help_keyword_id) values (362,331); -insert into help_relation (help_topic_id,help_keyword_id) values (102,332); -insert into help_relation (help_topic_id,help_keyword_id) values (507,333); -insert into help_relation (help_topic_id,help_keyword_id) values (66,334); -insert into help_relation (help_topic_id,help_keyword_id) values (277,334); -insert into help_relation (help_topic_id,help_keyword_id) values (203,335); -insert into help_relation (help_topic_id,help_keyword_id) values (362,336); -insert into help_relation (help_topic_id,help_keyword_id) values (333,337); -insert into help_relation (help_topic_id,help_keyword_id) values (484,337); -insert into help_relation (help_topic_id,help_keyword_id) values (465,338); -insert into help_relation (help_topic_id,help_keyword_id) values (68,338); -insert into help_relation (help_topic_id,help_keyword_id) values (512,339); -insert into help_relation (help_topic_id,help_keyword_id) values (18,340); -insert into help_relation (help_topic_id,help_keyword_id) values (442,340); -insert into help_relation (help_topic_id,help_keyword_id) values (111,341); -insert into help_relation (help_topic_id,help_keyword_id) values (200,342); -insert into help_relation (help_topic_id,help_keyword_id) values (250,342); -insert into help_relation (help_topic_id,help_keyword_id) values (201,343); -insert into help_relation (help_topic_id,help_keyword_id) values (341,344); -insert into help_relation (help_topic_id,help_keyword_id) values (494,344); -insert into help_relation (help_topic_id,help_keyword_id) values (362,345); -insert into help_relation (help_topic_id,help_keyword_id) values (203,346); -insert into help_relation (help_topic_id,help_keyword_id) values (111,347); -insert into help_relation (help_topic_id,help_keyword_id) values (442,348); -insert into help_relation (help_topic_id,help_keyword_id) values (459,348); -insert into help_relation (help_topic_id,help_keyword_id) values (442,349); -insert into help_relation (help_topic_id,help_keyword_id) values (163,349); -insert into help_relation (help_topic_id,help_keyword_id) values (483,349); -insert into help_relation (help_topic_id,help_keyword_id) values (207,350); -insert into help_relation (help_topic_id,help_keyword_id) values (227,351); -insert into help_relation (help_topic_id,help_keyword_id) values (310,351); -insert into help_relation (help_topic_id,help_keyword_id) values (70,351); -insert into help_relation (help_topic_id,help_keyword_id) values (448,351); -insert into help_relation (help_topic_id,help_keyword_id) values (512,352); -insert into help_relation (help_topic_id,help_keyword_id) values (172,353); -insert into help_relation (help_topic_id,help_keyword_id) values (448,354); -insert into help_relation (help_topic_id,help_keyword_id) values (111,355); -insert into help_relation (help_topic_id,help_keyword_id) values (51,356); -insert into help_relation (help_topic_id,help_keyword_id) values (111,356); -insert into help_relation (help_topic_id,help_keyword_id) values (448,357); -insert into help_relation (help_topic_id,help_keyword_id) values (471,358); -insert into help_relation (help_topic_id,help_keyword_id) values (310,359); -insert into help_relation (help_topic_id,help_keyword_id) values (98,359); -insert into help_relation (help_topic_id,help_keyword_id) values (86,359); -insert into help_relation (help_topic_id,help_keyword_id) values (362,360); -insert into help_relation (help_topic_id,help_keyword_id) values (333,361); -insert into help_relation (help_topic_id,help_keyword_id) values (484,361); -insert into help_relation (help_topic_id,help_keyword_id) values (427,362); -insert into help_relation (help_topic_id,help_keyword_id) values (292,363); -insert into help_relation (help_topic_id,help_keyword_id) values (427,363); -insert into help_relation (help_topic_id,help_keyword_id) values (200,364); -insert into help_relation (help_topic_id,help_keyword_id) values (250,364); -insert into help_relation (help_topic_id,help_keyword_id) values (6,364); -insert into help_relation (help_topic_id,help_keyword_id) values (111,365); -insert into help_relation (help_topic_id,help_keyword_id) values (362,366); -insert into help_relation (help_topic_id,help_keyword_id) values (71,367); -insert into help_relation (help_topic_id,help_keyword_id) values (341,368); -insert into help_relation (help_topic_id,help_keyword_id) values (239,368); -insert into help_relation (help_topic_id,help_keyword_id) values (203,369); -insert into help_relation (help_topic_id,help_keyword_id) values (220,370); -insert into help_relation (help_topic_id,help_keyword_id) values (203,371); -insert into help_relation (help_topic_id,help_keyword_id) values (512,372); -insert into help_relation (help_topic_id,help_keyword_id) values (82,373); -insert into help_relation (help_topic_id,help_keyword_id) values (277,374); -insert into help_relation (help_topic_id,help_keyword_id) values (476,375); -insert into help_relation (help_topic_id,help_keyword_id) values (65,375); -insert into help_relation (help_topic_id,help_keyword_id) values (378,375); -insert into help_relation (help_topic_id,help_keyword_id) values (512,375); -insert into help_relation (help_topic_id,help_keyword_id) values (248,376); -insert into help_relation (help_topic_id,help_keyword_id) values (115,376); -insert into help_relation (help_topic_id,help_keyword_id) values (512,376); -insert into help_relation (help_topic_id,help_keyword_id) values (0,377); -insert into help_relation (help_topic_id,help_keyword_id) values (519,378); -insert into help_relation (help_topic_id,help_keyword_id) values (476,378); -insert into help_relation (help_topic_id,help_keyword_id) values (235,378); -insert into help_relation (help_topic_id,help_keyword_id) values (92,378); -insert into help_relation (help_topic_id,help_keyword_id) values (111,378); -insert into help_relation (help_topic_id,help_keyword_id) values (200,378); -insert into help_relation (help_topic_id,help_keyword_id) values (380,378); -insert into help_relation (help_topic_id,help_keyword_id) values (39,378); -insert into help_relation (help_topic_id,help_keyword_id) values (116,378); -insert into help_relation (help_topic_id,help_keyword_id) values (470,378); -insert into help_relation (help_topic_id,help_keyword_id) values (383,378); -insert into help_relation (help_topic_id,help_keyword_id) values (512,378); -insert into help_relation (help_topic_id,help_keyword_id) values (248,379); -insert into help_relation (help_topic_id,help_keyword_id) values (250,380); -insert into help_relation (help_topic_id,help_keyword_id) values (0,381); -insert into help_relation (help_topic_id,help_keyword_id) values (448,381); -insert into help_relation (help_topic_id,help_keyword_id) values (0,382); -insert into help_relation (help_topic_id,help_keyword_id) values (442,383); -insert into help_relation (help_topic_id,help_keyword_id) values (443,383); -insert into help_relation (help_topic_id,help_keyword_id) values (484,384); -insert into help_relation (help_topic_id,help_keyword_id) values (487,385); -insert into help_relation (help_topic_id,help_keyword_id) values (248,386); -insert into help_relation (help_topic_id,help_keyword_id) values (250,387); -insert into help_relation (help_topic_id,help_keyword_id) values (253,387); -insert into help_relation (help_topic_id,help_keyword_id) values (470,387); -insert into help_relation (help_topic_id,help_keyword_id) values (111,387); -insert into help_relation (help_topic_id,help_keyword_id) values (306,387); -insert into help_relation (help_topic_id,help_keyword_id) values (427,387); -insert into help_relation (help_topic_id,help_keyword_id) values (448,388); -insert into help_relation (help_topic_id,help_keyword_id) values (514,389); -insert into help_relation (help_topic_id,help_keyword_id) values (126,389); -insert into help_relation (help_topic_id,help_keyword_id) values (63,390); -insert into help_relation (help_topic_id,help_keyword_id) values (302,391); -insert into help_relation (help_topic_id,help_keyword_id) values (442,391); -insert into help_relation (help_topic_id,help_keyword_id) values (262,392); -insert into help_relation (help_topic_id,help_keyword_id) values (401,393); -insert into help_relation (help_topic_id,help_keyword_id) values (239,394); -insert into help_relation (help_topic_id,help_keyword_id) values (448,395); -insert into help_relation (help_topic_id,help_keyword_id) values (224,396); -insert into help_relation (help_topic_id,help_keyword_id) values (116,396); -insert into help_relation (help_topic_id,help_keyword_id) values (494,397); -insert into help_relation (help_topic_id,help_keyword_id) values (341,398); -insert into help_relation (help_topic_id,help_keyword_id) values (182,398); -insert into help_relation (help_topic_id,help_keyword_id) values (494,398); -insert into help_relation (help_topic_id,help_keyword_id) values (248,399); -insert into help_relation (help_topic_id,help_keyword_id) values (259,400); -insert into help_relation (help_topic_id,help_keyword_id) values (224,401); -insert into help_relation (help_topic_id,help_keyword_id) values (311,402); -insert into help_relation (help_topic_id,help_keyword_id) values (203,402); -insert into help_relation (help_topic_id,help_keyword_id) values (111,403); -insert into help_relation (help_topic_id,help_keyword_id) values (203,404); -insert into help_relation (help_topic_id,help_keyword_id) values (116,405); -insert into help_relation (help_topic_id,help_keyword_id) values (518,406); -insert into help_relation (help_topic_id,help_keyword_id) values (248,406); -insert into help_relation (help_topic_id,help_keyword_id) values (111,406); -insert into help_relation (help_topic_id,help_keyword_id) values (497,407); -insert into help_relation (help_topic_id,help_keyword_id) values (403,408); -insert into help_relation (help_topic_id,help_keyword_id) values (239,409); -insert into help_relation (help_topic_id,help_keyword_id) values (502,410); -insert into help_relation (help_topic_id,help_keyword_id) values (311,411); -insert into help_relation (help_topic_id,help_keyword_id) values (328,412); -insert into help_relation (help_topic_id,help_keyword_id) values (7,413); -insert into help_relation (help_topic_id,help_keyword_id) values (442,413); -insert into help_relation (help_topic_id,help_keyword_id) values (248,414); -insert into help_relation (help_topic_id,help_keyword_id) values (518,415); -insert into help_relation (help_topic_id,help_keyword_id) values (280,415); -insert into help_relation (help_topic_id,help_keyword_id) values (401,415); -insert into help_relation (help_topic_id,help_keyword_id) values (239,416); -insert into help_relation (help_topic_id,help_keyword_id) values (293,417); -insert into help_relation (help_topic_id,help_keyword_id) values (309,418); -insert into help_relation (help_topic_id,help_keyword_id) values (113,418); -insert into help_relation (help_topic_id,help_keyword_id) values (242,418); -insert into help_relation (help_topic_id,help_keyword_id) values (199,418); -insert into help_relation (help_topic_id,help_keyword_id) values (309,419); -insert into help_relation (help_topic_id,help_keyword_id) values (113,419); -insert into help_relation (help_topic_id,help_keyword_id) values (343,419); -insert into help_relation (help_topic_id,help_keyword_id) values (311,419); -insert into help_relation (help_topic_id,help_keyword_id) values (419,419); -insert into help_relation (help_topic_id,help_keyword_id) values (104,420); -insert into help_relation (help_topic_id,help_keyword_id) values (108,421); -insert into help_relation (help_topic_id,help_keyword_id) values (519,421); -insert into help_relation (help_topic_id,help_keyword_id) values (181,422); -insert into help_relation (help_topic_id,help_keyword_id) values (509,423); -insert into help_relation (help_topic_id,help_keyword_id) values (248,424); -insert into help_relation (help_topic_id,help_keyword_id) values (341,425); -insert into help_relation (help_topic_id,help_keyword_id) values (494,425); -insert into help_relation (help_topic_id,help_keyword_id) values (427,425); -insert into help_relation (help_topic_id,help_keyword_id) values (24,426); -insert into help_relation (help_topic_id,help_keyword_id) values (510,427); -insert into help_relation (help_topic_id,help_keyword_id) values (255,428); -insert into help_relation (help_topic_id,help_keyword_id) values (343,428); -insert into help_relation (help_topic_id,help_keyword_id) values (412,428); -insert into help_relation (help_topic_id,help_keyword_id) values (6,428); -insert into help_relation (help_topic_id,help_keyword_id) values (401,428); -insert into help_relation (help_topic_id,help_keyword_id) values (21,428); -insert into help_relation (help_topic_id,help_keyword_id) values (280,428); -insert into help_relation (help_topic_id,help_keyword_id) values (311,428); -insert into help_relation (help_topic_id,help_keyword_id) values (361,428); -insert into help_relation (help_topic_id,help_keyword_id) values (333,429); -insert into help_relation (help_topic_id,help_keyword_id) values (512,430); -insert into help_relation (help_topic_id,help_keyword_id) values (150,431); -insert into help_relation (help_topic_id,help_keyword_id) values (63,432); -insert into help_relation (help_topic_id,help_keyword_id) values (250,433); -insert into help_relation (help_topic_id,help_keyword_id) values (378,433); -insert into help_relation (help_topic_id,help_keyword_id) values (470,433); -insert into help_relation (help_topic_id,help_keyword_id) values (429,433); -insert into help_relation (help_topic_id,help_keyword_id) values (306,433); -insert into help_relation (help_topic_id,help_keyword_id) values (427,433); -insert into help_relation (help_topic_id,help_keyword_id) values (421,434); -insert into help_relation (help_topic_id,help_keyword_id) values (442,435); -insert into help_relation (help_topic_id,help_keyword_id) values (418,435); -insert into help_relation (help_topic_id,help_keyword_id) values (512,435); -insert into help_relation (help_topic_id,help_keyword_id) values (227,436); -insert into help_relation (help_topic_id,help_keyword_id) values (33,436); -insert into help_relation (help_topic_id,help_keyword_id) values (70,436); -insert into help_relation (help_topic_id,help_keyword_id) values (448,436); -insert into help_relation (help_topic_id,help_keyword_id) values (49,436); -insert into help_relation (help_topic_id,help_keyword_id) values (63,436); -insert into help_relation (help_topic_id,help_keyword_id) values (518,437); -insert into help_relation (help_topic_id,help_keyword_id) values (39,437); -insert into help_relation (help_topic_id,help_keyword_id) values (318,437); -insert into help_relation (help_topic_id,help_keyword_id) values (248,437); -insert into help_relation (help_topic_id,help_keyword_id) values (512,437); -insert into help_relation (help_topic_id,help_keyword_id) values (248,438); -insert into help_relation (help_topic_id,help_keyword_id) values (127,439); -insert into help_relation (help_topic_id,help_keyword_id) values (448,440); -insert into help_relation (help_topic_id,help_keyword_id) values (270,441); -insert into help_relation (help_topic_id,help_keyword_id) values (318,441); -insert into help_relation (help_topic_id,help_keyword_id) values (522,441); -insert into help_relation (help_topic_id,help_keyword_id) values (509,442); -insert into help_relation (help_topic_id,help_keyword_id) values (201,442); -insert into help_relation (help_topic_id,help_keyword_id) values (172,442); -insert into help_relation (help_topic_id,help_keyword_id) values (516,443); -insert into help_relation (help_topic_id,help_keyword_id) values (512,443); -insert into help_relation (help_topic_id,help_keyword_id) values (248,444); -insert into help_relation (help_topic_id,help_keyword_id) values (512,444); -insert into help_relation (help_topic_id,help_keyword_id) values (248,445); -insert into help_relation (help_topic_id,help_keyword_id) values (387,445); -insert into help_relation (help_topic_id,help_keyword_id) values (518,446); -insert into help_relation (help_topic_id,help_keyword_id) values (248,446); -insert into help_relation (help_topic_id,help_keyword_id) values (341,447); -insert into help_relation (help_topic_id,help_keyword_id) values (239,447); -insert into help_relation (help_topic_id,help_keyword_id) values (26,447); -insert into help_relation (help_topic_id,help_keyword_id) values (494,447); -insert into help_relation (help_topic_id,help_keyword_id) values (108,448); -insert into help_relation (help_topic_id,help_keyword_id) values (519,448); -insert into help_relation (help_topic_id,help_keyword_id) values (330,449); -insert into help_relation (help_topic_id,help_keyword_id) values (239,449); -insert into help_relation (help_topic_id,help_keyword_id) values (443,449); -insert into help_relation (help_topic_id,help_keyword_id) values (338,449); -insert into help_relation (help_topic_id,help_keyword_id) values (442,450); -insert into help_relation (help_topic_id,help_keyword_id) values (250,450); -insert into help_relation (help_topic_id,help_keyword_id) values (343,450); -insert into help_relation (help_topic_id,help_keyword_id) values (417,450); -insert into help_relation (help_topic_id,help_keyword_id) values (361,450); -insert into help_relation (help_topic_id,help_keyword_id) values (116,450); -insert into help_relation (help_topic_id,help_keyword_id) values (309,451); -insert into help_relation (help_topic_id,help_keyword_id) values (518,451); -insert into help_relation (help_topic_id,help_keyword_id) values (199,451); -insert into help_relation (help_topic_id,help_keyword_id) values (257,452); -insert into help_relation (help_topic_id,help_keyword_id) values (246,453); -insert into help_relation (help_topic_id,help_keyword_id) values (484,454); -insert into help_relation (help_topic_id,help_keyword_id) values (340,455); -insert into help_relation (help_topic_id,help_keyword_id) values (284,455); -insert into help_relation (help_topic_id,help_keyword_id) values (476,455); -insert into help_relation (help_topic_id,help_keyword_id) values (311,455); -insert into help_relation (help_topic_id,help_keyword_id) values (122,455); -insert into help_relation (help_topic_id,help_keyword_id) values (292,455); -insert into help_relation (help_topic_id,help_keyword_id) values (427,455); -insert into help_relation (help_topic_id,help_keyword_id) values (144,456); -insert into help_relation (help_topic_id,help_keyword_id) values (448,457); -insert into help_relation (help_topic_id,help_keyword_id) values (449,457); -insert into help_relation (help_topic_id,help_keyword_id) values (261,458); -insert into help_relation (help_topic_id,help_keyword_id) values (484,459); -insert into help_relation (help_topic_id,help_keyword_id) values (476,460); -insert into help_relation (help_topic_id,help_keyword_id) values (311,460); -insert into help_relation (help_topic_id,help_keyword_id) values (512,460); -insert into help_relation (help_topic_id,help_keyword_id) values (248,461); -insert into help_relation (help_topic_id,help_keyword_id) values (116,461); -insert into help_relation (help_topic_id,help_keyword_id) values (111,462); -insert into help_relation (help_topic_id,help_keyword_id) values (528,463); -insert into help_relation (help_topic_id,help_keyword_id) values (246,464); -insert into help_relation (help_topic_id,help_keyword_id) values (181,464); -insert into help_relation (help_topic_id,help_keyword_id) values (26,464); -insert into help_relation (help_topic_id,help_keyword_id) values (333,464); -insert into help_relation (help_topic_id,help_keyword_id) values (324,464); -insert into help_relation (help_topic_id,help_keyword_id) values (484,464); -insert into help_relation (help_topic_id,help_keyword_id) values (516,464); -insert into help_relation (help_topic_id,help_keyword_id) values (269,465); -insert into help_relation (help_topic_id,help_keyword_id) values (58,465); -insert into help_relation (help_topic_id,help_keyword_id) values (461,465); -insert into help_relation (help_topic_id,help_keyword_id) values (408,465); -insert into help_relation (help_topic_id,help_keyword_id) values (231,465); -insert into help_relation (help_topic_id,help_keyword_id) values (415,465); -insert into help_relation (help_topic_id,help_keyword_id) values (448,465); -insert into help_relation (help_topic_id,help_keyword_id) values (449,465); -insert into help_relation (help_topic_id,help_keyword_id) values (263,466); -insert into help_relation (help_topic_id,help_keyword_id) values (362,467); -insert into help_relation (help_topic_id,help_keyword_id) values (111,468); -insert into help_relation (help_topic_id,help_keyword_id) values (335,469); -insert into help_relation (help_topic_id,help_keyword_id) values (442,469); -insert into help_relation (help_topic_id,help_keyword_id) values (165,469); -insert into help_relation (help_topic_id,help_keyword_id) values (26,469); -insert into help_relation (help_topic_id,help_keyword_id) values (527,470); -insert into help_relation (help_topic_id,help_keyword_id) values (181,471); -insert into help_relation (help_topic_id,help_keyword_id) values (20,472); -insert into help_relation (help_topic_id,help_keyword_id) values (442,473); -insert into help_relation (help_topic_id,help_keyword_id) values (16,473); -insert into help_relation (help_topic_id,help_keyword_id) values (146,473); -insert into help_relation (help_topic_id,help_keyword_id) values (442,474); -insert into help_relation (help_topic_id,help_keyword_id) values (526,474); -insert into help_relation (help_topic_id,help_keyword_id) values (111,475); -insert into help_relation (help_topic_id,help_keyword_id) values (448,476); -insert into help_relation (help_topic_id,help_keyword_id) values (318,476); -insert into help_relation (help_topic_id,help_keyword_id) values (115,477); -insert into help_relation (help_topic_id,help_keyword_id) values (248,478); -insert into help_relation (help_topic_id,help_keyword_id) values (63,478); -insert into help_relation (help_topic_id,help_keyword_id) values (512,478); -insert into help_relation (help_topic_id,help_keyword_id) values (512,479); -insert into help_relation (help_topic_id,help_keyword_id) values (108,480); -insert into help_relation (help_topic_id,help_keyword_id) values (519,480); -insert into help_relation (help_topic_id,help_keyword_id) values (509,481); -insert into help_relation (help_topic_id,help_keyword_id) values (201,481); -insert into help_relation (help_topic_id,help_keyword_id) values (172,481); -insert into help_relation (help_topic_id,help_keyword_id) values (27,482); -insert into help_relation (help_topic_id,help_keyword_id) values (38,482); -insert into help_relation (help_topic_id,help_keyword_id) values (150,482); -insert into help_relation (help_topic_id,help_keyword_id) values (362,482); -insert into help_relation (help_topic_id,help_keyword_id) values (147,482); -insert into help_relation (help_topic_id,help_keyword_id) values (372,483); -insert into help_relation (help_topic_id,help_keyword_id) values (248,483); -insert into help_relation (help_topic_id,help_keyword_id) values (366,484); -insert into help_relation (help_topic_id,help_keyword_id) values (248,485); +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; diff --git a/mysql-wsrep-5.6/scripts/msql2mysql.sh b/mysql-wsrep-5.6/scripts/msql2mysql.sh index 3c802d63..f506089d 100644 --- a/mysql-wsrep-5.6/scripts/msql2mysql.sh +++ b/mysql-wsrep-5.6/scripts/msql2mysql.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 1979-2007 MySQL AB +# Copyright (c) 1979, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,4 +15,6 @@ # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston # MA 02110-1301 USA. +echo "Warning: $0 is deprecated and will be removed in a future version.\n" 1>&2; + @bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* diff --git a/mysql-wsrep-5.6/scripts/mysql_config.pl.in b/mysql-wsrep-5.6/scripts/mysql_config.pl.in index ce3a9468..fb3230dd 100644 --- a/mysql-wsrep-5.6/scripts/mysql_config.pl.in +++ b/mysql-wsrep-5.6/scripts/mysql_config.pl.in @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- # -# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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 @@ if ( $^O eq "MSWin32" ) } else { - my $linkpath = "-L$pkglibdir"; + my $linkpath = "-L$pkglibdir @RPATH_OPTION@"; @lib_opts = ($linkpath,"-lmysqlclient"); @lib_r_opts = ($linkpath,"-lmysqlclient_r"); @lib_e_opts = ($linkpath,"-lmysqld"); diff --git a/mysql-wsrep-5.6/scripts/mysql_config.sh b/mysql-wsrep-5.6/scripts/mysql_config.sh index 7838d134..0ab07ebc 100644 --- a/mysql-wsrep-5.6/scripts/mysql_config.sh +++ b/mysql-wsrep-5.6/scripts/mysql_config.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,7 +76,8 @@ get_full_path () me=`get_full_path $0` -basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` +# Script might have been renamed but assume mysql_<something>config<something> +basedir=`echo $me | sed -e 's;/bin/mysql_.*config.*;;'` ldata='@localstatedir@' execdir='@libexecdir@' @@ -85,11 +86,11 @@ bindir='@bindir@' # If installed, search for the compiled in directory first (might be "lib64") pkglibdir='@pkglibdir@' pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` -fix_path pkglibdir $pkglibdir_rel lib/mysql lib +fix_path pkglibdir $pkglibdir_rel @libsubdir@/mysql @libsubdir@ plugindir='@pkgplugindir@' plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"` -fix_path plugindir $plugindir_rel lib/mysql/plugin lib/plugin +fix_path plugindir $plugindir_rel @libsubdir@/mysql/plugin @libsubdir@/plugin pkgincludedir='@pkgincludedir@' if [ -f "$basedir/include/mysql/mysql.h" ]; then @@ -110,10 +111,10 @@ fi # Create options # We intentionally add a space to the beginning and end of lib strings, simplifies replace later -libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" +libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " -libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ " -embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ " +libs_r=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqlclient @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ " +embedded_libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ " embedded_libs="$embedded_libs @QUOTED_CMAKE_CXX_LINK_FLAGS@" cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! diff --git a/mysql-wsrep-5.6/scripts/mysql_convert_table_format.sh b/mysql-wsrep-5.6/scripts/mysql_convert_table_format.sh index 2e5b5c11..66fe055b 100644 --- a/mysql-wsrep-5.6/scripts/mysql_convert_table_format.sh +++ b/mysql-wsrep-5.6/scripts/mysql_convert_table_format.sh @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright (c) 2000-2002, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify @@ -41,6 +41,8 @@ GetOptions( "P|port=i" => \$opt_port ) || usage(0); +print STDERR "Warning: $0 is deprecated and will be removed in a future version.\n"; + usage($opt_version) if ($#ARGV < 0 || $opt_help || $opt_version); $opt_database=shift(@ARGV); diff --git a/mysql-wsrep-5.6/scripts/mysql_find_rows.sh b/mysql-wsrep-5.6/scripts/mysql_find_rows.sh index 48c4915a..009085c0 100644 --- a/mysql-wsrep-5.6/scripts/mysql_find_rows.sh +++ b/mysql-wsrep-5.6/scripts/mysql_find_rows.sh @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright (c) 2000, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify @@ -23,6 +23,8 @@ $opt_help=$opt_Information=$opt_skip_use_db=0; $opt_regexp=$opt_dbregexp=".*"; $opt_start_row=1; $opt_rows=9999999999; +print STDERR "Warning: $0 is deprecated and will be removed in a future version.\n"; + GetOptions("Information","help","regexp=s","start_row=i","rows=i", "dbregexp=s", "skip-use-db") || usage(); diff --git a/mysql-wsrep-5.6/scripts/mysql_fix_extensions.sh b/mysql-wsrep-5.6/scripts/mysql_fix_extensions.sh index 2a50bfe2..3da49855 100644 --- a/mysql-wsrep-5.6/scripts/mysql_fix_extensions.sh +++ b/mysql-wsrep-5.6/scripts/mysql_fix_extensions.sh @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright (c) 2001 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or @@ -26,6 +26,7 @@ # makes .frm lowercase and .MYI/MYD/ISM/ISD uppercase # useful when datafiles are copied from windows +print STDERR "Warning: $0 is deprecated and will be removed in a future version.\n"; die "Usage: $0 datadir\n" unless -d $ARGV[0]; for $a (<$ARGV[0]/*/*.*>) { $_=$a; diff --git a/mysql-wsrep-5.6/scripts/mysql_install_db.pl.in b/mysql-wsrep-5.6/scripts/mysql_install_db.pl.in index 440a977b..c9af549d 100644 --- a/mysql-wsrep-5.6/scripts/mysql_install_db.pl.in +++ b/mysql-wsrep-5.6/scripts/mysql_install_db.pl.in @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. # # This 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,13 +34,37 @@ # ############################################################################## -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"); @@ -70,11 +94,14 @@ Usage: $0 [OPTIONS] Read this file after the global files are read. --defaults-file=name Only read default options from the given file name. --force Causes mysql_install_db to run even if DNS does not - work. In that case, grant table entries that normally - use hostnames will use IP addresses. + work. In that case, grant table entries that + normally use hostnames will use IP addresses. --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. + Deprecated, will be removed in future version. EOF1 if ( $^O !~ m/^(MSWin32|cygwin)$/ ) { print <<EOF2; @@ -149,6 +176,7 @@ sub parse_arguments "skip-name-resolve", "verbose", + "keep-my-cnf", "rpm", "help", "random-passwords", @@ -356,13 +384,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) || return ""; + 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 +433,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->{'keep-my-cnf'} ) +{ + $keep_my_cnf = 1; +} if ( $opt->{srcdir} ) { $opt->{builddir} = $opt->{srcdir} unless $opt->{builddir}; @@ -425,57 +464,63 @@ 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 $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf"; + +$config_file= "$basedir/my.$cnfext"; -my $cfg_template= find_in_basedir($opt,"file","my-default.cnf", - "share","share/mysql","support-files"); --e $cfg_template or cannot_find_file("my-default.cnf"); +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; my $failed_write_cfg= 0; if (-e $copy_cfg_file) { - $copy_cfg_file =~ s/my.cnf/my-new.cnf/; + $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/; # 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] # in the my.cfg file, then re-run to merge with command line arguments. # ---------------------------------------------------------------------- -my $print_def_file; +my $cmd; +my @default_options; if ( $opt->{'defaults-file'} ) { - $print_def_file= $opt->{'defaults-file'}; + $cmd = quote_options($print_defaults, + "--defaults-file=$opt->{'defaults-file'}", + "mysqld", "mysql_install_db"); } else { - $print_def_file= $config_file; + $cmd = quote_options($print_defaults, "mysqld", "mysql_install_db"); } -my @default_options; -my $cmd = quote_options($print_defaults,"--defaults-file=$print_def_file", - "mysqld","mysql_install_db"); open(PIPE, "$cmd |") or error($opt,"can't run $cmd: $!"); while ( <PIPE> ) { @@ -846,7 +891,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", @@ -871,7 +922,7 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") ) "The new default config file was created as $copy_cfg_file,", "please compare it with your file and take the changes you need."); } - foreach my $cfg ( "/etc/my.cnf", "/etc/mysql/my.cnf" ) + foreach my $cfg ( "/etc/my.$cnfext", "/etc/mysql/my.$cnfext" ) { check_sys_cfg_file ($opt, $cfg); } diff --git a/mysql-wsrep-5.6/scripts/mysql_install_db.sh b/mysql-wsrep-5.6/scripts/mysql_install_db.sh index b7ec561e..b474adf2 100644 --- a/mysql-wsrep-5.6/scripts/mysql_install_db.sh +++ b/mysql-wsrep-5.6/scripts/mysql_install_db.sh @@ -49,8 +49,8 @@ Usage: $0 [OPTIONS] Read this file after the global files are read. --defaults-file=name Only read default options from the given file name. --force Causes mysql_install_db to run even if DNS does not - work. In that case, grant table entries that normally - use hostnames will use IP addresses. + work. In that case, grant table entries that + normally use hostnames will use IP addresses. --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. diff --git a/mysql-wsrep-5.6/scripts/mysql_setpermission.sh b/mysql-wsrep-5.6/scripts/mysql_setpermission.sh index f23011a5..44cf5a37 100644 --- a/mysql-wsrep-5.6/scripts/mysql_setpermission.sh +++ b/mysql-wsrep-5.6/scripts/mysql_setpermission.sh @@ -1,7 +1,7 @@ #!/usr/bin/perl ## Emacs, this is -*- perl -*- mode? :-) -# Copyright (c) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2014 Oracle and/or its affiliates. All rights reserved. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or @@ -59,6 +59,8 @@ my $user = ""; $dbh=$host=$opt_user= $opt_password= $opt_help= $opt_host= $opt_socket= ""; $opt_port=0; +print STDERR "Warning: $0 is deprecated and will be removed in a future version.\n"; + read_my_cnf(); # Read options from ~/.my.cnf GetOptions("user=s","password=s","help","host=s","socket=s","port=i"); @@ -264,13 +266,13 @@ sub addall { foreach $host (@hosts) { # user privileges: SELECT if (($todo == 2) || ($todo == 3)) { - $sth = $dbh->do("GRANT SELECT ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 4) { # user privileges: SELECT,INSERT,UPDATE,DELETE - $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 5) { # user privileges: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES - $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 6) { # all privileges $sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; diff --git a/mysql-wsrep-5.6/scripts/mysql_system_tables.sql b/mysql-wsrep-5.6/scripts/mysql_system_tables.sql index fd9fd9ad..c73f41c3 100644 --- a/mysql-wsrep-5.6/scripts/mysql_system_tables.sql +++ b/mysql-wsrep-5.6/scripts/mysql_system_tables.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +-- Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. -- -- This 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,7 +25,7 @@ CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db c -- Remember for later if db table already existed set @had_db_table= @@warning_count != 0; -CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(64) DEFAULT '', authentication_string TEXT, password_expired ENUM('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(64) DEFAULT 'mysql_native_password', authentication_string TEXT, password_expired ENUM('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -- Remember for later if user table already existed set @had_user_table= @@warning_count != 0; diff --git a/mysql-wsrep-5.6/scripts/mysql_system_tables_data.sql b/mysql-wsrep-5.6/scripts/mysql_system_tables_data.sql index 567f58b6..98523ab3 100644 --- a/mysql-wsrep-5.6/scripts/mysql_system_tables_data.sql +++ b/mysql-wsrep-5.6/scripts/mysql_system_tables_data.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +-- Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. -- -- This 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,10 +39,10 @@ DROP TABLE tmp_db; -- Fill "user" table with default users allowing root access -- from local machine if "user" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; -INSERT INTO tmp_user VALUES ('localhost','root','','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,'','','N'); -REPLACE INTO tmp_user SELECT @current_hostname,'root','','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,'','','N' FROM dual WHERE @current_hostname != 'localhost'; -REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','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,'','','N'); -REPLACE INTO tmp_user VALUES ('::1','root','','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,'','','N'); +INSERT INTO tmp_user VALUES ('localhost','root','','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'); +REPLACE INTO tmp_user SELECT @current_hostname,'root','','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' FROM dual WHERE @current_hostname != 'localhost'; +REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','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'); +REPLACE INTO tmp_user VALUES ('::1','root','','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'); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; diff --git a/mysql-wsrep-5.6/scripts/mysql_system_tables_fix.sql b/mysql-wsrep-5.6/scripts/mysql_system_tables_fix.sql index c1eb6d61..49c15473 100644 --- a/mysql-wsrep-5.6/scripts/mysql_system_tables_fix.sql +++ b/mysql-wsrep-5.6/scripts/mysql_system_tables_fix.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +-- Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -606,8 +606,10 @@ DROP PREPARE stmt; drop procedure mysql.die; -ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT; -ALTER TABLE user MODIFY plugin char(64) DEFAULT ''; +ALTER TABLE user ADD plugin char(64) DEFAULT 'mysql_native_password', ADD authentication_string TEXT; +ALTER TABLE user MODIFY plugin char(64) DEFAULT 'mysql_native_password'; +UPDATE user SET plugin=IF((length(password) = 41) OR (length(password) = 0), 'mysql_native_password', '') WHERE plugin = ''; +UPDATE user SET plugin=IF(length(password) = 16, 'mysql_old_password', '') WHERE plugin = ''; ALTER TABLE user MODIFY authentication_string TEXT; -- establish if the field is already there. @@ -628,6 +630,23 @@ INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now( INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0; DROP TABLE tmp_proxies_priv; +-- Checking for any duplicate hostname and username combination are exists. +-- If exits we will throw error. +DROP PROCEDURE IF EXISTS mysql.count_duplicate_host_names; +DELIMITER // +CREATE PROCEDURE mysql.count_duplicate_host_names() +BEGIN + SET @duplicate_hosts=(SELECT count(*) FROM mysql.user GROUP BY user, lower(host) HAVING count(*) > 1 LIMIT 1); + IF @duplicate_hosts > 1 THEN + SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Multiple accounts exist for @user_name, @host_name that differ only in Host lettercase; remove all except one of them'; + END IF; +END // +DELIMITER ; +CALL mysql.count_duplicate_host_names(); +-- Get warnings (if any) +SHOW WARNINGS; +DROP PROCEDURE mysql.count_duplicate_host_names; + # Convering the host name to lower case for existing users UPDATE user SET host=LOWER( host ) WHERE LOWER( host ) <> host; diff --git a/mysql-wsrep-5.6/scripts/mysql_test_data_timezone.sql b/mysql-wsrep-5.6/scripts/mysql_test_data_timezone.sql index 54b423ab..b2d3a132 100644 --- a/mysql-wsrep-5.6/scripts/mysql_test_data_timezone.sql +++ b/mysql-wsrep-5.6/scripts/mysql_test_data_timezone.sql @@ -1,4 +1,5 @@ -- Copyright (C) 2007 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 diff --git a/mysql-wsrep-5.6/scripts/mysql_zap.sh b/mysql-wsrep-5.6/scripts/mysql_zap.sh index a9c3e7a7..cab209d2 100644 --- a/mysql-wsrep-5.6/scripts/mysql_zap.sh +++ b/mysql-wsrep-5.6/scripts/mysql_zap.sh @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright (c) 2000-2002, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2014 Oracle and/or its affiliates. All rights reserved. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify @@ -20,6 +20,8 @@ # Usage: mysql_zap [-signal] [-f] [-t] pattern +print STDERR "Warning: $0 is deprecated and will be removed in a future version.\n"; + # Configuration parameters. $sig = ""; # Default to try all signals diff --git a/mysql-wsrep-5.6/scripts/mysqlaccess.sh b/mysql-wsrep-5.6/scripts/mysqlaccess.sh index b6507b52..10c93746 100644 --- a/mysql-wsrep-5.6/scripts/mysqlaccess.sh +++ b/mysql-wsrep-5.6/scripts/mysqlaccess.sh @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2014, Oracle and/or 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 @@ -2393,7 +2393,8 @@ sub Print_Header { print "$MySQLaccess::script Version $MySQLaccess::VERSION\n" ."By RUG-AIV, by Yves Carlier (Yves.Carlier\@rug.ac.be)\n" ."Changes by Steve Harvey (sgh\@vex.net)\n" - ."This software comes with ABSOLUTELY NO WARRANTY.\n"; + ."This software comes with ABSOLUTELY NO WARRANTY.\n" + ."\nWarning: $MySQLaccess::script is deprecated and will be removed in a future version.\n"; } if ($MySQLaccess::CGI) { #CGI-BIN mode print "content-type: text/html\n\n" @@ -2407,6 +2408,7 @@ sub Print_Header { ."By RUG-AIV, by Yves Carlier (<a href=mailto:Yves.Carlier\@rug.ac.be>Yves.Carlier\@rug.ac.be</a>)<BR>\n" ."Changes by Steve Harvey (<a href=mailto:sgh\@vex.net>sgh\@vex.net</a>)<BR>\n" ."This software comes with ABSOLUTELY NO WARRANTY.<BR>\n" + ."<BR>\nWarning: $MySQLaccess::script is deprecated and will be removed in a future version.<BR>\n" ."</ADDRESS>\n</CENTER>\n" ."<HR>\n"; Print_Taskbar(); diff --git a/mysql-wsrep-5.6/scripts/mysqlbug.sh b/mysql-wsrep-5.6/scripts/mysqlbug.sh index 64804b5d..0259b6fd 100644 --- a/mysql-wsrep-5.6/scripts/mysqlbug.sh +++ b/mysql-wsrep-5.6/scripts/mysqlbug.sh @@ -1,5 +1,6 @@ #!/bin/sh -# Copyright (C) 2000-2002, 2004 MySQL AB +# Copyright (c) 2000, 2014 Oracle and/or its affiliates. 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 @@ -17,6 +18,7 @@ # Create a bug report and mail it to the mysql mailing list # Based on glibc bug reporting script. +echo "Warning: $0 is deprecated and will be removed in a future version." 1>&2 echo "Finding system information for a MySQL bug report" VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" diff --git a/mysql-wsrep-5.6/scripts/mysqld_safe.sh b/mysql-wsrep-5.6/scripts/mysqld_safe.sh index 772db06b..3af18858 100644 --- a/mysql-wsrep-5.6/scripts/mysqld_safe.sh +++ b/mysql-wsrep-5.6/scripts/mysqld_safe.sh @@ -504,7 +504,7 @@ if [ -n "${PLUGIN_DIR}" ]; then plugin_dir="${PLUGIN_DIR}" else # Try to find plugin dir relative to basedir - for dir in lib/mysql/plugin lib/plugin + for dir in lib64/mysql/plugin lib64/plugin lib/mysql/plugin lib/plugin do if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then plugin_dir="${MY_BASEDIR_VERSION}/${dir}" diff --git a/mysql-wsrep-5.6/scripts/mysqlhotcopy.sh b/mysql-wsrep-5.6/scripts/mysqlhotcopy.sh index a7f465dc..ffedc049 100644 --- a/mysql-wsrep-5.6/scripts/mysqlhotcopy.sh +++ b/mysql-wsrep-5.6/scripts/mysqlhotcopy.sh @@ -158,6 +158,8 @@ GetOptions( \%opt, my @db_desc = (); my $tgt_name = undef; +print STDERR "Warning: $0 is deprecated and will be removed in a future version.\n"; + usage("") if ($opt{help}); if ( $opt{regexp} || $opt{suffix} || @ARGV > 2 ) { diff --git a/mysql-wsrep-5.6/sql-bench/compare-results.sh b/mysql-wsrep-5.6/sql-bench/compare-results.sh old mode 100644 new mode 100755 diff --git a/mysql-wsrep-5.6/sql-bench/graph-compare-results.sh b/mysql-wsrep-5.6/sql-bench/graph-compare-results.sh old mode 100644 new mode 100755 index 317ef583..c5ba6865 --- a/mysql-wsrep-5.6/sql-bench/graph-compare-results.sh +++ b/mysql-wsrep-5.6/sql-bench/graph-compare-results.sh @@ -1,3 +1,5 @@ +#! /usr/bin/perl + #### #### Hello ... this is a heavily hacked script by Luuk #### instead of printing the result it makes a nice gif diff --git a/mysql-wsrep-5.6/sql-common/client.c b/mysql-wsrep-5.6/sql-common/client.c index 5f7f063f..c52bdd3c 100644 --- a/mysql-wsrep-5.6/sql-common/client.c +++ b/mysql-wsrep-5.6/sql-common/client.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -724,6 +724,20 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command, */ net_clear(&mysql->net, (command != COM_QUIT)); +#if !defined(EMBEDDED_LIBRARY) + /* + If auto-reconnect mode is enabled check if connection is still alive before + sending new command. Otherwise, send() might not notice that connection was + closed by the server (for example, due to KILL statement), and the fact that + connection is gone will be noticed only on attempt to read command's result, + when it is too late to reconnect. Note that such scenario can still occur if + connection gets killed after this check but before command is sent to + server. But this should be rare. + */ + if ((command != COM_QUIT) && mysql->reconnect && !vio_is_connected(net->vio)) + net->error= 2; +#endif + if (net_write_command(net,(uchar) command, header, header_length, arg, arg_length)) { @@ -1665,8 +1679,8 @@ mysql_init(MYSQL *mysql) strmov(mysql->net.sqlstate, not_error_sqlstate); /* - Only enable LOAD DATA INFILE by default if configured with - --enable-local-infile + Only enable LOAD DATA INFILE by default if configured with option + ENABLED_LOCAL_INFILE */ #if defined(ENABLED_LOCAL_INFILE) && !defined(MYSQL_SERVER) @@ -1844,6 +1858,12 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c DBUG_RETURN(1); } + if (X509_V_OK != SSL_get_verify_result(ssl)) + { + *errptr= "Failed to verify the server certificate"; + X509_free(server_cert); + DBUG_RETURN(1); + } /* We already know that the certificate exchanged was valid; the SSL library handled that. Now we need to verify that the contents of the certificate @@ -3971,12 +3991,15 @@ static void mysql_close_free(MYSQL *mysql) */ static void mysql_prune_stmt_list(MYSQL *mysql) { - LIST *element= mysql->stmts; - LIST *pruned_list= 0; + LIST *pruned_list= NULL; - for (; element; element= element->next) + while(mysql->stmts) { - MYSQL_STMT *stmt= (MYSQL_STMT *) element->data; + LIST *element= mysql->stmts; + MYSQL_STMT *stmt; + + mysql->stmts= list_delete(element, element); + stmt= (MYSQL_STMT *) element->data; if (stmt->state != MYSQL_STMT_INIT_DONE) { stmt->mysql= 0; @@ -4042,8 +4065,8 @@ void STDCALL mysql_close(MYSQL *mysql) { free_old_query(mysql); mysql->status=MYSQL_STATUS_READY; /* Force command */ - mysql->reconnect=0; simple_command(mysql,COM_QUIT,(uchar*) 0,0,1); + mysql->reconnect=0; end_server(mysql); /* Sets mysql->net.vio= 0 */ } mysql_close_free_options(mysql); @@ -4637,17 +4660,27 @@ const char * STDCALL mysql_error(MYSQL *mysql) RETURN Signed number > 323000 + Zero if there is no connection */ ulong STDCALL mysql_get_server_version(MYSQL *mysql) { - uint major, minor, version; - char *pos= mysql->server_version, *end_pos; - major= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; - minor= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1; - version= (uint) strtoul(pos, &end_pos, 10); - return (ulong) major*10000L+(ulong) (minor*100+version); + ulong major= 0, minor= 0, version= 0; + + if (mysql->server_version) + { + char *pos= mysql->server_version, *end_pos; + major= strtoul(pos, &end_pos, 10); pos=end_pos+1; + minor= strtoul(pos, &end_pos, 10); pos=end_pos+1; + version= strtoul(pos, &end_pos, 10); + } + else + { + set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); + } + + return major*10000 + minor*100 + version; } diff --git a/mysql-wsrep-5.6/sql-common/client_authentication.cc b/mysql-wsrep-5.6/sql-common/client_authentication.cc index 9ec330db..d0d03971 100644 --- a/mysql-wsrep-5.6/sql-common/client_authentication.cc +++ b/mysql-wsrep-5.6/sql-common/client_authentication.cc @@ -153,11 +153,16 @@ int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) Get the scramble from the server because we need it when sending encrypted password. */ - if (vio->read_packet(vio, &pkt) != SCRAMBLE_LENGTH) + if (vio->read_packet(vio, &pkt) != SCRAMBLE_LENGTH + 1) { DBUG_PRINT("info",("Scramble is not of correct length.")); DBUG_RETURN(CR_ERROR); } + if (pkt[SCRAMBLE_LENGTH] != '\0') + { + DBUG_PRINT("info",("Missing protocol token in scramble data.")); + DBUG_RETURN(CR_ERROR); + } /* Copy the scramble to the stack or it will be lost on the next use of the net buffer. diff --git a/mysql-wsrep-5.6/sql-common/my_time.c b/mysql-wsrep-5.6/sql-common/my_time.c index 27734f00..ddc24bbe 100644 --- a/mysql-wsrep-5.6/sql-common/my_time.c +++ b/mysql-wsrep-5.6/sql-common/my_time.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -426,6 +426,16 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, last_field_pos= str; field_length= 6; /* 6 digits */ } + else if (my_isdigit(&my_charset_latin1,str[0])) + { + /* + We do not see a decimal point which would have indicated a + fractional second part in further read. So we skip the further + processing of digits. + */ + i++; + break; + } continue; } while (str != end && diff --git a/mysql-wsrep-5.6/sql-common/pack.c b/mysql-wsrep-5.6/sql-common/pack.c index 9fc69183..02a4efe4 100644 --- a/mysql-wsrep-5.6/sql-common/pack.c +++ b/mysql-wsrep-5.6/sql-common/pack.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000-2003, 2007 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 diff --git a/mysql-wsrep-5.6/sql/CMakeLists.txt b/mysql-wsrep-5.6/sql/CMakeLists.txt index 63cd3b0a..3eeb07d9 100644 --- a/mysql-wsrep-5.6/sql/CMakeLists.txt +++ b/mysql-wsrep-5.6/sql/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -399,14 +399,15 @@ IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED) ENDIF() FOREACH(tool glibtoolize libtoolize aclocal autoconf autoheader automake gtar - tar bzr) + tar git) STRING(TOUPPER ${tool} TOOL) FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable") MARK_AS_ADVANCED(${TOOL}_EXECUTABLE) ENDFOREACH() CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/cmake/make_dist.cmake.in ${CMAKE_BINARY_DIR}/make_dist.cmake @ONLY) + ${CMAKE_SOURCE_DIR}/cmake/make_dist.cmake.in + ${CMAKE_BINARY_DIR}/make_dist.cmake @ONLY) ADD_CUSTOM_TARGET(dist COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/make_dist.cmake @@ -416,8 +417,7 @@ ADD_CUSTOM_TARGET(dist ADD_CUSTOM_TARGET(distclean COMMAND ${CMAKE_COMMAND} -E echo WARNING: distclean target is not functional - COMMAND ${CMAKE_COMMAND} -E echo Use 'bzr clean-tree' with --unknown and/or - --ignored parameter instead + COMMAND ${CMAKE_COMMAND} -E echo Use 'git clean -fdx' instead VERBATIM ) diff --git a/mysql-wsrep-5.6/sql/binlog.cc b/mysql-wsrep-5.6/sql/binlog.cc index 819fa0b8..d1babfec 100644 --- a/mysql-wsrep-5.6/sql/binlog.cc +++ b/mysql-wsrep-5.6/sql/binlog.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -395,6 +395,26 @@ public: { compute_statistics(); truncate(0); + + /* + If IOCACHE has a file associated, change its size to 0. + It is safer to do it here, since we are certain that one + asked the cache to go to position 0 with truncate. + */ + if(cache_log.file != -1) + { + int error= 0; + if((error= my_chsize(cache_log.file, 0, 0, MYF(MY_WME)))) + sql_print_warning("Unable to resize binlog IOCACHE auxilary file"); + + DBUG_EXECUTE_IF("show_io_cache_size", + { + ulong file_size= my_seek(cache_log.file, + 0L,MY_SEEK_END,MYF(MY_WME+MY_FAE)); + sql_print_error("New size:%ld", file_size); + }); + } + flags.incident= false; flags.with_xid= false; flags.immediate= false; @@ -1842,7 +1862,10 @@ static int log_in_use(const char* log_name) { size_t log_name_len = strlen(log_name) + 1; int thread_count=0; - +#ifndef DBUG_OFF + if (current_thd) + DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count"); +#endif mysql_mutex_lock(&LOCK_thread_count); Thread_iterator it= global_thread_list_begin(); @@ -2565,8 +2588,13 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg, this object. @param prev_gtids If not NULL, then the GTIDs from the Previous_gtids_log_events are stored in this object. + @param first_gtid If not NULL, then the first GTID information from the + file will be stored in this object. @param last_gtid If not NULL, then the last GTID information from the file will be stored in this object. + @param sid_map The sid_map object to use in the rpl_sidno generation + of the Gtid_log_event. If lock is needed in the sid_map, the caller + must hold it. @param verify_checksum Set to true to verify event checksums. @retval GOT_GTIDS The file was successfully read and it contains @@ -2585,7 +2613,9 @@ enum enum_read_gtids_from_binlog_status { GOT_GTIDS, GOT_PREVIOUS_GTIDS, NO_GTIDS, ERROR, TRUNCATED }; static enum_read_gtids_from_binlog_status read_gtids_from_binlog(const char *filename, Gtid_set *all_gtids, - Gtid_set *prev_gtids, Gtid *last_gtid, + Gtid_set *prev_gtids, Gtid *first_gtid, + Gtid *last_gtid, + Sid_map* sid_map, bool verify_checksum) { DBUG_ENTER("read_gtids_from_binlog"); @@ -2602,6 +2632,20 @@ read_gtids_from_binlog(const char *filename, Gtid_set *all_gtids, File file; IO_CACHE log; + /* + We assert here that both all_gtids and prev_gtids, if specified, + uses the same sid_map as the one passed as a parameter. This is just + to ensure that, if the sid_map needed some lock and was locked by + the caller, the lock applies to all the GTID sets this function is + dealing with. + */ +#ifndef DBUG_OFF + if (all_gtids) + DBUG_ASSERT(all_gtids->get_sid_map() == sid_map); + if (prev_gtids) + DBUG_ASSERT(prev_gtids->get_sid_map() == sid_map); +#endif + const char *errmsg= NULL; if ((file= open_binlog_file(&log, filename, &errmsg)) < 0) { @@ -2622,6 +2666,7 @@ read_gtids_from_binlog(const char *filename, Gtid_set *all_gtids, Log_event *ev= NULL; enum_read_gtids_from_binlog_status ret= NO_GTIDS; bool done= false; + bool seen_first_gtid= false; while (!done && (ev= Log_event::read_log_event(&log, 0, fd_ev_p, verify_checksum)) != NULL) @@ -2690,21 +2735,24 @@ read_gtids_from_binlog(const char *filename, Gtid_set *all_gtids, ret= GOT_GTIDS; } /* - When all_gtids==NULL, we just check if the binary log contains - at least one Gtid_log_event, so that we can distinguish the - return values GOT_GTID and GOT_PREVIOUS_GTIDS. We don't need - to read anything else from the binary log. - But if last_gtid is requested (i.e., NOT NULL), we should continue to - read all gtids. Otherwise, we are done. + When all_gtids, first_gtid and last_gtid are all NULL, + we just check if the binary log contains at least one Gtid_log_event, + so that we can distinguish the return values GOT_GTID and + GOT_PREVIOUS_GTIDS. We don't need to read anything else from the + binary log. + If all_gtids or last_gtid is requested (i.e., NOT NULL), we should + continue to read all gtids. + If just first_gtid was requested, we will be done after storing this + Gtid_log_event info on it. */ - if (all_gtids == NULL && last_gtid == NULL) + if (all_gtids == NULL && first_gtid == NULL && last_gtid == NULL) { ret= GOT_GTIDS, done= true; } else { Gtid_log_event *gtid_ev= (Gtid_log_event *)ev; - rpl_sidno sidno= gtid_ev->get_sidno(false/*false=don't need lock*/); + rpl_sidno sidno= gtid_ev->get_sidno(sid_map); if (sidno < 0) ret= ERROR, done= true; else @@ -2719,6 +2767,17 @@ read_gtids_from_binlog(const char *filename, Gtid_set *all_gtids, DBUG_PRINT("info", ("Got Gtid from file '%s': Gtid(%d, %lld).", filename, sidno, gtid_ev->get_gno())); } + + /* If the first GTID was requested, stores it */ + if (first_gtid && !seen_first_gtid) + { + first_gtid->set(sidno, gtid_ev->get_gno()); + seen_first_gtid= true; + /* If the first_gtid was the only thing requested, we are done */ + if (all_gtids == NULL && last_gtid == NULL) + ret= GOT_GTIDS, done= true; + } + if (last_gtid) last_gtid->set(sidno, gtid_ev->get_gno()); } @@ -2762,6 +2821,7 @@ read_gtids_from_binlog(const char *filename, Gtid_set *all_gtids, bool MYSQL_BIN_LOG::find_first_log_not_in_gtid_set(char *binlog_file_name, const Gtid_set *gtid_set, + Gtid *first_gtid, const char **errmsg) { DBUG_ENTER("MYSQL_BIN_LOG::gtid_read_start_binlog"); @@ -2807,6 +2867,8 @@ bool MYSQL_BIN_LOG::find_first_log_not_in_gtid_set(char *binlog_file_name, subset of the given gtid set. Since every binary log begins with a Previous_gtids_log_event, that contains all GTIDs in all previous binary logs. + We also ask for the first GTID in the binary log to know if we + should send the FD event with the "created" field cleared or not. */ DBUG_PRINT("info", ("Iterating backwards through binary logs, and reading " "only the Previous_gtids_log_event, to find the first " @@ -2818,7 +2880,9 @@ bool MYSQL_BIN_LOG::find_first_log_not_in_gtid_set(char *binlog_file_name, const char *filename= rit->c_str(); DBUG_PRINT("info", ("Read Previous_gtids_log_event from filename='%s'", filename)); - switch (read_gtids_from_binlog(filename, NULL, &previous_gtid_set, NULL, + switch (read_gtids_from_binlog(filename, NULL, &previous_gtid_set, + first_gtid, NULL/* last_gtid */, + previous_gtid_set.get_sid_map(), opt_master_verify_checksum)) { case ERROR: @@ -2869,8 +2933,8 @@ end: } bool MYSQL_BIN_LOG::init_gtid_sets(Gtid_set *all_gtids, Gtid_set *lost_gtids, - Gtid *last_gtid, - bool verify_checksum, bool need_lock) + Gtid *last_gtid, bool verify_checksum, + bool need_lock, bool is_server_starting) { DBUG_ENTER("MYSQL_BIN_LOG::init_gtid_sets"); DBUG_PRINT("info", ("lost_gtids=%p; so we are recovering a %s log", @@ -2906,6 +2970,13 @@ bool MYSQL_BIN_LOG::init_gtid_sets(Gtid_set *all_gtids, Gtid_set *lost_gtids, list<string>::reverse_iterator rit; bool reached_first_file= false; + /* Initialize the sid_map to be used in read_gtids_from_binlog */ + Sid_map *sid_map= NULL; + if (all_gtids) + sid_map= all_gtids->get_sid_map(); + else if (lost_gtids) + sid_map= lost_gtids->get_sid_map(); + for (error= find_log_pos(&linfo, NULL, false/*need_lock_index=false*/); !error; error= find_next_log(&linfo, false/*need_lock_index=false*/)) { @@ -2917,6 +2988,16 @@ bool MYSQL_BIN_LOG::init_gtid_sets(Gtid_set *all_gtids, Gtid_set *lost_gtids, DBUG_PRINT("error", ("Error reading binlog index")); goto end; } + /* + On server starting, one new empty binlog file is created and + its file name is put into index file before initializing + GLOBAL.GTID_EXECUTED AND GLOBAL.GTID_PURGED, it is not the + last binlog file before the server restarts, so we remove + its file name from filename_list. + */ + if (is_server_starting && !is_relay_log && !filename_list.empty()) + filename_list.pop_back(); + error= 0; if (all_gtids != NULL) @@ -2939,19 +3020,40 @@ bool MYSQL_BIN_LOG::init_gtid_sets(Gtid_set *all_gtids, Gtid_set *lost_gtids, filename, got_gtids, reached_first_file)); switch (read_gtids_from_binlog(filename, got_gtids ? NULL : all_gtids, reached_first_file ? lost_gtids : NULL, - last_gtid, - verify_checksum)) + NULL/* first_gtid */, last_gtid, + sid_map, verify_checksum)) { - case ERROR: - error= 1; - goto end; - case GOT_GTIDS: - case GOT_PREVIOUS_GTIDS: - got_gtids= true; - /*FALLTHROUGH*/ - case NO_GTIDS: - case TRUNCATED: - break; + case ERROR: + { + error= 1; + goto end; + } + case GOT_GTIDS: + case GOT_PREVIOUS_GTIDS: + { + got_gtids= true; + break; + } + case NO_GTIDS: + { + /* + If the binlog_gtid_simple_recovery is enabled, and the + last binary log does not contain any GTID event, do not + read any more binary logs, GLOBAL.GTID_EXECUTED and + GLOBAL.GTID_PURGED should be empty in the case. Otherwise, + initialize GTID_EXECUTED as usual. + */ + if (binlog_gtid_simple_recovery && !is_relay_log) + { + DBUG_ASSERT(all_gtids->is_empty() && lost_gtids->is_empty()); + goto end; + } + /*FALLTHROUGH*/ + } + case TRUNCATED: + { + break; + } } } } @@ -2962,18 +3064,39 @@ bool MYSQL_BIN_LOG::init_gtid_sets(Gtid_set *all_gtids, Gtid_set *lost_gtids, { const char *filename= it->c_str(); DBUG_PRINT("info", ("filename='%s'", filename)); - switch (read_gtids_from_binlog(filename, NULL, lost_gtids, NULL, - verify_checksum)) + switch (read_gtids_from_binlog(filename, NULL, lost_gtids, + NULL/* first_gtid */, NULL/* last_gtid */, + sid_map, verify_checksum)) { - case ERROR: - error= 1; - /*FALLTHROUGH*/ - case GOT_GTIDS: - goto end; - case GOT_PREVIOUS_GTIDS: - case NO_GTIDS: - case TRUNCATED: - break; + case ERROR: + { + error= 1; + /*FALLTHROUGH*/ + } + case GOT_GTIDS: + { + goto end; + } + case NO_GTIDS: + { + /* + If the binlog_gtid_simple_recovery is enabled, and the + first binary log does not contain any GTID event, do not + read any more binary logs, GLOBAL.GTID_PURGED should be + empty in the case. + */ + if (binlog_gtid_simple_recovery && !is_relay_log) + { + DBUG_ASSERT(lost_gtids->is_empty()); + goto end; + } + /*FALLTHROUGH*/ + } + case GOT_PREVIOUS_GTIDS: + case TRUNCATED: + { + break; + } } } } @@ -3139,6 +3262,8 @@ bool MYSQL_BIN_LOG::open_binlog(const char *log_name, else global_sid_lock->assert_some_wrlock(); Previous_gtids_log_event prev_gtids_ev(previous_gtid_set); + if (is_relay_log) + prev_gtids_ev.set_relay_log_event(); if (need_sid_lock) global_sid_lock->unlock(); prev_gtids_ev.checksum_alg= s.checksum_alg; @@ -3194,10 +3319,20 @@ bool MYSQL_BIN_LOG::open_binlog(const char *log_name, all the content of index file is copyed into the crash safe index file. Then move the crash safe index file to index file. */ + DBUG_EXECUTE_IF("simulate_disk_full_on_open_binlog", + {DBUG_SET("+d,simulate_no_free_space_error");}); if (DBUG_EVALUATE_IF("fault_injection_updating_index", 1, 0) || add_log_to_index((uchar*) log_file_name, strlen(log_file_name), need_lock_index)) + { + DBUG_EXECUTE_IF("simulate_disk_full_on_open_binlog", + { + DBUG_SET("-d,simulate_file_write_error"); + DBUG_SET("-d,simulate_no_free_space_error"); + DBUG_SET("-d,simulate_disk_full_on_open_binlog"); + }); goto err; + } #ifdef HAVE_REPLICATION DBUG_EXECUTE_IF("crash_create_after_update_index", DBUG_SUICIDE();); @@ -3218,10 +3353,6 @@ err: purge_index_entry(NULL, NULL, need_lock_index); close_purge_index_file(); #endif - sql_print_error("Could not use %s for logging (error %d). \ -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.", name, errno); if (file >= 0) mysql_file_close(file, MYF(0)); end_io_cache(&log_file); @@ -3229,6 +3360,26 @@ shutdown the MySQL server and restart it.", name, errno); my_free(name); name= NULL; 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); + } + else + sql_print_error("Could not use %s for logging (error %d). " + "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.", name, errno); DBUG_RETURN(1); } @@ -3625,6 +3776,13 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd) ha_reset_logs(thd); + /* + We need to get both locks to be sure that no one is trying to + write to the index log file. + */ + mysql_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_index); + /* The following mutex is needed to ensure that no threads call 'delete thd' as we would then risk missing a 'rollback' from this @@ -3633,13 +3791,6 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd) */ mysql_mutex_lock(&LOCK_thread_count); - /* - We need to get both locks to be sure that no one is trying to - write to the index log file. - */ - mysql_mutex_lock(&LOCK_log); - mysql_mutex_lock(&LOCK_index); - global_sid_lock->wrlock(); /* Save variables so that we can reopen the log */ @@ -4816,7 +4967,7 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock_log, Format_description_log_even /* reopen the binary log file. */ file_to_open= new_name_ptr; error= open_binlog(old_name, new_name_ptr, io_cache_type, - max_size, true, + max_size, true/*null_created_arg=true*/, false/*need_lock_index=false*/, true/*need_sid_lock=true*/, extra_description_event); @@ -4850,12 +5001,28 @@ end: - ... */ close(LOG_CLOSE_INDEX); - sql_print_error("Could not open %s for logging (error %d). " - "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.", - new_name_ptr, errno); + 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); + } + else + sql_print_error("Could not open %s for logging (error %d). " + "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.", + new_name_ptr, errno); } mysql_mutex_unlock(&LOCK_index); @@ -5319,12 +5486,19 @@ void MYSQL_BIN_LOG::purge() @retval nonzero - error in rotating routine. */ -int MYSQL_BIN_LOG::rotate_and_purge(bool force_rotate) +int MYSQL_BIN_LOG::rotate_and_purge(THD* thd, bool force_rotate) { int error= 0; DBUG_ENTER("MYSQL_BIN_LOG::rotate_and_purge"); bool check_purge= false; + /* + Wait for handlerton to insert any pending information into the binlog. + For e.g. ha_ndbcluster which updates the binlog asynchronously this is + needed so that the user see its own commands in the binlog. + */ + ha_binlog_wait(thd); + DBUG_ASSERT(!is_relay_log); mysql_mutex_lock(&LOCK_log); error= rotate(force_rotate, &check_purge); @@ -6848,7 +7022,14 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit) /* Stage #2: Syncing binary log file to disk */ - if (change_stage(thd, Stage_manager::SYNC_STAGE, wait_queue, &LOCK_log, &LOCK_sync)) + bool need_LOCK_log= (get_sync_period() == 1); + + /* + LOCK_log is not released when sync_binlog is 1. It guarantees that the + events are not be replicated by dump threads before they are synced to disk. + */ + if (change_stage(thd, Stage_manager::SYNC_STAGE, wait_queue, + need_LOCK_log ? NULL : &LOCK_log, &LOCK_sync)) { DBUG_PRINT("return", ("Thread ID: %lu, commit_error: %d", thd->thread_id, thd->commit_error)); @@ -6857,10 +7038,14 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit) THD *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; } + if (need_LOCK_log) + mysql_mutex_unlock(&LOCK_log); + /* Stage #3: Commit all transactions in order. @@ -6918,7 +7103,6 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit) need the mutex. Otherwise causes various deadlocks. */ - DBUG_EXECUTE_IF("crash_commit_before_unlog", DBUG_SUICIDE();); DEBUG_SYNC(thd, "ready_to_do_rotation"); bool check_purge= false; mysql_mutex_lock(&LOCK_log); diff --git a/mysql-wsrep-5.6/sql/binlog.h b/mysql-wsrep-5.6/sql/binlog.h index 4fec6c05..38efe642 100644 --- a/mysql-wsrep-5.6/sql/binlog.h +++ b/mysql-wsrep-5.6/sql/binlog.h @@ -1,5 +1,5 @@ #ifndef BINLOG_H_INCLUDED -/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -465,12 +465,15 @@ public: @param[out] binlog_file_name, the file name of oldest binary log found @param[in] gtid_set, the given gtid set + @param[out] first_gtid, the first GTID information from the binary log + file returned at binlog_file_name @param[out] errmsg, the error message outputted, which is left untouched if the function returns false @return false on success, true on error. */ bool find_first_log_not_in_gtid_set(char *binlog_file_name, const Gtid_set *gtid_set, + Gtid *first_gtid, const char **errmsg); /** @@ -488,11 +491,12 @@ public: @param need_lock If true, LOCK_log, LOCK_index, and global_sid_lock->wrlock are acquired; otherwise they are asserted to be taken already. + @param is_server_starting True if the server is starting. @return false on success, true on error. */ bool init_gtid_sets(Gtid_set *gtid_set, Gtid_set *lost_groups, Gtid *last_gtid, bool verify_checksum, - bool need_lock); + bool need_lock, bool is_server_starting= false); void set_previous_gtid_set(Gtid_set *previous_gtid_set_param) { @@ -615,7 +619,7 @@ public: int remove_logs_from_index(LOG_INFO* linfo, bool need_update_threads); int rotate(bool force_rotate, bool* check_purge); void purge(); - int rotate_and_purge(bool force_rotate); + int rotate_and_purge(THD* thd, bool force_rotate); /** Flush binlog cache and synchronize to disk. diff --git a/mysql-wsrep-5.6/sql/debug_sync.cc b/mysql-wsrep-5.6/sql/debug_sync.cc index 1ddf806c..1c977f38 100644 --- a/mysql-wsrep-5.6/sql/debug_sync.cc +++ b/mysql-wsrep-5.6/sql/debug_sync.cc @@ -32,19 +32,22 @@ Nomenclature: - - signal: A value of a global variable that persists - until overwritten by a new signal. The global - variable can also be seen as a "signal post" - or "flag mast". Then the signal is what is - attached to the "signal post" or "flag mast". - - - emit a signal: Assign the value (the signal) to the global - variable ("set a flag") and broadcast a - global condition to wake those waiting for - a signal. - - - wait for a signal: Loop over waiting for the global condition until - the global value matches the wait-for signal. + - signal: An event identified by a name that a signal + thread uses to notify the wait thread that + waits on this event. When the signal thread + notifies the wait thread, the signal name + is copied into global list and the wait thread + is signalled to wake up and proceed with further + processing. + + - emit a signal: Signal thread wakes up wait thread or multiple + wait threads that shall wait for the signal identified + by a signal name. This signal thread copies the signal + name into a global list and broadcasts the event which + wakes the threads that wait for this event. + + - wait for a signal: Wait on a event indentified by the signal name until + the signal thread signals the event. By default, all sync points are inactive. They do nothing (except to burn a couple of CPU cycles for checking if they are active). @@ -80,12 +83,19 @@ conn2 waits immediately at the special sync point 'now' for another thread to emit the 'opened' signal. - A signal remains in effect until it is overwritten. If conn1 signals - 'opened' before conn2 reaches 'now', conn2 will still find the 'opened' - signal. It does not wait in this case. + If conn1 signals 'opened' before conn2 reaches 'now', conn2 will find + the 'opened' signal. The wait thread shall not wait in this case. When conn2 reaches 'after_abort_locks', it signals 'flushed', which lets - conn1 awake. + conn1 awake and clears the 'flushed' signal from the global list. In case + the 'flushed' signal is to be notified to multiple wait threads, an attribute + NO_CLEAR_EVENT need to be specified with the WAIT_FOR in addition to signal + the name as: + SET DEBUG_SYNC= 'WAIT_FOR flushed NO_CLEAR_EVENT'; + It is up to the user to ensure once when all the wait threads have processed + the 'flushed' signal to clear/deactivate the signal using the RESET action + of DEBUG_SYNC accordingly. + Normally the activation of a sync point is cleared when it has been executed. Sometimes it is necessary to keep the sync point active for @@ -149,7 +159,8 @@ <sync point name> TEST | <sync point name> CLEAR | <sync point name> {{SIGNAL <signal name> | - WAIT_FOR <signal name> [TIMEOUT <seconds>]} + WAIT_FOR <signal name> [TIMEOUT <seconds>] + [NO_CLEAR_EVENT]} [EXECUTE <count>] &| HIT_LIMIT <count>} Here '&|' means 'and/or'. This means that one of the sections @@ -161,8 +172,6 @@ The facility is an optional part of the MySQL server. It is enabled in a debug server by default. - ./configure --enable-debug-sync - The Debug Sync Facility, when compiled in, is disabled by default. It can be enabled by a mysqld command line option: @@ -329,6 +338,9 @@ #include "sql_priv.h" #include "sql_parse.h" +#include <set> +#include <string> + using std::max; using std::min; @@ -349,6 +361,7 @@ struct st_debug_sync_action String wait_for; /* signal to wait for */ String sync_point; /* sync point name */ bool need_sort; /* if new action, array needs sort */ + bool clear_event; /* do not clear signal if false */ }; /* Debug sync control. Referenced by THD. */ @@ -367,21 +380,28 @@ struct st_debug_sync_control char ds_proc_info[80]; /* proc_info string */ }; +typedef std::set<std::string> signal_event_set; /** Definitions for the debug sync facility. - 1. Global string variable to hold a "signal" ("signal post", "flag mast"). + 1. Global set of signal names which are signalled. 2. Global condition variable for signaling and waiting. 3. Global mutex to synchronize access to the above. */ struct st_debug_sync_globals { - String ds_signal; /* signal variable */ + signal_event_set ds_signal_set; /* list of signals signalled */ mysql_cond_t ds_cond; /* condition variable */ mysql_mutex_t ds_mutex; /* mutex variable */ ulonglong dsp_hits; /* statistics */ ulonglong dsp_executed; /* statistics */ ulonglong dsp_max_active; /* statistics */ + + st_debug_sync_globals() : dsp_hits(0), dsp_executed(0), dsp_max_active(0) {} +private: + // Not implemented: + st_debug_sync_globals(const st_debug_sync_globals&); + st_debug_sync_globals &operator=(const st_debug_sync_globals&); }; static st_debug_sync_globals debug_sync_global; /* All globals in one object */ @@ -486,7 +506,6 @@ int debug_sync_init(void) int rc; /* Initialize the global variables. */ - debug_sync_global.ds_signal.length(0); if ((rc= mysql_cond_init(key_debug_sync_globals_ds_cond, &debug_sync_global.ds_cond, NULL)) || (rc= mysql_mutex_init(key_debug_sync_globals_ds_mutex, @@ -520,7 +539,7 @@ void debug_sync_end(void) debug_sync_C_callback_ptr= NULL; /* Destroy the global variables. */ - debug_sync_global.ds_signal.free(); + debug_sync_global.ds_signal_set.clear(); mysql_cond_destroy(&debug_sync_global.ds_cond); mysql_mutex_destroy(&debug_sync_global.ds_mutex); @@ -868,9 +887,9 @@ static void debug_sync_reset(THD *thd) /* Remove all actions of this thread. */ ds_control->ds_active= 0; - /* Clear the global signal. */ + /* Clear the signals. */ mysql_mutex_lock(&debug_sync_global.ds_mutex); - debug_sync_global.ds_signal.length(0); + debug_sync_global.ds_signal_set.clear(); mysql_mutex_unlock(&debug_sync_global.ds_mutex); DBUG_VOID_RETURN; @@ -1478,6 +1497,7 @@ static bool debug_sync_eval_action(THD *thd, char *action_str) /* Set default for EXECUTE and TIMEOUT options. */ action->execute= 1; action->timeout= opt_debug_sync_timeout; + action->clear_event= true; /* Get next token. If none follows, set action. */ if (!(ptr= debug_sync_token(&token, &token_length, ptr))) @@ -1528,6 +1548,17 @@ static bool debug_sync_eval_action(THD *thd, char *action_str) goto set_action; } + /* + Try NO_CLEAR_EVENT. + */ + if (!my_strcasecmp(system_charset_info, token, "NO_CLEAR_EVENT")) + { + action->clear_event= false; + /* Get next token. If none follows, set action. */ + if (!(ptr= debug_sync_token(&token, &token_length, ptr))) + goto set_action; + } + /* Try HIT_LIMIT. */ @@ -1617,7 +1648,7 @@ bool debug_sync_update(THD *thd, char *val_str) The value of the system variable 'debug_sync' reflects if the facility is enabled ("ON") or disabled (default, "OFF"). - When "ON", the current signal is added. + When "ON", the list of signals signalled are added separated by comma. */ uchar *debug_sync_value_ptr(THD *thd) @@ -1627,26 +1658,28 @@ uchar *debug_sync_value_ptr(THD *thd) if (opt_debug_sync_timeout) { - static char on[]= "ON - current signal: '"; + std::string signals_on("ON - signals: '"); + static char sep[]= ","; - // Ensure exclusive access to debug_sync_global.ds_signal + // Ensure exclusive access to debug_sync_global.ds_signal_set mysql_mutex_lock(&debug_sync_global.ds_mutex); - size_t lgt= (sizeof(on) /* includes '\0' */ + - debug_sync_global.ds_signal.length() + 1 /* for '\'' */); - char *vend; - char *vptr; - - if ((value= (char*) alloc_root(thd->mem_root, lgt))) + signal_event_set::const_iterator iter; + for (iter= debug_sync_global.ds_signal_set.begin(); + iter != debug_sync_global.ds_signal_set.end(); ) { - vend= value + lgt - 1; /* reserve space for '\0'. */ - vptr= debug_sync_bmove_len(value, vend, STRING_WITH_LEN(on)); - vptr= debug_sync_bmove_len(vptr, vend, debug_sync_global.ds_signal.ptr(), - debug_sync_global.ds_signal.length()); - if (vptr < vend) - *(vptr++)= '\''; - *vptr= '\0'; /* We have one byte reserved for the worst case. */ + signals_on.append(*iter); + if ((++iter) != debug_sync_global.ds_signal_set.end()) + signals_on.append(sep); } + signals_on.append("'"); + + const char *c_str= signals_on.c_str(); + const size_t lgt= strlen(c_str) + 1; + + if ((value= (char*) alloc_root(thd->mem_root, lgt))) + memcpy(value, c_str, lgt); + mysql_mutex_unlock(&debug_sync_global.ds_mutex); } else @@ -1660,6 +1693,62 @@ uchar *debug_sync_value_ptr(THD *thd) } +/** + Return true if the signal is found in global signal list. + + @param signal Signal name identifying the signal. + + @note + If signal is found in the global signal set, it means that the + signal thread has signalled to the waiting thread. This method + must be called with the debug_sync_global.ds_mutex held. + + @eretval true if signal is found in the global signal list. + @retval false otherwise. +*/ + +static inline bool is_signalled(const std::string *signal_name) +{ + return (debug_sync_global.ds_signal_set.find(*signal_name) != + debug_sync_global.ds_signal_set.end()); +} + + +/** + Return false if signal has been added to global signal list. + + @param signal signal name that is to be added to the global signal + list. + + @note + This method add signal name to the global signal list and signals + the waiting thread that this signal has been emitted. This method + must be called with the debug_sync_global.ds_mutex held. +*/ + +static inline void add_signal_event(const std::string *signal_name) +{ + debug_sync_global.ds_signal_set.insert(*signal_name); +} + + +/** + Remove the signal from the global signal list. + + @param signal signal name to be removed from the global signal list. + + @note + This method erases the signal from the signal list. This happens + when the wait thread has processed the signal event from the + signalling thread. This method should be called with the + debug_sync_global.ds_mutex held. +*/ +static inline void clear_signal_event(const std::string *signal_name) +{ + debug_sync_global.ds_signal_set.erase(*signal_name); +} + + /** Execute requested action at a synchronization point. @@ -1711,7 +1800,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) /* Take mutex to ensure that only one thread access - debug_sync_global.ds_signal at a time. Need to take mutex for + debug_sync_global.ds_signal_set at a time. Need to take mutex for read access too, to create a memory barrier in order to avoid that threads just reads an old cached version of the signal. */ @@ -1719,15 +1808,9 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) if (action->signal.length()) { - /* Copy the signal to the global variable. */ - if (debug_sync_global.ds_signal.copy(action->signal)) - { - /* - Error is reported by my_malloc(). - We must disable the facility. We have no way to return an error. - */ - debug_sync_emergency_disable(); /* purecov: tested */ - } + std::string signal= action->signal.ptr(); + /* Copy the signal to the global set. */ + add_signal_event(&signal); /* Wake threads waiting in a sync point. */ mysql_cond_broadcast(&debug_sync_global.ds_cond); DBUG_PRINT("debug_sync_exec", ("signal '%s' at: '%s'", @@ -1740,6 +1823,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) mysql_cond_t *old_cond= 0; int error= 0; struct timespec abstime; + std::string wait_for= action->wait_for.ptr(); /* We don't use enter_cond()/exit_cond(). They do not save old @@ -1762,30 +1846,27 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) set_timespec(abstime, action->timeout); DBUG_EXECUTE("debug_sync_exec", { - /* Functions as DBUG_PRINT args can change keyword and line nr. */ - const char *sig_glob= debug_sync_global.ds_signal.c_ptr(); DBUG_PRINT("debug_sync_exec", - ("wait for '%s' at: '%s' curr: '%s'", - sig_wait, dsp_name, sig_glob));}); - + ("wait for '%s' at: '%s'", + sig_wait, dsp_name));}); /* Wait until global signal string matches the wait_for string. Interrupt when thread or query is killed or facility disabled. The facility can become disabled when some thread cannot get the required dynamic memory allocated. */ - while (stringcmp(&debug_sync_global.ds_signal, &action->wait_for) && + while (!is_signalled(&wait_for) && !thd->killed && opt_debug_sync_timeout) { error= mysql_cond_timedwait(&debug_sync_global.ds_cond, &debug_sync_global.ds_mutex, &abstime); + DBUG_EXECUTE("debug_sync", { /* Functions as DBUG_PRINT args can change keyword and line nr. */ - const char *sig_glob= debug_sync_global.ds_signal.c_ptr(); DBUG_PRINT("debug_sync", - ("awoke from %s global: %s error: %d", - sig_wait, sig_glob, error));}); + ("awoke from %s error: %d", sig_wait, error)); }); + if (error == ETIMEDOUT || error == ETIME) { // We should not make the statement fail, even if in strict mode. @@ -1799,6 +1880,9 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) } error= 0; } + if (action->clear_event) + clear_signal_event(&wait_for); + DBUG_EXECUTE("debug_sync_exec", if (thd->killed) DBUG_PRINT("debug_sync_exec", @@ -1911,7 +1995,7 @@ void debug_sync(THD *thd, const char *sync_point_name, size_t name_len) @description The function is similar to @c debug_sync_eval_action but is - to be called immediately from the server code rather than + to be called immediately from the server code rather than to be triggered by setting a value to DEBUG_SYNC system variable. @note @@ -1920,7 +2004,7 @@ void debug_sync(THD *thd, const char *sync_point_name, size_t name_len) Caution. The function allocates in THD::mem_root and therefore - is not recommended to be deployed inside big loops. + is not recommended to be deployed inside big loops. */ bool debug_sync_set_action(THD *thd, const char *action_str, size_t len) @@ -1930,7 +2014,7 @@ bool debug_sync_set_action(THD *thd, const char *action_str, size_t len) DBUG_ENTER("debug_sync_set_action"); DBUG_ASSERT(thd); DBUG_ASSERT(action_str); - + value= strmake_root(thd->mem_root, action_str, len); rc= debug_sync_eval_action(thd, value); DBUG_RETURN(rc); diff --git a/mysql-wsrep-5.6/sql/event_scheduler.cc b/mysql-wsrep-5.6/sql/event_scheduler.cc index 52632939..e16a2937 100644 --- a/mysql-wsrep-5.6/sql/event_scheduler.cc +++ b/mysql-wsrep-5.6/sql/event_scheduler.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -159,9 +159,7 @@ deinit_event_thread(THD *thd) dec_thread_running(); thd->release_resources(); - mysql_mutex_lock(&LOCK_thread_count); remove_global_thread(thd); - mysql_mutex_unlock(&LOCK_thread_count); delete thd; } diff --git a/mysql-wsrep-5.6/sql/field.cc b/mysql-wsrep-5.6/sql/field.cc index 4231636f..301beb51 100644 --- a/mysql-wsrep-5.6/sql/field.cc +++ b/mysql-wsrep-5.6/sql/field.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2348,7 +2348,7 @@ type_conversion_status Field_decimal::store(double nr) return TYPE_WARN_OUT_OF_RANGE; } - if (!isfinite(nr)) // Handle infinity as special case + if (!my_isfinite(nr)) // Handle infinity as special case { overflow(nr < 0.0); return TYPE_WARN_OUT_OF_RANGE; @@ -4492,7 +4492,7 @@ type_conversion_status Field_double::store(longlong nr, bool unsigned_val) bool Field_real::truncate(double *nr, double max_value) { - if (isnan(*nr)) + if (my_isnan(*nr)) { *nr= 0; set_null(); @@ -7767,8 +7767,7 @@ Field_blob::store_internal(const char *from, uint length, If content of the 'from'-address is cached in the 'value'-object it is possible that the content needs a character conversion. */ - uint32 dummy_offset; - if (!String::needs_conversion(length, cs, field_charset, &dummy_offset)) + if (!String::needs_conversion_on_storage(length, cs, field_charset)) { store_ptr_and_length(from, length); return TYPE_OK; @@ -8398,12 +8397,11 @@ Field_enum::store(const char *from,uint length,const CHARSET_INFO *cs) ASSERT_COLUMN_MARKED_FOR_WRITE; int err= 0; type_conversion_status ret= TYPE_OK; - uint32 not_used; char buff[STRING_BUFFER_USUAL_SIZE]; String tmpstr(buff,sizeof(buff), &my_charset_bin); /* Convert character set if necessary */ - if (String::needs_conversion(length, cs, field_charset, ¬_used)) + if (String::needs_conversion_on_storage(length, cs, field_charset)) { uint dummy_errors; tmpstr.copy(from, length, cs, field_charset, &dummy_errors); @@ -8629,12 +8627,11 @@ Field_set::store(const char *from,uint length,const CHARSET_INFO *cs) type_conversion_status ret= TYPE_OK; char *not_used; uint not_used2; - uint32 not_used_offset; char buff[STRING_BUFFER_USUAL_SIZE]; String tmpstr(buff,sizeof(buff), &my_charset_bin); /* Convert character set if necessary */ - if (String::needs_conversion(length, cs, field_charset, ¬_used_offset)) + if (String::needs_conversion_on_storage(length, cs, field_charset)) { uint dummy_errors; tmpstr.copy(from, length, cs, field_charset, &dummy_errors); diff --git a/mysql-wsrep-5.6/sql/field.h b/mysql-wsrep-5.6/sql/field.h index e1573e3a..e0e6bb53 100644 --- a/mysql-wsrep-5.6/sql/field.h +++ b/mysql-wsrep-5.6/sql/field.h @@ -1,7 +1,7 @@ #ifndef FIELD_INCLUDED #define FIELD_INCLUDED -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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/mysql-wsrep-5.6/sql/global_threads.h b/mysql-wsrep-5.6/sql/global_threads.h index 89f6ef18..50ebf59a 100644 --- a/mysql-wsrep-5.6/sql/global_threads.h +++ b/mysql-wsrep-5.6/sql/global_threads.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved. This 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,23 +23,39 @@ class THD; extern mysql_mutex_t LOCK_thread_count; +extern mysql_mutex_t LOCK_thd_remove; extern mysql_cond_t COND_thread_count; /** - We maintail a set of all registered threads. - We provide acccessors to iterate over all threads. - There is no guarantee on the order of THDs when iterating. + We maintain a set of all registered threads. + We provide accessors (global_thread_list_begin, global_thread_list_end) + to iterate over all threads. There is no guarantee on the order of THDs + when iterating. The caller of these two accessors is expected to + hold lock on LOCK_thread_count mutex before calling these accessors inorder + to make sure that there are no new threads are added to the system while + processing this thread list. We also provide mutators for inserting, and removing an element: - add_global_thread() inserts a THD into the set, and increments the counter. - remove_global_thread() removes a THD from the set, and decrements the counter. - remove_global_thread() also broadcasts COND_thread_count. + > add_global_thread() inserts a THD into the set, and increments the counter. + The caller of this function is expected to hold lock on LOCK_thread_count + mutex before calling this function to avoid any parallel operations + happening on the set. + > remove_global_thread() removes a THD from the set, and decrements the counter. + This function acquires lock on LOCK_thd_remove followed by lock on + LOCK_thread_count. At the end of the function, it releases both the + locks. remove_global_thread() also broadcasts COND_thread_count. - All functions must be called with LOCK_thread_count. + We also provide a function (copy_global_thread_list) to copy global thread list + into a new set. The caller of this function is expected to hold lock on + LOCK_thd_remove to avoid any removal from the copied set. This function also + acquires lock on LOCK_thread_count before the copy operation to + avoid any parallel modification to the set and will release the lock at the + end of the function. */ typedef std::set<THD*>::iterator Thread_iterator; Thread_iterator global_thread_list_begin(); Thread_iterator global_thread_list_end(); +void copy_global_thread_list(std::set<THD*> *new_copy); void add_global_thread(THD *); void remove_global_thread(THD *); diff --git a/mysql-wsrep-5.6/sql/ha_partition.cc b/mysql-wsrep-5.6/sql/ha_partition.cc index 115101a5..26172ca0 100644 --- a/mysql-wsrep-5.6/sql/ha_partition.cc +++ b/mysql-wsrep-5.6/sql/ha_partition.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -97,6 +97,13 @@ static handler *partition_create_handler(handlerton *hton, static uint partition_flags(); static uint alter_table_flags(uint flags); + +/**************************************************************************** + Check whether the partition column order changes after alter +****************************************************************************/ +static bool check_partition_column_order(List<Create_field> *create_list, + Field** field_arary); + #ifdef HAVE_PSI_INTERFACE PSI_mutex_key key_partition_auto_inc_mutex; @@ -221,6 +228,34 @@ static uint alter_table_flags(uint flags __attribute__((unused))) HA_FAST_CHANGE_PARTITION); } +static bool check_partition_column_order(List<Create_field> *create_list, + Field** field_arary) +{ + + Field **f_ptr; + List_iterator_fast<Create_field> new_field_it; + Create_field *new_field; + new_field_it.init(*create_list); + + for (f_ptr= field_arary ; *f_ptr; f_ptr++) + { + while ((new_field= new_field_it++)) + { + if (new_field->field == *f_ptr) + break; + } + if (!new_field) + break; + } + + if (!new_field) + { + /* Not same order, INPLACE cannot be allowed!*/ + return false; + } + return true; +} + const uint32 ha_partition::NO_CURRENT_PART_ID= NOT_A_PARTITION_ID; /* @@ -362,6 +397,7 @@ void ha_partition::init_handler_variables() part_share= NULL; m_new_partitions_share_refs.empty(); m_part_ids_sorted_by_num_of_records= NULL; + m_sec_sort_by_rowid= false; #ifdef DONT_HAVE_TO_BE_INITALIZED m_start_key.flag= 0; @@ -4343,6 +4379,11 @@ int ha_partition::truncate_partition(Alter_info *alter_info, bool *binlog_stmt) part_elem->part_state= PART_NORMAL; } } while (!error && (++i < num_parts)); + if (error) + { + /* Reset to PART_NORMAL. */ + set_all_part_state(m_part_info, PART_NORMAL); + } DBUG_RETURN(error); } @@ -4783,9 +4824,32 @@ void ha_partition::position(const uchar *record) DBUG_ASSERT(bitmap_is_set(&(m_part_info->read_partitions), m_last_part)); DBUG_ENTER("ha_partition::position"); - file->position(record); int2store(ref, m_last_part); - memcpy((ref + PARTITION_BYTES_IN_POS), file->ref, file->ref_length); + /* + If m_sec_sort_by_rowid is set, then the ref is already stored in the + priority queue (m_queue) when doing ordered scans. + */ + if (m_sec_sort_by_rowid && m_ordered_scan_ongoing) + { + DBUG_ASSERT(m_queue.elements); + DBUG_ASSERT(m_ordered_rec_buffer); + DBUG_ASSERT(!m_curr_key_info[1]); + /* We already have the ref. */ + memcpy(ref + PARTITION_BYTES_IN_POS, + queue_top(&m_queue) + PARTITION_BYTES_IN_POS, + file->ref_length); +#ifndef DBUG_OFF + /* Verify that the position is correct! */ + file->position(record); + DBUG_ASSERT(!memcmp(ref + PARTITION_BYTES_IN_POS, file->ref, + file->ref_length)); +#endif + } + else + { + file->position(record); + memcpy((ref + PARTITION_BYTES_IN_POS), file->ref, file->ref_length); + } pad_length= m_ref_length - PARTITION_BYTES_IN_POS - file->ref_length; if (pad_length) memset((ref + PARTITION_BYTES_IN_POS + file->ref_length), 0, pad_length); @@ -4879,6 +4943,37 @@ int ha_partition::rnd_pos_by_record(uchar *record) subset of the partitions are used, then only use those partitions. */ +/** Compare key and rowid. + Helper function for sorting records in the priority queue. + a/b points to table->record[0] rows which must have the + key fields set. The bytes before a and b store the handler::ref. + This is used for comparing/sorting rows first according to + KEY and if same KEY, by handler::ref (rowid). + + @param key_info Null terminated array of index information + @param a Pointer to record+ref in first record + @param b Pointer to record+ref in second record + + @return Return value is SIGN(first_rec - second_rec) + @retval 0 Keys are equal + @retval -1 second_rec is greater than first_rec + @retval +1 first_rec is greater than second_rec +*/ + +static int key_and_ref_cmp(void* key_info, uchar *a, uchar *b) +{ + int cmp= key_rec_cmp(key_info, a, b); + if (cmp) + return cmp; + /* + We must compare by handler::ref, which is added before the record, + in the priority queue. + */ + KEY **key = (KEY**)key_info; + uint ref_length= (*key)->table->file->ref_length; + return (*key)->table->file->cmp_ref(a - ref_length, b - ref_length); +} + /** Setup the ordered record buffer and the priority queue. @@ -4895,8 +4990,21 @@ bool ha_partition::init_record_priority_queue() { uint alloc_len; uint used_parts= bitmap_bits_set(&m_part_info->read_partitions); - /* Allocate record buffer for each used partition. */ - alloc_len= used_parts * (m_rec_length + PARTITION_BYTES_IN_POS); + /* + Allocate record buffer for each used partition. + If we need to do a secondary sort by PK, then it is already in the + record, so we only need to allocate for part id and a full record per + partition. + Otherwise we do a secondary sort by rowid (handler::ref) and must + allocate for ref (includes part id) and full record per partition. + We don't know yet if we need to do secondary sort by rowid, so we must + allocate space for it. + */ + if (m_curr_key_info[1]) + m_rec_offset= PARTITION_BYTES_IN_POS; + else + m_rec_offset= m_ref_length; + alloc_len= used_parts * (m_rec_offset + m_rec_length); /* Allocate a key for temporary use when setting up the scan. */ alloc_len+= table_share->max_key_length; @@ -4907,6 +5015,8 @@ bool ha_partition::init_record_priority_queue() We set-up one record per partition and each record has 2 bytes in front where the partition id is written. This is used by ordered index_read. + If we need to also sort by rowid (handler::ref), then m_curr_key_info[1] + is NULL and we add the rowid before the record. We also set-up a reference to the first record for temporary use in setting up the scan. */ @@ -4918,12 +5028,18 @@ bool ha_partition::init_record_priority_queue() { DBUG_PRINT("info", ("init rec-buf for part %u", i)); int2store(ptr, i); - ptr+= m_rec_length + PARTITION_BYTES_IN_POS; + ptr+= m_rec_offset + m_rec_length; } m_start_key.key= (const uchar*)ptr; - /* Initialize priority queue, initialized to reading forward. */ - if (init_queue(&m_queue, used_parts, (uint) PARTITION_BYTES_IN_POS, - 0, key_rec_cmp, (void*)m_curr_key_info)) + /* + Initialize priority queue, initialized to reading forward. + Start by only sort by KEY, HA_EXTRA_SECONDARY_SORT_ROWID + will be given if we should sort by handler::ref too. + */ + if (init_queue(&m_queue, used_parts, m_rec_offset, + 0, + key_rec_cmp, + (void*)m_curr_key_info)) { my_free(m_ordered_rec_buffer); m_ordered_rec_buffer= NULL; @@ -4979,7 +5095,18 @@ int ha_partition::index_init(uint inx, bool sorted) m_part_spec.start_part= NO_CURRENT_PART_ID; m_start_key.length= 0; m_ordered= sorted; + m_sec_sort_by_rowid= false; m_curr_key_info[0]= table->key_info+inx; + m_curr_key_info[1]= NULL; + /* + There are two cases where it is not enough to only sort on the key: + 1) For clustered indexes, the optimizer assumes that all keys + have the rest of the PK columns appended to the KEY, so it will + sort by PK as secondary sort key. + 2) Rowid-Order-Retrieval access methods, like index_merge_intersect + and index_merge_union. These methods requires the index to be sorted + on rowid (handler::ref) as secondary sort key. + */ if (m_pkey_is_clustered && table->s->primary_key != MAX_KEY) { /* @@ -4990,8 +5117,6 @@ int ha_partition::index_init(uint inx, bool sorted) m_curr_key_info[1]= table->key_info+table->s->primary_key; m_curr_key_info[2]= NULL; } - else - m_curr_key_info[1]= NULL; if (init_record_priority_queue()) DBUG_RETURN(HA_ERR_OUT_OF_MEM); @@ -5029,6 +5154,7 @@ err: { (void) m_file[j]->ha_index_end(); } + destroy_record_priority_queue(); } DBUG_RETURN(error); } @@ -5057,6 +5183,7 @@ int ha_partition::index_end() active_index= MAX_KEY; m_part_spec.start_part= NO_CURRENT_PART_ID; + m_sec_sort_by_rowid= false; for (i= bitmap_get_first_set(&m_part_info->read_partitions); i < m_tot_parts; i= bitmap_get_next_set(&m_part_info->read_partitions, i)) @@ -5837,7 +5964,7 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order) i < m_part_spec.start_part; i= bitmap_get_next_set(&m_part_info->read_partitions, i)) { - part_rec_buf_ptr+= m_rec_length + PARTITION_BYTES_IN_POS; + part_rec_buf_ptr+= m_rec_offset + m_rec_length; } DBUG_PRINT("info", ("m_part_spec.start_part %u first_used_part %u", m_part_spec.start_part, i)); @@ -5848,7 +5975,7 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order) DBUG_PRINT("info", ("reading from part %u (scan_type: %u)", i, m_index_scan_type)); DBUG_ASSERT(i == uint2korr(part_rec_buf_ptr)); - uchar *rec_buf_ptr= part_rec_buf_ptr + PARTITION_BYTES_IN_POS; + uchar *rec_buf_ptr= part_rec_buf_ptr + m_rec_offset; int error; handler *file= m_file[i]; @@ -5892,6 +6019,12 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order) if (!error) { found= TRUE; + if (m_sec_sort_by_rowid) + { + file->position(rec_buf_ptr); + memcpy(part_rec_buf_ptr + PARTITION_BYTES_IN_POS, + file->ref, file->ref_length); + } /* Initialize queue without order first, simply insert */ @@ -5908,7 +6041,7 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order) m_key_not_found= true; saved_error= error; } - part_rec_buf_ptr+= m_rec_length + PARTITION_BYTES_IN_POS; + part_rec_buf_ptr+= m_rec_offset + m_rec_length; } if (found) { @@ -5918,6 +6051,12 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order) */ queue_set_max_at_top(&m_queue, reverse_order); queue_set_cmp_arg(&m_queue, (void*)m_curr_key_info); + DBUG_ASSERT(m_queue.elements == 0); + /* + If PK, we should not sort by rowid, since that is already done + through the KEY setup. + */ + DBUG_ASSERT(!m_curr_key_info[1] || !m_sec_sort_by_rowid); m_queue.elements= j; queue_fix(&m_queue); return_top_record(buf); @@ -5944,7 +6083,7 @@ void ha_partition::return_top_record(uchar *buf) { uint part_id; uchar *key_buffer= queue_top(&m_queue); - uchar *rec_buffer= key_buffer + PARTITION_BYTES_IN_POS; + uchar *rec_buffer= key_buffer + m_rec_offset; part_id= uint2korr(key_buffer); memcpy(buf, rec_buffer, m_rec_length); @@ -5983,16 +6122,25 @@ int ha_partition::handle_ordered_index_scan_key_not_found() This partition is used and did return HA_ERR_KEY_NOT_FOUND in index_read_map. */ - curr_rec_buf= part_buf + PARTITION_BYTES_IN_POS; + curr_rec_buf= part_buf + m_rec_offset; error= m_file[i]->ha_index_next(curr_rec_buf); /* HA_ERR_KEY_NOT_FOUND is not allowed from index_next! */ DBUG_ASSERT(error != HA_ERR_KEY_NOT_FOUND); if (!error) + { + if (m_sec_sort_by_rowid) + { + m_file[i]->position(curr_rec_buf); + memcpy(part_buf + PARTITION_BYTES_IN_POS, + m_file[i]->ref, + m_file[i]->ref_length); + } queue_insert(&m_queue, part_buf); + } else if (error != HA_ERR_END_OF_FILE && error != HA_ERR_KEY_NOT_FOUND) DBUG_RETURN(error); } - part_buf+= m_rec_length + PARTITION_BYTES_IN_POS; + part_buf+= m_rec_offset + m_rec_length; } DBUG_ASSERT(curr_rec_buf); bitmap_clear_all(&m_key_not_found_partitions); @@ -6026,7 +6174,7 @@ int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same) { int error; uint part_id= m_top_entry; - uchar *rec_buf= queue_top(&m_queue) + PARTITION_BYTES_IN_POS; + uchar *rec_buf= queue_top(&m_queue) + m_rec_offset; handler *file; DBUG_ENTER("ha_partition::handle_ordered_next"); @@ -6089,6 +6237,12 @@ int ha_partition::handle_ordered_next(uchar *buf, bool is_next_same) } DBUG_RETURN(error); } + if (m_sec_sort_by_rowid) + { + file->position(rec_buf); + memcpy(rec_buf - m_rec_offset + PARTITION_BYTES_IN_POS, + file->ref, file->ref_length); + } queue_replaced(&m_queue); return_top_record(buf); DBUG_PRINT("info", ("Record returned from partition %u", m_top_entry)); @@ -6113,7 +6267,7 @@ int ha_partition::handle_ordered_prev(uchar *buf) { int error; uint part_id= m_top_entry; - uchar *rec_buf= queue_top(&m_queue) + PARTITION_BYTES_IN_POS; + uchar *rec_buf= queue_top(&m_queue) + m_rec_offset; handler *file= m_file[part_id]; DBUG_ENTER("ha_partition::handle_ordered_prev"); @@ -6133,6 +6287,12 @@ int ha_partition::handle_ordered_prev(uchar *buf) } DBUG_RETURN(error); } + if (m_sec_sort_by_rowid) + { + file->position(rec_buf); + memcpy(rec_buf - m_rec_offset + PARTITION_BYTES_IN_POS, + file->ref, file->ref_length); + } queue_replaced(&m_queue); return_top_record(buf); DBUG_PRINT("info", ("Record returned from partition %d", m_top_entry)); @@ -6520,8 +6680,10 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info, 7) Operations only used by federated tables for query processing 8) Operations only used by NDB 9) Operations only used by MERGE + 10) Operations only used by InnoDB + 11) Operations only used by partitioning - The partition handler need to handle category 1), 2) and 3). + The partition handler need to handle category 1), 2), 3), 10) and 11). 1) Operations used by most handlers ----------------------------------- @@ -6806,6 +6968,18 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info, HA_EXTRA_IS_ATTACHED_CHILDREN: HA_EXTRA_DETACH_CHILDREN: Special actions for MERGE tables. Ignore. + + 10) Operations only used by InnoDB + ---------------------------------- + HA_EXTRA_EXPORT: + Prepare table for export + (e.g. quiesce the table and write table metadata). + + 11) Operations only used by partitioning + ------------------------------ + HA_EXTRA_SECONDARY_SORT_ROWID: + INDEX_MERGE type of execution, needs to do secondary sort by + ROWID (handler::ref). */ int ha_partition::extra(enum ha_extra_function operation) @@ -6946,6 +7120,25 @@ int ha_partition::extra(enum ha_extra_function operation) */ case HA_EXTRA_MARK_AS_LOG_TABLE: DBUG_RETURN(ER_UNSUPORTED_LOG_ENGINE); + /* Category 10), used by InnoDB handlers */ + case HA_EXTRA_EXPORT: + DBUG_RETURN(loop_extra(operation)); + /* Category 11) Operations only used by partitioning. */ + case HA_EXTRA_SECONDARY_SORT_ROWID: + { + /* index_init(sorted=true) must have been called! */ + DBUG_ASSERT(m_ordered); + DBUG_ASSERT(m_ordered_rec_buffer); + /* No index_read call must have been done! */ + DBUG_ASSERT(m_queue.elements == 0); + /* If not PK is set as secondary sort, do secondary sort by rowid/ref. */ + if (!m_curr_key_info[1]) + { + m_sec_sort_by_rowid= true; + queue_set_compare(&m_queue, key_and_ref_cmp); + } + break; + } default: { /* Temporary crash to discover what is wrong */ @@ -7895,6 +8088,26 @@ ha_partition::check_if_supported_inplace_alter(TABLE *altered_table, if (ha_alter_info->alter_info->flags == Alter_info::ALTER_PARTITION) DBUG_RETURN(HA_ALTER_INPLACE_NO_LOCK); + /* We cannot allow INPLACE to change order of KEY partitioning fields! */ + if (ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_ORDER) + { + /* If column partitioning is used then no need to check partition order */ + if (m_part_info->list_of_part_fields && !m_part_info->column_list) + { + if(!check_partition_column_order(&ha_alter_info->alter_info->create_list, + table->part_info->part_field_array)) + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } + + /* Check subpartition ordering */ + if (m_part_info->list_of_subpart_fields) + { + if(!check_partition_column_order(&ha_alter_info->alter_info->create_list, + table->part_info->subpart_field_array)) + DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); + } + } + part_inplace_ctx= new (thd->mem_root) ha_partition_inplace_ctx(thd, m_tot_parts); if (!part_inplace_ctx) diff --git a/mysql-wsrep-5.6/sql/ha_partition.h b/mysql-wsrep-5.6/sql/ha_partition.h index c5b10ac0..6b20de0e 100644 --- a/mysql-wsrep-5.6/sql/ha_partition.h +++ b/mysql-wsrep-5.6/sql/ha_partition.h @@ -143,14 +143,18 @@ private: partition_info *m_part_info; // local reference to partition Field **m_part_field_array; // Part field array locally to save acc uchar *m_ordered_rec_buffer; // Row and key buffer for ord. idx scan - /* - Current index. - When used in key_rec_cmp: If clustered pk, index compare - must compare pk if given index is same for two rows. - So normally m_curr_key_info[0]= current index and m_curr_key[1]= NULL, - and if clustered pk, [0]= current index, [1]= pk, [2]= NULL - */ - KEY *m_curr_key_info[3]; // Current index + /** + Current index used for sorting. + If clustered PK exists, then it will be used as secondary index to + sort on if the first is equal in key_rec_cmp. + So if clustered pk: m_curr_key_info[0]= current index and + m_curr_key_info[1]= pk and [2]= NULL. + Otherwise [0]= current index, [1]= NULL, and we will + sort by rowid as secondary sort key if equal first key. + */ + KEY *m_curr_key_info[3]; + /** Offset in m_ordered_rec_buffer from part buffer to its record buffer. */ + uint m_rec_offset; uchar *m_rec0; // table->record[0] const uchar *m_err_rec; // record which gave error QUEUE m_queue; // Prio queue used by sorted read @@ -261,6 +265,8 @@ private: /** partitions that returned HA_ERR_KEY_NOT_FOUND. */ MY_BITMAP m_key_not_found_partitions; bool m_key_not_found; + /** Need to sort by ref (rowid) too. */ + bool m_sec_sort_by_rowid; public: Partition_share *get_part_share() { return part_share; } handler *clone(const char *name, MEM_ROOT *mem_root); diff --git a/mysql-wsrep-5.6/sql/handler.cc b/mysql-wsrep-5.6/sql/handler.cc index 157430f7..f91c04c0 100644 --- a/mysql-wsrep-5.6/sql/handler.cc +++ b/mysql-wsrep-5.6/sql/handler.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -557,6 +557,7 @@ int ha_init_errors(void) SETMSG(HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT, "FTS query exceeds result cache limit"); SETMSG(HA_ERR_TEMP_FILE_WRITE_FAILURE, ER_DEFAULT(ER_TEMP_FILE_WRITE_FAILURE)); SETMSG(HA_ERR_INNODB_FORCED_RECOVERY, ER_DEFAULT(ER_INNODB_FORCED_RECOVERY)); + SETMSG(HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE, "Too many words in a FTS phrase or proximity search"); /* Register the error messages for use with my_error(). */ return my_error_register(get_handler_errmsgs, HA_ERR_FIRST, HA_ERR_LAST); } @@ -3215,7 +3216,14 @@ int handler::update_auto_increment() if (forced != NULL) { nr= forced->minimum(); - nb_reserved_values= forced->values(); + /* + In a multi insert statement when the number of affected rows is known + then reserve those many number of auto increment values. So that + interval will be starting value to starting value + number of affected + rows * increment of auto increment. + */ + nb_reserved_values= (estimation_rows_to_insert > 0) ? + estimation_rows_to_insert : forced->values(); } else { diff --git a/mysql-wsrep-5.6/sql/handler.h b/mysql-wsrep-5.6/sql/handler.h index 7864e75f..3d7d4fa8 100644 --- a/mysql-wsrep-5.6/sql/handler.h +++ b/mysql-wsrep-5.6/sql/handler.h @@ -2,7 +2,7 @@ #define HANDLER_INCLUDED /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -999,6 +999,8 @@ struct handlerton */ #define HTON_SUPPORTS_EXTENDED_KEYS (1 << 10) +// Engine supports foreign key constraint. +#define HTON_SUPPORTS_FOREIGN_KEYS (1 << 11) enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED, @@ -1111,8 +1113,7 @@ public: All these operations are supported as in-place operations by the SQL layer. This means that operations that by their nature must be performed by copying the table to a temporary table, will not - have their own flags here (e.g. ALTER TABLE FORCE, ALTER TABLE - ENGINE). + have their own flags here. We generally try to specify handler flags only if there are real changes. But in cases when it is cumbersome to determine if some @@ -1213,6 +1214,12 @@ public: // Partition operation with ALL keyword static const HA_ALTER_FLAGS ALTER_ALL_PARTITION = 1L << 28; + /** + Recreate the table for ALTER TABLE FORCE, ALTER TABLE ENGINE + and OPTIMIZE TABLE operations. + */ + static const HA_ALTER_FLAGS RECREATE_TABLE = 1L << 29; + /** Create options (like MAX_ROWS) for the new version of table. diff --git a/mysql-wsrep-5.6/sql/item.cc b/mysql-wsrep-5.6/sql/item.cc index 12328853..72aed8d5 100644 --- a/mysql-wsrep-5.6/sql/item.cc +++ b/mysql-wsrep-5.6/sql/item.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -551,7 +551,8 @@ Item::save_str_value_in_field(Field *field, String *result) Item::Item(): is_expensive_cache(-1), rsize(0), marker(0), fixed(0), - collation(&my_charset_bin, DERIVATION_COERCIBLE), with_subselect(false), + collation(&my_charset_bin, DERIVATION_COERCIBLE), + runtime_item(false), with_subselect(false), with_stored_program(false), tables_locked_cache(false) { maybe_null=null_value=with_sum_func=unsigned_flag=0; @@ -600,6 +601,7 @@ Item::Item(THD *thd, Item *item): fixed(item->fixed), collation(item->collation), cmp_context(item->cmp_context), + runtime_item(false), with_subselect(item->has_subquery()), with_stored_program(item->with_stored_program), tables_locked_cache(item->tables_locked_cache) @@ -1514,9 +1516,25 @@ bool Item::is_blob_field() const DBUG_ASSERT(fixed); enum_field_types type= field_type(); - return (type == MYSQL_TYPE_BLOB || type == MYSQL_TYPE_GEOMETRY || - // Char length, not the byte one, should be taken into account - max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB); + if (type == MYSQL_TYPE_BLOB || type == MYSQL_TYPE_GEOMETRY || + // Char length, not the byte one, should be taken into account + (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB)) + return true; + + /* + This function is used only for subquery/semijoin materialization; + these are not able to handle a tmp table with share->uniques==true; it is + possible, if the tmp table has many rows, that it becomes a MyISAM table, + which will have share->uniques==true if the column's length in bytes is + bigger than MI_MAX_KEY_LENGTH. + So we add and extra restriction, only in MySQL 5.6: if longer than this, + pretend it's a blob, to disable materialization: + */ + if (max_length >= + (MI_MAX_KEY_LENGTH - HA_KEY_NULL_LENGTH - HA_KEY_BLOB_LENGTH)) + return true; + + return false; } @@ -3950,6 +3968,9 @@ bool Item_param::convert_str_value(THD *thd) bool rc= FALSE; if (state == STRING_VALUE || state == LONG_DATA_VALUE) { + if (value.cs_info.final_character_set_of_str_value == NULL || + value.cs_info.character_set_of_placeholder == NULL) + return true; /* Check is so simple because all charsets were set up properly in setup_one_conversion_function, where typecode of @@ -5876,6 +5897,18 @@ 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. + + @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 + */ String *Item::check_well_formed_result(String *str, bool send_error) { /* Check whether we got a well-formed string */ @@ -5990,7 +6023,7 @@ bool Item::can_be_evaluated_now() const If max_length > CONVERT_IF_BIGGER_TO_BLOB create a blob @n If max_length > 0 create a varchar @n - If max_length == 0 create a CHAR(0) + If max_length == 0 create a CHAR(0) (or VARCHAR(0) if we are grouping) @param table Table for which the field is created */ @@ -6008,8 +6041,19 @@ Field *Item::make_string_field(TABLE *table) field= new Field_varstring(max_length, maybe_null, item_name.ptr(), table->s, collation.collation); else - field= new Field_string(max_length, maybe_null, item_name.ptr(), - collation.collation); + { + /* + marker == 4 : see create_tmp_table() + With CHAR(0) end_update() may write garbage into the next field. + */ + if (max_length == 0 && marker == 4 && maybe_null && + field_type() == MYSQL_TYPE_VAR_STRING && type() != Item::TYPE_HOLDER) + field= new Field_varstring(max_length, maybe_null, item_name.ptr(), + table->s, collation.collation); + else + field= new Field_string(max_length, maybe_null, item_name.ptr(), + collation.collation); + } if (field) field->init(table); return field; diff --git a/mysql-wsrep-5.6/sql/item.h b/mysql-wsrep-5.6/sql/item.h index 41b93e00..3471af4c 100644 --- a/mysql-wsrep-5.6/sql/item.h +++ b/mysql-wsrep-5.6/sql/item.h @@ -1,7 +1,8 @@ #ifndef ITEM_INCLUDED #define ITEM_INCLUDED -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights + reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -723,6 +724,11 @@ public: my_bool fixed; /* If item fixed with fix_fields */ DTCollation collation; Item_result cmp_context; /* Comparison context */ + /* + If this item was created in runtime memroot,it cannot be used for + substitution in subquery transformation process + */ + bool runtime_item; protected: my_bool with_subselect; /* If this item is a subselect or some of its arguments is or contains a @@ -1346,6 +1352,11 @@ public: virtual Item *copy_andor_structure(THD *thd, bool real_items= false) { return real_items ? real_item() : this; } virtual Item *real_item() { return this; } + virtual Item *substitutional_item() + { + return runtime_item ? real_item() : this; + } + virtual void set_runtime_created() { runtime_item= true; } virtual Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); } static const CHARSET_INFO *default_charset(); @@ -4040,6 +4051,11 @@ public: row_version_type row_version; /* Next in list of all Item_trigger_field's in trigger */ Item_trigger_field *next_trg_field; + /* + Next list of Item_trigger_field's in "sp_head:: + m_list_of_trig_fields_item_lists". + */ + SQL_I_List<Item_trigger_field> *next_trig_field_list; /* Index of the field in the TABLE::field array */ uint field_idx; /* Pointer to Table_trigger_list object for table of this trigger */ @@ -4051,8 +4067,9 @@ public: ulong priv, const bool ro) :Item_field(context_arg, (const char *)NULL, (const char *)NULL, field_name_arg), - row_version(row_ver_arg), field_idx((uint)-1), original_privilege(priv), - want_privilege(priv), table_grants(NULL), read_only (ro) + row_version(row_ver_arg), next_trig_field_list(NULL), field_idx((uint)-1), + original_privilege(priv), want_privilege(priv), table_grants(NULL), + read_only (ro) {} void setup_field(THD *thd, TABLE *table, GRANT_INFO *table_grant_info); enum Type type() const { return TRIGGER_FIELD_ITEM; } diff --git a/mysql-wsrep-5.6/sql/item_create.cc b/mysql-wsrep-5.6/sql/item_create.cc index 7df83bc5..6b919da9 100644 --- a/mysql-wsrep-5.6/sql/item_create.cc +++ b/mysql-wsrep-5.6/sql/item_create.cc @@ -261,11 +261,68 @@ protected: virtual ~Create_func_addtime() {} }; +class Create_func_aes_base : public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list) + { + Item *func= NULL, *p1, *p2, *p3; + int arg_count= 0; + + /* Unsafe for SBR since result depends on a session variable */ + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); + + if (item_list != NULL) + arg_count= item_list->elements; + + switch (arg_count) + { + case 2: + { + p1= item_list->pop(); + p2= item_list->pop(); + func= create_aes(thd, p1, p2); + break; + } + case 3: + { + p1= item_list->pop(); + p2= item_list->pop(); + p3= item_list->pop(); + func= create_aes(thd, p1, p2, p3); + break; + } + default: + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + break; + } + } + return func; + + } + virtual Item *create_aes(THD *thd, Item *arg1, Item *arg2)= 0; + virtual Item *create_aes(THD *thd, Item *arg1, Item *arg2, Item *arg3)= 0; +protected: + Create_func_aes_base() + {} + virtual ~Create_func_aes_base() + {} + +}; + -class Create_func_aes_encrypt : public Create_func_arg2 +class Create_func_aes_encrypt : public Create_func_aes_base { public: - virtual Item *create(THD *thd, Item *arg1, Item *arg2); + virtual Item *create_aes(THD *thd, Item *arg1, Item *arg2) + { + return new (thd->mem_root) Item_func_aes_encrypt(arg1, arg2); + } + virtual Item *create_aes(THD *thd, Item *arg1, Item *arg2, Item *arg3) + { + return new (thd->mem_root) Item_func_aes_encrypt(arg1, arg2, arg3); + } static Create_func_aes_encrypt s_singleton; @@ -275,10 +332,17 @@ protected: }; -class Create_func_aes_decrypt : public Create_func_arg2 +class Create_func_aes_decrypt : public Create_func_aes_base { public: - virtual Item *create(THD *thd, Item *arg1, Item *arg2); + virtual Item *create_aes(THD *thd, Item *arg1, Item *arg2) + { + return new (thd->mem_root) Item_func_aes_decrypt(arg1, arg2); + } + virtual Item *create_aes(THD *thd, Item *arg1, Item *arg2, Item *arg3) + { + return new (thd->mem_root) Item_func_aes_decrypt(arg1, arg2, arg3); + } static Create_func_aes_decrypt s_singleton; @@ -288,6 +352,25 @@ protected: }; +class Create_func_random_bytes : public Create_func_arg1 +{ +public: + virtual Item *create(THD *thd, Item *arg1) + { + /* it is unsafe for SBR since it uses crypto random from the ssl library */ + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); + return new (thd->mem_root) Item_func_random_bytes(arg1); + } + static Create_func_random_bytes s_singleton; + +protected: + Create_func_random_bytes() + {} + virtual ~Create_func_random_bytes() + {} +}; + + #ifdef HAVE_SPATIAL class Create_func_area : public Create_func_arg1 { @@ -3017,20 +3100,11 @@ Create_func_addtime::create(THD *thd, Item *arg1, Item *arg2) Create_func_aes_encrypt Create_func_aes_encrypt::s_singleton; -Item* -Create_func_aes_encrypt::create(THD *thd, Item *arg1, Item *arg2) -{ - return new (thd->mem_root) Item_func_aes_encrypt(arg1, arg2); -} - Create_func_aes_decrypt Create_func_aes_decrypt::s_singleton; -Item* -Create_func_aes_decrypt::create(THD *thd, Item *arg1, Item *arg2) -{ - return new (thd->mem_root) Item_func_aes_decrypt(arg1, arg2); -} + +Create_func_random_bytes Create_func_random_bytes::s_singleton; #ifdef HAVE_SPATIAL @@ -5554,7 +5628,8 @@ static Native_func_registry func_array[] = { { C_STRING_WITH_LEN("QUOTE") }, BUILDER(Create_func_quote)}, { { C_STRING_WITH_LEN("RADIANS") }, BUILDER(Create_func_radians)}, { { C_STRING_WITH_LEN("RAND") }, BUILDER(Create_func_rand)}, - { { C_STRING_WITH_LEN("RELEASE_LOCK") }, BUILDER(Create_func_release_lock)}, + { { C_STRING_WITH_LEN("RANDOM_BYTES") }, BUILDER(Create_func_random_bytes) }, + { { C_STRING_WITH_LEN("RELEASE_LOCK") }, BUILDER(Create_func_release_lock) }, { { C_STRING_WITH_LEN("REVERSE") }, BUILDER(Create_func_reverse)}, { { C_STRING_WITH_LEN("ROUND") }, BUILDER(Create_func_round)}, { { C_STRING_WITH_LEN("RPAD") }, BUILDER(Create_func_rpad)}, diff --git a/mysql-wsrep-5.6/sql/item_func.cc b/mysql-wsrep-5.6/sql/item_func.cc index ee0e56d0..e5ff0b82 100644 --- a/mysql-wsrep-5.6/sql/item_func.cc +++ b/mysql-wsrep-5.6/sql/item_func.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1826,9 +1826,11 @@ void Item_func_int_div::fix_length_and_dec() { Item_result argtype= args[0]->result_type(); /* use precision ony for the data type it is applicable for and valid */ - max_length=args[0]->max_length - - (argtype == DECIMAL_RESULT || argtype == INT_RESULT ? - args[0]->decimals : 0); + uint32 char_length= args[0]->max_char_length() - + (argtype == DECIMAL_RESULT || argtype == INT_RESULT ? + args[0]->decimals : 0); + fix_char_length(char_length > MY_INT64_NUM_DECIMAL_DIGITS ? + MY_INT64_NUM_DECIMAL_DIGITS : char_length); maybe_null=1; unsigned_flag=args[0]->unsigned_flag | args[1]->unsigned_flag; } @@ -3678,8 +3680,12 @@ bool udf_handler::get_arguments() { f_args.args[i]= (char*) res->ptr(); f_args.lengths[i]= res->length(); - break; } + else + { + f_args.lengths[i]= 0; + } + break; } case INT_RESULT: *((longlong*) to) = args[i]->val_int(); @@ -6497,21 +6503,24 @@ longlong Item_func_is_free_lock::val_int() DBUG_ASSERT(fixed == 1); String *res=args[0]->val_str(&value); User_level_lock *ull; + longlong ret_val= 0LL; null_value=0; if (!res || !res->length()) { null_value=1; - return 0; + return ret_val; } mysql_mutex_lock(&LOCK_user_locks); ull= (User_level_lock *) my_hash_search(&hash_user_locks, (uchar*) res->ptr(), (size_t) res->length()); - mysql_mutex_unlock(&LOCK_user_locks); if (!ull || !ull->locked) - return 1; - return 0; + ret_val= 1; + mysql_mutex_unlock(&LOCK_user_locks); + DEBUG_SYNC(current_thd, "after_getting_user_level_lock_info"); + + return ret_val; } longlong Item_func_is_used_lock::val_int() @@ -6519,6 +6528,7 @@ longlong Item_func_is_used_lock::val_int() DBUG_ASSERT(fixed == 1); String *res=args[0]->val_str(&value); User_level_lock *ull; + my_thread_id thread_id= 0UL; null_value=1; if (!res || !res->length()) @@ -6527,12 +6537,15 @@ longlong Item_func_is_used_lock::val_int() mysql_mutex_lock(&LOCK_user_locks); ull= (User_level_lock *) my_hash_search(&hash_user_locks, (uchar*) res->ptr(), (size_t) res->length()); + if ((ull != NULL) && ull->locked) + { + null_value= 0; + thread_id= ull->thread_id; + } mysql_mutex_unlock(&LOCK_user_locks); - if (!ull || !ull->locked) - return 0; + DEBUG_SYNC(current_thd, "after_getting_user_level_lock_info"); - null_value=0; - return ull->thread_id; + return thread_id; } diff --git a/mysql-wsrep-5.6/sql/item_func.h b/mysql-wsrep-5.6/sql/item_func.h index ffaf107e..7a5b654f 100644 --- a/mysql-wsrep-5.6/sql/item_func.h +++ b/mysql-wsrep-5.6/sql/item_func.h @@ -228,7 +228,7 @@ public: void * arg, traverse_order order); inline double fix_result(double value) { - if (isfinite(value)) + if (my_isfinite(value)) return value; null_value=1; return 0.0; @@ -262,7 +262,7 @@ public: */ inline double check_float_overflow(double value) { - return isfinite(value) ? value : raise_float_overflow(); + return my_isfinite(value) ? value : raise_float_overflow(); } /** Throw an error if the input BIGINT value represented by the diff --git a/mysql-wsrep-5.6/sql/item_row.cc b/mysql-wsrep-5.6/sql/item_row.cc index a333f1cb..0ff7c499 100644 --- a/mysql-wsrep-5.6/sql/item_row.cc +++ b/mysql-wsrep-5.6/sql/item_row.cc @@ -56,6 +56,30 @@ Item_row::Item_row(List<Item> &arg): } } +Item_row::Item_row(Item *head, List<Item> &tail): + used_tables_cache(0), not_null_tables_cache(0), + const_item_cache(1), with_null(0) +{ + + //TODO: think placing 2-3 component items in item (as it done for function) + arg_count= 1 + tail.elements; + items= (Item**) sql_alloc(sizeof(Item*)*arg_count); + if (items == NULL) + { + arg_count= 0; + return; // OOM + } + items[0]= head; + List_iterator<Item> li(tail); + uint i= 1; + Item *item; + while ((item= li++)) + { + items[i]= item; + i++; + } +} + void Item_row::illegal_method_call(const char *method) { DBUG_ENTER("Item_row::illegal_method_call"); @@ -73,7 +97,7 @@ bool Item_row::fix_fields(THD *thd, Item **ref) Item **arg, **arg_end; for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++) { - if ((*arg)->fix_fields(thd, arg)) + if (!(*arg)->fixed && (*arg)->fix_fields(thd, arg)) return TRUE; // we can't assign 'item' before, because fix_fields() can change arg Item *item= *arg; diff --git a/mysql-wsrep-5.6/sql/item_row.h b/mysql-wsrep-5.6/sql/item_row.h index 13506bea..e17e20d1 100644 --- a/mysql-wsrep-5.6/sql/item_row.h +++ b/mysql-wsrep-5.6/sql/item_row.h @@ -25,6 +25,7 @@ class Item_row: public Item bool with_null; public: Item_row(List<Item> &); + Item_row(Item *head, List<Item> &tail); Item_row(Item_row *item): Item(), items(item->items), diff --git a/mysql-wsrep-5.6/sql/item_strfunc.cc b/mysql-wsrep-5.6/sql/item_strfunc.cc index 0e44416f..919b083c 100644 --- a/mysql-wsrep-5.6/sql/item_strfunc.cc +++ b/mysql-wsrep-5.6/sql/item_strfunc.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,6 +52,7 @@ #include "sha1.h" #include "my_aes.h" #include <zlib.h> +#include "my_rnd.h" C_MODE_START #include "../mysys/my_static.h" // For soundex_map C_MODE_END @@ -172,16 +173,27 @@ String *Item_func_md5::val_str_ascii(String *str) } +/* + The MD5()/SHA() functions treat their parameter as being a case sensitive. + Thus we set binary collation on it so different instances of MD5() will be + compared properly. +*/ +static CHARSET_INFO *get_checksum_charset(const char *csname) +{ + CHARSET_INFO *cs= get_charset_by_csname(csname, MY_CS_BINSORT, MYF(0)); + if (!cs) + { + // Charset has no binary collation: use my_charset_bin. + cs= &my_charset_bin; + } + return cs; +} + + void Item_func_md5::fix_length_and_dec() { - /* - The MD5() function treats its parameter as being a case sensitive. Thus - we set binary collation on it so different instances of MD5() will be - compared properly. - */ - args[0]->collation.set( - get_charset_by_csname(args[0]->collation.collation->csname, - MY_CS_BINSORT,MYF(0)), DERIVATION_COERCIBLE); + CHARSET_INFO *cs= get_checksum_charset(args[0]->collation.collation->csname); + args[0]->collation.set(cs, DERIVATION_COERCIBLE); fix_length_and_charset(32, default_charset()); } @@ -211,14 +223,8 @@ String *Item_func_sha::val_str_ascii(String *str) void Item_func_sha::fix_length_and_dec() { - /* - The SHA() function treats its parameter as being a case sensitive. Thus - we set binary collation on it so different instances of MD5() will be - compared properly. - */ - args[0]->collation.set( - get_charset_by_csname(args[0]->collation.collation->csname, - MY_CS_BINSORT,MYF(0)), DERIVATION_COERCIBLE); + CHARSET_INFO *cs= get_checksum_charset(args[0]->collation.collation->csname); + args[0]->collation.set(cs, DERIVATION_COERCIBLE); // size of hex representation of hash fix_length_and_charset(SHA1_HASH_SIZE * 2, default_charset()); } @@ -341,18 +347,9 @@ void Item_func_sha2::fix_length_and_dec() ER(ER_WRONG_PARAMETERS_TO_NATIVE_FCT), "sha2"); } - /* - The SHA2() function treats its parameter as being a case sensitive. - Thus we set binary collation on it so different instances of SHA2() - will be compared properly. - */ + CHARSET_INFO *cs= get_checksum_charset(args[0]->collation.collation->csname); + args[0]->collation.set(cs, DERIVATION_COERCIBLE); - args[0]->collation.set( - get_charset_by_csname( - args[0]->collation.collation->csname, - MY_CS_BINSORT, - MYF(0)), - DERIVATION_COERCIBLE); #else push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN, @@ -364,39 +361,135 @@ void Item_func_sha2::fix_length_and_dec() /* Implementation of AES encryption routines */ +/** helper class to process an IV argument to aes_encrypt/aes_decrypt */ +class iv_argument +{ + char iv_buff[MY_AES_IV_SIZE + 1]; // +1 to cater for the terminating NULL + String tmp_iv_value; +public: + iv_argument() : + tmp_iv_value(iv_buff, sizeof(iv_buff), system_charset_info) + {} + + /** + Validate the arguments and retrieve the IV value. + + Processes a 3d optional IV argument to an Item_func function. + Contains all the necessary stack buffers etc. + + @param aes_opmode the encryption mode + @param arg_count number of parameters passed to the function + @param args array of arguments passed to the function + @param func_name the name of the function (for errors) + @param thd the current thread (for errors) + @param [out] error_generated set to true if error was generated. + + @return a pointer to the retrived validated IV or NULL + */ + const unsigned char *retrieve_iv_ptr(enum my_aes_opmode aes_opmode, + uint arg_count, + Item **args, + const char *func_name, + THD *thd, + my_bool *error_generated) + { + const unsigned char *iv_str= NULL; + + *error_generated= FALSE; + + if (my_aes_needs_iv(aes_opmode)) + { + /* we only enforce the need for IV */ + if (arg_count == 3) + { + String *iv= args[2]->val_str(&tmp_iv_value); + if (!iv || iv->length() < MY_AES_IV_SIZE) + { + my_error(ER_AES_INVALID_IV, MYF(0), func_name, (long long) MY_AES_IV_SIZE); + *error_generated= TRUE; + return NULL; + } + iv_str= (unsigned char *) iv->ptr(); + } + else + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), func_name); + *error_generated= TRUE; + return NULL; + } + } + else + { + if (arg_count == 3) + { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + WARN_OPTION_IGNORED, + ER(WARN_OPTION_IGNORED), "IV"); + } + } + return iv_str; + } +}; + + String *Item_func_aes_encrypt::val_str(String *str) { DBUG_ASSERT(fixed == 1); char key_buff[80]; String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info); - String *sptr= args[0]->val_str(str); // String to encrypt - String *key= args[1]->val_str(&tmp_key_value); // key + String *sptr, *key; int aes_length; + THD *thd= current_thd; + ulong aes_opmode; + iv_argument iv_arg; + DBUG_ENTER("Item_func_aes_decrypt::val_str"); + + sptr= args[0]->val_str(str); // String to encrypt + key= args[1]->val_str(&tmp_key_value); // key + aes_opmode= thd->variables.my_aes_mode; + + DBUG_ASSERT(aes_opmode <= MY_AES_END); + if (sptr && key) // we need both arguments to be not NULL { - null_value=0; - aes_length=my_aes_get_size(sptr->length()); // Calculate result length + const unsigned char *iv_str= + iv_arg.retrieve_iv_ptr((enum my_aes_opmode) aes_opmode, arg_count, args, + func_name(), thd, &null_value); + if (null_value) + DBUG_RETURN(NULL); + // Calculate result length + aes_length= my_aes_get_size(sptr->length(), + (enum my_aes_opmode) aes_opmode); + + str_value.set_charset(&my_charset_bin); if (!str_value.alloc(aes_length)) // Ensure that memory is free { // finally encrypt directly to allocated buffer. - if (my_aes_encrypt(sptr->ptr(),sptr->length(), (char*) str_value.ptr(), - key->ptr(), key->length()) == aes_length) + if (my_aes_encrypt((unsigned char *) sptr->ptr(), sptr->length(), + (unsigned char *) str_value.ptr(), + (unsigned char *) key->ptr(), key->length(), + (enum my_aes_opmode) aes_opmode, + iv_str) == aes_length) { // We got the expected result length str_value.length((uint) aes_length); - return &str_value; + DBUG_RETURN(&str_value); } } } null_value=1; - return 0; + DBUG_RETURN(0); } void Item_func_aes_encrypt::fix_length_and_dec() { - max_length=my_aes_get_size(args[0]->max_length); + ulong aes_opmode= current_thd->variables.my_aes_mode; + DBUG_ASSERT(aes_opmode <= MY_AES_END); + + max_length=my_aes_get_size(args[0]->max_length, + (enum my_aes_opmode) aes_opmode); } @@ -406,20 +499,32 @@ String *Item_func_aes_decrypt::val_str(String *str) char key_buff[80]; String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info); String *sptr, *key; + THD *thd= current_thd; + ulong aes_opmode; + iv_argument iv_arg; DBUG_ENTER("Item_func_aes_decrypt::val_str"); sptr= args[0]->val_str(str); // String to decrypt key= args[1]->val_str(&tmp_key_value); // Key + aes_opmode= thd->variables.my_aes_mode; + DBUG_ASSERT(aes_opmode <= MY_AES_END); + if (sptr && key) // Need to have both arguments not NULL { - null_value=0; + const unsigned char *iv_str= + iv_arg.retrieve_iv_ptr((enum my_aes_opmode) aes_opmode, arg_count, args, + func_name(), thd, &null_value); + if (null_value) + DBUG_RETURN(NULL); + str_value.set_charset(&my_charset_bin); if (!str_value.alloc(sptr->length())) // Ensure that memory is free { // finally decrypt directly to allocated buffer. int length; - length=my_aes_decrypt(sptr->ptr(), sptr->length(), - (char*) str_value.ptr(), - key->ptr(), key->length()); + length= my_aes_decrypt((unsigned char *) sptr->ptr(), sptr->length(), + (unsigned char *) str_value.ptr(), + (unsigned char *) key->ptr(), key->length(), + (enum my_aes_opmode) aes_opmode, iv_str); if (length >= 0) // if we got correct data data { str_value.length((uint) length); @@ -439,6 +544,59 @@ void Item_func_aes_decrypt::fix_length_and_dec() maybe_null= 1; } +/* + Artificially limited to 1k to avoid excessive memory usage. + The SSL lib supports up to INT_MAX. +*/ +const longlong Item_func_random_bytes::MAX_RANDOM_BYTES_BUFFER= 1024; + + +void Item_func_random_bytes::fix_length_and_dec() +{ + collation.set(&my_charset_bin); + max_length= MAX_RANDOM_BYTES_BUFFER; +} + + +String *Item_func_random_bytes::val_str(String *a) +{ + DBUG_ASSERT(fixed == 1); + longlong n_bytes= args[0]->val_int(); + null_value= args[0]->null_value; + + if (null_value) + return NULL; + + str_value.set_charset(&my_charset_bin); + + if (n_bytes <= 0 || n_bytes > MAX_RANDOM_BYTES_BUFFER) + { + my_error(ER_DATA_OUT_OF_RANGE, MYF(0), "length", func_name()); + null_value= TRUE; + return NULL; + } + + if (str_value.alloc(n_bytes)) + { + my_error(ER_OUTOFMEMORY, n_bytes); + null_value= TRUE; + return NULL; + } + + str_value.set_charset(&my_charset_bin); + + if (my_rand_buffer((unsigned char *) str_value.ptr(), n_bytes)) + { + my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0), func_name(), + "SSL library can't generate random bytes"); + null_value= TRUE; + return NULL; + } + + str_value.length(n_bytes); + return &str_value; +} + void Item_func_to_base64::fix_length_and_dec() { @@ -1665,6 +1823,42 @@ String *Item_func_substr_index::val_str(String *str) return (&tmp_value); } + +/** + A helper function for trim(leading ...) for multibyte charsets. + @param res Copy of 'res' in calling functions. + @param ptr Where to start trimming. + @param end End of string to be trimmed. + @param remove_str The string to be removed from [ptr .. end) + @return Pointer to left-trimmed string. + */ +static inline +char *trim_left_mb(String *res, char *ptr, char *end, String *remove_str) +{ + const char * const r_ptr= remove_str->ptr(); + const uint remove_length= remove_str->length(); + + while (ptr + remove_length <= end) + { + uint num_bytes= 0; + while (num_bytes < remove_length) + { + uint len; + if ((len= my_ismbchar(res->charset(), ptr + num_bytes, end))) + num_bytes+= len; + else + ++num_bytes; + } + if (num_bytes != remove_length) + break; + if (memcmp(ptr, r_ptr, remove_length)) + break; + ptr+= remove_length; + } + return ptr; +} + + /* ** The trim functions are extension to ANSI SQL because they trim substrings ** They ltrim() and rtrim() functions are optimized for 1 byte strings @@ -1699,19 +1893,28 @@ String *Item_func_ltrim::val_str(String *str) ptr= (char*) res->ptr(); end= ptr+res->length(); - if (remove_length == 1) +#ifdef USE_MB + if (use_mb(res->charset())) { - char chr=(*remove_str)[0]; - while (ptr != end && *ptr == chr) - ptr++; + ptr= trim_left_mb(res, ptr, end, remove_str); } else +#endif /* USE_MB */ { - const char *r_ptr=remove_str->ptr(); - end-=remove_length; - while (ptr <= end && !memcmp(ptr, r_ptr, remove_length)) - ptr+=remove_length; - end+=remove_length; + if (remove_length == 1) + { + char chr=(*remove_str)[0]; + while (ptr != end && *ptr == chr) + ptr++; + } + else + { + const char *r_ptr=remove_str->ptr(); + end-=remove_length; + while (ptr <= end && !memcmp(ptr, r_ptr, remove_length)) + ptr+=remove_length; + end+=remove_length; + } } if (ptr == res->ptr()) return res; @@ -1805,11 +2008,8 @@ String *Item_func_trim::val_str(String *str) { DBUG_ASSERT(fixed == 1); char buff[MAX_FIELD_WIDTH], *ptr, *end; - const char *r_ptr; String tmp(buff, sizeof(buff), system_charset_info); String *res, *remove_str; - uint remove_length; - LINT_INIT(remove_length); res= args[0]->val_str(str); if ((null_value=args[0]->null_value)) @@ -1822,33 +2022,19 @@ String *Item_func_trim::val_str(String *str) return 0; } - if ((remove_length= remove_str->length()) == 0 || + const uint remove_length= remove_str->length(); + if (remove_length == 0 || remove_length > res->length()) return res; ptr= (char*) res->ptr(); end= ptr+res->length(); - r_ptr= remove_str->ptr(); + const char * const r_ptr= remove_str->ptr(); #ifdef USE_MB if (use_mb(res->charset())) { - while (ptr + remove_length <= end) - { - uint num_bytes= 0; - while (num_bytes < remove_length) - { - uint len; - if ((len= my_ismbchar(res->charset(), ptr + num_bytes, end))) - num_bytes+= len; - else - ++num_bytes; - } - if (num_bytes != remove_length) - break; - if (memcmp(ptr, r_ptr, remove_length)) - break; - ptr+= remove_length; - } + ptr= trim_left_mb(res, ptr, end, remove_str); + char *p=ptr; register uint32 l; loop: @@ -2532,7 +2718,7 @@ String *Item_func_format::val_str_ascii(String *str) return 0; /* purecov: inspected */ nr= my_double_round(nr, (longlong) dec, FALSE, FALSE); str->set_real(nr, dec, &my_charset_numeric); - if (isnan(nr) || my_isinf(nr)) + if (my_isnan(nr) || my_isinf(nr)) return str; str_length=str->length(); } @@ -3067,6 +3253,16 @@ String *Item_func_rpad::val_str(String *str) rpad->set_charset(&my_charset_bin); } +#ifdef USE_MB + 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); + if (!well_formed_pad) + goto err; + } +#endif + if (count <= (res_char_length= res->numchars())) { // String to pad is big enough res->length(res->charpos((int) count)); // Shorten result if longer @@ -3172,6 +3368,16 @@ String *Item_func_lpad::val_str(String *str) pad->set_charset(&my_charset_bin); } +#ifdef USE_MB + 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); + if (!well_formed_pad) + goto err; + } +#endif + res_char_length= res->numchars(); if (count <= res_char_length) diff --git a/mysql-wsrep-5.6/sql/item_strfunc.h b/mysql-wsrep-5.6/sql/item_strfunc.h index 480075a4..d8976e44 100644 --- a/mysql-wsrep-5.6/sql/item_strfunc.h +++ b/mysql-wsrep-5.6/sql/item_strfunc.h @@ -138,6 +138,7 @@ class Item_func_aes_encrypt :public Item_str_func { public: Item_func_aes_encrypt(Item *a, Item *b) :Item_str_func(a,b) {} + Item_func_aes_encrypt(Item *a, Item *b, Item *c) :Item_str_func(a, b, c) {} String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "aes_encrypt"; } @@ -147,12 +148,31 @@ class Item_func_aes_decrypt :public Item_str_func { public: Item_func_aes_decrypt(Item *a, Item *b) :Item_str_func(a,b) {} + Item_func_aes_decrypt(Item *a, Item *b, Item *c) :Item_str_func(a, b, c) {} String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "aes_decrypt"; } }; +class Item_func_random_bytes : public Item_str_func +{ + /** limitation from the SSL library */ + static const longlong MAX_RANDOM_BYTES_BUFFER; +public: + Item_func_random_bytes(Item *a) : Item_str_func(a) + {} + + void fix_length_and_dec(); + String *val_str(String *a); + + const char *func_name() const + { + return "random_bytes"; + } + +}; + class Item_func_concat :public Item_str_func { String tmp_value; diff --git a/mysql-wsrep-5.6/sql/item_subselect.cc b/mysql-wsrep-5.6/sql/item_subselect.cc index ba1d0bd0..34f74fbb 100644 --- a/mysql-wsrep-5.6/sql/item_subselect.cc +++ b/mysql-wsrep-5.6/sql/item_subselect.cc @@ -1,4 +1,5 @@ -/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights + reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1603,13 +1604,13 @@ Item_in_subselect::single_value_transformer(JOIN *join, upper_item->set_subselect(this); /* fix fields is already called for left expression. - Note that real_item() should be used instead of - original left expression because left_expr can be - runtime created Ref item which is deleted at the end + Note that real_item() should be used for all the runtime + created Ref items instead of original left expression + because these items would be deleted at the end of the statement. Thus one of 'substitution' arguments can be broken in case of PS. */ - substitution= func->create(left_expr->real_item(), subs); + substitution= func->create(left_expr->substitutional_item(), subs); DBUG_RETURN(RES_OK); } @@ -1903,13 +1904,13 @@ Item_in_subselect::single_value_in_to_exists_transformer(JOIN * join, Comp_creat /* fix_field of substitution item will be done in time of substituting. - Note that real_item() should be used instead of - original left expression because left_expr can be - runtime created Ref item which is deleted at the end + Note that real_item() should be used for all the runtime + created Ref items instead of original left expression + because these items would be deleted at the end of the statement. Thus one of 'substitution' arguments can be broken in case of PS. - */ - substitution= func->create(left_expr->real_item(), orig_item); + */ + substitution= func->create(left_expr->substitutional_item(), orig_item); have_to_be_excluded= 1; if (thd->lex->describe) { diff --git a/mysql-wsrep-5.6/sql/item_sum.cc b/mysql-wsrep-5.6/sql/item_sum.cc index 631999e3..b2e85cf2 100644 --- a/mysql-wsrep-5.6/sql/item_sum.cc +++ b/mysql-wsrep-5.6/sql/item_sum.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. rights reserved. This program is free software; you can redistribute it and/or modify @@ -790,17 +790,39 @@ bool Aggregator_distinct::setup(THD *thd) if (!(tmp_table_param= new TMP_TABLE_PARAM)) return TRUE; - /* Create a table with an unique key over all parameters */ - for (uint i=0; i < item_sum->get_arg_count() ; i++) + /** + Create a table with an unique key over all parameters. + If the list contains only const values, const_distinct + is set to CONST_NOT_NULL to avoid creation of temp table + and thereby counting as count(distinct of const values) + will always be 1. If any of these const values is null, + const_distinct is set to CONST_NULL to ensure aggregation + does not happen. + */ + uint const_items= 0; + uint num_args= item_sum->get_arg_count(); + DBUG_ASSERT(num_args); + for (uint i=0; i < num_args; i++) { Item *item=item_sum->get_arg(i); if (list.push_back(item)) - return TRUE; // End of memory - if (item->const_item() && item->is_null()) - always_null= true; + return true; // End of memory + if (item->const_item()) + { + if (item->is_null()) + { + const_distinct= CONST_NULL; + return false; + } + else + const_items++; + } + } + if (num_args == const_items) + { + const_distinct= CONST_NOT_NULL; + return false; } - if (always_null) - return FALSE; count_field_types(select_lex, tmp_table_param, list, 0); tmp_table_param->force_copy_fields= item_sum->has_force_copy_fields(); DBUG_ASSERT(table == 0); @@ -928,11 +950,12 @@ bool Aggregator_distinct::setup(THD *thd) { (void) arg->val_int(); if (arg->null_value) - always_null= true; + { + const_distinct= CONST_NULL; + DBUG_RETURN(false); + } } - if (always_null) - DBUG_RETURN(FALSE); enum enum_field_types field_type; @@ -977,7 +1000,7 @@ void Aggregator_distinct::clear() item_sum->clear(); if (tree) tree->reset(); - /* tree and table can be both null only if always_null */ + /* tree and table can be both null only if const_distinct is enabled*/ if (item_sum->sum_func() == Item_sum::COUNT_FUNC || item_sum->sum_func() == Item_sum::COUNT_DISTINCT_FUNC) { @@ -1013,13 +1036,21 @@ void Aggregator_distinct::clear() bool Aggregator_distinct::add() { - if (always_null) + if (const_distinct == CONST_NULL) return 0; if (item_sum->sum_func() == Item_sum::COUNT_FUNC || item_sum->sum_func() == Item_sum::COUNT_DISTINCT_FUNC) { int error; + + if (const_distinct == CONST_NOT_NULL) + { + DBUG_ASSERT(item_sum->fixed == 1); + Item_sum_count *sum= (Item_sum_count *)item_sum; + sum->count= 1; + return 0; + } copy_fields(tmp_table_param); if (copy_funcs(tmp_table_param->items_to_copy, table->in_use)) return TRUE; @@ -1076,11 +1107,17 @@ void Aggregator_distinct::endup() if (endup_done) return; + if (const_distinct == CONST_NOT_NULL) + { + endup_done= TRUE; + return; + } + /* we are going to calculate the aggregate value afresh */ item_sum->clear(); /* The result will definitely be null : no more calculations needed */ - if (always_null) + if (const_distinct == CONST_NULL) return; if (item_sum->sum_func() == Item_sum::COUNT_FUNC || @@ -1088,6 +1125,7 @@ void Aggregator_distinct::endup() { DBUG_ASSERT(item_sum->fixed == 1); Item_sum_count *sum= (Item_sum_count *)item_sum; + if (tree && tree->elements == 0) { /* everything fits in memory */ diff --git a/mysql-wsrep-5.6/sql/item_sum.h b/mysql-wsrep-5.6/sql/item_sum.h index a3db7df8..f36353a6 100644 --- a/mysql-wsrep-5.6/sql/item_sum.h +++ b/mysql-wsrep-5.6/sql/item_sum.h @@ -1,7 +1,7 @@ #ifndef ITEM_SUM_INCLUDED #define ITEM_SUM_INCLUDED -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. reserved. reserved. This program is free software; you can redistribute it and/or modify @@ -589,14 +589,24 @@ class Aggregator_distinct : public Aggregator */ uint tree_key_length; - /* - Set to true if the result is known to be always NULL. - If set deactivates creation and usage of the temporary table (in the - 'table' member) and the Unique instance (in the 'tree' member) as well as - the calculation of the final value on the first call to - Item_[sum|avg|count]::val_xxx(). - */ - bool always_null; + enum Const_distinct{ + NOT_CONST= 0, + /** + Set to true if the result is known to be always NULL. + If set deactivates creation and usage of the temporary table (in the + 'table' member) and the Unique instance (in the 'tree' member) as well as + the calculation of the final value on the first call to + Item_[sum|avg|count]::val_xxx(). + */ + CONST_NULL, + /** + Set to true if count distinct is on only const items. Distinct on a const + value will always be the constant itself. And count distinct of the same + would always be 1. Similar to CONST_NULL, it avoids creation of temporary + table and the Unique instance. + */ + CONST_NOT_NULL + } const_distinct; /** When feeding back the data in endup() from Unique/temp table back to @@ -611,7 +621,7 @@ class Aggregator_distinct : public Aggregator public: Aggregator_distinct (Item_sum *sum) : Aggregator(sum), table(NULL), tmp_table_param(NULL), tree(NULL), - always_null(false), use_distinct_values(false) {} + const_distinct(NOT_CONST), use_distinct_values(false) {} virtual ~Aggregator_distinct (); Aggregator_type Aggrtype() { return DISTINCT_AGGREGATOR; } diff --git a/mysql-wsrep-5.6/sql/item_timefunc.h b/mysql-wsrep-5.6/sql/item_timefunc.h index e265424b..e0710db7 100644 --- a/mysql-wsrep-5.6/sql/item_timefunc.h +++ b/mysql-wsrep-5.6/sql/item_timefunc.h @@ -896,6 +896,7 @@ public: bool basic_const_item() const { return true; } bool const_item() const { return true; } table_map used_tables() const { return (table_map) 0L; } + table_map not_null_tables() const { return used_tables(); } void cleanup() { // See Item_basic_const::cleanup() @@ -953,6 +954,7 @@ public: bool basic_const_item() const { return true; } bool const_item() const { return true; } table_map used_tables() const { return (table_map) 0L; } + table_map not_null_tables() const { return used_tables(); } void cleanup() { // See Item_basic_const::cleanup() @@ -1010,6 +1012,7 @@ public: bool basic_const_item() const { return true; } bool const_item() const { return true; } table_map used_tables() const { return (table_map) 0L; } + table_map not_null_tables() const { return used_tables(); } void cleanup() { // See Item_basic_const::cleanup() diff --git a/mysql-wsrep-5.6/sql/key.cc b/mysql-wsrep-5.6/sql/key.cc index 847eddd9..cbc2b3e5 100644 --- a/mysql-wsrep-5.6/sql/key.cc +++ b/mysql-wsrep-5.6/sql/key.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -493,6 +493,7 @@ bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields) - 0 Key is equal to range or 'range' == 0 (no range) - -1 Key is less than range - 1 Key is larger than range + @note: keep this function and key_cmp2() in sync */ int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length) @@ -531,6 +532,87 @@ int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length) } +/** + Compare two given keys + + @param key_part Key part handler + @param key1 Key to be compared with key2 + @param key1_length length of 'key1' + @param key2 Key to be compared with key1 + @param key2_length length of 'key2' + + @return + The return value is an integral value indicating the + relationship between the two keys: + - 0 key1 = key2 + - -1 Key1 < Key2 + - 1 Key1 > Key2 + @note: keep this function and key_cmp() in sync + + Below comparison code is under the assumption + that key1_length and key2_length are same and + key1_length, key2_length are non zero value. +*/ +int key_cmp2(KEY_PART_INFO *key_part, + const uchar *key1, uint key1_length, + const uchar *key2, uint key2_length) +{ + DBUG_ASSERT(key_part && key1 && key2); + DBUG_ASSERT((key1_length == key2_length) && key1_length != 0 ); + uint store_length; + + /* Compare all the subkeys (if it is a composite key) */ + for (const uchar *end= key1 + key1_length; key1 < end; + key1+= store_length, key2+= store_length, key_part++) + { + store_length= key_part->store_length; + /* This key part allows null values; NULL is lower than everything */ + if (key_part->null_bit) + { + if (*key1 != *key2) + { + /* + Key Format= "1 byte (NULL Indicator flag) + Key value" + If NULL Indicator flag is '1' that means the key is NULL value + and If the flag is '0' that means the key is Non-NULL value. + + If null indicating flag in key1 and key2 are not same, then + > if key1's null flag is '1' (i.e., key1 is NULL), return -1 + > if key1's null flag is '0' (i.e., key1 is NOT NULL), then + key2's null flag is '1' (since *key1 != *key2) then return 1; + */ + return (*key1) ? -1 : 1; + } + else + { + /* + If null indicating flag in key1 and key2 are same and + > if it is '1' , both are NULLs and both are same, continue with + next key in key_part. + > if it is '0', then go ahead and compare the content using + field->key_cmp. + */ + if (*key1) + continue; + } + /* + Increment the key1 and key2 pointers to point them to the actual + key values + */ + key1++; + key2++; + store_length--; + } + /* Compare two keys using field->key_cmp */ + int cmp; + if ((cmp= key_part->field->key_cmp(key1, key2)) < 0) + return -1; + if (cmp > 0) + return 1; + } + return 0; /* Keys are equal */ +} + /** Compare two records in index order. diff --git a/mysql-wsrep-5.6/sql/key.h b/mysql-wsrep-5.6/sql/key.h index 77d942e1..83f230c1 100644 --- a/mysql-wsrep-5.6/sql/key.h +++ b/mysql-wsrep-5.6/sql/key.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,6 +36,9 @@ void field_unpack(String *to, Field *field, const uchar *rec, uint max_length, bool prefix_key); bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields); int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length); +int key_cmp2(KEY_PART_INFO *key_part, + const uchar *key1, uint key1_length, + const uchar *key2, uint key2_length); extern "C" int key_rec_cmp(void *key_info, uchar *a, uchar *b); #endif /* KEY_INCLUDED */ diff --git a/mysql-wsrep-5.6/sql/log.cc b/mysql-wsrep-5.6/sql/log.cc index 90f380b7..808c1763 100644 --- a/mysql-wsrep-5.6/sql/log.cc +++ b/mysql-wsrep-5.6/sql/log.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1529,6 +1529,7 @@ bool MYSQL_LOG::open( const char *new_name, enum cache_type io_cache_type_arg) { char buff[FN_REFLEN]; + MY_STAT f_stat; File file= -1; my_off_t pos= 0; int open_flags= O_CREAT | O_BINARY; @@ -1544,7 +1545,12 @@ bool MYSQL_LOG::open( } if (init_and_set_log_file_name(name, new_name, - log_type_arg, io_cache_type_arg)) + log_type_arg, io_cache_type_arg) || + DBUG_EVALUATE_IF("fault_injection_init_name", log_type == LOG_BIN, 0)) + goto err; + + /* File is regular writable file */ + if (my_stat(log_file_name, &f_stat, MYF(0)) && !MY_S_ISREG(f_stat.st_mode)) goto err; if (io_cache_type == SEQ_READ_APPEND) @@ -1605,10 +1611,28 @@ bool MYSQL_LOG::open( DBUG_RETURN(0); err: - sql_print_error("Could not use %s for logging (error %d). \ -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.", name, errno); + 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); + } + else + sql_print_error("Could not open %s for logging (error %d). " + "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.", + name, errno); if (file >= 0) mysql_file_close(file, MYF(0)); end_io_cache(&log_file); @@ -2187,11 +2211,20 @@ void sql_perror(const char *message) extern "C" my_bool reopen_fstreams(const char *filename, FILE *outstream, FILE *errstream) { - if (outstream && !my_freopen(filename, "a", outstream)) - return TRUE; + int retries= 2, errors= 0; - if (errstream && !my_freopen(filename, "a", errstream)) - return TRUE; + do + { + errors= 0; + if (errstream && !my_freopen(filename, "a", errstream)) + errors++; + if (outstream && !my_freopen(filename, "a", outstream)) + errors++; + } + while (retries-- && errors); + + if (errors) + return true; /* The error stream must be unbuffered. */ if (errstream) diff --git a/mysql-wsrep-5.6/sql/log_event.cc b/mysql-wsrep-5.6/sql/log_event.cc index 013824ff..cbca5d76 100644 --- a/mysql-wsrep-5.6/sql/log_event.cc +++ b/mysql-wsrep-5.6/sql/log_event.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This 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,6 @@ #include "sql_base.h" // close_thread_tables #include "sql_cache.h" // QUERY_CACHE_FLAGS_SIZE #include "sql_locale.h" // MY_LOCALE, my_locale_by_number, my_locale_en_US -#include "key.h" // key_copy #include "lock.h" // mysql_unlock_tables #include "sql_parse.h" // mysql_test_parse_for_slave #include "tztime.h" // struct Time_zone @@ -46,7 +45,13 @@ #include "rpl_rli_pdb.h" #include "sql_show.h" // append_identifier #include <mysql/psi/mysql_statement.h> - +#define window_size Log_throttle::LOG_THROTTLE_WINDOW_SIZE +Error_log_throttle +slave_ignored_err_throttle(window_size, + sql_print_warning, + "Error log throttle: %lu time(s) Error_code: 1237" + " \"Slave SQL thread ignored the query because of" + " replicate-*-table rules\" got suppressed."); #endif /* MYSQL_CLIENT */ #include <base64.h> @@ -56,6 +61,9 @@ using std::min; using std::max; +/* The number of event types need to be permuted. */ +static const uint EVENT_TYPE_PERMUTATION_NUM= 23; + /** BINLOG_CHECKSUM variable. */ @@ -1253,15 +1261,22 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet, } else { - /* Corrupt the event for Dump thread*/ + /* + Corrupt the event for Dump thread. + We also need to exclude Previous_gtids_log_event and Gtid_log_event + events from injected corruption to allow dump thread to move forward + on binary log until the missing transactions from slave when + MASTER_AUTO_POSITION= 1. + */ DBUG_EXECUTE_IF("corrupt_read_log_event", uchar *debug_event_buf_c = (uchar*) packet->ptr() + ev_offset; - if (debug_event_buf_c[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT) + if (debug_event_buf_c[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && + debug_event_buf_c[EVENT_TYPE_OFFSET] != PREVIOUS_GTIDS_LOG_EVENT && + debug_event_buf_c[EVENT_TYPE_OFFSET] != GTID_LOG_EVENT) { int debug_cor_pos = rand() % (data_len + sizeof(buf) - BINLOG_CHECKSUM_LEN); debug_event_buf_c[debug_cor_pos] =~ debug_event_buf_c[debug_cor_pos]; DBUG_PRINT("info", ("Corrupt the event at Log_event::read_log_event: byte on position %d", debug_cor_pos)); - DBUG_SET("-d,corrupt_read_log_event"); } ); /* @@ -1424,7 +1439,6 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, /* Check the integrity */ if (event_len < EVENT_LEN_OFFSET || - buf[EVENT_TYPE_OFFSET] >= ENUM_END_EVENT || (uint) event_len != uint4korr(buf+EVENT_LEN_OFFSET)) { DBUG_PRINT("error", ("event_len=%u EVENT_LEN_OFFSET=%d " @@ -1441,6 +1455,22 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, // all following START events in the current file are without checksum if (event_type == START_EVENT_V3) (const_cast< Format_description_log_event *>(description_event))->checksum_alg= BINLOG_CHECKSUM_ALG_OFF; + // Sanity check for Format description event + if (event_type == FORMAT_DESCRIPTION_EVENT) + { + if (event_len < LOG_EVENT_MINIMAL_HEADER_LEN + + ST_COMMON_HEADER_LEN_OFFSET) + { + *error= "Found invalid Format description event in binary log"; + DBUG_RETURN(0); + } + uint tmp_header_len= buf[LOG_EVENT_MINIMAL_HEADER_LEN + ST_COMMON_HEADER_LEN_OFFSET]; + if (event_len < tmp_header_len + ST_SERVER_VER_OFFSET + ST_SERVER_VER_LEN) + { + *error= "Found invalid Format description event in binary log"; + DBUG_RETURN(0); + } + } /* CRC verification by SQL and Show-Binlog-Events master side. The caller has to provide @description_event->checksum_alg to @@ -1472,9 +1502,11 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, DBUG_PRINT("info", ("Corrupt the event at Log_event::read_log_event(char*,...): byte on position %d", debug_cor_pos)); DBUG_SET(""); } - ); + ); if (crc_check && - event_checksum_test((uchar *) buf, event_len, alg)) + event_checksum_test((uchar *) buf, event_len, alg) && + /* Skip the crc check when simulating an unknown ignorable log event. */ + !DBUG_EVALUATE_IF("simulate_unknown_ignorable_log_event", 1, 0)) { *error= "Event crc check failed! Most likely there is event corruption."; #ifdef MYSQL_CLIENT @@ -1488,7 +1520,12 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, } if (event_type > description_event->number_of_event_types && - event_type != FORMAT_DESCRIPTION_EVENT) + event_type != FORMAT_DESCRIPTION_EVENT && + /* + Skip the event type check when simulating an + unknown ignorable log event. + */ + !DBUG_EVALUATE_IF("simulate_unknown_ignorable_log_event", 1, 0)) { /* It is unsafe to use the description_event if its post_header_len @@ -1514,10 +1551,16 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, */ if (description_event->event_type_permutation) { - int new_event_type= description_event->event_type_permutation[event_type]; + uint new_event_type; + if (event_type >= EVENT_TYPE_PERMUTATION_NUM) + /* Safe guard for read out of bounds of event_type_permutation. */ + new_event_type= UNKNOWN_EVENT; + else + new_event_type= description_event->event_type_permutation[event_type]; + DBUG_PRINT("info", ("converting event type %d to %d (%s)", - event_type, new_event_type, - get_type_str((Log_event_type)new_event_type))); + event_type, new_event_type, + get_type_str((Log_event_type)new_event_type))); event_type= new_event_type; } @@ -1552,7 +1595,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ev = new Execute_load_log_event(buf, event_len, description_event); break; case START_EVENT_V3: /* this is sent only by MySQL <=4.x */ - ev = new Start_log_event_v3(buf, description_event); + ev = new Start_log_event_v3(buf, event_len, description_event); break; case STOP_EVENT: ev = new Stop_log_event(buf, description_event); @@ -2553,13 +2596,8 @@ void Log_event::print_timestamp(IO_CACHE* file, time_t *ts) */ time_t ts_tmp= ts ? *ts : (ulong)when.tv_sec; DBUG_ENTER("Log_event::print_timestamp"); -#ifdef MYSQL_SERVER // This is always false struct tm tm_tmp; localtime_r(&ts_tmp, (res= &tm_tmp)); -#else - res= localtime(&ts_tmp); -#endif - my_b_printf(file,"%02d%02d%02d %2d:%02d:%02d", res->tm_year % 100, res->tm_mon+1, @@ -2634,32 +2672,32 @@ bool Log_event::contains_partition_info(bool end_group_sets_max_dbs) g - mini-group representative event containing the partition info (any Table_map, a Query_log_event) p - a mini-group internal event that *p*receeding its g-parent - (int_, rand_, user_ var:s) + (int_, rand_, user_ var:s) r - a mini-group internal "regular" event that follows its g-parent (Delete, Update, Write -rows) T - terminator of the group (XID, COMMIT, ROLLBACK, auto-commit query) - Only the first g-event computes the assigned Worker which once + Only the first g-event computes the assigned Worker which once is determined remains to be for the rest of the group. That is the g-event solely carries partitioning info. - For B-event the assigned Worker is NULL to indicate Coordinator + For B-event the assigned Worker is NULL to indicate Coordinator has not yet decided. The same applies to p-event. - + Notice, these is a special group consisting of optionally multiple p-events terminating with a g-event. Such case is caused by old master binlog and a few corner-cases of - the current master version (todo: to fix). + the current master version (todo: to fix). In case of the event accesses more than OVER_MAX_DBS the method has to ensure sure previously assigned groups to all other workers are done. - @note The function updates GAQ queue directly, updates APH hash + @note The function updates GAQ queue directly, updates APH hash plus relocates some temporary tables from Coordinator's list into involved entries of APH through @c map_db_to_worker. There's few memory allocations commented where to be freed. - + @return a pointer to the Worker struct or NULL. */ @@ -2667,7 +2705,6 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) { Slave_job_group group, *ptr_group= NULL; bool is_s_event; - int num_dbs= 0; Slave_worker *ret_worker= NULL; char llbuff[22]; #ifndef DBUG_OFF @@ -2701,7 +2738,7 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) group.reset(log_pos, rli->mts_groups_assigned); // the last occupied GAQ's array index gaq_idx= gaq->assigned_group_index= gaq->en_queue((void *) &group); - + DBUG_ASSERT(gaq_idx != MTS_WORKER_UNDEF && gaq_idx < gaq->size); DBUG_ASSERT(gaq->get_job_group(rli->gaq->assigned_group_index)-> group_relay_log_name == NULL); @@ -2723,7 +2760,7 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) rli->mts_end_group_sets_max_dbs= true; rli->curr_group_seen_begin= true; } - + if (is_gtid_event(this)) // mark the current group as started with explicit Gtid-event rli->curr_group_seen_gtid= true; @@ -2749,10 +2786,9 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) if (contains_partition_info(rli->mts_end_group_sets_max_dbs)) { int i= 0; - num_dbs= mts_number_dbs(); - List_iterator<char> it(*get_mts_dbs(&rli->mts_coor_mem_root)); - it++; + Mts_db_names mts_dbs; + get_mts_dbs(&mts_dbs); /* Bug 12982188 - MTS: SBR ABORTS WITH ERROR 1742 ON LOAD DATA Logging on master can create a group with no events holding @@ -2771,13 +2807,13 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) (rli->curr_group_da.elements == 2 && !rli->curr_group_seen_gtid)) && ((*(Log_event **) dynamic_array_ptr(&rli->curr_group_da, - rli->curr_group_da.elements - 1))-> + rli->curr_group_da.elements - 1))-> get_type_code() == BEGIN_LOAD_QUERY_EVENT))); // partioning info is found which drops the flag rli->mts_end_group_sets_max_dbs= false; ret_worker= rli->last_assigned_worker; - if (num_dbs == OVER_MAX_DBS_IN_EVENT_MTS) + if (mts_dbs.num == OVER_MAX_DBS_IN_EVENT_MTS) { // Worker with id 0 to handle serial execution if (!ret_worker) @@ -2790,15 +2826,23 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) rli->curr_group_isolated= TRUE; } - do + /* One run of the loop in the case of over-max-db:s */ + for (i= 0; i < ((mts_dbs.num != OVER_MAX_DBS_IN_EVENT_MTS) ? mts_dbs.num : 1); + i++) { - char **ref_cur_db= it.ref(); - + /* + The over max db:s case handled through passing to map_db_to_worker + such "all" db as encoded as the "" empty string. + Note, the empty string is allocated in a large buffer + to satisfy hashcmp() implementation. + */ + const char all_db[NAME_LEN]= {0}; if (!(ret_worker= - map_db_to_worker(*ref_cur_db, rli, + map_db_to_worker(mts_dbs.num == OVER_MAX_DBS_IN_EVENT_MTS ? + all_db : mts_dbs.name[i], rli, &mts_assigned_partitions[i], /* - todo: optimize it. Although pure + todo: optimize it. Although pure rows- event load in insensetive to the flag value */ TRUE, @@ -2811,31 +2855,31 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) return ret_worker; } // all temporary tables are transferred from Coordinator in over-max case - DBUG_ASSERT(num_dbs != OVER_MAX_DBS_IN_EVENT_MTS || !thd->temporary_tables); - DBUG_ASSERT(!strcmp(mts_assigned_partitions[i]->db, *ref_cur_db)); + DBUG_ASSERT(mts_dbs.num != OVER_MAX_DBS_IN_EVENT_MTS || !thd->temporary_tables); + DBUG_ASSERT(!strcmp(mts_assigned_partitions[i]->db, + mts_dbs.num != OVER_MAX_DBS_IN_EVENT_MTS ? + mts_dbs.name[i] : all_db)); DBUG_ASSERT(ret_worker == mts_assigned_partitions[i]->worker); DBUG_ASSERT(mts_assigned_partitions[i]->usage >= 0); - - i++; - } while (it++); + } if ((ptr_group= gaq->get_job_group(rli->gaq->assigned_group_index))-> worker_id == MTS_WORKER_UNDEF) { ptr_group->worker_id= ret_worker->id; - + DBUG_ASSERT(ptr_group->group_relay_log_name == NULL); } - DBUG_ASSERT(i == num_dbs || num_dbs == OVER_MAX_DBS_IN_EVENT_MTS); + DBUG_ASSERT(i == mts_dbs.num || mts_dbs.num == OVER_MAX_DBS_IN_EVENT_MTS); } - else + else { // a mini-group internal "regular" event if (rli->last_assigned_worker) { ret_worker= rli->last_assigned_worker; - + DBUG_ASSERT(rli->curr_group_assigned_parts.elements > 0 || ret_worker->id == 0); } @@ -2846,12 +2890,12 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) if (!(get_type_code() == INTVAR_EVENT || get_type_code() == RAND_EVENT || get_type_code() == USER_VAR_EVENT || - get_type_code() == ROWS_QUERY_LOG_EVENT || get_type_code() == BEGIN_LOAD_QUERY_EVENT || - get_type_code() == APPEND_BLOCK_EVENT)) + get_type_code() == APPEND_BLOCK_EVENT || + is_ignorable_event())) { DBUG_ASSERT(!ret_worker); - + llstr(rli->get_event_relay_log_pos(), llbuff); my_error(ER_MTS_CANT_PARALLEL, MYF(0), get_type_str(), rli->get_event_relay_log_name(), llbuff, @@ -2862,7 +2906,7 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) } insert_dynamic(&rli->curr_group_da, (uchar*) &ptr_curr_ev); - + DBUG_ASSERT(!ret_worker); return ret_worker; } @@ -2899,10 +2943,10 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) ptr_group= gaq->get_job_group(rli->gaq->assigned_group_index); DBUG_ASSERT(ret_worker != NULL); - + /* The following two blocks are executed if the worker has not been - notified about new relay-log or a new checkpoints. + notified about new relay-log or a new checkpoints. Relay-log string is freed by Coordinator, Worker deallocates strings in the checkpoint block. However if the worker exits earlier reclaiming for both happens anyway at @@ -2946,16 +2990,22 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli) ptr_group->checkpoint_seqno= rli->checkpoint_seqno; ptr_group->ts= when.tv_sec + (time_t) exec_time; // Seconds_behind_master related rli->checkpoint_seqno++; - - // reclaiming resources allocated during the group scheduling - free_root(&rli->mts_coor_mem_root, MYF(MY_KEEP_PREALLOC)); + /* + Coordinator should not use the main memroot however its not + reset elsewhere either, so let's do it safe way. + The main mem root is also reset by the SQL thread in at the end + of applying which Coordinator does not do in this case. + That concludes the memroot reset can't harm anything in SQL thread roles + after Coordinator has finished its current scheduling. + */ + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); #ifndef DBUG_OFF w_rr++; #endif } - + return ret_worker; } @@ -4555,6 +4605,7 @@ static bool is_silent_error(THD* thd) int Query_log_event::do_apply_event(Relay_log_info const *rli, const char *query_arg, uint32 q_len_arg) { + DBUG_ENTER("Query_log_event::do_apply_event"); int expected_error,actual_error= 0; HA_CREATE_INFO db_options; @@ -4637,7 +4688,6 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli, ::do_apply_event(), then the companion SET also have so we don't need to reset_one_shot_variables(). */ - if (is_trans_keyword() || rpl_filter->db_ok(thd->db)) { thd->set_time(&when); thd->set_query_and_id((char*)query_arg, q_len_arg, @@ -4882,11 +4932,22 @@ Default database: '%s'. Query: '%s'", ignored_error_code(actual_error)) { DBUG_PRINT("info",("error ignored")); - if (log_warnings > 1 && ignored_error_code(actual_error)) + if (actual_error && log_warnings > 1 && ignored_error_code(actual_error)) { - rli->report(WARNING_LEVEL, actual_error, - "Could not execute %s event. Detailed error: %s;", - get_type_str(), thd->get_stmt_da()->message()); + if (actual_error == ER_SLAVE_IGNORED_TABLE) + { + if (!slave_ignored_err_throttle.log(thd)) + rli->report(WARNING_LEVEL, actual_error, + "Could not execute %s event. Detailed error: %s;" + " Error log throttle is enabled. This error will not be" + " displayed for next %lu secs. It will be suppressed", + get_type_str(), thd->get_stmt_da()->message(), + (window_size / 1000000)); + } + else + rli->report(WARNING_LEVEL, actual_error, + "Could not execute %s event. Detailed error: %s;", + get_type_str(), thd->get_stmt_da()->message()); } clear_all_errors(thd, const_cast<Relay_log_info*>(rli)); thd->killed= THD::NOT_KILLED; @@ -4984,7 +5045,7 @@ end: thd->first_successful_insert_id_in_prev_stmt= 0; thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt= 0; free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); - return thd->is_slave_error; + DBUG_RETURN(thd->is_slave_error); } int Query_log_event::do_update_pos(Relay_log_info *rli) @@ -5110,8 +5171,19 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info) my_b_printf(head,"RESET CONNECTION%s\n", print_event_info->delimiter); #else my_b_printf(head,"ROLLBACK%s\n", print_event_info->delimiter); + if (print_event_info->is_gtid_next_set) + print_event_info->is_gtid_next_valid= false; #endif } + // set gtid_next=automatic if we have previously set it to uuid:number + if (!print_event_info->is_gtid_next_valid) + { + my_b_printf(head, "%sAUTOMATIC'%s\n", + Gtid_log_event::SET_STRING_PREFIX, + print_event_info->delimiter); + print_event_info->is_gtid_next_set= false; + print_event_info->is_gtid_next_valid= true; + } if (temp_buf && print_event_info->base64_output_mode != BASE64_OUTPUT_NEVER && !print_event_info->short_form) @@ -5129,11 +5201,17 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info) Start_log_event_v3::Start_log_event_v3() */ -Start_log_event_v3::Start_log_event_v3(const char* buf, +Start_log_event_v3::Start_log_event_v3(const char* buf, uint event_len, const Format_description_log_event *description_event) - :Log_event(buf, description_event) + :Log_event(buf, description_event), binlog_version(BINLOG_VERSION) { + if (event_len < (uint)description_event->common_header_len + + ST_COMMON_HEADER_LEN_OFFSET) + { + server_version[0]= 0; + return; + } buf+= description_event->common_header_len; binlog_version= uint2korr(buf+ST_BINLOG_VER_OFFSET); memcpy(server_version, buf+ST_SERVER_VER_OFFSET, @@ -5435,10 +5513,13 @@ Format_description_log_event(const char* buf, const Format_description_log_event* description_event) - :Start_log_event_v3(buf, description_event), event_type_permutation(0) + :Start_log_event_v3(buf, event_len, description_event), + common_header_len(0), post_header_len(NULL), event_type_permutation(0) { ulong ver_calc; DBUG_ENTER("Format_description_log_event::Format_description_log_event(char*,...)"); + if (!Start_log_event_v3::is_valid()) + DBUG_VOID_RETURN; /* sanity check */ buf+= LOG_EVENT_MINIMAL_HEADER_LEN; if ((common_header_len=buf[ST_COMMON_HEADER_LEN_OFFSET]) < OLD_HEADER_LEN) DBUG_VOID_RETURN; /* sanity check */ @@ -5547,7 +5628,7 @@ Format_description_log_event(const char* buf, post_header_len= NULL; DBUG_VOID_RETURN; } - static const uint8 perm[23]= + static const uint8 perm[EVENT_TYPE_PERMUTATION_NUM]= { UNKNOWN_EVENT, START_EVENT_V3, QUERY_EVENT, STOP_EVENT, ROTATE_EVENT, INTVAR_EVENT, LOAD_EVENT, SLAVE_EVENT, CREATE_FILE_EVENT, @@ -5568,10 +5649,10 @@ Format_description_log_event(const char* buf, Since we use (permuted) event id's to index the post_header_len array, we need to permute the post_header_len array too. */ - uint8 post_header_len_temp[23]; - for (int i= 1; i < 23; i++) + uint8 post_header_len_temp[EVENT_TYPE_PERMUTATION_NUM]; + for (uint i= 1; i < EVENT_TYPE_PERMUTATION_NUM; i++) post_header_len_temp[perm[i] - 1]= post_header_len[i - 1]; - for (int i= 0; i < 22; i++) + for (uint i= 0; i < EVENT_TYPE_PERMUTATION_NUM - 1; i++) post_header_len[i] = post_header_len_temp[i]; } DBUG_VOID_RETURN; @@ -5653,7 +5734,8 @@ int Format_description_log_event::do_apply_event(Relay_log_info const *rli) original place when it comes to us; we'll know this by checking log_pos ("artificial" events have log_pos == 0). */ - if (!is_artificial_event() && created && thd->transaction.all.ha_list) + if (!thd->rli_fake && !is_artificial_event() && created + && thd->transaction.all.ha_list) { /* This is not an error (XA is safe), just an information */ rli->report(INFORMATION_LEVEL, 0, @@ -5816,7 +5898,7 @@ uint Load_log_event::get_query_buffer_length() return //the DB name may double if we escape the quote character 5 + 2*db_len + 3 + - 18 + fname_len + 2 + // "LOAD DATA INFILE 'file''" + 18 + fname_len*4 + 2 + // "LOAD DATA INFILE 'file''" 11 + // "CONCURRENT " 7 + // LOCAL 9 + // " REPLACE or IGNORE " @@ -5862,9 +5944,9 @@ void Load_log_event::print_query(bool need_db, const char *cs, char *buf, if (check_fname_outside_temp_buf()) pos= strmov(pos, "LOCAL "); - pos= strmov(pos, "INFILE '"); - memcpy(pos, fname, fname_len); - pos= strmov(pos+fname_len, "' "); + pos= strmov(pos, "INFILE "); + pos= pretty_print_str(pos, fname, fname_len); + pos= strmov(pos, " "); if (sql_ex.opt_flags & REPLACE_FLAG) pos= strmov(pos, "REPLACE "); @@ -6800,10 +6882,18 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli) 5.0.0, there also are some rotates from the slave itself, in the relay log, which shall not change the group positions. */ + + /* + The way we check if SQL thread is currently in a group is different + for STS and MTS. + */ + bool in_group = rli->is_parallel_exec() ? + (rli->mts_group_status == Relay_log_info::MTS_IN_GROUP) : + rli->is_in_group(); + if ((server_id != ::server_id || rli->replicate_same_server_id) && !is_relay_log_event() && - ((!rli->is_parallel_exec() && !rli->is_in_group()) || - rli->mts_group_status != Relay_log_info::MTS_IN_GROUP)) + !in_group) { if (rli->is_parallel_exec()) { @@ -6839,7 +6929,8 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli) (ulong) rli->get_group_master_log_pos())); mysql_mutex_unlock(&rli->data_lock); if (rli->is_parallel_exec()) - rli->reset_notified_checkpoint(0, when.tv_sec + (time_t) exec_time, + rli->reset_notified_checkpoint(0, + server_id ? when.tv_sec + (time_t) exec_time : 0, true/*need_data_lock=true*/); /* @@ -7277,6 +7368,8 @@ bool Xid_log_event::do_commit(THD *thd) int Xid_log_event::do_apply_event_worker(Slave_worker *w) { int error= 0; + lex_start(thd); + mysql_reset_thd_for_next_command(thd); Slave_committed_queue *coordinator_gaq= w->c_rli->gaq; /* For a slave Xid_log_event is COMMIT */ @@ -7315,13 +7408,26 @@ int Xid_log_event::do_apply_event_worker(Slave_worker *w) DBUG_SUICIDE();); error= do_commit(thd); + if (error) + w->rollback_positions(ptr_group); err: return error; } int Xid_log_event::do_apply_event(Relay_log_info const *rli) { + DBUG_ENTER("Xid_log_event::do_apply_event"); int error= 0; + char saved_group_master_log_name[FN_REFLEN]; + char saved_group_relay_log_name[FN_REFLEN]; + volatile my_off_t saved_group_master_log_pos; + volatile my_off_t saved_group_relay_log_pos; + + char new_group_master_log_name[FN_REFLEN]; + char new_group_relay_log_name[FN_REFLEN]; + volatile my_off_t new_group_master_log_pos; + volatile my_off_t new_group_relay_log_pos; + lex_start(thd); mysql_reset_thd_for_next_command(thd); Relay_log_info *rli_ptr= const_cast<Relay_log_info *>(rli); @@ -7332,6 +7438,17 @@ int Xid_log_event::do_apply_event(Relay_log_info const *rli) mysql_mutex_lock(&rli_ptr->data_lock); + /* + Save the rli positions. We need them to temporarily reset the positions + just before the commit. + */ + strmake(saved_group_master_log_name, rli_ptr->get_group_master_log_name(), + FN_REFLEN - 1); + saved_group_master_log_pos= rli_ptr->get_group_master_log_pos(); + strmake(saved_group_relay_log_name, rli_ptr->get_group_relay_log_name(), + FN_REFLEN - 1); + saved_group_relay_log_pos= rli_ptr->get_group_relay_log_pos(); + DBUG_PRINT("info", ("do_apply group master %s %llu group relay %s %llu event %s %llu\n", rli_ptr->get_group_master_log_name(), rli_ptr->get_group_master_log_pos(), @@ -7355,17 +7472,25 @@ int Xid_log_event::do_apply_event(Relay_log_info const *rli) if (log_pos) // 3.23 binlogs don't have log_posx rli_ptr->set_group_master_log_pos(log_pos); - - if ((error= rli_ptr->flush_info(rli_ptr->is_transactional()))) - goto err; + + /* + rli repository being transactional means replication is crash safe. + Positions are written into transactional tables ahead of commit and the + changes are made permanent during commit. + */ + if (rli_ptr->is_transactional()) + { + if ((error= rli_ptr->flush_info(true))) + goto err; + } DBUG_PRINT("info", ("do_apply group master %s %llu group relay %s %llu event %s %llu\n", - rli_ptr->get_group_master_log_name(), - rli_ptr->get_group_master_log_pos(), - rli_ptr->get_group_relay_log_name(), - rli_ptr->get_group_relay_log_pos(), - rli_ptr->get_event_relay_log_name(), - rli_ptr->get_event_relay_log_pos())); + rli_ptr->get_group_master_log_name(), + rli_ptr->get_group_master_log_pos(), + rli_ptr->get_group_relay_log_name(), + rli_ptr->get_group_relay_log_pos(), + rli_ptr->get_event_relay_log_name(), + rli_ptr->get_event_relay_log_pos())); DBUG_EXECUTE_IF("crash_after_update_pos_before_apply", sql_print_information("Crashing crash_after_update_pos_before_apply."); @@ -7381,16 +7506,76 @@ int Xid_log_event::do_apply_event(Relay_log_info const *rli) { thd->transaction.xid_state.xa_state = XA_IDLE; }); + + /* + Save the new rli positions. These positions will be set back to group* + positions on successful completion of the commit operation. + */ + strmake(new_group_master_log_name, rli_ptr->get_group_master_log_name(), + FN_REFLEN - 1); + new_group_master_log_pos= rli_ptr->get_group_master_log_pos(); + strmake(new_group_relay_log_name, rli_ptr->get_group_relay_log_name(), + FN_REFLEN - 1); + new_group_relay_log_pos= rli_ptr->get_group_relay_log_pos(); + /* + Rollback positions in memory just before commit. Position values will be + reset to their new values only on successful commit operation. + */ + rli_ptr->set_group_master_log_name(saved_group_master_log_name); + rli_ptr->notify_group_master_log_name_update(); + rli_ptr->set_group_master_log_pos(saved_group_master_log_pos); + rli_ptr->set_group_relay_log_name(saved_group_relay_log_name); + rli_ptr->notify_group_relay_log_name_update(); + rli_ptr->set_group_relay_log_pos(saved_group_relay_log_pos); + + DBUG_PRINT("info", ("Rolling back to group master %s %llu group relay %s" + " %llu\n", rli_ptr->get_group_master_log_name(), + rli_ptr->get_group_master_log_pos(), + rli_ptr->get_group_relay_log_name(), + rli_ptr->get_group_relay_log_pos())); + mysql_mutex_unlock(&rli_ptr->data_lock); error= do_commit(thd); - if(error) + mysql_mutex_lock(&rli_ptr->data_lock); + if (error) + { rli->report(ERROR_LEVEL, thd->get_stmt_da()->sql_errno(), "Error in Xid_log_event: Commit could not be completed, '%s'", thd->get_stmt_da()->message()); + } + else + { + DBUG_EXECUTE_IF("crash_after_commit_before_update_pos", + sql_print_information("Crashing " + "crash_after_commit_before_update_pos."); + DBUG_SUICIDE();); + /* Update positions on successful commit */ + rli_ptr->set_group_master_log_name(new_group_master_log_name); + rli_ptr->notify_group_master_log_name_update(); + rli_ptr->set_group_master_log_pos(new_group_master_log_pos); + rli_ptr->set_group_relay_log_name(new_group_relay_log_name); + rli_ptr->notify_group_relay_log_name_update(); + rli_ptr->set_group_relay_log_pos(new_group_relay_log_pos); + + DBUG_PRINT("info", ("Updating positions on succesful commit to group master" + " %s %llu group relay %s %llu\n", + rli_ptr->get_group_master_log_name(), + rli_ptr->get_group_master_log_pos(), + rli_ptr->get_group_relay_log_name(), + rli_ptr->get_group_relay_log_pos())); + + /* + For transactional repository the positions are flushed ahead of commit. + Where as for non transactional rli repository the positions are flushed + only on succesful commit. + */ + if (!rli_ptr->is_transactional()) + rli_ptr->flush_info(false); + } err: mysql_cond_broadcast(&rli_ptr->data_cond); mysql_mutex_unlock(&rli_ptr->data_lock); - return error; + DBUG_RETURN(error); } Log_event::enum_skip_reason @@ -8873,9 +9058,9 @@ void Execute_load_query_log_event::print(FILE* file, if (local_fname) { my_b_write(head, (uchar*) query, fn_pos_start); - my_b_printf(head, " LOCAL INFILE \'"); - my_b_printf(head, "%s", local_fname); - my_b_printf(head, "\'"); + my_b_printf(head, " LOCAL INFILE "); + pretty_print_str(head, local_fname, strlen(local_fname)); + if (dup_handling == LOAD_DUP_REPLACE) my_b_printf(head, " REPLACE"); my_b_printf(head, " INTO"); @@ -9152,7 +9337,8 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, const Table_id& tid m_rows_buf(0), m_rows_cur(0), m_rows_end(0), m_flags(0), m_type(event_type), m_extra_row_data(0) #ifdef HAVE_REPLICATION - , m_curr_row(NULL), m_curr_row_end(NULL), m_key(NULL), last_hashed_key(NULL) + , m_curr_row(NULL), m_curr_row_end(NULL), m_key(NULL), m_key_info(NULL), + m_distinct_keys(Key_compare(&m_key_info)), m_distinct_key_spare_buf(NULL) #endif { DBUG_ASSERT(tbl_arg && tbl_arg->s && tid.is_valid()); @@ -9214,7 +9400,8 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, m_table_id(0), m_rows_buf(0), m_rows_cur(0), m_rows_end(0), m_extra_row_data(0) #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - , m_curr_row(NULL), m_curr_row_end(NULL), m_key(NULL), last_hashed_key(NULL) + , m_curr_row(NULL), m_curr_row_end(NULL), m_key(NULL), m_key_info(NULL), + m_distinct_keys(Key_compare(&m_key_info)), m_distinct_key_spare_buf(NULL) #endif { DBUG_ENTER("Rows_log_event::Rows_log_event(const char*,...)"); @@ -9454,8 +9641,31 @@ int Rows_log_event::do_add_row_data(uchar *row_data, size_t length) if (static_cast<size_t>(m_rows_end - m_rows_cur) <= length) { size_t const block_size= 1024; - my_ptrdiff_t const cur_size= m_rows_cur - m_rows_buf; - my_ptrdiff_t const new_alloc= + ulong cur_size= m_rows_cur - m_rows_buf; + DBUG_EXECUTE_IF("simulate_too_big_row_case1", + cur_size= UINT_MAX32 - (block_size * 10); + length= UINT_MAX32 - (block_size * 10);); + DBUG_EXECUTE_IF("simulate_too_big_row_case2", + cur_size= UINT_MAX32 - (block_size * 10); + length= block_size * 10;); + DBUG_EXECUTE_IF("simulate_too_big_row_case3", + cur_size= block_size * 10; + length= UINT_MAX32 - (block_size * 10);); + DBUG_EXECUTE_IF("simulate_too_big_row_case4", + cur_size= UINT_MAX32 - (block_size * 10); + length= (block_size * 10) - block_size + 1;); + ulong remaining_space= UINT_MAX32 - cur_size; + /* Check that the new data fits within remaining space and we can add + block_size without wrapping. + */ + if (length > remaining_space || + ((length + block_size) > remaining_space)) + { + sql_print_error("The row data is greater than 4GB, which is too big to " + "write to the binary log."); + DBUG_RETURN(ER_BINLOG_ROW_LOGGING_FAILED); + } + ulong const new_alloc= block_size * ((cur_size + length + block_size - 1) / block_size); // Allocate one extra byte, in case we have to do uint3korr! @@ -9726,6 +9936,7 @@ Rows_log_event::decide_row_lookup_algorithm_and_key() MY_BITMAP *cols= &this->m_cols; this->m_rows_lookup_algorithm= ROW_LOOKUP_NOT_NEEDED; this->m_key_index= MAX_KEY; + this->m_key_info= NULL; if (event_type == WRITE_ROWS_EVENT) // row lookup not needed DBUG_VOID_RETURN; @@ -9755,6 +9966,8 @@ TABLE_OR_INDEX_HASH_SCAN: /* search for a key to see if we can narrow the lookup domain further. */ this->m_key_index= search_key_in_table(table, cols, (PRI_KEY_FLAG | UNIQUE_KEY_FLAG | MULTIPLE_KEY_FLAG)); this->m_rows_lookup_algorithm= ROW_LOOKUP_HASH_SCAN; + if (m_key_index < MAX_KEY) + m_distinct_key_spare_buf= (uchar*) thd->alloc(table->key_info[m_key_index].key_length); DBUG_PRINT("info", ("decide_row_lookup_algorithm_and_key: decided - HASH_SCAN")); goto end; @@ -9778,6 +9991,15 @@ TABLE_OR_INDEX_FULL_SCAN: } end: + + /* m_key_index is ready, set m_key_info now. */ + m_key_info= m_table->key_info + m_key_index; + /* + m_key_info will influence key comparison code in HASH_SCAN mode, + so the m_distinct_keys set should still be empty. + */ + DBUG_ASSERT(m_distinct_keys.empty()); + #ifndef DBUG_OFF const char* s= ((m_rows_lookup_algorithm == Rows_log_event::ROW_LOOKUP_TABLE_SCAN) ? "TABLE_SCAN" : ((m_rows_lookup_algorithm == Rows_log_event::ROW_LOOKUP_HASH_SCAN) ? "HASH_SCAN" : @@ -9867,6 +10089,7 @@ Rows_log_event::row_operations_scan_and_key_teardown(int error) my_free(m_key); // Free for multi_malloc m_key= NULL; m_key_index= MAX_KEY; + m_key_info= NULL; } goto err; } @@ -10091,7 +10314,6 @@ int Rows_log_event::do_apply_row(Relay_log_info const *rli) /** Does the cleanup - - deallocates all the elements in m_distinct_key_list if any - closes the index if opened by open_record_scan - closes the table if opened for scanning. */ @@ -10106,15 +10328,6 @@ Rows_log_event::close_record_scan() { if (m_table->file->inited) error= m_table->file->ha_index_end(); - - if(m_rows_lookup_algorithm == ROW_LOOKUP_HASH_SCAN) - { - uchar *key_val; - /* free the allocated memory for each key values */ - List_iterator_fast<uchar> it(m_distinct_key_list); - while((key_val= it++) && (key_val)) - my_free(key_val); - } } else if (m_table->file->inited) error= m_table->file->ha_rnd_end(); @@ -10146,7 +10359,6 @@ Rows_log_event::next_record_scan(bool first_read) error= table->file->ha_rnd_next(table->record[0]); else { - KEY *keyinfo= m_table->key_info + m_key_index; /* We need to set the null bytes to ensure that the filler bit are all set when returning. There are storage engines that just set @@ -10173,10 +10385,14 @@ Rows_log_event::next_record_scan(bool first_read) list. */ if ((error) || - (key_cmp(keyinfo->key_part, m_key, keyinfo->key_length) != 0)) + (key_cmp(m_key_info->key_part, m_key, m_key_info->key_length) != 0)) { - if ((m_key= m_itr++)) + if (m_itr != m_distinct_keys.end()) + { + m_key= *m_itr; + m_itr++; first_read= true; + } else error= HA_ERR_KEY_NOT_FOUND; } @@ -10198,7 +10414,7 @@ Rows_log_event::next_record_scan(bool first_read) /** Initializes scanning of rows. Opens an index and initializes an iterator - over a list of distinct keys (m_distinct_key_list) if it is a HASH_SCAN + over a list of distinct keys (m_distinct_keys) if it is a HASH_SCAN over an index or the table if its a HASH_SCAN over the table. */ int @@ -10210,21 +10426,21 @@ Rows_log_event::open_record_scan() if (m_key_index < MAX_KEY ) { - KEY *keyinfo= m_table->key_info + m_key_index; if(m_rows_lookup_algorithm == ROW_LOOKUP_HASH_SCAN) { /* initialize the iterator over the list of distinct keys that we have */ - m_itr.init(m_distinct_key_list); + m_itr= m_distinct_keys.begin(); /* get the first element from the list of keys and increment the iterator */ - m_key= m_itr++; + m_key= *m_itr; + m_itr++; } else { /* this is an INDEX_SCAN we need to store the key in m_key */ DBUG_ASSERT((m_rows_lookup_algorithm == ROW_LOOKUP_INDEX_SCAN) && m_key); - key_copy(m_key, m_table->record[0], keyinfo, 0); + key_copy(m_key, m_table->record[0], m_key_info, 0); } /* @@ -10247,7 +10463,7 @@ Rows_log_event::open_record_scan() trigger false warnings. */ #ifndef HAVE_purify - DBUG_DUMP("key data", m_key, keyinfo->key_length); + DBUG_DUMP("key data", m_key, m_key_info->key_length); #endif } else @@ -10265,7 +10481,7 @@ end: } /** - Populates the m_distinct_key_list with unique keys to be modified + Populates the m_distinct_keys with unique keys to be modified during HASH_SCAN over keys. @return_value -0 success -Err_code @@ -10274,29 +10490,21 @@ int Rows_log_event::add_key_to_distinct_keyset() { int error= 0; - bool distinct= true; DBUG_ENTER("Rows_log_event::add_key_to_distinct_keyset"); DBUG_ASSERT(m_key_index < MAX_KEY); - KEY *cur_key_info= m_table->key_info + m_key_index; - - if ((last_hashed_key)) - distinct= key_cmp(cur_key_info->key_part, last_hashed_key, - cur_key_info->key_length); - - if (distinct) + key_copy(m_distinct_key_spare_buf, m_table->record[0], m_key_info, 0); + std::pair<std::set<uchar *, Key_compare>::iterator,bool> ret= + m_distinct_keys.insert(m_distinct_key_spare_buf); + if (ret.second) { - uchar *cur_key= (uchar *)my_malloc(cur_key_info->key_length, - MYF(MY_WME)); - if (!cur_key ) + /* Insert is successful, so allocate a new buffer for next key */ + m_distinct_key_spare_buf= (uchar*) thd->alloc(m_key_info->key_length); + if (!m_distinct_key_spare_buf) { error= HA_ERR_OUT_OF_MEM; goto err; } - m_distinct_key_list.push_back(cur_key); - last_hashed_key= cur_key; - key_copy(cur_key, m_table->record[0], cur_key_info, 0); } - err: DBUG_RETURN(error); } @@ -10307,8 +10515,6 @@ int Rows_log_event::do_index_scan_and_update(Relay_log_info const *rli) DBUG_ENTER("Rows_log_event::do_index_scan_and_update"); DBUG_ASSERT(m_table && m_table->in_use != NULL); - KEY *keyinfo= NULL; - TABLE *table= m_table; int error= 0; const uchar *saved_m_curr_row= m_curr_row; @@ -10319,7 +10525,7 @@ int Rows_log_event::do_index_scan_and_update(Relay_log_info const *rli) Todo: fix wl3228 hld that requires defaults for all types of events */ - prepare_record(table, &m_cols, FALSE); + prepare_record(m_table, &m_cols, FALSE); if ((error= unpack_current_row(rli, &m_cols))) goto end; @@ -10342,14 +10548,14 @@ int Rows_log_event::do_index_scan_and_update(Relay_log_info const *rli) #ifndef DBUG_OFF DBUG_PRINT("info",("looking for the following record")); - DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + DBUG_DUMP("record[0]", m_table->record[0], m_table->s->reclength); #endif if (m_key_index != m_table->s->primary_key) /* we dont have a PK, or PK is not usable */ goto INDEX_SCAN; - if ((table->file->ha_table_flags() & HA_READ_BEFORE_WRITE_REMOVAL)) + if ((m_table->file->ha_table_flags() & HA_READ_BEFORE_WRITE_REMOVAL)) { /* Read removal is possible since the engine supports write without @@ -10362,12 +10568,12 @@ int Rows_log_event::do_index_scan_and_update(Relay_log_info const *rli) Tell the handler to ignore if key exists or not, since it's not yet known if the key does exist(when using rbwr) */ - table->file->extra(HA_EXTRA_IGNORE_NO_KEY); + m_table->file->extra(HA_EXTRA_IGNORE_NO_KEY); goto end; } - if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION)) + if ((m_table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION)) { /* Use a more efficient method to fetch the record given by @@ -10389,15 +10595,15 @@ int Rows_log_event::do_index_scan_and_update(Relay_log_info const *rli) */ DBUG_PRINT("info",("locating record using primary key (position)")); - if (table->file->inited && (error= table->file->ha_index_end())) + if (m_table->file->inited && (error= m_table->file->ha_index_end())) goto end; - if ((error= table->file->ha_rnd_init(FALSE))) + if ((error= m_table->file->ha_rnd_init(FALSE))) goto end; - error= table->file->rnd_pos_by_record(table->record[0]); + error= m_table->file->rnd_pos_by_record(m_table->record[0]); - table->file->ha_rnd_end(); + m_table->file->ha_rnd_end(); if (error) { DBUG_PRINT("info",("rnd_pos returns error %d",error)); @@ -10413,7 +10619,6 @@ int Rows_log_event::do_index_scan_and_update(Relay_log_info const *rli) INDEX_SCAN: /* Use the m_key_index'th key */ - keyinfo= table->key_info + m_key_index; if ((error= open_record_scan())) goto end; @@ -10434,7 +10639,7 @@ INDEX_SCAN: */ #ifndef HAVE_purify DBUG_PRINT("info",("found first matching record")); - DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + DBUG_DUMP("record[0]", m_table->record[0], m_table->s->reclength); #endif /* Below is a minor "optimization". If the key (i.e., key number @@ -10450,10 +10655,10 @@ INDEX_SCAN: found. I can see no scenario where it would be incorrect to chose the row to change only using a PK or an UNNI. */ - if (keyinfo->flags & HA_NOSAME || m_key_index == table->s->primary_key) + if (m_key_info->flags & HA_NOSAME || m_key_index == m_table->s->primary_key) { /* Unique does not have non nullable part */ - if (!(keyinfo->flags & (HA_NULL_PART_KEY))) + if (!(m_key_info->flags & (HA_NULL_PART_KEY))) goto end; // record found else { @@ -10462,10 +10667,10 @@ INDEX_SCAN: BI image that is null and part of UNNI. */ bool null_found= FALSE; - for (uint i=0; i < keyinfo->user_defined_key_parts && !null_found; i++) + for (uint i=0; i < m_key_info->user_defined_key_parts && !null_found; i++) { - uint fieldnr= keyinfo->key_part[i].fieldnr - 1; - Field **f= table->field+fieldnr; + uint fieldnr= m_key_info->key_part[i].fieldnr - 1; + Field **f= m_table->field+fieldnr; null_found= (*f)->is_null(); } @@ -10483,7 +10688,7 @@ INDEX_SCAN: */ DBUG_PRINT("info",("non-unique index, scanning it to find matching record")); - while (record_compare(table, &m_cols)) + while (record_compare(m_table, &m_cols)) { while((error= next_record_scan(false))) { @@ -10500,7 +10705,7 @@ end: DBUG_ASSERT(error != HA_ERR_RECORD_DELETED); if (error && error != HA_ERR_RECORD_DELETED) - table->file->print_error(error, MYF(0)); + m_table->file->print_error(error, MYF(0)); else error= do_apply_row(rli); @@ -10520,7 +10725,7 @@ end: m_curr_row= m_curr_row_end; unpack_current_row(rli, &m_cols); } - table->default_column_bitmaps(); + m_table->default_column_bitmaps(); DBUG_RETURN(error); } @@ -10812,6 +11017,7 @@ int Rows_log_event::do_table_scan_and_update(Relay_log_info const *rli) /* Continue until we find the right record or have made a full loop */ do { + restart_ha_rnd_next: error= m_table->file->ha_rnd_next(m_table->record[0]); if (error) DBUG_PRINT("info", ("error: %s", HA_ERR(error))); @@ -10819,11 +11025,16 @@ int Rows_log_event::do_table_scan_and_update(Relay_log_info const *rli) case HA_ERR_END_OF_FILE: // restart scan from top if (++restart_count < 2) - error= m_table->file->ha_rnd_init(1); + { + if ((error= m_table->file->ha_rnd_init(1))) + goto end; + goto restart_ha_rnd_next; + } break; case HA_ERR_RECORD_DELETED: // fetch next + goto restart_ha_rnd_next; case 0: // we're good, check if record matches break; @@ -10833,9 +11044,7 @@ int Rows_log_event::do_table_scan_and_update(Relay_log_info const *rli) goto end; } } - while ((error == HA_ERR_END_OF_FILE && restart_count < 2) || - (error == HA_ERR_RECORD_DELETED) || - (!error && record_compare(m_table, &m_cols))); + while (restart_count < 2 && record_compare(m_table, &m_cols)); } end: @@ -11051,6 +11260,14 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) DBUG_PRINT("debug", ("m_table: 0x%lx, m_table_id: %llu", (ulong) m_table, m_table_id.id())); + /* + A row event comprising of a P_S table + - should not be replicated (i.e executed) by the slave SQL thread. + - should not be executed by the client in the form BINLOG '...' stmts. + */ + if (table && table->s->table_category == TABLE_CATEGORY_PERFORMANCE) + table= NULL; + if (table) { /* @@ -11117,10 +11334,14 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) /* Bug#56662 Assertion failed: next_insert_id == 0, file handler.cc Don't allow generation of auto_increment value when processing - rows event by setting 'MODE_NO_AUTO_VALUE_ON_ZERO'. + rows event by setting 'MODE_NO_AUTO_VALUE_ON_ZERO'. The exception + to this rule happens when the auto_inc column exists on some + extra columns on the slave. In that case, do not force + MODE_NO_AUTO_VALUE_ON_ZERO. */ ulong saved_sql_mode= thd->variables.sql_mode; - thd->variables.sql_mode= MODE_NO_AUTO_VALUE_ON_ZERO; + if (!is_auto_inc_in_extra_columns()) + thd->variables.sql_mode= MODE_NO_AUTO_VALUE_ON_ZERO; // row processing loop @@ -11267,13 +11488,26 @@ AFTER_MAIN_EXEC_ROW_LOOP: DBUG_RETURN(error); } - if (get_flags(STMT_END_F) && (error= rows_event_stmt_cleanup(rli, thd))) + if (get_flags(STMT_END_F)) + { + if((error= rows_event_stmt_cleanup(rli, thd))) slave_rows_error_report(ERROR_LEVEL, thd->is_error() ? 0 : error, rli, thd, table, get_type_str(), const_cast<Relay_log_info*>(rli)->get_rpl_log_name(), (ulong) log_pos); + /* We are at end of the statement (STMT_END_F flag), lets clean + the memory which was used from thd's mem_root now. + This needs to be done only if we are here in SQL thread context. + In other flow ( in case of a regular thread which can happen + when the thread is applying BINLOG'...' row event) we should + *not* try to free the memory here. It will be done latter + in dispatch_command() after command execution is completed. + */ + if (thd->slave_thread) + free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC)); + } DBUG_RETURN(error); } @@ -12249,15 +12483,34 @@ Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability * table->auto_increment_field_not_null and SQL_MODE(if includes * MODE_NO_AUTO_VALUE_ON_ZERO) in update_auto_increment function. * SQL_MODE of slave sql thread is always consistency with master's. - * In RBR, auto_increment fields never are NULL. + * In RBR, auto_increment fields never are NULL, except if the auto_inc + * column exists only on the slave side (i.e., in an extra column + * on the slave's table). */ - m_table->auto_increment_field_not_null= TRUE; + if (!is_auto_inc_in_extra_columns()) + m_table->auto_increment_field_not_null= TRUE; + else + { + /* + Here we have checked that there is an extra field + on this server's table that has an auto_inc column. + + Mark that the auto_increment field is null and mark + the read and write set bits. + + (There can only be one AUTO_INC column, it is always + indexed and it cannot have a DEFAULT value). + */ + m_table->auto_increment_field_not_null= FALSE; + m_table->mark_auto_increment_column(); + } /** Sets it to ROW_LOOKUP_NOT_NEEDED. */ decide_row_lookup_algorithm_and_key(); DBUG_ASSERT(m_rows_lookup_algorithm==ROW_LOOKUP_NOT_NEEDED); + return error; } @@ -12266,6 +12519,19 @@ Write_rows_log_event::do_after_row_operations(const Slave_reporting_capability * int error) { int local_error= 0; + + /** + Clear the write_set bit for auto_inc field that only + existed on the destination table as an extra column. + */ + if (is_auto_inc_in_extra_columns()) + { + bitmap_clear_bit(m_table->write_set, m_table->next_number_field->field_index); + bitmap_clear_bit( m_table->read_set, m_table->next_number_field->field_index); + + if (get_flags(STMT_END_F)) + m_table->file->ha_release_auto_increment(); + } m_table->next_number_field=0; m_table->auto_increment_field_not_null= FALSE; if ((slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT) || @@ -12398,7 +12664,13 @@ Write_rows_log_event::write_row(const Relay_log_info *const rli, m_table->file->ha_start_bulk_insert(estimated_rows); } - + + /* + Explicitly set the auto_inc to null to make sure that + it gets an auto_generated value. + */ + if (is_auto_inc_in_extra_columns()) + m_table->next_number_field->set_null(); #ifndef DBUG_OFF DBUG_DUMP("record[0]", table->record[0], table->s->reclength); @@ -13287,6 +13559,30 @@ int Gtid_log_event::do_apply_event(Relay_log_info const *rli) DBUG_RETURN(1); // out of memory if (thd->owned_gtid.sidno) { + /* + Slave will execute this code if a previous Gtid_log_event was applied + but the GTID wasn't consumed yet (the transaction was not committed + nor rolled back). + On a client session we cannot do consecutive SET GTID_NEXT without + a COMMIT or a ROLLBACK in the middle. + Applying this event without rolling back the current transaction may + lead to problems, as a "BEGIN" event following this GTID will + implicitly commit the "partial transaction" and will consume the + GTID. If this "partial transaction" was left in the relay log by the + IO thread restarting in the middle of a transaction, you could have + the partial transaction being logged with the GTID on the slave, + causing data corruption on replication. + */ + if (thd->transaction.all.ha_list) + { + /* This is not an error (XA is safe), just an information */ + rli->report(INFORMATION_LEVEL, 0, + "Rolling back unfinished transaction (no COMMIT " + "or ROLLBACK in relay log). A probable cause is partial " + "transaction left on relay log because of restarting IO " + "thread with auto-positioning protocol."); + const_cast<Relay_log_info*>(rli)->cleanup_context(thd, 1); + } gtid_rollback(thd); } thd->variables.gtid_next.set(sidno, spec.gtid.gno); @@ -13458,7 +13754,8 @@ st_print_event_info::st_print_event_info() charset_database_number(ILLEGAL_CHARSET_INFO_NUMBER), thread_id(0), thread_id_printed(false), base64_output_mode(BASE64_OUTPUT_UNSPEC), printed_fd_event(FALSE), - have_unflushed_events(FALSE), skipped_event_in_transaction(false) + have_unflushed_events(false), skipped_event_in_transaction(false), + is_gtid_next_set(false), is_gtid_next_valid(true) { /* Currently we only use static PRINT_EVENT_INFO objects, so zeroed at diff --git a/mysql-wsrep-5.6/sql/log_event.h b/mysql-wsrep-5.6/sql/log_event.h index 58665c16..1f1b0ba7 100644 --- a/mysql-wsrep-5.6/sql/log_event.h +++ b/mysql-wsrep-5.6/sql/log_event.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include <my_bitmap.h> #include "rpl_constants.h" #include "table_id.h" +#include <set> #ifdef MYSQL_CLIENT #include "sql_const.h" @@ -45,6 +46,7 @@ #include "sql_class.h" /* THD */ #include "rpl_utility.h" /* Hash_slave_rows */ #include "rpl_filter.h" +#include "key.h" /* key_copy, compare_keys */ #endif /* Forward declarations */ @@ -834,9 +836,36 @@ typedef struct st_print_event_info False, otherwise. */ bool skipped_event_in_transaction; + + /* true if gtid_next is set with a value */ + bool is_gtid_next_set; + + /* + Determines if the current value of gtid_next needs to be restored + to AUTOMATIC if the binary log would end after the current event. + + If the log ends after a transaction, then this should be false. + If the log ends in the middle of a transaction, then this should + be true; this can happen for relay logs where transactions are + split over multiple logs. + + Set to true initially, and after a Gtid_log_event is processed. + Set to false if is_gtid_next_set is true. + */ + bool is_gtid_next_valid; } PRINT_EVENT_INFO; #endif +/* + A specific to the database-scheduled MTS type. +*/ +typedef struct st_mts_db_names +{ + const char *name[MAX_DBS_IN_EVENT_MTS]; + int num; +} Mts_db_names; + + /** @class Log_event @@ -1443,27 +1472,35 @@ private: */ Slave_worker *get_slave_worker(Relay_log_info *rli); - /* - The method returns a list of updated by the event databases. - Other than in the case of Query-log-event the list is just one item. + /** + The method fills in pointers to event's database name c-strings + to a supplied array. + In other than Query-log-event case the returned array contains + just one item. + @param[out] arg pointer to a struct containing char* array + pointers to be filled in and the number + of filled instances. + + @return number of the filled intances indicating how many + databases the event accesses. */ - virtual List<char>* get_mts_dbs(MEM_ROOT *mem_root) + virtual uint8 get_mts_dbs(Mts_db_names *arg) { - List<char> *res= new List<char>; - res->push_back(strdup_root(mem_root, get_db())); - return res; + arg->name[0]= get_db(); + + return arg->num= mts_number_dbs(); } /* Group of events can be marked to force its execution in isolation from any other Workers. - Typically that is done for a transaction that contains + Typically that is done for a transaction that contains a query accessing more than OVER_MAX_DBS_IN_EVENT_MTS databases. Factually that's a sequential mode where a Worker remains to be the applier. */ virtual void set_mts_isolate_group() - { + { DBUG_ASSERT(ends_group() || get_type_code() == QUERY_EVENT || get_type_code() == EXEC_LOAD_EVENT || @@ -2108,17 +2145,21 @@ public: const char* get_db() { return db; } /** - Returns a list of updated databases or the default db single item list - in case of the number of databases exceeds MAX_DBS_IN_EVENT_MTS. + @param[out] arg pointer to a struct containing char* array + pointers be filled in and the number of + filled instances. + In case the number exceeds MAX_DBS_IN_EVENT_MTS, + the overfill is indicated with assigning the number to + OVER_MAX_DBS_IN_EVENT_MTS. + + @return number of databases in the array or OVER_MAX_DBS_IN_EVENT_MTS. */ - virtual List<char>* get_mts_dbs(MEM_ROOT *mem_root) + virtual uint8 get_mts_dbs(Mts_db_names* arg) { - List<char> *res= new (mem_root) List<char>; if (mts_accessed_dbs == OVER_MAX_DBS_IN_EVENT_MTS) { // the empty string db name is special to indicate sequential applying mts_accessed_db_names[0][0]= 0; - res->push_back((char*) mts_accessed_db_names[0]); } else { @@ -2135,11 +2176,10 @@ public: if (strcmp(db_name, db_filtered)) db_name= (char*)db_filtered; } - - res->push_back(db_name); + arg->name[i]= db_name; } } - return res; + return arg->num= mts_accessed_dbs; } void attach_temp_tables_worker(THD*); @@ -2603,14 +2643,14 @@ public: void print(FILE* file, PRINT_EVENT_INFO* print_event_info); #endif - Start_log_event_v3(const char* buf, + Start_log_event_v3(const char* buf, uint event_len, const Format_description_log_event* description_event); ~Start_log_event_v3() {} Log_event_type get_type_code() { return START_EVENT_V3;} #ifdef MYSQL_SERVER bool write(IO_CACHE* file); #endif - bool is_valid() const { return 1; } + bool is_valid() const { return server_version[0] != 0; } int get_data_size() { return START_V3_HEADER_LEN; //no variable-sized part @@ -3334,11 +3374,16 @@ public: #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) virtual uint8 mts_number_dbs() { return OVER_MAX_DBS_IN_EVENT_MTS; } - virtual List<char>* get_mts_dbs(MEM_ROOT *mem_root) + /** + @param[out] arg pointer to a struct containing char* array + pointers be filled in and the number of + filled instances. + + @return number of databases in the array (must be one). + */ + virtual uint8 get_mts_dbs(Mts_db_names *arg) { - List<char> *res= new List<char>; - res->push_back(strdup_root(mem_root, "")); - return res; + return arg->num= mts_number_dbs(); } #endif @@ -3858,19 +3903,26 @@ public: virtual Log_event_type get_type_code() { return TABLE_MAP_EVENT; } virtual bool is_valid() const { return m_memory != NULL; /* we check malloc */ } - virtual int get_data_size() { return (uint) m_data_size; } + virtual int get_data_size() { return (uint) m_data_size; } #ifdef MYSQL_SERVER virtual int save_field_metadata(); virtual bool write_data_header(IO_CACHE *file); virtual bool write_data_body(IO_CACHE *file); virtual const char *get_db() { return m_dbnam; } virtual uint8 mts_number_dbs() - { + { return get_flags(TM_REFERRED_FK_DB_F) ? OVER_MAX_DBS_IN_EVENT_MTS : 1; } - virtual List<char>* get_mts_dbs(MEM_ROOT *mem_root) + /** + @param[out] arg pointer to a struct containing char* array + pointers be filled in and the number of filled instances. + + @return number of databases in the array: either one or + OVER_MAX_DBS_IN_EVENT_MTS, when the Table map event reports + foreign keys constraint. + */ + virtual uint8 get_mts_dbs(Mts_db_names *arg) { - List<char> *res= new List<char>; const char *db_name= get_db(); if (!rpl_filter->is_rewrite_empty() && !get_flags(TM_REFERRED_FK_DB_F)) @@ -3882,9 +3934,10 @@ public: db_name= db_filtered; } - res->push_back(strdup_root(mem_root, - get_flags(TM_REFERRED_FK_DB_F) ? "" : db_name)); - return res; + if (!get_flags(TM_REFERRED_FK_DB_F)) + arg->name[0]= db_name; + + return arg->num= mts_number_dbs(); } #endif @@ -4183,10 +4236,39 @@ protected: const uchar *m_curr_row; /* Start of the row being processed */ const uchar *m_curr_row_end; /* One-after the end of the current row */ uchar *m_key; /* Buffer to keep key value during searches */ - uchar *last_hashed_key; uint m_key_index; - List<uchar> m_distinct_key_list; - List_iterator_fast<uchar> m_itr; + KEY *m_key_info; /* Points to description of index #m_key_index */ + class Key_compare + { +public: + /** + @param ki Where to find KEY description + @note m_distinct_keys is instantiated when Rows_log_event is constructed; it + stores a Key_compare object internally. However at that moment, the + index (KEY*) to use for comparisons, is not yet known. So, at + instantiation, we indicate the Key_compare the place where it can + find the KEY* when needed (this place is Rows_log_event::m_key_info), + Key_compare remembers the place in member m_key_info. + Before we need to do comparisons - i.e. before we need to insert + elements, we update Rows_log_event::m_key_info once for all. + */ + Key_compare(KEY **ki= NULL) : m_key_info(ki) {} + bool operator()(uchar *k1, uchar *k2) const + { + return key_cmp2((*m_key_info)->key_part, + k1, (*m_key_info)->key_length, + k2, (*m_key_info)->key_length) < 0 ; + } +private: + KEY **m_key_info; + }; + std::set<uchar *, Key_compare> m_distinct_keys; + std::set<uchar *, Key_compare>::iterator m_itr; + /** + A spare buffer which will be used when saving the distinct keys + for doing an index scan with HASH_SCAN search algorithm. + */ + uchar *m_distinct_key_spare_buf; // Unpack the current row into m_table->record[0] int unpack_current_row(const Relay_log_info *const rli, @@ -4220,6 +4302,19 @@ protected: */ int row_operations_scan_and_key_teardown(int error); + /** + Helper function to check whether there is an auto increment + column on the table where the event is to be applied. + + @return true if there is an autoincrement field on the extra + columns, false otherwise. + */ + inline bool is_auto_inc_in_extra_columns() + { + DBUG_ASSERT(m_table); + return (m_table->next_number_field && + m_table->next_number_field->field_index >= m_width); + } #endif private: @@ -4331,14 +4426,13 @@ private: /** Initializes scanning of rows. Opens an index and initailizes an iterator - over a list of distinct keys (m_distinct_key_list) if it is a HASH_SCAN + over a list of distinct keys (m_distinct_keys) if it is a HASH_SCAN over an index or the table if its a HASH_SCAN over the table. */ int open_record_scan(); /** Does the cleanup - - deallocates all the elements in m_distinct_key_list if any - closes the index if opened by open_record_scan - closes the table if opened for scanning. */ @@ -4359,7 +4453,7 @@ private: int next_record_scan(bool first_read); /** - Populates the m_distinct_key_list with unique keys to be modified + Populates the m_distinct_keys with unique keys to be modified during HASH_SCAN over keys. @return_value -0 success -Err_code @@ -4963,9 +5057,9 @@ public: /// Return true if this is the last group of the transaction, else false. bool get_commit_flag() const { return commit_flag; } -private: /// string holding the text "SET @@GLOBAL.GTID_NEXT = '" static const char *SET_STRING_PREFIX; +private: /// Length of SET_STRING_PREFIX static const size_t SET_STRING_PREFIX_LENGTH= 26; /// The maximal length of the entire "SET ..." query. @@ -5056,6 +5150,18 @@ public: const Gtid_set::String_format *string_format) const; /// Add all GTIDs from this event to the given Gtid_set. int add_to_set(Gtid_set *gtid_set) const; + /* + Previous Gtid Log events should always be skipped + there is nothing to apply there, whether it is + relay log's (generated on Slave) or it is binary log's + (generated on Master, copied to slave as relay log). + Also, we should not increment slave_skip_counter + for this event, hence return EVENT_SKIP_IGNORE. + */ + enum_skip_reason do_shall_skip(Relay_log_info *rli) + { + return EVENT_SKIP_IGNORE; + } #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) int do_apply_event(Relay_log_info const *rli) { return 0; } diff --git a/mysql-wsrep-5.6/sql/log_event_old.cc b/mysql-wsrep-5.6/sql/log_event_old.cc index 12741038..944d2862 100644 --- a/mysql-wsrep-5.6/sql/log_event_old.cc +++ b/mysql-wsrep-5.6/sql/log_event_old.cc @@ -2455,6 +2455,7 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli) table->file->print_error(error, MYF(0)); DBUG_RETURN(error); } + goto restart_ha_rnd_next; } break; diff --git a/mysql-wsrep-5.6/sql/mysqld.cc b/mysql-wsrep-5.6/sql/mysqld.cc index 2df21f5b..fa686132 100644 --- a/mysql-wsrep-5.6/sql/mysqld.cc +++ b/mysql-wsrep-5.6/sql/mysqld.cc @@ -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 @@ -344,10 +345,6 @@ static PSI_rwlock_key key_rwlock_openssl; #endif #endif /* HAVE_PSI_INTERFACE */ -#ifdef HAVE_NPTL -volatile sig_atomic_t ld_assume_kernel_is_set= 0; -#endif - /** Statement instrumentation key for replication. */ @@ -487,6 +484,9 @@ my_bool opt_master_verify_checksum= 0; my_bool opt_slave_sql_verify_checksum= 1; const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS}; my_bool enforce_gtid_consistency; +my_bool binlog_gtid_simple_recovery; +ulong binlog_error_action; +const char *binlog_error_action_list[]= {"IGNORE_ERROR", "ABORT_SERVER", NullS}; ulong gtid_mode; const char *gtid_mode_names[]= {"OFF", "UPGRADE_STEP_1", "UPGRADE_STEP_2", "ON", NullS}; @@ -708,7 +708,7 @@ SHOW_COMP_OPTION have_profiling; pthread_key(MEM_ROOT**,THR_MALLOC); pthread_key(THD*, THR_THD); mysql_mutex_t LOCK_thread_created; -mysql_mutex_t LOCK_thread_count; +mysql_mutex_t LOCK_thread_count, LOCK_thd_remove; mysql_mutex_t LOCK_status, LOCK_error_log, LOCK_uuid_generator, LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create, @@ -829,6 +829,14 @@ Thread_iterator global_thread_list_end() return global_thread_list->end(); } +void copy_global_thread_list(std::set<THD*> *new_copy) +{ + mysql_mutex_assert_owner(&LOCK_thd_remove); + mysql_mutex_lock(&LOCK_thread_count); + *new_copy= *global_thread_list; + mysql_mutex_unlock(&LOCK_thread_count); +} + void add_global_thread(THD *thd) { DBUG_PRINT("info", ("add_global_thread %p", thd)); @@ -848,8 +856,16 @@ void remove_global_thread(THD *thd) { DBUG_PRINT("info", ("remove_global_thread %p current_linfo %p", thd, thd->current_linfo)); - mysql_mutex_assert_owner(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thd_remove); + mysql_mutex_lock(&LOCK_thread_count); DBUG_ASSERT(thd->release_resources_done()); + /* + Used by binlog_reset_master. It would be cleaner to use + DEBUG_SYNC here, but that's not possible because the THD's debug + sync feature has been shut down at this point. + */ + DBUG_EXECUTE_IF("sleep_after_lock_thread_count_before_delete_thd", + sleep(5);); const size_t num_erased= global_thread_list->erase(thd); if (num_erased == 1) @@ -857,7 +873,9 @@ void remove_global_thread(THD *thd) // Removing a THD that was never added is an error. DBUG_ASSERT(1 == num_erased); + mysql_mutex_unlock(&LOCK_thd_remove); mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } uint get_thread_count() @@ -1993,6 +2011,7 @@ static void clean_up_mutexes() mysql_mutex_destroy(&LOCK_slave_net_timeout); mysql_mutex_destroy(&LOCK_error_messages); mysql_cond_destroy(&COND_thread_count); + mysql_mutex_destroy(&LOCK_thd_remove); mysql_cond_destroy(&COND_thread_cache); mysql_cond_destroy(&COND_flush_thread_cache); mysql_cond_destroy(&COND_manager); @@ -2080,7 +2099,7 @@ static struct passwd *check_user(const char *user) } if (!user) { - if (!opt_bootstrap) + if (!opt_bootstrap && !opt_help) { sql_print_error("Fatal error: Please read \"Security\" section of the manual to find out how to run mysqld as root!\n"); unireg_abort(1); @@ -2726,14 +2745,6 @@ bool one_thread_per_connection_end(THD *thd, bool block_pthread) thd->release_resources(); dec_connection_count(); - - mysql_mutex_lock(&LOCK_thread_count); - /* - Used by binlog_reset_master. It would be cleaner to use - DEBUG_SYNC here, but that's not possible because the THD's debug - sync feature has been shut down at this point. - */ - DBUG_EXECUTE_IF("sleep_after_lock_thread_count_before_delete_thd", sleep(5);); remove_global_thread(thd); if (kill_blocked_pthreads_flag) { @@ -2746,11 +2757,6 @@ bool one_thread_per_connection_end(THD *thd, bool block_pthread) ERR_remove_state(0); #endif - /* - Using global resources (like mutexes) is unsafe once we have released - the mutex here: the server may be shutting down. - */ - mysql_mutex_unlock(&LOCK_thread_count); delete thd; #ifdef HAVE_PSI_THREAD_INTERFACE @@ -3051,8 +3057,7 @@ void my_init_signals(void) #ifdef SIGTSTP sigaddset(&set,SIGTSTP); #endif - if (thd_lib_detected != THD_LIB_LT) - sigaddset(&set,THR_SERVER_ALARM); + sigaddset(&set,THR_SERVER_ALARM); if (test_flags & TEST_SIGINT) { my_sigset(thr_kill_signal, end_thread_signal); @@ -3124,7 +3129,7 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) */ init_thr_alarm(thread_scheduler->max_threads + global_system_variables.max_insert_delayed_threads + 10); - if (thd_lib_detected != THD_LIB_LT && (test_flags & TEST_SIGINT)) + if (test_flags & TEST_SIGINT) { (void) sigemptyset(&set); // Setup up SIGINT for debug (void) sigaddset(&set,SIGINT); // For debugging @@ -4181,6 +4186,8 @@ static int init_thread_environment() &LOCK_thread_created, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_thread_count, &LOCK_thread_count, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_status, &LOCK_status, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_thd_remove, + &LOCK_thd_remove, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_delayed_insert, &LOCK_delayed_insert, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_delayed_status, @@ -4498,6 +4505,17 @@ static int init_server_auto_options() /* load_defaults require argv[0] is not null */ char **argv= &name; int argc= 1; + if (!check_file_permissions(fname)) + { + /* + Found a world writable file hence removing it as it is dangerous to write + a new UUID into the same file. + */ + my_delete(fname,MYF(MY_WME)); + sql_print_warning("World-writable config file '%s' has been removed.\n", + fname); + } + /* load all options in 'auto.cnf'. */ if (my_load_defaults(fname, groups, &argc, &argv, NULL)) DBUG_RETURN(1); @@ -5177,9 +5195,7 @@ int mysqld_main(int argc, char **argv) to be able to read defaults files and parse options. */ my_progname= argv[0]; -#ifdef HAVE_NPTL - ld_assume_kernel_is_set= (getenv("LD_ASSUME_KERNEL") != 0); -#endif + #ifndef _WIN32 // For windows, my_init() is called from the win specific mysqld_main if (my_init()) // init my_sys library & pthreads @@ -5289,7 +5305,7 @@ int mysqld_main(int argc, char **argv) /* Set signal used to kill MySQL */ #if defined(SIGUSR2) - thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2; + thr_kill_signal= SIGUSR2; #else thr_kill_signal= SIGINT; #endif @@ -5464,7 +5480,7 @@ int mysqld_main(int argc, char **argv) const_cast<Gtid_set *>(gtid_state->get_lost_gtids()), NULL, opt_master_verify_checksum, - true/*true=need lock*/)) + true/*true=need lock*/, true)) unireg_abort(1); /* @@ -8387,6 +8403,14 @@ mysqld_get_one_option(int optid, case OPT_BINLOG_FORMAT: binlog_format_used= true; break; + case OPT_BINLOGGING_IMPOSSIBLE_MODE: + WARN_DEPRECATED(NULL, "--binlogging_impossible_mode", + "'--binlog_error_action'"); + break; + case OPT_SIMPLIFIED_BINLOG_GTID_RECOVERY: + WARN_DEPRECATED(NULL, "--simplified_binlog_gtid_recovery", + "'--binlog_gtid_simple_recovery'"); + break; #include <sslopt-case.h> #ifndef EMBEDDED_LIBRARY case 'V': @@ -8405,6 +8429,9 @@ mysqld_get_one_option(int optid, test_flags= argument ? (uint) atoi(argument) : 0; opt_endinfo=1; break; + case OPT_THREAD_CONCURRENCY: + WARN_DEPRECATED_NO_REPLACEMENT(NULL, "THREAD_CONCURRENCY"); + break; case (int) OPT_ISAM_LOG: opt_myisam_log=1; break; @@ -9356,6 +9383,7 @@ 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; +PSI_mutex_key key_LOCK_thd_remove; PSI_mutex_key key_RELAYLOG_LOCK_commit; PSI_mutex_key key_RELAYLOG_LOCK_commit_queue; PSI_mutex_key key_RELAYLOG_LOCK_done; @@ -9440,6 +9468,7 @@ 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}, + { &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}, { &key_LOCK_thread_created, "LOCK_thread_created", PSI_FLAG_GLOBAL } diff --git a/mysql-wsrep-5.6/sql/mysqld.h b/mysql-wsrep-5.6/sql/mysqld.h index c586c2b4..2844275f 100644 --- a/mysql-wsrep-5.6/sql/mysqld.h +++ b/mysql-wsrep-5.6/sql/mysqld.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -108,7 +108,7 @@ extern bool opt_disable_networking, opt_skip_show_db; extern bool opt_skip_name_resolve; extern bool opt_ignore_builtin_innodb; extern my_bool opt_character_set_client_handshake; -extern bool volatile abort_loop; +extern MYSQL_PLUGIN_IMPORT bool volatile abort_loop; extern bool in_bootstrap; extern my_bool opt_bootstrap; extern uint connection_count; @@ -216,6 +216,16 @@ extern const char *binlog_checksum_type_names[]; extern my_bool opt_master_verify_checksum; extern my_bool opt_slave_sql_verify_checksum; extern my_bool enforce_gtid_consistency; +extern my_bool binlog_gtid_simple_recovery; +extern ulong binlog_error_action; +enum enum_binlog_error_action +{ + /// Ignore the error and let server continue without binlogging + IGNORE_ERROR= 0, + /// Abort the server + ABORT_SERVER= 1 +}; +extern const char *binlog_error_action_list[]; enum enum_gtid_mode { /// Support only anonymous groups, not GTIDs. @@ -333,7 +343,7 @@ extern PSI_mutex_key key_mutex_slave_parallel_pend_jobs, key_mutex_mts_temp_tables_lock, key_mutex_slave_parallel_worker, key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, - key_LOCK_error_messages, key_LOCK_thread_count, + key_LOCK_error_messages, key_LOCK_thread_count, key_LOCK_thd_remove, key_LOCK_log_throttle_qni; extern PSI_mutex_key key_RELAYLOG_LOCK_commit; extern PSI_mutex_key key_RELAYLOG_LOCK_commit_queue; @@ -606,6 +616,8 @@ enum options_mysqld OPT_BINLOG_FORMAT, OPT_BINLOG_IGNORE_DB, OPT_BIN_LOG, + OPT_BINLOGGING_IMPOSSIBLE_MODE, + OPT_SIMPLIFIED_BINLOG_GTID_RECOVERY, OPT_BOOTSTRAP, OPT_CONSOLE, OPT_DEBUG_SYNC_TIMEOUT, @@ -641,6 +653,7 @@ enum options_mysqld OPT_SSL_CERT, OPT_SSL_CIPHER, OPT_SSL_KEY, + OPT_THREAD_CONCURRENCY, OPT_UPDATE_LOG, OPT_WANT_CORE, OPT_ENGINE_CONDITION_PUSHDOWN, diff --git a/mysql-wsrep-5.6/sql/opt_range.cc b/mysql-wsrep-5.6/sql/opt_range.cc index c22a6f01..9616d7c0 100644 --- a/mysql-wsrep-5.6/sql/opt_range.cc +++ b/mysql-wsrep-5.6/sql/opt_range.cc @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights + * reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -419,31 +420,54 @@ public: { DBUG_ASSERT(type_arg == MAYBE_KEY || type_arg == IMPOSSIBLE); } - inline bool is_same(SEL_ARG *arg) + /** + returns true if a range predicate is equal. Use all_same() + to check for equality of all the predicates on this keypart. + */ + inline bool is_same(const SEL_ARG *arg) const { if (type != arg->type || part != arg->part) - return 0; + return false; if (type != KEY_RANGE) - return 1; + return true; return cmp_min_to_min(arg) == 0 && cmp_max_to_max(arg) == 0; } + /** + returns true if all the predicates in the keypart tree are equal + */ + bool all_same(const SEL_ARG *arg) const + { + if (type != arg->type || part != arg->part) + return false; + if (type != KEY_RANGE) + return true; + if (arg == this) + return true; + const SEL_ARG *cmp_arg= arg->first(); + const SEL_ARG *cur_arg= first(); + for (; cur_arg && cmp_arg && cur_arg->is_same(cmp_arg); + cur_arg= cur_arg->next, cmp_arg= cmp_arg->next) ; + if (cur_arg || cmp_arg) + return false; + return true; + } inline void merge_flags(SEL_ARG *arg) { maybe_flag|=arg->maybe_flag; } inline void maybe_smaller() { maybe_flag=1; } /* Return true iff it's a single-point null interval */ inline bool is_null_interval() { return maybe_null && max_value[0] == 1; } - inline int cmp_min_to_min(SEL_ARG* arg) + inline int cmp_min_to_min(const SEL_ARG* arg) const { return sel_cmp(field,min_value, arg->min_value, min_flag, arg->min_flag); } - inline int cmp_min_to_max(SEL_ARG* arg) + inline int cmp_min_to_max(const SEL_ARG* arg) const { return sel_cmp(field,min_value, arg->max_value, min_flag, arg->max_flag); } - inline int cmp_max_to_max(SEL_ARG* arg) + inline int cmp_max_to_max(const SEL_ARG* arg) const { return sel_cmp(field,max_value, arg->max_value, max_flag, arg->max_flag); } - inline int cmp_max_to_min(SEL_ARG* arg) + inline int cmp_max_to_min(const SEL_ARG* arg) const { return sel_cmp(field,max_value, arg->min_value, max_flag, arg->min_flag); } @@ -622,6 +646,7 @@ public: void test_use_count(SEL_ARG *root); #endif SEL_ARG *first(); + const SEL_ARG *first() const; SEL_ARG *last(); void make_root(); inline bool simple_key() @@ -697,6 +722,18 @@ public: SEL_ARG *clone_tree(RANGE_OPT_PARAM *param); }; +/** + Helper function to compare two SEL_ARG's. +*/ +static bool all_same(const SEL_ARG *sa1, const SEL_ARG *sa2) +{ + if (sa1 == NULL && sa2 == NULL) + return true; + if ((sa1 != NULL && sa2 == NULL) || (sa1 == NULL && sa2 != NULL)) + return false; + return sa1->all_same(sa2); +} + class SEL_IMERGE; @@ -1556,6 +1593,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) DBUG_ENTER("QUICK_RANGE_SELECT::init_ror_merged_scan"); in_ror_merged_scan= 1; + mrr_flags|= HA_MRR_SORTED; if (reuse_handler) { DBUG_PRINT("info", ("Reusing handler %p", file)); @@ -1564,6 +1602,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) DBUG_RETURN(1); } head->column_bitmaps_set(&column_bitmap, &column_bitmap); + file->extra(HA_EXTRA_SECONDARY_SORT_ROWID); goto end; } @@ -1602,6 +1641,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) } free_file= TRUE; last_rowid= file->ref; + file->extra(HA_EXTRA_SECONDARY_SORT_ROWID); end: /* @@ -2010,6 +2050,13 @@ SEL_ARG *SEL_ARG::clone(RANGE_OPT_PARAM *param, SEL_ARG *new_parent, return tmp; } +/** + This gives the first SEL_ARG in the interval list, and the minimal element + in the red-black tree + + @return + SEL_ARG first SEL_ARG in the interval list +*/ SEL_ARG *SEL_ARG::first() { SEL_ARG *next_arg=this; @@ -2020,6 +2067,11 @@ SEL_ARG *SEL_ARG::first() return next_arg; } +const SEL_ARG *SEL_ARG::first() const +{ + return const_cast<SEL_ARG*>(this)->first(); +} + SEL_ARG *SEL_ARG::last() { SEL_ARG *next_arg=this; @@ -11202,6 +11254,8 @@ void QUICK_ROR_UNION_SELECT::add_keys_and_lengths(String *key_names, static inline uint get_field_keypart(KEY *index, Field *field); static inline SEL_ARG * get_index_range_tree(uint index, SEL_TREE* range_tree, PARAM *param, uint *param_idx); +static bool get_sel_arg_for_keypart(Field *field, SEL_ARG *index_range_tree, + SEL_ARG **cur_range); static bool get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree, KEY_PART_INFO *first_non_group_part, KEY_PART_INFO *min_max_arg_part, @@ -11266,6 +11320,16 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, never stored after a unique key lookup in the clustered index and furhter index_next/prev calls can not be used. So loose index scan optimization can not be used in this case. + SA7. If Q has both AGG_FUNC(DISTINCT ...) and MIN/MAX() functions then this + access method is not used. + For above queries MIN/MAX() aggregation has to be done at + nested_loops_join (end_send_group). But with current design MIN/MAX() + is always set as part of loose index scan. Because of this mismatch + MIN() and MAX() values will be set incorrectly. For such queries to + work we need a new interface for loose index scan. This new interface + should only fetch records with min and max values and let + end_send_group to do aggregation. Until then do not use + loose_index_scan. GA1. If Q has a GROUP BY clause, then GA is a prefix of I. That is, if G_i = A_j => i = j. GA2. If Q has a DISTINCT clause, then there is a permutation of SA that @@ -11297,6 +11361,8 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, above tests. By transitivity then it also follows that each WA_i participates in the index I (if this was already tested for GA, NGA and C). + WA2. If there is a predicate on C, then it must be in conjunction + to all predicates on all earlier keyparts in I. C) Overall query form: SELECT EXPR([A_1,...,A_k], [B_1,...,B_m], [MIN(C)], [MAX(C)]) @@ -11454,6 +11520,14 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time) } } + /* Check (SA7). */ + if (is_agg_distinct && (have_max || have_min)) + { + trace_group.add("chosen", false). + add_alnum("cause", "have_both_agg_distinct_and_min_max"); + DBUG_RETURN(NULL); + } + select_items_it= List_iterator<Item>(join->fields_list); /* Check (SA5). */ if (join->select_distinct) @@ -11767,6 +11841,26 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time) } } + /** + Test WA2:If there are conditions on a column C participating in + MIN/MAX, those conditions must be conjunctions to all earlier + keyparts. Otherwise, Loose Index Scan cannot be used. + */ + if (tree && min_max_arg_item) + { + uint dummy; + SEL_ARG *index_range_tree= get_index_range_tree(cur_index, tree, param, + &dummy); + SEL_ARG *cur_range= NULL; + if (get_sel_arg_for_keypart(min_max_arg_part->field, + index_range_tree, &cur_range) || + (cur_range && cur_range->type != SEL_ARG::KEY_RANGE)) + { + cause= "minmax_keypart_in_disjunctive_query"; + goto next_index; + } + } + /* If we got to this point, cur_index_info passes the test. */ key_infix_parts= cur_key_infix_len ? (uint) (first_non_infix_part - first_non_group_part) : 0; @@ -12035,35 +12129,44 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item, /* - Get SEL_ARG tree, if any, for the keypart covering non grouping - attribute (NGA) field 'nga_field'. + Get the SEL_ARG tree 'tree' for the keypart covering 'field', if + any. 'tree' must be a unique conjunction to ALL predicates in earlier + keyparts of 'keypart_tree'. + + E.g., if 'keypart_tree' is for a composite index (kp1,kp2) and kp2 + covers 'field', all these conditions satisfies the requirement: + + 1. "(kp1=2 OR kp1=3) AND kp2=10" => returns "kp2=10" + 2. "(kp1=2 AND kp2=10) OR (kp1=3 AND kp2=10)" => returns "kp2=10" + 3. "(kp1=2 AND (kp2=10 OR kp2=11)) OR (kp1=3 AND (kp2=10 OR kp2=11))" + => returns "kp2=10 OR kp2=11" - This function enforces the NGA3 test: If 'keypart_tree' contains a - condition for 'nga_field', there can only be one range. In the - opposite case, this function returns with error and 'cur_range' - should not be used. + whereas these do not + 1. "(kp1=2 AND kp2=10) OR kp1=3" + 2. "(kp1=2 AND kp2=10) OR (kp1=3 AND kp2=11)" + 3. "(kp1=2 AND kp2=10) OR (kp1=3 AND (kp2=10 OR kp2=11))" - Note that the NGA1 and NGA2 requirements, like whether or not the - range predicate for 'nga_field' is equality, is not tested by this - function. + This function effectively tests requirement WA2. In combination with + a test that the returned tree has no more than one range it is also + a test of NGA3. - @param[in] nga_field The NGA field we want the SEL_ARG tree for + @param[in] field The field we want the SEL_ARG tree for @param[in] keypart_tree Root node of the SEL_ARG* tree for the index @param[out] cur_range The SEL_ARG tree, if any, for the keypart covering field 'keypart_field' - @retval true 'keypart_tree' contained a predicate for 'nga_field' but - multiple ranges exists. 'cur_range' should not be used. + @retval true 'keypart_tree' contained a predicate for 'field' that + is not conjunction to all predicates on earlier keyparts @retval false otherwise */ static bool -get_sel_arg_for_keypart(Field *nga_field, +get_sel_arg_for_keypart(Field *field, SEL_ARG *keypart_tree, SEL_ARG **cur_range) { - if(keypart_tree == NULL) + if (keypart_tree == NULL) return false; - if(keypart_tree->type != SEL_ARG::KEY_RANGE) + if (keypart_tree->type != SEL_ARG::KEY_RANGE) { /* A range predicate not usable by Loose Index Scan is found. @@ -12073,45 +12176,38 @@ get_sel_arg_for_keypart(Field *nga_field, *cur_range= keypart_tree; return false; } - if(keypart_tree->field->eq(nga_field)) + if (keypart_tree->field->eq(field)) { - /* - Enforce NGA3: If a condition for nga_field has been found, only - a single range is allowed. - */ - if (keypart_tree->prev || keypart_tree->next) - return true; // There are multiple ranges - *cur_range= keypart_tree; return false; } - SEL_ARG *found_tree= NULL; + SEL_ARG *tree_first_range= NULL; SEL_ARG *first_kp= keypart_tree->first(); - for (SEL_ARG *cur_kp= first_kp; cur_kp && !found_tree; - cur_kp= cur_kp->next) + for (SEL_ARG *cur_kp= first_kp; cur_kp; cur_kp= cur_kp->next) { + SEL_ARG *curr_tree= NULL; if (cur_kp->next_key_part) { - if (get_sel_arg_for_keypart(nga_field, + if (get_sel_arg_for_keypart(field, cur_kp->next_key_part, - &found_tree)) + &curr_tree)) return true; - } - /* - Enforce NGA3: If a condition for nga_field has been found,only - a single range is allowed. - */ - if (found_tree && found_tree->type == SEL_ARG::KEY_RANGE && first_kp->next) - return true; // There are multiple ranges + /** + Check if the SEL_ARG tree for 'field' is identical for all ranges in + 'keypart_tree + */ + if (cur_kp == first_kp) + tree_first_range= curr_tree; + else if (!all_same(tree_first_range, curr_tree)) + return true; } - *cur_range= found_tree; + *cur_range= tree_first_range; return false; } - /* Extract a sequence of constants from a conjunction of equality predicates. @@ -12133,7 +12229,8 @@ get_sel_arg_for_keypart(Field *nga_field, constant equality predicate among conds with the form (NGF_i = const_ci) or (const_ci = NGF_i). Thus all the NGF_i attributes must fill the 'gap' between the last group-by - attribute and the MIN/MAX attribute in the index (if present). If these + attribute and the MIN/MAX attribute in the index (if present). Also ensure + that there is only a single range on NGF_i (NGA3). If these conditions hold, copy each constant from its corresponding predicate into key_infix, in the order its NG_i attribute appears in the index, and update key_infix_len with the total length of the key parts in key_infix. @@ -12142,7 +12239,6 @@ get_sel_arg_for_keypart(Field *nga_field, TRUE if the index passes the test FALSE o/w */ - static bool get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree, KEY_PART_INFO *first_non_group_part, @@ -12162,32 +12258,42 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree, { cur_range= NULL; /* - Find the range tree for the current keypart. We assume that - index_range_tree points to the leftmost keypart in the index. + Check NGA3: + 1. get_sel_arg_for_keypart gets the range tree for the 'field' and also + checks for a unique conjunction of this tree with all the predicates + on the earlier keyparts in the index. + 2. Check for multiple ranges on the found keypart tree. + + We assume that index_range_tree points to the leftmost keypart in + the index. */ - if(get_sel_arg_for_keypart(cur_part->field, index_range_tree, &cur_range)) + if (get_sel_arg_for_keypart(cur_part->field, index_range_tree, + &cur_range)) + return false; + + if (cur_range && cur_range->elements > 1) return false; if (!cur_range || cur_range->type != SEL_ARG::KEY_RANGE) { if (min_max_arg_part) - return FALSE; /* The current keypart has no range predicates at all. */ + return false; /* The current keypart has no range predicates at all. */ else { *first_non_infix_part= cur_part; - return TRUE; + return true; } } if ((cur_range->min_flag & NO_MIN_RANGE) || (cur_range->max_flag & NO_MAX_RANGE) || (cur_range->min_flag & NEAR_MIN) || (cur_range->max_flag & NEAR_MAX)) - return FALSE; + return false; uint field_length= cur_part->store_length; if (cur_range->maybe_null && cur_range->min_value[0] && cur_range->max_value[0]) - { + { /* cur_range specifies 'IS NULL'. In this case the argument points to a "null value" (a copy of is_null_string) that we do not @@ -12205,7 +12311,7 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree, *key_infix_len+= field_length; } else - return FALSE; + return false; } if (!min_max_arg_part && (cur_part == last_part)) diff --git a/mysql-wsrep-5.6/sql/parse_file.h b/mysql-wsrep-5.6/sql/parse_file.h index b2d3de75..1a600645 100644 --- a/mysql-wsrep-5.6/sql/parse_file.h +++ b/mysql-wsrep-5.6/sql/parse_file.h @@ -42,7 +42,7 @@ enum file_opt_type { struct File_option { LEX_STRING name; /**< Name of the option */ - int offset; /**< offset to base address of value */ + size_t offset; /**< offset to base address of value */ file_opt_type type; /**< Option type */ }; diff --git a/mysql-wsrep-5.6/sql/replication.h b/mysql-wsrep-5.6/sql/replication.h index d43f493e..865df602 100644 --- a/mysql-wsrep-5.6/sql/replication.h +++ b/mysql-wsrep-5.6/sql/replication.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -139,6 +139,23 @@ typedef struct Binlog_storage_observer { typedef struct Binlog_transmit_param { uint32 server_id; uint32 flags; + /* Let us keep 1-16 as output flags and 17-32 as input flags */ + static const uint32 F_OBSERVE= 1; + static const uint32 F_DONT_OBSERVE= 2; + + void set_observe_flag() { flags|= F_OBSERVE; } + void set_dont_observe_flag() { flags|= F_DONT_OBSERVE; } + /** + If F_OBSERVE is set by any plugin, then it should observe binlog + transmission, even F_DONT_OBSERVE is set by some plugins. + + If both F_OBSERVE and F_DONT_OBSERVE are not set, then it is an old + plugin. In this case, it should always observe binlog transmission. + */ + bool should_observe() + { + return (flags & F_OBSERVE) || !(flags & F_DONT_OBSERVE); + } } Binlog_transmit_param; /** @@ -441,28 +458,6 @@ int register_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void * */ int unregister_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p); -/** - Connect to master - - This function can only used in the slave I/O thread context, and - will use the same master information to do the connection. - - @code - MYSQL *mysql = mysql_init(NULL); - if (rpl_connect_master(mysql)) - { - // do stuff with the connection - } - mysql_close(mysql); // close the connection - @endcode - - @param mysql address of MYSQL structure to use, pass NULL will - create a new one - - @return address of MYSQL structure on success, NULL on failure -*/ -MYSQL *rpl_connect_master(MYSQL *mysql); - /** Set thread entering a condition diff --git a/mysql-wsrep-5.6/sql/rpl_constants.h b/mysql-wsrep-5.6/sql/rpl_constants.h index 6ec99c5b..e963388c 100644 --- a/mysql-wsrep-5.6/sql/rpl_constants.h +++ b/mysql-wsrep-5.6/sql/rpl_constants.h @@ -45,6 +45,8 @@ const int BINLOG_FLAGS_INFO_SIZE= 2; const int BINLOG_SERVER_ID_INFO_SIZE= 4; const int BINLOG_NAME_SIZE_INFO_SIZE= 4; +const int BINLOG_DUMP_NON_BLOCK= 1<<0; + /** Enumeration of the reserved formats of Binlog extra row information */ diff --git a/mysql-wsrep-5.6/sql/rpl_gtid.h b/mysql-wsrep-5.6/sql/rpl_gtid.h index 1286c0a3..caaef3f1 100644 --- a/mysql-wsrep-5.6/sql/rpl_gtid.h +++ b/mysql-wsrep-5.6/sql/rpl_gtid.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -1032,6 +1032,24 @@ public: enum_return_status ensure_sidno(rpl_sidno sidno); /// Returns true if this Gtid_set is a subset of the other Gtid_set. bool is_subset(const Gtid_set *super) const; + + /** + Returns true if this Gtid_set is a subset of the given gtid_set + on the given superset_sidno and subset_sidno. + + @param super Gtid_set with which 'this'::gtid_set needs to be + compared + @param superset_sidno The sidno that will be compared, relative to + super->sid_map. + @param subset_sidno The sidno that will be compared, relative to + this->sid_map. + @return true If 'this' Gtid_set is subset of given + 'super' Gtid_set. + false If 'this' Gtid_set is *not* subset of given + 'super' Gtid_set. + */ + bool is_subset_for_sid(const Gtid_set *super, rpl_sidno superset_sidno, + rpl_sidno subset_sidno) const; /// Returns true if there is a least one element of this Gtid_set in /// the other Gtid_set. bool is_intersection_nonempty(const Gtid_set *other) const; @@ -2266,6 +2284,11 @@ public: const Owned_gtids *get_owned_gtids() const { return &owned_gtids; } /// Return the server's SID's SIDNO rpl_sidno get_server_sidno() const { return server_sidno; } + /// Return the server's SID + const rpl_sid &get_server_sid() const + { + return global_sid_map->sidno_to_sid(server_sidno); + } #ifndef DBUG_OFF /** Debug only: Returns an upper bound on the length of the string diff --git a/mysql-wsrep-5.6/sql/rpl_gtid_execution.cc b/mysql-wsrep-5.6/sql/rpl_gtid_execution.cc index ead11f3b..eb259674 100644 --- a/mysql-wsrep-5.6/sql/rpl_gtid_execution.cc +++ b/mysql-wsrep-5.6/sql/rpl_gtid_execution.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -445,6 +445,12 @@ int gtid_rollback(THD *thd) { DBUG_ENTER("gtid_rollback"); + if (thd->skip_gtid_rollback) + { + DBUG_PRINT("info",("skipping the gtid_rollback")); + DBUG_RETURN(0); + } + global_sid_lock->rdlock(); gtid_state->update_on_rollback(thd); global_sid_lock->unlock(); diff --git a/mysql-wsrep-5.6/sql/rpl_gtid_set.cc b/mysql-wsrep-5.6/sql/rpl_gtid_set.cc index 5b527d7c..c14cbe88 100644 --- a/mysql-wsrep-5.6/sql/rpl_gtid_set.cc +++ b/mysql-wsrep-5.6/sql/rpl_gtid_set.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -1053,6 +1053,49 @@ bool Gtid_set::is_interval_subset(Const_interval_iterator *sub, DBUG_RETURN(true); } +bool Gtid_set::is_subset_for_sid(const Gtid_set *super, + rpl_sidno superset_sidno, + rpl_sidno subset_sidno) const +{ + DBUG_ENTER("Gtid_set::is_subset_for_sidno"); + /* + The following assert code is to see that caller acquired + either write or read lock on global_sid_lock. + Note that if it is read lock, then it should also + acquire lock on sidno. + i.e., the caller must acquire lock either A1 way or A2 way. + A1. global_sid_lock.wrlock() + A2. global_sid_lock.rdlock(); gtid_state.lock_sidno(sidno) + */ + if (sid_lock != NULL) + super->sid_lock->assert_some_lock(); + if (super->sid_lock != NULL) + super->sid_lock->assert_some_lock(); + /* + If subset(i.e, this object) does not have required sid in it, i.e., + subset_sidno is zero, then it means it is subset of any given + super set. Hence return true. + */ + if (subset_sidno == 0) + DBUG_RETURN(true); + /* + If superset (i.e., the passed gtid_set) does not have given sid in it, + i.e., superset_sidno is zero, then it means it cannot be superset + to any given subset. Hence return false. + */ + if (superset_sidno == 0) + DBUG_RETURN(false); + /* + Once we have valid(non-zero) subset's and superset's sid numbers, call + is_interval_subset(). + */ + Const_interval_iterator subset_ivit(this, subset_sidno); + Const_interval_iterator superset_ivit(super, superset_sidno); + if (!is_interval_subset(&subset_ivit, &superset_ivit)) + DBUG_RETURN(false); + + DBUG_RETURN(true); +} bool Gtid_set::is_subset(const Gtid_set *super) const { diff --git a/mysql-wsrep-5.6/sql/rpl_handler.cc b/mysql-wsrep-5.6/sql/rpl_handler.cc index 99edba7a..9ec49029 100644 --- a/mysql-wsrep-5.6/sql/rpl_handler.cc +++ b/mysql-wsrep-5.6/sql/rpl_handler.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -264,13 +264,15 @@ int Binlog_storage_delegate::after_flush(THD *thd, #ifdef HAVE_REPLICATION int Binlog_transmit_delegate::transmit_start(THD *thd, ushort flags, const char *log_file, - my_off_t log_pos) + my_off_t log_pos, + bool *observe_transmission) { Binlog_transmit_param param; param.flags= flags; int ret= 0; FOREACH_OBSERVER(ret, transmit_start, thd, (¶m, log_file, log_pos)); + *observe_transmission= param.should_observe(); return ret; } @@ -279,6 +281,8 @@ int Binlog_transmit_delegate::transmit_stop(THD *thd, ushort flags) Binlog_transmit_param param; param.flags= flags; + DBUG_EXECUTE_IF("crash_binlog_transmit_hook", DBUG_SUICIDE();); + int ret= 0; FOREACH_OBSERVER(ret, transmit_stop, thd, (¶m)); return ret; @@ -299,6 +303,8 @@ int Binlog_transmit_delegate::reserve_header(THD *thd, ushort flags, param.flags= flags; param.server_id= thd->server_id; + DBUG_EXECUTE_IF("crash_binlog_transmit_hook", DBUG_SUICIDE();); + int ret= 0; read_lock(); Observer_info_iterator iter= observer_info_iter(); @@ -344,6 +350,8 @@ int Binlog_transmit_delegate::before_send_event(THD *thd, ushort flags, Binlog_transmit_param param; param.flags= flags; + DBUG_EXECUTE_IF("crash_binlog_transmit_hook", DBUG_SUICIDE();); + int ret= 0; FOREACH_OBSERVER(ret, before_send_event, thd, (¶m, (uchar *)packet->c_ptr(), @@ -360,6 +368,8 @@ int Binlog_transmit_delegate::after_send_event(THD *thd, ushort flags, Binlog_transmit_param param; param.flags= flags; + DBUG_EXECUTE_IF("crash_binlog_transmit_hook", DBUG_SUICIDE();); + int ret= 0; FOREACH_OBSERVER(ret, after_send_event, thd, (¶m, packet->c_ptr(), packet->length(), diff --git a/mysql-wsrep-5.6/sql/rpl_handler.h b/mysql-wsrep-5.6/sql/rpl_handler.h index 878d10ca..98d068ef 100644 --- a/mysql-wsrep-5.6/sql/rpl_handler.h +++ b/mysql-wsrep-5.6/sql/rpl_handler.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -215,7 +215,8 @@ public: typedef Binlog_transmit_observer Observer; int transmit_start(THD *thd, ushort flags, - const char *log_file, my_off_t log_pos); + const char *log_file, my_off_t log_pos, + bool *observe_transmission); int transmit_stop(THD *thd, ushort flags); int reserve_header(THD *thd, ushort flags, String *packet); int before_send_event(THD *thd, ushort flags, diff --git a/mysql-wsrep-5.6/sql/rpl_info_table_access.cc b/mysql-wsrep-5.6/sql/rpl_info_table_access.cc index 599fa380..89df87d6 100644 --- a/mysql-wsrep-5.6/sql/rpl_info_table_access.cc +++ b/mysql-wsrep-5.6/sql/rpl_info_table_access.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +162,7 @@ bool Rpl_info_table_access::close_table(THD *thd, TABLE* table, */ ha_commit_trans(thd, FALSE, TRUE); } - if (saved_current_thd != current_thd) + if (thd_created) { if (error) ha_rollback_trans(thd, TRUE); @@ -441,19 +441,17 @@ bool Rpl_info_table_access::store_info_values(uint max_num_field, Field **fields */ THD *Rpl_info_table_access::create_thd() { - THD *thd= NULL; - saved_current_thd= current_thd; + THD *thd= current_thd; - if (!current_thd) + if (!thd) { thd= new THD; thd->thread_stack= (char*) &thd; thd->store_globals(); thd->security_ctx->skip_grants(); thd->system_thread= SYSTEM_THREAD_INFO_REPOSITORY; + thd_created= true; } - else - thd= current_thd; return(thd); } @@ -472,10 +470,11 @@ bool Rpl_info_table_access::drop_thd(THD *thd) { DBUG_ENTER("Rpl_info::drop_thd"); - if (saved_current_thd != current_thd) + if (thd_created) { delete thd; my_pthread_setspecific_ptr(THR_THD, NULL); + thd_created= false; } DBUG_RETURN(FALSE); diff --git a/mysql-wsrep-5.6/sql/rpl_info_table_access.h b/mysql-wsrep-5.6/sql/rpl_info_table_access.h index 8d2ae942..b571deed 100644 --- a/mysql-wsrep-5.6/sql/rpl_info_table_access.h +++ b/mysql-wsrep-5.6/sql/rpl_info_table_access.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. This 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,7 +28,7 @@ enum enum_return_id { FOUND_ID= 1, NOT_FOUND_ID, ERROR_ID }; class Rpl_info_table_access { public: - Rpl_info_table_access() { }; + Rpl_info_table_access(): thd_created(false) { }; virtual ~Rpl_info_table_access() { }; bool open_table(THD* thd, const LEX_STRING dbstr, const LEX_STRING tbstr, @@ -47,7 +47,7 @@ public: bool drop_thd(THD* thd); private: - THD *saved_current_thd; + bool thd_created; Rpl_info_table_access& operator=(const Rpl_info_table_access& info); Rpl_info_table_access(const Rpl_info_table_access& info); diff --git a/mysql-wsrep-5.6/sql/rpl_master.cc b/mysql-wsrep-5.6/sql/rpl_master.cc index cf3d3aab..349793cd 100644 --- a/mysql-wsrep-5.6/sql/rpl_master.cc +++ b/mysql-wsrep-5.6/sql/rpl_master.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -422,7 +422,8 @@ static int fake_rotate_event(NET* net, String* packet, char* log_file_name, should be called before store the event data to the packet buffer. */ static int reset_transmit_packet(THD *thd, ushort flags, - ulong *ev_offset, const char **errmsg) + ulong *ev_offset, const char **errmsg, + bool observe_transmission) { int ret= 0; String *packet= &thd->packet; @@ -431,7 +432,8 @@ static int reset_transmit_packet(THD *thd, ushort flags, packet->length(0); packet->set("\0", 1, &my_charset_bin); - if (RUN_HOOK(binlog_transmit, reserve_header, (thd, flags, packet))) + if (observe_transmission && + RUN_HOOK(binlog_transmit, reserve_header, (thd, flags, packet))) { *errmsg= "Failed to run hook 'reserve_header'"; my_errno= ER_UNKNOWN_ERROR; @@ -653,7 +655,8 @@ static int send_heartbeat_event(NET* net, String* packet, static int send_last_skip_group_heartbeat(THD *thd, NET* net, String *packet, const struct event_coordinates *last_skip_coord, ulong *ev_offset, - uint8 checksum_alg_arg, const char **errmsg) + uint8 checksum_alg_arg, const char **errmsg, + bool observe_transmission) { DBUG_ENTER("send_last_skip_group_heartbeat"); String save_packet; @@ -662,7 +665,7 @@ static int send_last_skip_group_heartbeat(THD *thd, NET* net, String *packet, /* Save the current read packet */ save_packet.swap(*packet); - if (reset_transmit_packet(thd, 0, ev_offset, errmsg)) + if (reset_transmit_packet(thd, 0, ev_offset, errmsg, observe_transmission)) DBUG_RETURN(-1); /* Send heart beat event to the slave to update slave threads coordinates */ @@ -736,6 +739,7 @@ bool com_binlog_dump(THD *thd, char *packet, uint packet_length) DBUG_ENTER("com_binlog_dump"); ulong pos; String slave_uuid; + ushort flags= 0; const uchar* packet_position= (uchar *) packet; uint packet_bytes_todo= packet_length; @@ -750,15 +754,17 @@ bool com_binlog_dump(THD *thd, char *packet, uint packet_length) com_binlog_dump_gtid(). */ READ_INT(pos, 4); - SKIP(2); /* flags field is unused */ + READ_INT(flags, 2); READ_INT(thd->server_id, 4); + DBUG_PRINT("info", ("pos=%lu flags=%d server_id=%d", pos, flags, thd->server_id)); + get_slave_uuid(thd, &slave_uuid); kill_zombie_dump_threads(&slave_uuid); general_log_print(thd, thd->get_command(), "Log: '%s' Pos: %ld", packet + 10, (long) pos); - mysql_binlog_send(thd, thd->strdup(packet + 10), (my_off_t) pos, NULL); + mysql_binlog_send(thd, thd->strdup(packet + 10), (my_off_t) pos, NULL, flags); unregister_slave(thd, true, true/*need_lock_slave_list=true*/); /* fake COM_QUIT -- if we get here, the thread needs to terminate */ @@ -778,6 +784,7 @@ bool com_binlog_dump_gtid(THD *thd, char *packet, uint packet_length) breaking compatitibilty. /Alfranio. */ String slave_uuid; + ushort flags= 0; uint32 data_size= 0; uint64 pos= 0; char name[FN_REFLEN + 1]; @@ -793,11 +800,12 @@ bool com_binlog_dump_gtid(THD *thd, char *packet, uint packet_length) if (check_global_access(thd, REPL_SLAVE_ACL)) DBUG_RETURN(false); - SKIP(2); /* flags field is unused */ + READ_INT(flags, 2); READ_INT(thd->server_id, 4); READ_INT(name_size, 4); READ_STRING(name, name_size, sizeof(name)); READ_INT(pos, 8); + DBUG_PRINT("info", ("pos=%llu flags=%d server_id=%d", pos, flags, thd->server_id)); READ_INT(data_size, 4); CHECK_PACKET_SIZE(data_size); if (slave_gtid_executed.add_gtid_encoding(packet_position, data_size) != @@ -812,7 +820,7 @@ bool com_binlog_dump_gtid(THD *thd, char *packet, uint packet_length) general_log_print(thd, thd->get_command(), "Log: '%s' Pos: %llu GTIDs: '%s'", name, pos, gtid_string); my_free(gtid_string); - mysql_binlog_send(thd, name, (my_off_t) pos, &slave_gtid_executed); + mysql_binlog_send(thd, name, (my_off_t) pos, &slave_gtid_executed, flags); unregister_slave(thd, true, true/*need_lock_slave_list=true*/); /* fake COM_QUIT -- if we get here, the thread needs to terminate */ @@ -825,7 +833,7 @@ error_malformed_packet: void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, - const Gtid_set* slave_gtid_executed) + const Gtid_set* slave_gtid_executed, int flags) { /** @todo: Clean up loop so that, among other things, we only have one @@ -846,6 +854,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, bool searching_first_gtid= using_gtid_protocol; bool skip_group= false; bool binlog_has_previous_gtids_log_event= false; + bool has_transmit_started= false; Sid_map *sid_map= slave_gtid_executed ? slave_gtid_executed->get_sid_map() : NULL; IO_CACHE log; @@ -859,6 +868,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, mysql_cond_t *log_cond; uint8 current_checksum_alg= BINLOG_CHECKSUM_ALG_UNDEF; Format_description_log_event fdle(BINLOG_VERSION), *p_fdle= &fdle; + Gtid first_gtid; #ifndef DBUG_OFF int left_events = max_binlog_dump_events; @@ -903,21 +913,13 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, /* Coordinates of the last skip group */ LOG_POS_COORD last_skip_coord_buf= {last_skip_log_name, BIN_LOG_HEADER_SIZE}, *p_last_skip_coord= &last_skip_coord_buf; + bool observe_transmission= false; if (heartbeat_period != LL(0)) { heartbeat_ts= &heartbeat_buf; set_timespec_nsec(*heartbeat_ts, 0); } - if (log_warnings > 1) - sql_print_information("Start binlog_dump to master_thread_id(%lu) slave_server(%u), pos(%s, %lu)", - thd->thread_id, thd->server_id, log_ident, (ulong)pos); - if (RUN_HOOK(binlog_transmit, transmit_start, (thd, 0/*flags*/, log_ident, pos))) - { - errmsg= "Failed to run hook 'transmit_start'"; - my_errno= ER_UNKNOWN_ERROR; - GOTO_ERR; - } #ifndef DBUG_OFF if (opt_sporadic_binlog_dump_fail && (binlog_dump_count++ % 2)) @@ -948,8 +950,72 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, { if (using_gtid_protocol) { + /* + In normal scenarios, it is not possible that Slave will + contain more gtids than Master with resepctive to Master's + UUID. But it could be possible case if Master's binary log + is truncated(due to raid failure) or Master's binary log is + deleted but GTID_PURGED was not set properly. That scenario + needs to be validated, i.e., it should *always* be the case that + Slave's gtid executed set (+retrieved set) is a subset of + Master's gtid executed set with respective to Master's UUID. + If it happens, dump thread will be stopped during the handshake + with Slave (thus the Slave's I/O thread will be stopped with the + error. Otherwise, it can lead to data inconsistency between Master + and Slave. + */ + Sid_map* slave_sid_map= slave_gtid_executed->get_sid_map(); + DBUG_ASSERT(slave_sid_map); + global_sid_lock->wrlock(); + const rpl_sid &server_sid= gtid_state->get_server_sid(); + rpl_sidno subset_sidno= slave_sid_map->sid_to_sidno(server_sid); + if (!slave_gtid_executed->is_subset_for_sid(gtid_state->get_logged_gtids(), + gtid_state->get_server_sidno(), + subset_sidno)) + { + errmsg= ER(ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER); + my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; + global_sid_lock->unlock(); + GOTO_ERR; + } + /* + Setting GTID_PURGED (when GTID_EXECUTED set is empty i.e., when + previous_gtids are also empty) will make binlog rotate. That + leaves first binary log with empty previous_gtids and second + binary log's previous_gtids with the value of gtid_purged. + In find_first_log_not_in_gtid_set() while we search for a binary + log whose previous_gtid_set is subset of slave_gtid_executed, + in this particular case, server will always find the first binary + log with empty previous_gtids which is subset of any given + slave_gtid_executed. Thus Master thinks that it found the first + binary log which is actually not correct and unable to catch + this error situation. Hence adding below extra if condition + to check the situation. Slave should know about Master's purged GTIDs. + If Slave's GTID executed + retrieved set does not contain Master's + complete purged GTID list, that means Slave is requesting(expecting) + GTIDs which were purged by Master. We should let Slave know about the + situation. i.e., throw error if slave's GTID executed set is not + a superset of Master's purged GTID set. + The other case, where user deleted binary logs manually + (without using 'PURGE BINARY LOGS' command) but gtid_purged + is not set by the user, the following if condition cannot catch it. + But that is not a problem because in find_first_log_not_in_gtid_set() + while checking for subset previous_gtids binary log, the logic + will not find one and an error ER_MASTER_HAS_PURGED_REQUIRED_GTIDS + is thrown from there. + */ + if (!gtid_state->get_lost_gtids()->is_subset(slave_gtid_executed)) + { + errmsg= ER(ER_MASTER_HAS_PURGED_REQUIRED_GTIDS); + my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; + global_sid_lock->unlock(); + GOTO_ERR; + } + global_sid_lock->unlock(); + first_gtid.clear(); if (mysql_bin_log.find_first_log_not_in_gtid_set(name, slave_gtid_executed, + &first_gtid, &errmsg)) { my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; @@ -991,8 +1057,20 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, GOTO_ERR; } + if (log_warnings > 1) + sql_print_information("Start binlog_dump to master_thread_id(%lu) slave_server(%u), pos(%s, %lu)", + thd->thread_id, thd->server_id, log_ident, (ulong)pos); + if (RUN_HOOK(binlog_transmit, transmit_start, + (thd, flags, log_ident, pos, &observe_transmission))) + { + errmsg= "Failed to run hook 'transmit_start'"; + my_errno= ER_UNKNOWN_ERROR; + GOTO_ERR; + } + has_transmit_started= true; /* reset transmit packet for the fake rotate event below */ - if (reset_transmit_packet(thd, 0/*flags*/, &ev_offset, &errmsg)) + if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg, + observe_transmission)) GOTO_ERR; /* @@ -1054,7 +1132,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, { /* reset transmit packet for the event read from binary log file */ - if (reset_transmit_packet(thd, 0/*flags*/, &ev_offset, &errmsg)) + if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg, + observe_transmission)) GOTO_ERR; /* @@ -1151,11 +1230,12 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, /* reset the transmit packet for the event read from binary log file */ - if (reset_transmit_packet(thd, 0/*flags*/, &ev_offset, &errmsg)) + if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg, + observe_transmission)) GOTO_ERR; DBUG_EXECUTE_IF("semi_sync_3-way_deadlock", { - const char act[]= "now wait_for signal.rotate_finished"; + const char act[]= "now wait_for signal.rotate_finished no_clear_event"; DBUG_ASSERT(!debug_sync_set_action(current_thd, STRING_WITH_LEN(act))); };); @@ -1165,6 +1245,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, log_file_name, &is_active_binlog))) { + time_t created; DBUG_PRINT("info", ("read_log_event returned 0 on line %d", __LINE__)); #ifndef DBUG_OFF if (max_binlog_dump_events && !left_events--) @@ -1217,6 +1298,33 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, GOTO_ERR; } (*packet)[FLAGS_OFFSET+ev_offset] &= ~LOG_EVENT_BINLOG_IN_USE_F; + + created= uint4korr(packet->ptr()+LOG_EVENT_MINIMAL_HEADER_LEN+ + ST_CREATED_OFFSET+ev_offset); + + if (using_gtid_protocol && created > 0) + { + if (first_gtid.sidno >= 1 && first_gtid.gno >= 1 && + slave_gtid_executed->contains_gtid(first_gtid.sidno, + first_gtid.gno)) + { + /* + As we are skipping at least the first transaction of the binlog, + we must clear the "created" field of the FD event (set it to 0) + to avoid cleaning up temp tables on slave. + */ + DBUG_PRINT("info",("setting 'created' to 0 before sending FD event")); + int4store((char*) packet->ptr()+LOG_EVENT_MINIMAL_HEADER_LEN+ + ST_CREATED_OFFSET+ev_offset, (ulong) 0); + + /* Fix the checksum due to latest changes in header */ + if (current_checksum_alg != BINLOG_CHECKSUM_ALG_OFF && + current_checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF) + fix_checksum(packet, ev_offset); + + first_gtid.clear(); + } + } /* Fixes the information on the checksum algorithm when a new format description is read. Notice that this only necessary @@ -1308,8 +1416,9 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, event_type, searching_first_gtid, skip_group, log_file_name, my_b_tell(&log))); pos = my_b_tell(&log); - if (RUN_HOOK(binlog_transmit, before_send_event, - (thd, 0/*flags*/, packet, log_file_name, pos))) + if (observe_transmission && + RUN_HOOK(binlog_transmit, before_send_event, + (thd, flags, packet, log_file_name, pos))) { my_errno= ER_UNKNOWN_ERROR; errmsg= "run 'before_send_event' hook failed"; @@ -1339,7 +1448,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, if (send_last_skip_group_heartbeat(thd, net, packet, p_last_skip_coord, &ev_offset, current_checksum_alg, - &errmsg)) + &errmsg, observe_transmission)) { GOTO_ERR; } @@ -1375,8 +1484,9 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, } } - if (RUN_HOOK(binlog_transmit, after_send_event, (thd, 0/*flags*/, packet, - log_file_name, skip_group ? pos : 0))) + if (observe_transmission && + RUN_HOOK(binlog_transmit, after_send_event, + (thd, flags, packet, log_file_name, skip_group ? pos : 0))) { errmsg= "Failed to run hook 'after_send_event'"; my_errno= ER_UNKNOWN_ERROR; @@ -1384,13 +1494,14 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, } /* reset transmit packet for next loop */ - if (reset_transmit_packet(thd, 0/*flags*/, &ev_offset, &errmsg)) + if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg, + observe_transmission)) GOTO_ERR; } DBUG_EXECUTE_IF("wait_after_binlog_EOF", { - const char act[]= "now wait_for signal.rotate_finished"; + const char act[]= "now wait_for signal.rotate_finished no_clear_event"; DBUG_ASSERT(!debug_sync_set_action(current_thd, STRING_WITH_LEN(act))); };); @@ -1441,7 +1552,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, /* reset the transmit packet for the event read from binary log file */ - if (reset_transmit_packet(thd, 0/*flags*/, &ev_offset, &errmsg)) + if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg, + observe_transmission)) GOTO_ERR; /* @@ -1473,8 +1585,42 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, int ret; ulong signal_cnt; DBUG_PRINT("wait",("waiting for data in binary log")); - if (thd->server_id==0) // for mysqlbinlog (mysqlbinlog.server_id==0) + /* + There are two ways to tell the server to not block: + + - Set the BINLOG_DUMP_NON_BLOCK flag. + This is official, documented, not used by any mysql + client, but used by some external users. + + - Set server_id=0. + This is unofficial, undocumented, and used by + mysqlbinlog -R since the beginning of time. + + When mysqlbinlog --stop-never is used, it sets a 'fake' + server_id that defaults to 1 but can be set to anything + else using stop-never-slave-server-id. This has the + drawback that if the server_id conflicts with any other + running slave, or with any other instance of mysqlbinlog + --stop-never, then that other instance will be killed. It + is also an unnecessary burden on the user to have to + specify a server_id different from all other server_ids + just to avoid conflicts. + + As of MySQL 5.6.20 and 5.7.5, mysqlbinlog redundantly sets + the BINLOG_DUMP_NONBLOCK flag when one or both of the + following holds: + - the --stop-never option is *not* specified + + In a far future, this means we can remove the unofficial + functionality that server_id=0 implies nonblocking + behavior. That will allow mysqlbinlog to use server_id=0 + always. That has the advantage that mysqlbinlog + --stop-never cannot cause any running dump threads to be + killed. + */ + if (thd->server_id == 0 || ((flags & BINLOG_DUMP_NON_BLOCK) != 0)) { + DBUG_PRINT("info", ("stopping dump thread because server_id==0 or the BINLOG_DUMP_NON_BLOCK flag is set: server_id=%u flags=%d", thd->server_id, flags)); mysql_mutex_unlock(log_lock); DBUG_EXECUTE_IF("inject_hb_event_on_mysqlbinlog_dump_thread", { @@ -1485,7 +1631,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, Suicide on failure, since if it happens the entire purpose of the test is comprimised. */ - if (reset_transmit_packet(thd, 0/*flags*/, &ev_offset, &errmsg) || + if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg, + observe_transmission) || send_heartbeat_event(net, packet, p_coord, current_checksum_alg)) DBUG_SUICIDE(); }); @@ -1520,7 +1667,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, { if (send_last_skip_group_heartbeat(thd, net, packet, p_coord, &ev_offset, - current_checksum_alg, &errmsg)) + current_checksum_alg, &errmsg, + observe_transmission)) { thd->EXIT_COND(&old_stage); GOTO_ERR; @@ -1542,7 +1690,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, } #endif /* reset transmit packet for the heartbeat event */ - if (reset_transmit_packet(thd, 0/*flags*/, &ev_offset, &errmsg)) + if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg, + observe_transmission)) { thd->EXIT_COND(&old_stage); GOTO_ERR; @@ -1648,16 +1797,18 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, /* If the last group was skipped, send a HB event */ if (last_skip_group && send_last_skip_group_heartbeat(thd, net, packet, - p_last_skip_coord, &ev_offset, - current_checksum_alg, &errmsg)) + p_last_skip_coord, &ev_offset, + current_checksum_alg, &errmsg, + observe_transmission)) { GOTO_ERR; } THD_STAGE_INFO(thd, stage_sending_binlog_event_to_slave); pos = my_b_tell(&log); - if (RUN_HOOK(binlog_transmit, before_send_event, - (thd, 0/*flags*/, packet, log_file_name, pos))) + if (observe_transmission && + RUN_HOOK(binlog_transmit, before_send_event, + (thd, flags, packet, log_file_name, pos))) { my_errno= ER_UNKNOWN_ERROR; errmsg= "run 'before_send_event' hook failed"; @@ -1684,8 +1835,10 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, if(!goto_next_binlog) { - if (RUN_HOOK(binlog_transmit, after_send_event, (thd, 0/*flags*/, packet, - log_file_name, skip_group ? pos : 0))) + if (observe_transmission && + RUN_HOOK(binlog_transmit, after_send_event, + (thd, flags, packet, log_file_name, + skip_group ? pos : 0))) { my_errno= ER_UNKNOWN_ERROR; errmsg= "Failed to run hook 'after_send_event'"; @@ -1721,7 +1874,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, mysql_file_close(file, MYF(MY_WME)); /* reset transmit packet for the possible fake rotate event */ - if (reset_transmit_packet(thd, 0/*flags*/, &ev_offset, &errmsg)) + if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg, + observe_transmission)) GOTO_ERR; /* @@ -1757,7 +1911,8 @@ end: end_io_cache(&log); mysql_file_close(file, MYF(MY_WME)); - (void) RUN_HOOK(binlog_transmit, transmit_stop, (thd, 0/*flags*/)); + if (has_transmit_started) + (void) RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags)); my_eof(thd); THD_STAGE_INFO(thd, stage_waiting_to_finalize_termination); mysql_mutex_lock(&LOCK_thread_count); @@ -1789,7 +1944,8 @@ err: error_text[sizeof(error_text) - 1]= '\0'; } end_io_cache(&log); - (void) RUN_HOOK(binlog_transmit, transmit_stop, (thd, 0/*flags*/)); + if (has_transmit_started) + (void) RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags)); /* Exclude iteration through thread list this is needed for purge_logs() - it will iterate through @@ -1888,6 +2044,11 @@ void kill_zombie_dump_threads(String *slave_uuid) it will be slow because it will iterate through the list again. We just to do kill the thread ourselves. */ + if (log_warnings > 1) + 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()); tmp->awake(THD::KILL_QUERY); mysql_mutex_unlock(&tmp->LOCK_thd_data); } @@ -2021,6 +2182,7 @@ bool show_binlogs(THD* thd) DBUG_RETURN(TRUE); mysql_mutex_lock(mysql_bin_log.get_log_lock()); + DEBUG_SYNC(thd, "show_binlogs_after_lock_log_before_lock_index"); mysql_bin_log.lock_index(); index_file=mysql_bin_log.get_index_file(); diff --git a/mysql-wsrep-5.6/sql/rpl_master.h b/mysql-wsrep-5.6/sql/rpl_master.h index bb898aa7..94b76083 100644 --- a/mysql-wsrep-5.6/sql/rpl_master.h +++ b/mysql-wsrep-5.6/sql/rpl_master.h @@ -1,5 +1,5 @@ #ifndef RPL_MASTER_H_INCLUDED -/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. This 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 @@ bool com_binlog_dump(THD *thd, char *packet, uint packet_length); events in that set. */ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, - const Gtid_set* gtid_set); + const Gtid_set* gtid_set, int flags); int reset_master(THD* thd); diff --git a/mysql-wsrep-5.6/sql/rpl_reporting.cc b/mysql-wsrep-5.6/sql/rpl_reporting.cc index d8293f8c..84982932 100644 --- a/mysql-wsrep-5.6/sql/rpl_reporting.cc +++ b/mysql-wsrep-5.6/sql/rpl_reporting.cc @@ -161,8 +161,8 @@ Slave_reporting_capability::va_report(loglevel level, int err_code, } curr_buff= pbuff; if (prefix_msg) - curr_buff += sprintf(curr_buff, "%s; ", prefix_msg); - my_vsnprintf(curr_buff, pbuffsize, msg, args); + curr_buff += my_snprintf(curr_buff, pbuffsize, "%s; ", prefix_msg); + my_vsnprintf(curr_buff, pbuffsize - (curr_buff - pbuff), msg, args); mysql_mutex_unlock(&err_lock); @@ -172,7 +172,7 @@ Slave_reporting_capability::va_report(loglevel level, int err_code, m_thread_name, pbuff, (curr_buff[0] && *(strend(curr_buff)-1) == '.') ? "" : ",", err_code); -#endif +#endif } Slave_reporting_capability::~Slave_reporting_capability() diff --git a/mysql-wsrep-5.6/sql/rpl_rli.cc b/mysql-wsrep-5.6/sql/rpl_rli.cc index 9b3c8861..dc058f36 100644 --- a/mysql-wsrep-5.6/sql/rpl_rli.cc +++ b/mysql-wsrep-5.6/sql/rpl_rli.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1183,9 +1183,8 @@ bool Relay_log_info::is_until_satisfied(THD *thd, Log_event *ev) if (ev && ev->server_id == (uint32) ::server_id && !replicate_same_server_id) DBUG_RETURN(false); log_name= group_master_log_name; - log_pos= (!ev)? group_master_log_pos : - ((thd->variables.option_bits & OPTION_BEGIN || !ev->log_pos) ? - group_master_log_pos : ev->log_pos - ev->data_written); + log_pos= (!ev || is_in_group() || !ev->log_pos) ? + group_master_log_pos : ev->log_pos - ev->data_written; } else { /* until_condition == UNTIL_RELAY_POS */ diff --git a/mysql-wsrep-5.6/sql/rpl_rli.h b/mysql-wsrep-5.6/sql/rpl_rli.h index 10a8b153..cfaa6993 100644 --- a/mysql-wsrep-5.6/sql/rpl_rli.h +++ b/mysql-wsrep-5.6/sql/rpl_rli.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -534,13 +534,6 @@ public: ulong mts_recovery_index; // running index of recoverable groups bool mts_recovery_group_seen_begin; - /* - Coordinator's specific mem-root to hold various temporary data while - the current group is being schedulled. The root is shunk to default size - at the end of the group distribution. - */ - MEM_ROOT mts_coor_mem_root; - /* While distibuting events basing on their properties MTS Coordinator changes its mts group status. @@ -717,13 +710,16 @@ public: Replication is inside a group if either: - The OPTION_BEGIN flag is set, meaning we're inside a transaction - The RLI_IN_STMT flag is set, meaning we're inside a statement + - There is an GTID owned by the thd, meaning we've passed a SET GTID_NEXT @retval true Replication thread is currently inside a group @retval false Replication thread is currently not inside a group */ bool is_in_group() const { return (info_thd->variables.option_bits & OPTION_BEGIN) || - (m_flags & (1UL << IN_STMT)); + (m_flags & (1UL << IN_STMT)) || + /* If a SET GTID_NEXT was issued we are inside of a group */ + info_thd->owned_gtid.sidno; } int count_relay_log_space(); diff --git a/mysql-wsrep-5.6/sql/rpl_rli_pdb.cc b/mysql-wsrep-5.6/sql/rpl_rli_pdb.cc index 91333d60..6f5cab16 100644 --- a/mysql-wsrep-5.6/sql/rpl_rli_pdb.cc +++ b/mysql-wsrep-5.6/sql/rpl_rli_pdb.cc @@ -490,6 +490,15 @@ bool Slave_worker::commit_positions(Log_event *ev, Slave_job_group* ptr_g, bool DBUG_RETURN(flush_info(force)); } +void Slave_worker::rollback_positions(Slave_job_group* ptr_g) +{ + if (!is_transactional()) + { + bitmap_clear_bit(&group_executed, ptr_g->checkpoint_seqno); + flush_info(false); + } +} + static HASH mapping_db_to_worker; static bool inited_hash_workers= FALSE; @@ -1491,11 +1500,11 @@ void Slave_worker::do_report(loglevel level, int err_code, const char *msg, { buff_gtid[0]= 0; } - - sprintf(buff_coord, - "Worker %lu failed executing transaction '%s' at " - "master log %s, end_log_pos %llu", - id, buff_gtid, log_name, log_pos); + + my_snprintf(buff_coord, sizeof(buff_coord), + "Worker %lu failed executing transaction '%s' at " + "master log %s, end_log_pos %llu", + id, buff_gtid, log_name, log_pos); c_rli->va_report(level, err_code, buff_coord, msg, args); } diff --git a/mysql-wsrep-5.6/sql/rpl_rli_pdb.h b/mysql-wsrep-5.6/sql/rpl_rli_pdb.h index 9b121520..ef98c7d6 100644 --- a/mysql-wsrep-5.6/sql/rpl_rli_pdb.h +++ b/mysql-wsrep-5.6/sql/rpl_rli_pdb.h @@ -378,6 +378,14 @@ public: ulonglong get_master_log_pos() { return master_log_pos; }; ulonglong set_master_log_pos(ulong val) { return master_log_pos= val; }; bool commit_positions(Log_event *evt, Slave_job_group *ptr_g, bool force); + /* + When commit fails clear bitmap for executed worker group. Revert back the + positions to the old positions that existed before commit using the checkpoint. + + @param Slave_job_group a pointer to Slave_job_group struct instance which + holds group master log pos, group relay log pos and checkpoint positions. + */ + void rollback_positions(Slave_job_group *ptr_g); bool reset_recovery_info(); /** Different from the parent method in that this does not delete diff --git a/mysql-wsrep-5.6/sql/rpl_slave.cc b/mysql-wsrep-5.6/sql/rpl_slave.cc index 90e7823e..736d790e 100644 --- a/mysql-wsrep-5.6/sql/rpl_slave.cc +++ b/mysql-wsrep-5.6/sql/rpl_slave.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -414,6 +414,191 @@ err: DBUG_RETURN(error); } +/** + Parse the given relay log and identify the rotate event from the master. + Ignore the Format description event, Previous_gtid log event and ignorable + events within the relay log. When a rotate event is found check if it is a + rotate that is originated from the master or not based on the server_id. If + the rotate is from slave or if it is a fake rotate event ignore the event. + If any other events are encountered apart from the above events generate an + error. From the rotate event extract the master's binary log name and + position. + + @param filename + Relay log name which needs to be parsed. + + @param[OUT] master_log_file + Set the master_log_file to the log file name that is extracted from + rotate event. The master_log_file should contain string of len + FN_REFLEN. + + @param[OUT] master_log_pos + Set the master_log_pos to the log position extracted from rotate + event. + + @retval FOUND_ROTATE: When rotate event is found in the relay log + @retval NOT_FOUND_ROTATE: When rotate event is not found in the relay log + @retval ERROR: On error + */ +enum enum_read_rotate_from_relay_log_status +{ FOUND_ROTATE, NOT_FOUND_ROTATE, ERROR }; + +static enum_read_rotate_from_relay_log_status +read_rotate_from_relay_log(char *filename, char *master_log_file, + my_off_t *master_log_pos) +{ + DBUG_ENTER("read_rotate_from_relay_log"); + /* + Create a Format_description_log_event that is used to read the + first event of the log. + */ + Format_description_log_event fd_ev(BINLOG_VERSION), *fd_ev_p= &fd_ev; + DBUG_ASSERT(fd_ev.is_valid()); + IO_CACHE log; + const char *errmsg= NULL; + File file= open_binlog_file(&log, filename, &errmsg); + if (file < 0) + { + sql_print_error("Error during --relay-log-recovery: %s", errmsg); + DBUG_RETURN(ERROR); + } + my_b_seek(&log, BIN_LOG_HEADER_SIZE); + Log_event *ev= NULL; + bool done= false; + enum_read_rotate_from_relay_log_status ret= NOT_FOUND_ROTATE; + while (!done && + (ev= Log_event::read_log_event(&log, 0, fd_ev_p, opt_slave_sql_verify_checksum)) != + NULL) + { + DBUG_PRINT("info", ("Read event of type %s", ev->get_type_str())); + switch (ev->get_type_code()) + { + case FORMAT_DESCRIPTION_EVENT: + if (fd_ev_p != &fd_ev) + delete fd_ev_p; + fd_ev_p= (Format_description_log_event *)ev; + break; + case ROTATE_EVENT: + /* + Check for rotate event from the master. Ignore the ROTATE event if it + is a fake rotate event with server_id=0. + */ + if (ev->server_id && ev->server_id != ::server_id) + { + Rotate_log_event *rotate_ev= (Rotate_log_event *)ev; + DBUG_ASSERT(FN_REFLEN >= rotate_ev->ident_len + 1); + memcpy(master_log_file, rotate_ev->new_log_ident, rotate_ev->ident_len + 1); + *master_log_pos= rotate_ev->pos; + ret= FOUND_ROTATE; + done= true; + } + break; + case PREVIOUS_GTIDS_LOG_EVENT: + break; + case IGNORABLE_LOG_EVENT: + break; + default: + sql_print_error("Error during --relay-log-recovery: Could not locate " + "rotate event from the master."); + ret= ERROR; + done= true; + break; + } + if (ev != fd_ev_p) + delete ev; + } + if (log.error < 0) + { + sql_print_error("Error during --relay-log-recovery: Error reading events from relay log: %d", + log.error); + DBUG_RETURN(ERROR); + } + + if (fd_ev_p != &fd_ev) + { + delete fd_ev_p; + fd_ev_p= &fd_ev; + } + + if (mysql_file_close(file, MYF(MY_WME))) + DBUG_RETURN(ERROR); + if (end_io_cache(&log)) + { + sql_print_error("Error during --relay-log-recovery: Error while freeing " + "IO_CACHE object"); + DBUG_RETURN(ERROR); + } + DBUG_RETURN(ret); +} + +/** + Reads relay logs one by one starting from the first relay log. Looks for + the first rotate event from the master. If rotate is not found in the relay + log search continues to next relay log. If rotate event from master is + found then the extracted master_log_file and master_log_pos are used to set + rli->group_master_log_name and rli->group_master_log_pos. If an error has + occurred the error code is retuned back. + + @param rli + Relay_log_info object to read relay log files and to set + group_master_log_name and group_master_log_pos. + + @retval 0 On success + @retval 1 On failure + */ +static int +find_first_relay_log_with_rotate_from_master(Relay_log_info* rli) +{ + DBUG_ENTER("find_first_relay_log_with_rotate_from_master"); + int error= 0; + LOG_INFO linfo; + bool got_rotate_from_master= false; + int pos; + char master_log_file[FN_REFLEN]; + my_off_t master_log_pos= 0; + + for (pos= rli->relay_log.find_log_pos(&linfo, NULL, true); + !pos; + pos= rli->relay_log.find_next_log(&linfo, true)) + { + switch (read_rotate_from_relay_log(linfo.log_file_name, master_log_file, + &master_log_pos)) + { + case ERROR: + error= 1; + break; + case FOUND_ROTATE: + got_rotate_from_master= true; + break; + case NOT_FOUND_ROTATE: + break; + } + if (error || got_rotate_from_master) + break; + } + if (pos== LOG_INFO_IO) + { + error= 1; + sql_print_error("Error during --relay-log-recovery: Could not read " + "relay log index file due to an IO error."); + goto err; + } + if (pos== LOG_INFO_EOF) + { + error= 1; + sql_print_error("Error during --relay-log-recovery: Could not locate " + "rotate event from master in relay log file."); + goto err; + } + if (!error && got_rotate_from_master) + { + rli->set_group_master_log_name(master_log_file); + rli->set_group_master_log_pos(master_log_pos); + } +err: + DBUG_RETURN(error); +} + /* Updates the master info based on the information stored in the relay info and ignores relay logs previously retrieved by the IO @@ -421,6 +606,14 @@ err: master_log_pos and master_log_name. Eventually, the old relay logs will be purged by the normal purge mechanism. + There can be a special case where rli->group_master_log_name and + rli->group_master_log_pos are not intialized, as the sql thread was never + started at all. In those cases all the existing relay logs are parsed + starting from the first one and the initial rotate event that was received + from the master is identified. From the rotate event master_log_name and + master_log_pos are extracted and they are set to rli->group_master_log_name + and rli->group_master_log_pos. + In the feature, we should improve this routine in order to avoid throwing away logs that are safely stored in the disk. Note also that this recovery routine relies on the correctness of the relay-log.info and only tolerates @@ -475,8 +668,23 @@ int init_recovery(Master_info* mi, const char** errmsg) } group_master_log_name= const_cast<char *>(rli->get_group_master_log_name()); - if (!error && group_master_log_name[0]) + if (!error) { + if (!group_master_log_name[0]) + { + if (rli->replicate_same_server_id) + { + error= 1; + sql_print_error("Error during --relay-log-recovery: " + "replicate_same_server_id is in use and sql thread's " + "positions are not initialized, hence relay log " + "recovery cannot happen."); + DBUG_RETURN(error); + } + error= find_first_relay_log_with_rotate_from_master(rli); + if (error) + DBUG_RETURN(error); + } mi->set_master_log_pos(max<ulonglong>(BIN_LOG_HEADER_SIZE, rli->get_group_master_log_pos())); mi->set_master_log_name(rli->get_group_master_log_name()); @@ -1801,6 +2009,15 @@ static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi) goto err; } + if (mi->get_mi_description_event()->binlog_version < 4 && + opt_slave_sql_verify_checksum) + { + sql_print_warning("Found a master with MySQL server version older than " + "5.0. With checksums enabled on the slave, replication " + "might not work correctly. To ensure correct " + "replication, restart the slave server with " + "--slave_sql_verify_checksum=0."); + } /* FD_q's (A) is set initially from RL's (A): FD_q.(A) := RL.(A). It's necessary to adjust FD_q.(A) at this point because in the following @@ -2883,9 +3100,9 @@ bool show_slave_status(THD* thd, Master_info* mi) // Last_SQL_Error_Timestamp protocol->store(mi->rli->last_error().timestamp, &my_charset_bin); // Master_Ssl_Crl - protocol->store(mi->ssl_ca, &my_charset_bin); + protocol->store(mi->ssl_crl, &my_charset_bin); // Master_Ssl_Crlpath - protocol->store(mi->ssl_capath, &my_charset_bin); + protocol->store(mi->ssl_crlpath, &my_charset_bin); // Retrieved_Gtid_Set protocol->store(io_gtid_set_buffer, &my_charset_bin); // Executed_Gtid_Set @@ -3275,9 +3492,13 @@ static ulong read_event(MYSQL* mysql, Master_info *mi, bool* suppress_warnings) /* Check if eof packet */ if (len < 8 && mysql->net.read_pos[0] == 254) { - sql_print_information("Slave: received end packet from server, apparent " - "master shutdown: %s", - mysql_error(mysql)); + sql_print_information("Slave: received end packet from server due to dump " + "thread being killed on master. Dump threads are " + "killed for example during master shutdown, " + "explicitly by a user, or when the master receives " + "a binlog send request from a duplicate server " + "UUID <%s> : Error %s", ::server_uuid, + mysql_error(mysql)); DBUG_RETURN(packet_error); } @@ -3754,6 +3975,88 @@ apply_event_and_update_pos(Log_event** ptr_ev, THD* thd, Relay_log_info* rli) : SLAVE_APPLY_EVENT_AND_UPDATE_POS_OK); } +/** + Let the worker applying the current group to rollback and gracefully + finish its work before. + + @param rli The slave's relay log info. + + @param ev a pointer to the event on hold before applying this rollback + procedure. + + @retval false The rollback succeeded. + + @retval true There was an error while injecting events. +*/ +static bool coord_handle_partial_binlogged_transaction(Relay_log_info *rli, + const Log_event *ev) +{ + DBUG_ENTER("coord_handle_partial_binlogged_transaction"); + /* + This function is called holding the rli->data_lock. + We must return it still holding this lock, except in the case of returning + error. + */ + mysql_mutex_assert_owner(&rli->data_lock); + THD *thd= rli->info_thd; + + if (!rli->curr_group_seen_begin) + { + DBUG_PRINT("info",("Injecting QUERY(BEGIN) to rollback worker")); + Log_event *begin_event= new Query_log_event(thd, + STRING_WITH_LEN("BEGIN"), + true, /* using_trans */ + false, /* immediate */ + true, /* suppress_use */ + 0, /* error */ + true /* ignore_command */); + ((Query_log_event*) begin_event)->db= ""; + begin_event->data_written= 0; + begin_event->server_id= ev->server_id; + /* + We must be careful to avoid SQL thread increasing its position + farther than the event that triggered this QUERY(BEGIN). + */ + begin_event->log_pos= ev->log_pos; + begin_event->future_event_relay_log_pos= ev->future_event_relay_log_pos; + + if (apply_event_and_update_pos(&begin_event, thd, rli) != + SLAVE_APPLY_EVENT_AND_UPDATE_POS_OK) + { + delete begin_event; + DBUG_RETURN(true); + } + mysql_mutex_lock(&rli->data_lock); + } + + DBUG_PRINT("info",("Injecting QUERY(ROLLBACK) to rollback worker")); + Log_event *rollback_event= new Query_log_event(thd, + STRING_WITH_LEN("ROLLBACK"), + true, /* using_trans */ + false, /* immediate */ + true, /* suppress_use */ + 0, /* error */ + true /* ignore_command */); + ((Query_log_event*) rollback_event)->db= ""; + rollback_event->data_written= 0; + rollback_event->server_id= ev->server_id; + /* + We must be careful to avoid SQL thread increasing its position + farther than the event that triggered this QUERY(ROLLBACK). + */ + rollback_event->log_pos= ev->log_pos; + rollback_event->future_event_relay_log_pos= ev->future_event_relay_log_pos; + + if (apply_event_and_update_pos(&rollback_event, thd, rli) != + SLAVE_APPLY_EVENT_AND_UPDATE_POS_OK) + { + delete rollback_event; + DBUG_RETURN(true); + } + mysql_mutex_lock(&rli->data_lock); + + DBUG_RETURN(false); +} /** Top-level function for executing the next event in the relay log. @@ -3832,12 +4135,13 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) that are not replayed, so we keep falling behind). If it is an artificial event, or a relay log event (IO thread generated - event) or ev->when is set to 0, or a FD from master, we don't update the - last_master_timestamp. + event) or ev->when is set to 0, or a FD from master, or a heartbeat + event with server_id '0' then we don't update the last_master_timestamp. */ if (!(rli->is_parallel_exec() || ev->is_artificial_event() || ev->is_relay_log_event() || - (ev->when.tv_sec == 0) || ev->get_type_code() == FORMAT_DESCRIPTION_EVENT)) + ev->when.tv_sec == 0 || ev->get_type_code() == FORMAT_DESCRIPTION_EVENT || + ev->server_id == 0)) { rli->last_master_timestamp= ev->when.tv_sec + (time_t) ev->exec_time; DBUG_ASSERT(rli->last_master_timestamp >= 0); @@ -3885,6 +4189,28 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) };); } + /* + GTID protocol will put a FORMAT_DESCRIPTION_EVENT from the master with + log_pos != 0 after each (re)connection if auto positioning is enabled. + This means that the SQL thread might have already started to apply the + current group but, as the IO thread had to reconnect, it left this + group incomplete and will start it again from the beginning. + So, before applying this FORMAT_DESCRIPTION_EVENT, we must let the + worker roll back the current group and gracefully finish its work, + before starting to apply the new (complete) copy of the group. + */ + if (ev->get_type_code() == FORMAT_DESCRIPTION_EVENT && + ev->server_id != ::server_id && ev->log_pos != 0 && + rli->is_parallel_exec() && rli->curr_group_seen_gtid) + { + if (coord_handle_partial_binlogged_transaction(rli, ev)) + /* + In the case of an error, coord_handle_partial_binlogged_transaction + will not try to get the rli->data_lock again. + */ + DBUG_RETURN(1); + } + /* ptr_ev can change to NULL indicating MTS coorinator passed to a Worker */ exec_res= apply_event_and_update_pos(ptr_ev, thd, rli); /* @@ -3901,6 +4227,15 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) { DBUG_ASSERT(*ptr_ev == ev); // event remains to belong to Coordinator + DBUG_EXECUTE_IF("dbug.calculate_sbm_after_previous_gtid_log_event", + { + if (ev->get_type_code() == PREVIOUS_GTIDS_LOG_EVENT) + { + const char act[]= "now signal signal.reached wait_for signal.done_sbm_calculation"; + DBUG_ASSERT(opt_debug_sync_timeout > 0); + DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act))); + } + };); /* Format_description_log_event should not be deleted because it will be used to read info about the relay log's format; it will be deleted when @@ -4226,6 +4561,11 @@ connected: DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act))); };); + DBUG_EXECUTE_IF("dbug.calculate_sbm_after_previous_gtid_log_event", + { + /* Fake that thread started 3 mints ago */ + thd->start_time.tv_sec-=180; + };); mysql_mutex_lock(&mi->run_lock); mi->slave_running= MYSQL_SLAVE_RUN_CONNECT; mysql_mutex_unlock(&mi->run_lock); @@ -4452,15 +4792,27 @@ log space"); } 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; + thd->killed= THD::KILLED_NO_VALUE; ); DBUG_EXECUTE_IF("stop_io_after_reading_query_log_event", if (event_buf[EVENT_TYPE_OFFSET] == QUERY_EVENT) - thd->killed= THD::KILLED_NO_VALUE; + thd->killed= THD::KILLED_NO_VALUE; + ); + DBUG_EXECUTE_IF("stop_io_after_reading_user_var_log_event", + if (event_buf[EVENT_TYPE_OFFSET] == USER_VAR_EVENT) + thd->killed= THD::KILLED_NO_VALUE; + ); + DBUG_EXECUTE_IF("stop_io_after_reading_table_map_event", + if (event_buf[EVENT_TYPE_OFFSET] == TABLE_MAP_EVENT) + thd->killed= THD::KILLED_NO_VALUE; ); DBUG_EXECUTE_IF("stop_io_after_reading_xid_log_event", if (event_buf[EVENT_TYPE_OFFSET] == XID_EVENT) - thd->killed= THD::KILLED_NO_VALUE; + thd->killed= THD::KILLED_NO_VALUE; + ); + DBUG_EXECUTE_IF("stop_io_after_reading_write_rows_log_event", + if (event_buf[EVENT_TYPE_OFFSET] == WRITE_ROWS_EVENT) + thd->killed= THD::KILLED_NO_VALUE; ); } } @@ -4508,11 +4860,9 @@ err: net_end(&thd->net); // destructor will not free it, because net.vio is 0 thd->release_resources(); - mysql_mutex_lock(&LOCK_thread_count); THD_CHECK_SENTRY(thd); if (thd_added) remove_global_thread(thd); - mysql_mutex_unlock(&LOCK_thread_count); delete thd; mi->abort_slave= 0; @@ -4712,12 +5062,9 @@ err: */ thd->system_thread= NON_SYSTEM_THREAD; thd->release_resources(); - - mysql_mutex_lock(&LOCK_thread_count); THD_CHECK_SENTRY(thd); if (thd_added) remove_global_thread(thd); - mysql_mutex_unlock(&LOCK_thread_count); delete thd; } @@ -5301,11 +5648,6 @@ int slave_start_workers(Relay_log_info *rli, ulong n, bool *mts_inited) rli->checkpoint_seqno= 0; rli->mts_last_online_stat= my_time(0); rli->mts_group_status= Relay_log_info::MTS_NOT_IN_GROUP; - /* - dyn memory to consume by Coordinator per event - */ - init_alloc_root(&rli->mts_coor_mem_root, NAME_LEN, - (MAX_DBS_IN_EVENT_MTS / 2) * NAME_LEN); if (init_hash_workers(n)) // MTS: mapping_db_to_worker { @@ -5461,7 +5803,6 @@ end: delete_dynamic(&rli->curr_group_assigned_parts); // GCAP rli->deinit_workers(); rli->slave_parallel_workers= 0; - free_root(&rli->mts_coor_mem_root, MYF(0)); *mts_inited= false; } @@ -5846,11 +6187,9 @@ llstr(rli->get_group_master_log_pos(), llbuff)); set_thd_in_use_temporary_tables(rli); // (re)set info_thd in use for saved temp tables thd->release_resources(); - mysql_mutex_lock(&LOCK_thread_count); THD_CHECK_SENTRY(thd); if (thd_added) remove_global_thread(thd); - mysql_mutex_unlock(&LOCK_thread_count); delete thd; /* Note: the order of the broadcast and unlock calls below (first broadcast, then unlock) @@ -6577,11 +6916,6 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) case PREVIOUS_GTIDS_LOG_EVENT: { - if (gtid_mode == 0) - { - error= ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF; - goto err; - } /* This event does not have any meaning for the slave and was just sent to show the slave the master is making @@ -6629,6 +6963,23 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) break; } + /* + Simulate an unknown ignorable log event by rewriting the write_rows log + event and previous_gtids log event before writing them in relay log. + */ + DBUG_EXECUTE_IF("simulate_unknown_ignorable_log_event", + if (event_type == WRITE_ROWS_EVENT || + event_type == PREVIOUS_GTIDS_LOG_EVENT) + { + char *event_buf= const_cast<char*>(buf); + /* Overwrite the log event type with an unknown type. */ + event_buf[EVENT_TYPE_OFFSET]= ENUM_END_EVENT + 1; + /* Set LOG_EVENT_IGNORABLE_F for the log event. */ + int2store(event_buf + FLAGS_OFFSET, + uint2korr(event_buf + FLAGS_OFFSET) | LOG_EVENT_IGNORABLE_F); + } + ); + /* If this event is originating from this server, don't queue it. We don't check this for 3.23 events because it's simpler like this; 3.23 @@ -6812,7 +7163,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, #endif ulong client_flag= CLIENT_REMEMBER_OPTIONS; if (opt_slave_compressed_protocol) - client_flag=CLIENT_COMPRESS; /* We will use compression */ + client_flag|= CLIENT_COMPRESS; /* We will use compression */ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout); mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout); @@ -6832,9 +7183,13 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, mi->ssl_ca[0]?mi->ssl_ca:0, mi->ssl_capath[0]?mi->ssl_capath:0, mi->ssl_cipher[0]?mi->ssl_cipher:0); - mysql_options(mysql, MYSQL_OPT_SSL_CRL, +#ifdef HAVE_YASSL + mi->ssl_crl[0]= '\0'; + mi->ssl_crlpath[0]= '\0'; +#endif + mysql_options(mysql, MYSQL_OPT_SSL_CRL, mi->ssl_crl[0] ? mi->ssl_crl : 0); - mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, + mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, mi->ssl_crlpath[0] ? mi->ssl_crlpath : 0); mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &mi->ssl_verify_server_cert); @@ -6961,107 +7316,6 @@ static int safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi, } -MYSQL *rpl_connect_master(MYSQL *mysql) -{ - THD *thd= current_thd; - char password[MAX_PASSWORD_LENGTH + 1]; - int password_size= sizeof(password); - Master_info *mi= my_pthread_getspecific_ptr(Master_info*, RPL_MASTER_INFO); - if (!mi) - { - sql_print_error("'rpl_connect_master' must be called in slave I/O thread context."); - return NULL; - } - - bool allocated= false; - - if (!mysql) - { - if(!(mysql= mysql_init(NULL))) - { - sql_print_error("rpl_connect_master: failed in mysql_init()"); - return NULL; - } - allocated= true; - } - - /* - XXX: copied from connect_to_master, this function should not - change the slave status, so we cannot use connect_to_master - directly - - TODO: make this part a seperate function to eliminate duplication - */ - mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout); - mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout); - - if (mi->bind_addr[0]) - { - DBUG_PRINT("info",("bind_addr: %s", mi->bind_addr)); - mysql_options(mysql, MYSQL_OPT_BIND, mi->bind_addr); - } - -#ifdef HAVE_OPENSSL - if (mi->ssl) - { - mysql_ssl_set(mysql, - mi->ssl_key[0]?mi->ssl_key:0, - mi->ssl_cert[0]?mi->ssl_cert:0, - mi->ssl_ca[0]?mi->ssl_ca:0, - mi->ssl_capath[0]?mi->ssl_capath:0, - mi->ssl_cipher[0]?mi->ssl_cipher:0); - mysql_options(mysql, MYSQL_OPT_SSL_CRL, - mi->ssl_crl[0] ? mi->ssl_crl : 0); - mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, - mi->ssl_crlpath[0] ? mi->ssl_crlpath : 0); - mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, - &mi->