From b550771df3620fd9e584f608738a3e0d8610f4b1 Mon Sep 17 00:00:00 2001 From: Dmitry Teselkin Date: Thu, 25 May 2017 18:03:06 +0300 Subject: [PATCH] mysql 5.6.36 * Update mysql to 5.6.36 * d/p/* - quilt refresh to avoid fuzz * d/rules - switch to bundled editline instead of system to avoid broken build Closes-Bug: #1691463 Related-Prod: https://mirantis.jira.com/browse/PROD-11416 Change-Id: I42628acf53354767ee348941ae6b2a4180514988 --- debian/changelog | 9 + debian/patches/fix_standalone_tests.patch | 4 +- debian/patches/hurd.patch | 2 +- debian/patches/kfreebsd_tests.patch | 2 +- .../scripts__mysqld_safe.sh__signals.patch | 6 +- debian/rules | 2 +- mysql-wsrep-5.6/CMakeLists.txt | 12 +- mysql-wsrep-5.6/README | 2 +- mysql-wsrep-5.6/VERSION | 2 +- mysql-wsrep-5.6/client/client_priv.h | 34 +- mysql-wsrep-5.6/client/mysql.cc | 15 +- mysql-wsrep-5.6/client/mysql_upgrade.c | 6 +- mysql-wsrep-5.6/client/mysqladmin.cc | 6 +- mysql-wsrep-5.6/client/mysqlcheck.c | 4 +- mysql-wsrep-5.6/client/mysqldump.c | 60 +- mysql-wsrep-5.6/client/mysqlimport.c | 4 +- mysql-wsrep-5.6/client/mysqlshow.c | 4 +- mysql-wsrep-5.6/client/mysqlslap.c | 5 +- mysql-wsrep-5.6/client/mysqltest.cc | 14 +- mysql-wsrep-5.6/cmake/os/SunOS.cmake | 5 +- mysql-wsrep-5.6/cmake/os/Windows.cmake | 7 +- mysql-wsrep-5.6/cmake/readline.cmake | 22 +- mysql-wsrep-5.6/config.h.cmake | 3 +- mysql-wsrep-5.6/configure.cmake | 5 +- mysql-wsrep-5.6/include/mysql.h | 10 +- mysql-wsrep-5.6/include/mysql.h.pp | 7 +- mysql-wsrep-5.6/include/mysql_com.h | 3 +- mysql-wsrep-5.6/include/sql_common.h | 3 +- mysql-wsrep-5.6/include/sslopt-case.h | 4 +- mysql-wsrep-5.6/include/sslopt-vars.h | 6 +- .../include/welcome_copyright_notice.h | 4 +- .../collections/default.weekly.basic | 35 +- mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm | 3 +- mysql-wsrep-5.6/mysql-test/mysql-test-run.pl | 20 +- mysql-wsrep-5.6/mysql-test/r/distinct.result | 13 + mysql-wsrep-5.6/mysql-test/r/events_2.result | 4 +- .../mysql-test/r/group_min_max_innodb.result | 238 +++++++ mysql-wsrep-5.6/mysql-test/r/loaddata.result | 2 +- .../mysql-test/r/log_tables-big.result | 14 +- .../mysql-test/r/mysql_config_editor.result | 2 +- mysql-wsrep-5.6/mysql-test/r/mysqldump.result | 63 ++ mysql-wsrep-5.6/mysql-test/r/parser.result | 4 + mysql-wsrep-5.6/mysql-test/r/ps.result | 27 + mysql-wsrep-5.6/mysql-test/r/ssl_mode.result | 6 +- .../mysql-test/r/ssl_mode_no_ssl.result | 22 +- mysql-wsrep-5.6/mysql-test/r/symlink.result | 11 + .../mysql-test/std_data/checkDBI_DBD-mysql.pl | 4 +- .../suite/innodb/r/end_range_check.result | 54 ++ .../suite/innodb/r/ibuf_not_empty.result | 30 + .../innodb/r/innodb_force_recovery.result | 64 ++ .../suite/innodb/r/innodb_io_pf.result | 19 + .../suite/innodb/r/undo_space_id.result | 11 + .../suite/innodb/t/end_range_check.test | 77 +++ .../suite/innodb/t/ibuf_not_empty-master.opt | 1 + .../suite/innodb/t/ibuf_not_empty.test | 102 +++ .../suite/innodb/t/innodb_force_recovery.test | 155 +++++ .../suite/innodb/t/innodb_io_pf.test | 15 + .../suite/innodb/t/undo_space_id.test | 30 + .../suite/opt_trace/include/bugs.inc | 7 +- .../suite/opt_trace/r/bugs_no_prot_all.result | 296 +-------- .../opt_trace/r/bugs_no_prot_none.result | 296 +-------- .../suite/opt_trace/r/bugs_ps_prot_all.result | 296 +-------- .../opt_trace/r/bugs_ps_prot_none.result | 296 +-------- .../perfschema/r/start_server_1_digest.result | 7 + .../t/start_server_1_digest-master.opt | 1 + .../perfschema/t/start_server_1_digest.test | 15 + .../suite/rpl/r/rpl_alter_user.result | 47 ++ .../r/rpl_gtid_sql_until_before_after.result | 23 + .../suite/rpl/r/rpl_gtid_temp_table.result | 2 + .../suite/rpl/r/rpl_master_pos_wait.result | 22 + .../r/rpl_parallel_switch_sequential.result | 1 + .../rpl/r/rpl_sbm_fake_rotate_event.result | 20 + .../suite/rpl/t/rpl_alter_user.test | 104 +++ .../t/rpl_gtid_sql_until_before_after.test | 33 + .../suite/rpl/t/rpl_gtid_temp_table.test | 4 + .../suite/rpl/t/rpl_master_pos_wait.test | 34 + .../rpl/t/rpl_parallel_switch_sequential.test | 6 +- .../rpl/t/rpl_sbm_fake_rotate_event.test | 61 ++ mysql-wsrep-5.6/mysql-test/t/disabled.def | 3 +- mysql-wsrep-5.6/mysql-test/t/distinct.test | 16 + mysql-wsrep-5.6/mysql-test/t/events_2.test | 2 +- .../mysql-test/t/group_min_max_innodb.test | 162 +++++ mysql-wsrep-5.6/mysql-test/t/loaddata.test | 2 +- .../mysql-test/t/log_tables-big.test | 16 +- mysql-wsrep-5.6/mysql-test/t/mysqldump.test | 50 ++ mysql-wsrep-5.6/mysql-test/t/parser.test | 8 + mysql-wsrep-5.6/mysql-test/t/ps.test | 38 ++ mysql-wsrep-5.6/mysql-test/t/symlink.test | 16 + mysql-wsrep-5.6/mysql-test/valgrind.supp | 29 +- mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs | 4 +- .../packaging/WiX/mysql_server_extra.wxs.in | 2 +- .../packaging/deb-in/CMakeLists.txt | 250 ++++++++ mysql-wsrep-5.6/packaging/deb-in/README | 16 + .../packaging/deb-in/README.Maintainer | 20 + mysql-wsrep-5.6/packaging/deb-in/changelog.in | 163 +++++ mysql-wsrep-5.6/packaging/deb-in/compat | 1 + mysql-wsrep-5.6/packaging/deb-in/control.in | 217 +++++++ .../packaging/deb-in/copyright.com.in | 64 ++ .../packaging/deb-in/copyright.gpl.in | 41 ++ .../packaging/deb-in/extra/apparmor-profile | 67 ++ .../packaging/deb-in/extra/conf.d/mysql.cnf | 22 + .../packaging/deb-in/extra/my.cnf.fallback | 25 + .../packaging/deb-in/extra/mysql-helpers | 181 ++++++ .../deb-in/extra/mysql-systemd-start | 45 ++ .../packaging/deb-in/extra/mysql.cnf | 26 + .../packaging/deb-in/extra/mysql_embedded.1 | 1 + .../packaging/deb-in/extra/mysqld.cnf | 28 + .../deb-in/libmysqlclient-dev.install.in | 27 + .../libmysqlclient-dev.lintian-overrides.in | 21 + .../deb-in/libmysqlclient18.install.in | 19 + .../libmysqlclient18.lintian-overrides.in | 20 + .../packaging/deb-in/libmysqld-dev.install.in | 20 + .../deb-in/libmysqld-dev.lintian-overrides.in | 19 + .../packaging/deb-in/mysql-client.install.in | 18 + .../deb-in/mysql-client.lintian-overrides.in | 19 + .../packaging/deb-in/mysql-common.dirs.in | 16 + .../packaging/deb-in/mysql-common.install.in | 25 + .../deb-in/mysql-common.lintian-overrides.in | 19 + .../packaging/deb-in/mysql-common.postinst.in | 25 + .../packaging/deb-in/mysql-common.postrm.in | 25 + .../mysql-packagesource-bench.install.in | 19 + ...l-packagesource-bench.lintian-overrides.in | 18 + .../mysql-packagesource-client.conffiles.in | 25 + .../mysql-packagesource-client.install.in | 55 ++ ...-packagesource-client.lintian-overrides.in | 21 + .../mysql-packagesource-server.config.in | 97 +++ .../deb-in/mysql-packagesource-server.dirs.in | 16 + .../mysql-packagesource-server.install.in | 103 +++ ...-packagesource-server.lintian-overrides.in | 23 + .../mysql-packagesource-server.mysql.init.in | 115 ++++ ...ysql-packagesource-server.mysql.service.in | 34 + .../mysql-packagesource-server.postinst.in | 98 +++ .../mysql-packagesource-server.postrm.in | 172 +++++ .../mysql-packagesource-server.preinst.in | 85 +++ .../mysql-packagesource-server.prerm.in | 24 + .../mysql-packagesource-server.templates.in | 35 + .../mysql-packagesource-source.install.in | 21 + ...-packagesource-source.lintian-overrides.in | 19 + .../mysql-packagesource-test.install.in | 48 ++ .../deb-in/mysql-packagesource-test.links.in | 17 + ...ql-packagesource-test.lintian-overrides.in | 19 + .../packaging/deb-in/mysql-server.install.in | 18 + .../deb-in/mysql-server.lintian-overrides.in | 19 + .../deb-in/mysql-testsuite.install.in | 18 + .../mysql-testsuite.lintian-overrides.in | 19 + .../packaging/deb-in/patches/series | 15 + mysql-wsrep-5.6/packaging/deb-in/rules.in | 145 +++++ .../packaging/deb-in/source/format | 1 + .../packaging/deb-in/source/include-binaries | 73 +++ .../packaging/deb-in/source/lintian-overrides | 18 + mysql-wsrep-5.6/packaging/deb-in/watch | 2 + .../packaging/rpm-fedora/mysql.spec.in | 3 +- mysql-wsrep-5.6/packaging/rpm-oel/mysql.init | 34 +- mysql-wsrep-5.6/packaging/rpm-sles/mysql.init | 20 +- .../plugin/connection_control/CMakeLists.txt | 2 +- .../connection_control/connection_control.cc | 8 +- .../connection_control_coordinator.cc | 26 +- .../connection_control/connection_delay.cc | 79 ++- .../security_context_wrapper.cc | 6 +- .../innodb_memcache/src/innodb_engine.c | 2 +- mysql-wsrep-5.6/regex/regcomp.c | 22 +- .../scripts/mysql_secure_installation.sh | 67 +- mysql-wsrep-5.6/scripts/mysqld_safe.sh | 177 +++--- mysql-wsrep-5.6/scripts/mysqlhotcopy.sh | 4 +- mysql-wsrep-5.6/sql-common/client.c | 51 +- mysql-wsrep-5.6/sql/field.cc | 7 + mysql-wsrep-5.6/sql/field.h | 20 +- mysql-wsrep-5.6/sql/handler.cc | 54 ++ mysql-wsrep-5.6/sql/handler.h | 81 +-- mysql-wsrep-5.6/sql/item.cc | 8 +- mysql-wsrep-5.6/sql/item_func.cc | 40 +- mysql-wsrep-5.6/sql/item_strfunc.cc | 13 +- mysql-wsrep-5.6/sql/item_subselect.cc | 12 +- mysql-wsrep-5.6/sql/item_xmlfunc.cc | 4 +- mysql-wsrep-5.6/sql/log_event.cc | 5 +- mysql-wsrep-5.6/sql/mysqld.cc | 6 +- mysql-wsrep-5.6/sql/opt_range.cc | 6 +- mysql-wsrep-5.6/sql/rpl_rli.cc | 17 +- mysql-wsrep-5.6/sql/rpl_rli.h | 6 +- mysql-wsrep-5.6/sql/rpl_slave.cc | 17 +- mysql-wsrep-5.6/sql/sp.cc | 2 +- mysql-wsrep-5.6/sql/sp_instr.cc | 51 +- mysql-wsrep-5.6/sql/sql_acl.cc | 597 +++++++++++++++++- mysql-wsrep-5.6/sql/sql_acl.h | 52 +- mysql-wsrep-5.6/sql/sql_base.cc | 7 +- mysql-wsrep-5.6/sql/sql_class.cc | 6 +- mysql-wsrep-5.6/sql/sql_class.h | 15 +- mysql-wsrep-5.6/sql/sql_digest.cc | 12 +- mysql-wsrep-5.6/sql/sql_load.cc | 18 + mysql-wsrep-5.6/sql/sql_parse.cc | 7 +- mysql-wsrep-5.6/sql/sql_prepare.cc | 4 +- mysql-wsrep-5.6/sql/sql_select.cc | 2 +- mysql-wsrep-5.6/sql/sql_table.cc | 15 + mysql-wsrep-5.6/sql/table.cc | 65 +- mysql-wsrep-5.6/sql/xa.h | 108 ++++ .../storage/innobase/btr/btr0sea.cc | 2 +- .../storage/innobase/buf/buf0buf.cc | 2 +- .../storage/innobase/buf/buf0dblwr.cc | 4 +- .../storage/innobase/buf/buf0dump.cc | 4 +- .../storage/innobase/buf/buf0flu.cc | 4 +- .../storage/innobase/dict/dict0boot.cc | 7 +- .../storage/innobase/dict/dict0stats.cc | 15 +- .../storage/innobase/dict/dict0stats_bg.cc | 4 +- .../storage/innobase/fil/fil0fil.cc | 20 +- .../storage/innobase/handler/ha_innodb.cc | 7 +- .../storage/innobase/include/buf0dblwr.h | 4 +- .../storage/innobase/include/fil0fil.h | 14 +- .../storage/innobase/include/ha0ha.h | 6 +- .../storage/innobase/include/os0file.h | 134 +++- .../storage/innobase/include/os0file.ic | 130 +++- .../storage/innobase/include/row0mysql.h | 8 + .../storage/innobase/include/srv0srv.h | 9 +- .../storage/innobase/include/srv0start.h | 4 +- .../storage/innobase/include/trx0xa.h | 15 +- .../storage/innobase/include/univ.i | 10 +- .../storage/innobase/log/log0log.cc | 9 +- .../storage/innobase/log/log0recv.cc | 4 +- .../storage/innobase/os/os0file.cc | 130 ++-- .../storage/innobase/row/row0log.cc | 17 +- .../storage/innobase/row/row0merge.cc | 35 +- .../storage/innobase/row/row0sel.cc | 235 +++++-- .../storage/innobase/srv/srv0srv.cc | 26 +- .../storage/innobase/srv/srv0start.cc | 66 +- .../storage/innobase/trx/trx0purge.cc | 5 +- .../storage/innobase/trx/trx0roll.cc | 4 +- .../storage/innobase/trx/trx0sys.cc | 18 +- mysql-wsrep-5.6/storage/perfschema/pfs.cc | 3 +- .../storage/perfschema/pfs_digest.cc | 5 +- .../storage/perfschema/unittest/pfs-t.cc | 46 +- .../perfschema/unittest/pfs_account-oom-t.cc | 4 +- .../perfschema/unittest/pfs_connect_attr-t.cc | 4 +- .../perfschema/unittest/pfs_host-oom-t.cc | 4 +- .../perfschema/unittest/pfs_instr-oom-t.cc | 29 +- .../perfschema/unittest/pfs_instr-t.cc | 9 +- .../unittest/pfs_instr_class-oom-t.cc | 4 +- .../perfschema/unittest/pfs_instr_class-t.cc | 4 +- .../storage/perfschema/unittest/pfs_misc-t.cc | 4 +- .../perfschema/unittest/pfs_timer-t.cc | 4 +- .../perfschema/unittest/pfs_user-oom-t.cc | 4 +- mysql-wsrep-5.6/strings/ctype-utf8.c | 80 ++- mysql-wsrep-5.6/support-files/CMakeLists.txt | 7 +- mysql-wsrep-5.6/support-files/mysql.server.sh | 16 +- mysql-wsrep-5.6/tests/mysql_client_test.c | 113 +++- mysql-wsrep-5.6/unittest/gunit/dbug-t.cc | 16 +- 244 files changed, 7030 insertions(+), 2085 deletions(-) create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/end_range_check.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/ibuf_not_empty.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_io_pf.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/r/undo_space_id.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/end_range_check.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/ibuf_not_empty-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/ibuf_not_empty.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_io_pf.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/innodb/t/undo_space_id.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_1_digest.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt create mode 100644 mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_1_digest.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_user.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sbm_fake_rotate_event.result create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_user.test create mode 100644 mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_fake_rotate_event.test create mode 100644 mysql-wsrep-5.6/packaging/deb-in/CMakeLists.txt create mode 100644 mysql-wsrep-5.6/packaging/deb-in/README create mode 100644 mysql-wsrep-5.6/packaging/deb-in/README.Maintainer create mode 100644 mysql-wsrep-5.6/packaging/deb-in/changelog.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/compat create mode 100644 mysql-wsrep-5.6/packaging/deb-in/control.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/copyright.com.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/copyright.gpl.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/extra/apparmor-profile create mode 100644 mysql-wsrep-5.6/packaging/deb-in/extra/conf.d/mysql.cnf create mode 100644 mysql-wsrep-5.6/packaging/deb-in/extra/my.cnf.fallback create mode 100644 mysql-wsrep-5.6/packaging/deb-in/extra/mysql-helpers create mode 100644 mysql-wsrep-5.6/packaging/deb-in/extra/mysql-systemd-start create mode 100644 mysql-wsrep-5.6/packaging/deb-in/extra/mysql.cnf create mode 100644 mysql-wsrep-5.6/packaging/deb-in/extra/mysql_embedded.1 create mode 100644 mysql-wsrep-5.6/packaging/deb-in/extra/mysqld.cnf create mode 100644 mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/libmysqlclient18.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/libmysqlclient18.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/libmysqld-dev.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/libmysqld-dev.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-client.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-client.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-common.dirs.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-common.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-common.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-common.postinst.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-common.postrm.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-bench.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-bench.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client.conffiles.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.config.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.dirs.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.mysql.init.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.mysql.service.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.postinst.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.postrm.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.preinst.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.prerm.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.templates.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.links.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-server.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-server.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-testsuite.install.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/mysql-testsuite.lintian-overrides.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/patches/series create mode 100644 mysql-wsrep-5.6/packaging/deb-in/rules.in create mode 100644 mysql-wsrep-5.6/packaging/deb-in/source/format create mode 100644 mysql-wsrep-5.6/packaging/deb-in/source/include-binaries create mode 100644 mysql-wsrep-5.6/packaging/deb-in/source/lintian-overrides create mode 100644 mysql-wsrep-5.6/packaging/deb-in/watch create mode 100644 mysql-wsrep-5.6/sql/xa.h diff --git a/debian/changelog b/debian/changelog index f948e3f7..cb6cbec9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +mysql-wsrep-5.6 (5.6.36-0~u14.04+mos0) mos; urgency=medium + + * Update mysql to 5.6.36 + * d/p/* - quilt refresh to avoid fuzz + * d/rules - switch to bundled editline instead of system to avoid broken + build + + -- Dmitry Teselkin Thu, 25 May 2017 18:02:02 +0300 + mysql-wsrep-5.6 (5.6.35-0~u14.04+mos2) mos; urgency=low * Add libmysqlclient18 metapackage diff --git a/debian/patches/fix_standalone_tests.patch b/debian/patches/fix_standalone_tests.patch index faedcc42..a670351f 100644 --- a/debian/patches/fix_standalone_tests.patch +++ b/debian/patches/fix_standalone_tests.patch @@ -5,7 +5,7 @@ Forwarded: not-needed --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm -@@ -287,7 +287,8 @@ sub collect_one_suite($) +@@ -287,7 +287,8 @@ else { $suitedir= my_find_dir($::basedir, @@ -13,5 +13,5 @@ Forwarded: not-needed + ["lib/mysql-testsuite/suite", + "share/mysql-test/suite", "mysql-test/suite", + "lib/mysql-test/suite", "internal/mysql-test/suite", - "mysql-test", diff --git a/debian/patches/hurd.patch b/debian/patches/hurd.patch index b64feeba..dbd44e79 100644 --- a/debian/patches/hurd.patch +++ b/debian/patches/hurd.patch @@ -29,7 +29,7 @@ Reviewed-by: Nicholas Bamber +SET(_FILE_OFFSET_BITS 64) --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm -@@ -110,6 +110,9 @@ sub check_socket_path_length { +@@ -110,6 +110,9 @@ # This may not be true, but we can't test for it on AIX due to Perl bug # See Bug #45771 return 0 if ($^O eq 'aix'); diff --git a/debian/patches/kfreebsd_tests.patch b/debian/patches/kfreebsd_tests.patch index 981e0a9a..3aaa8ce5 100644 --- a/debian/patches/kfreebsd_tests.patch +++ b/debian/patches/kfreebsd_tests.patch @@ -7,7 +7,7 @@ Forwarded: no Last-Update: 2012-04-28 --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm -@@ -113,6 +113,8 @@ sub check_socket_path_length { +@@ -113,6 +113,8 @@ # Similarly the path length is hidden. # See Debian bug #651002 return 0 if ($^O eq 'gnu'); diff --git a/debian/patches/scripts__mysqld_safe.sh__signals.patch b/debian/patches/scripts__mysqld_safe.sh__signals.patch index 984fd8cc..2bb2481b 100644 --- a/debian/patches/scripts__mysqld_safe.sh__signals.patch +++ b/debian/patches/scripts__mysqld_safe.sh__signals.patch @@ -10,7 +10,7 @@ Reviewed-by: Nicholas Bamber --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh -@@ -29,9 +29,6 @@ err_log= +@@ -29,9 +29,6 @@ syslog_tag_mysqld=mysqld syslog_tag_mysqld_safe=mysqld_safe @@ -20,7 +20,7 @@ Reviewed-by: Nicholas Bamber # MySQL-specific environment variable. First off, it's not really a umask, # it's the desired mode. Second, it follows umask(2), not umask(3) in that # octal needs to be explicit. Our shell might be a proper sh without printf, -@@ -154,7 +151,7 @@ eval_log_error () { +@@ -169,7 +166,7 @@ # sed buffers output (only GNU sed supports a -u (unbuffered) option) # which means that messages may not get sent to syslog until the # mysqld process quits. @@ -29,7 +29,7 @@ Reviewed-by: Nicholas Bamber ;; *) echo "Internal program error (non-fatal):" \ -@@ -815,6 +815,13 @@ mysqld daemon not started" +@@ -891,6 +888,13 @@ fi # diff --git a/debian/rules b/debian/rules index 44ee56cc..e4ab0af3 100755 --- a/debian/rules +++ b/debian/rules @@ -103,7 +103,7 @@ configure-stamp configure-pic-stamp: -DWITH_WSREP=1 \ -DWITH_LIBWRAP=ON \ -DWITH_ZLIB=system \ - -DWITH_EDITLINE=system \ + -DWITH_EDITLINE=bundled \ $(USE_STATIC_MYSQLD) \ -DWITH_SSL=system \ -DCOMPILATION_COMMENT="($(DISTRIBUTION))" \ diff --git a/mysql-wsrep-5.6/CMakeLists.txt b/mysql-wsrep-5.6/CMakeLists.txt index 617815c5..fb2bd6c5 100644 --- a/mysql-wsrep-5.6/CMakeLists.txt +++ b/mysql-wsrep-5.6/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -289,12 +289,9 @@ IF (WITH_ASAN) ENDIF() ENDIF() - -OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON) -IF(ENABLE_DEBUG_SYNC) - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") -ENDIF() +# Always enable debug sync for debug builds. +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") # Older versions of ccache must be disabled: export CCACHE_DISABLE=1 # See http://www.cmake.org/Wiki/CTest/Coverage @@ -524,6 +521,7 @@ IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(packaging/rpm-fedora) ADD_SUBDIRECTORY(packaging/rpm-sles) ADD_SUBDIRECTORY(packaging/rpm-docker) + ADD_SUBDIRECTORY(packaging/deb-in) ENDIF() INCLUDE(cmake/abi_check.cmake) diff --git a/mysql-wsrep-5.6/README b/mysql-wsrep-5.6/README index 108364d0..fdda76b4 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, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2000, 2017, 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 929bbfc2..8a458099 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=35 +MYSQL_VERSION_PATCH=36 MYSQL_VERSION_EXTRA= diff --git a/mysql-wsrep-5.6/client/client_priv.h b/mysql-wsrep-5.6/client/client_priv.h index cf63ae94..e4d7a488 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, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -127,13 +127,15 @@ enum options_client /** Wrapper for mysql_real_connect() that checks if SSL connection is establised. - The function calls mysql_real_connect() first, then if given ssl_required==TRUE - argument (i.e. --ssl-mode=REQUIRED option used) checks current SSL chiper to - ensure that SSL is used for current connection. - Otherwise it returns NULL and sets errno to CR_SSL_CONNECTION_ERROR. + The function calls mysql_real_connect() first. Then, if the ssl_required + argument is TRUE (i.e., the --ssl-mode=REQUIRED option was specified), it + checks the current SSL cipher to ensure that SSL is used for the current + connection. Otherwise, it returns NULL and sets errno to + CR_SSL_CONNECTION_ERROR. - All clients (except mysqlbinlog which disregards SSL options) use this function - instead of mysql_real_connect() to handle --ssl-mode=REQUIRED option. + All clients (except mysqlbinlog, which disregards SSL options) use this + function instead of mysql_real_connect() to handle the --ssl-mode=REQUIRED + option. */ MYSQL *mysql_connect_ssl_check(MYSQL *mysql_arg, const char *host, const char *user, const char *passwd, @@ -141,8 +143,22 @@ MYSQL *mysql_connect_ssl_check(MYSQL *mysql_arg, const char *host, const char *unix_socket, ulong client_flag, my_bool ssl_required MY_ATTRIBUTE((unused))) { - MYSQL *mysql= mysql_real_connect(mysql_arg, host, user, passwd, db, port, - unix_socket, client_flag); + MYSQL *mysql; + +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + enum mysql_ssl_mode opt_ssl_mode= SSL_MODE_REQUIRED; + if (ssl_required && + mysql_options(mysql_arg, MYSQL_OPT_SSL_MODE, (char *) &opt_ssl_mode)) + { + NET *net= &mysql_arg->net; + net->last_errno= CR_SSL_CONNECTION_ERROR; + strmov(net->last_error, "Client library doesn't support MYSQL_SSL_REQUIRED option"); + strmov(net->sqlstate, "HY000"); + return NULL; + } +#endif + mysql= mysql_real_connect(mysql_arg, host, user, passwd, db, port, + unix_socket, client_flag); #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) if (mysql && /* connection established. */ ssl_required && /* --ssl-mode=REQUIRED. */ diff --git a/mysql-wsrep-5.6/client/mysql.cc b/mysql-wsrep-5.6/client/mysql.cc index 7ab706fb..6f725df4 100644 --- a/mysql-wsrep-5.6/client/mysql.cc +++ b/mysql-wsrep-5.6/client/mysql.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1488,7 +1488,8 @@ sig_handler handle_kill_signal(int sig) "program_name", "mysql"); if (!mysql_connect_ssl_check(kill_mysql, current_host, current_user, opt_password, "", opt_mysql_port, - opt_mysql_unix_port, 0, opt_ssl_required)) + opt_mysql_unix_port, 0, + opt_ssl_mode == SSL_MODE_REQUIRED)) { tee_fprintf(stdout, "%s -- sorry, cannot connect to server to kill query, giving up ...\n", reason); goto err; @@ -2630,7 +2631,7 @@ C_MODE_END if not. */ -#if defined(USE_NEW_READLINE_INTERFACE) +#if defined(USE_NEW_EDITLINE_INTERFACE) static int fake_magic_space(int, int); extern "C" char *no_completion(const char*,int) #elif defined(USE_LIBEDIT_INTERFACE) @@ -2712,7 +2713,7 @@ static int not_in_history(const char *line) } -#if defined(USE_NEW_READLINE_INTERFACE) +#if defined(USE_NEW_EDITLINE_INTERFACE) static int fake_magic_space(int, int) #else static int fake_magic_space(const char *, int) @@ -2729,7 +2730,7 @@ static void initialize_readline (char *name) rl_readline_name = name; /* Tell the completer that we want a crack first. */ -#if defined(USE_NEW_READLINE_INTERFACE) +#if defined(USE_NEW_EDITLINE_INTERFACE) rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion; rl_completion_entry_function= (rl_compentry_func_t*)&no_completion; @@ -2759,7 +2760,7 @@ static char **new_mysql_completion(const char *text, int end MY_ATTRIBUTE((unused))) { if (!status.batch && !quick) -#if defined(USE_NEW_READLINE_INTERFACE) +#if defined(USE_NEW_EDITLINE_INTERFACE) return rl_completion_matches(text, new_command_generator); #else return completion_matches((char *)text, (CPFunction *)new_command_generator); @@ -4819,7 +4820,7 @@ sql_real_connect(char *host,char *database,char *user,char *password, if (!mysql_connect_ssl_check(&mysql, host, user, password, database, opt_mysql_port, opt_mysql_unix_port, connect_flag | CLIENT_MULTI_STATEMENTS, - opt_ssl_required)) + opt_ssl_mode == SSL_MODE_REQUIRED)) { if (!silent || (mysql_errno(&mysql) != CR_CONN_HOST_ERROR && diff --git a/mysql-wsrep-5.6/client/mysql_upgrade.c b/mysql-wsrep-5.6/client/mysql_upgrade.c index f8df0cd4..34934eb4 100644 --- a/mysql-wsrep-5.6/client/mysql_upgrade.c +++ b/mysql-wsrep-5.6/client/mysql_upgrade.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -401,9 +401,11 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...) va_end(args); +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) /* If given --ssl-mode=REQUIRED propagate it to the tool. */ - if (opt_ssl_required) + if (opt_ssl_mode == SSL_MODE_REQUIRED) dynstr_append(&ds_cmdline, "--ssl-mode=REQUIRED"); +#endif #ifdef __WIN__ dynstr_append(&ds_cmdline, "\""); diff --git a/mysql-wsrep-5.6/client/mysqladmin.cc b/mysql-wsrep-5.6/client/mysqladmin.cc index 99e9b774..c608af64 100644 --- a/mysql-wsrep-5.6/client/mysqladmin.cc +++ b/mysql-wsrep-5.6/client/mysqladmin.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -552,8 +552,8 @@ static my_bool sql_connect(MYSQL *mysql, uint wait) for (;;) { if (mysql_connect_ssl_check(mysql, host, user, opt_password, NullS, - tcp_port, unix_port, - CLIENT_REMEMBER_OPTIONS, opt_ssl_required)) + tcp_port, unix_port, CLIENT_REMEMBER_OPTIONS, + opt_ssl_mode == SSL_MODE_REQUIRED)) { mysql->reconnect= 1; if (info) diff --git a/mysql-wsrep-5.6/client/mysqlcheck.c b/mysql-wsrep-5.6/client/mysqlcheck.c index 258ea475..e5fb8fc4 100644 --- a/mysql-wsrep-5.6/client/mysqlcheck.c +++ b/mysql-wsrep-5.6/client/mysqlcheck.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -937,7 +937,7 @@ static int dbConnect(char *host, char *user, char *passwd) if (!(sock = mysql_connect_ssl_check(&mysql_connection, host, user, passwd, NULL, opt_mysql_port, opt_mysql_unix_port, 0, - opt_ssl_required))) + opt_ssl_mode == SSL_MODE_REQUIRED))) { DBerror(&mysql_connection, "when trying to connect"); DBUG_RETURN(1); diff --git a/mysql-wsrep-5.6/client/mysqldump.c b/mysql-wsrep-5.6/client/mysqldump.c index 17637e4e..f1313241 100644 --- a/mysql-wsrep-5.6/client/mysqldump.c +++ b/mysql-wsrep-5.6/client/mysqldump.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -582,6 +582,7 @@ static int dump_tablespaces_for_databases(char** databases); static int dump_tablespaces(char* ts_where); static void print_comment(FILE *sql_file, my_bool is_error, const char *format, ...); +static const char* fix_identifier_with_newline(char*); /* @@ -682,7 +683,7 @@ static void write_header(FILE *sql_file, char *db_name) MACHINE_TYPE); print_comment(sql_file, 0, "-- Host: %s Database: %s\n", current_host ? current_host : "localhost", - db_name ? db_name : ""); + db_name ? fix_identifier_with_newline(db_name) : ""); print_comment(sql_file, 0, "-- ------------------------------------------------------\n" ); @@ -1556,7 +1557,7 @@ static int connect_to_db(char *host, char *user,char *passwd) if (!(mysql= mysql_connect_ssl_check(&mysql_connection, host, user, passwd, NULL, opt_mysql_port, opt_mysql_unix_port, 0, - opt_ssl_required))) + opt_ssl_mode == SSL_MODE_REQUIRED))) { DB_error(&mysql_connection, "when trying to connect"); DBUG_RETURN(1); @@ -2036,6 +2037,30 @@ static void print_comment(FILE *sql_file, my_bool is_error, const char *format, print_xml_comment(sql_file, strlen(comment_buff), comment_buff); } +/* + This function accepts object names and prefixes -- wherever \n + character is found. + + @param[in] object_name + + @return + @retval fixed object name. +*/ + +static const char* fix_identifier_with_newline(char* object_name) +{ + static char buff[COMMENT_LENGTH]= {0}; + char *ptr= buff; + memset(buff, 0, 255); + while(*object_name) + { + *ptr++ = *object_name; + if (*object_name == '\n') + ptr= strmov(ptr, "-- "); + object_name++; + } + return buff; +} /* create_delimiter @@ -2104,7 +2129,8 @@ static uint dump_events_for_db(char *db) /* nice comments */ print_comment(sql_file, 0, - "\n--\n-- Dumping events for database '%s'\n--\n", db); + "\n--\n-- Dumping events for database '%s'\n--\n", + fix_identifier_with_newline(db)); /* not using "mysql_query_with_error_report" because we may have not @@ -2321,7 +2347,8 @@ static uint dump_routines_for_db(char *db) /* nice comments */ print_comment(sql_file, 0, - "\n--\n-- Dumping routines for database '%s'\n--\n", db); + "\n--\n-- Dumping routines for database '%s'\n--\n", + fix_identifier_with_newline(db)); /* not using "mysql_query_with_error_report" because we may have not @@ -2380,7 +2407,7 @@ static uint dump_routines_for_db(char *db) query_buff); print_comment(sql_file, 1, "-- does %s have permissions on mysql.proc?\n\n", - current_user); + fix_identifier_with_newline(current_user)); maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!", current_user, query_buff); } else if (strlen(row[2])) @@ -2593,12 +2620,12 @@ 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 view structure for view %s\n--\n\n", - result_table); + "\n--\n-- Temporary table structure for view %s\n--\n\n", + fix_identifier_with_newline(result_table)); else print_comment(sql_file, 0, "\n--\n-- Table structure for table %s\n--\n\n", - result_table); + fix_identifier_with_newline(result_table)); if (opt_drop) { @@ -2833,7 +2860,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, print_comment(sql_file, 0, "\n--\n-- Table structure for table %s\n--\n\n", - result_table); + fix_identifier_with_newline(result_table)); if (opt_drop) fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", result_table); if (!opt_xml) @@ -3531,21 +3558,23 @@ static void dump_table(char *table, char *db) { print_comment(md_result_file, 0, "\n--\n-- Dumping data for table %s\n--\n", - result_table); + fix_identifier_with_newline(result_table)); dynstr_append_checked(&query_string, "SELECT /*!40001 SQL_NO_CACHE */ * FROM "); dynstr_append_checked(&query_string, result_table); if (where) { - print_comment(md_result_file, 0, "-- WHERE: %s\n", where); + print_comment(md_result_file, 0, "-- WHERE: %s\n", + fix_identifier_with_newline(where)); dynstr_append_checked(&query_string, " WHERE "); dynstr_append_checked(&query_string, where); } if (order_by) { - print_comment(md_result_file, 0, "-- ORDER BY: %s\n", order_by); + print_comment(md_result_file, 0, "-- ORDER BY: %s\n", + fix_identifier_with_newline(order_by)); dynstr_append_checked(&query_string, " ORDER BY "); dynstr_append_checked(&query_string, order_by); @@ -4371,7 +4400,8 @@ static int init_dumping(char *database, int init_func(char*)) char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted); print_comment(md_result_file, 0, - "\n--\n-- Current Database: %s\n--\n", qdatabase); + "\n--\n-- Current Database: %s\n--\n", + fix_identifier_with_newline(qdatabase)); /* Call the view or table specific function */ init_func(qdatabase); @@ -5597,7 +5627,7 @@ static my_bool get_view_structure(char *table, char* db) print_comment(sql_file, 0, "\n--\n-- Final view structure for view %s\n--\n\n", - result_table); + fix_identifier_with_newline(result_table)); verbose_msg("-- Dropping the temporary view structure created\n"); fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", opt_quoted_table); diff --git a/mysql-wsrep-5.6/client/mysqlimport.c b/mysql-wsrep-5.6/client/mysqlimport.c index cec3b08d..50ec90b0 100644 --- a/mysql-wsrep-5.6/client/mysqlimport.c +++ b/mysql-wsrep-5.6/client/mysqlimport.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -482,7 +482,7 @@ static MYSQL *db_connect(char *host, char *database, "program_name", "mysqlimport"); if (!(mysql_connect_ssl_check(mysql, host, user, passwd, database, opt_mysql_port, opt_mysql_unix_port, - 0, opt_ssl_required))) + 0, opt_ssl_mode == SSL_MODE_REQUIRED))) { ignore_errors=0; /* NO RETURN FROM db_error */ db_error(mysql); diff --git a/mysql-wsrep-5.6/client/mysqlshow.c b/mysql-wsrep-5.6/client/mysqlshow.c index 10a4cf05..d05577ae 100644 --- a/mysql-wsrep-5.6/client/mysqlshow.c +++ b/mysql-wsrep-5.6/client/mysqlshow.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This 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,7 +159,7 @@ int main(int argc, char **argv) if (!(mysql_connect_ssl_check(&mysql, host, user, opt_password, (first_argument_uses_wildcards) ? "" : argv[0], opt_mysql_port, opt_mysql_unix_port, - 0, opt_ssl_required))) + 0, opt_ssl_mode == SSL_MODE_REQUIRED))) { fprintf(stderr,"%s: %s\n",my_progname,mysql_error(&mysql)); exit(1); diff --git a/mysql-wsrep-5.6/client/mysqlslap.c b/mysql-wsrep-5.6/client/mysqlslap.c index ad0bb965..afa8c92a 100644 --- a/mysql-wsrep-5.6/client/mysqlslap.c +++ b/mysql-wsrep-5.6/client/mysqlslap.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -371,7 +371,8 @@ int main(int argc, char **argv) { if (!(mysql_connect_ssl_check(&mysql, host, user, opt_password, NULL, opt_mysql_port, opt_mysql_unix_port, - connect_flags, opt_ssl_required))) + connect_flags, + opt_ssl_mode == SSL_MODE_REQUIRED))) { fprintf(stderr,"%s: Error when connecting to server: %s\n", my_progname,mysql_error(&mysql)); diff --git a/mysql-wsrep-5.6/client/mysqltest.cc b/mysql-wsrep-5.6/client/mysqltest.cc index 1e133b31..23f21288 100644 --- a/mysql-wsrep-5.6/client/mysqltest.cc +++ b/mysql-wsrep-5.6/client/mysqltest.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "my_regex.h" /* Our own version of regex */ #ifdef HAVE_SYS_WAIT_H @@ -52,6 +53,7 @@ using std::min; using std::max; +using std::string; #ifdef __WIN__ #include @@ -4235,7 +4237,11 @@ void do_perl(struct st_command *command) die("Failed to create temporary file for perl command"); my_close(fd, MYF(0)); - str_to_file(temp_file_path, ds_script.str, ds_script.length); + /* Compatibility for Perl 5.24 and newer. */ + string script = "push @INC, \".\";\n"; + script.append(ds_script.str, ds_script.length); + + str_to_file(temp_file_path, &script[0], script.size()); /* Format the "perl " command */ my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path); @@ -5315,7 +5321,7 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host, &can_handle_expired_passwords); while(!mysql_connect_ssl_check(mysql, host,user, pass, db, port, sock, CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS, - opt_ssl_required)) + opt_ssl_mode == SSL_MODE_REQUIRED)) { /* Connect failed @@ -5421,7 +5427,7 @@ int connect_n_handle_errors(struct st_command *command, &can_handle_expired_passwords); while (!mysql_connect_ssl_check(con, host, user, pass, db, port, sock ? sock: 0, CLIENT_MULTI_STATEMENTS, - opt_ssl_required)) + opt_ssl_mode == SSL_MODE_REQUIRED)) { /* If we have used up all our connections check whether this diff --git a/mysql-wsrep-5.6/cmake/os/SunOS.cmake b/mysql-wsrep-5.6/cmake/os/SunOS.cmake index f0b03f23..8efcf71c 100644 --- a/mysql-wsrep-5.6/cmake/os/SunOS.cmake +++ b/mysql-wsrep-5.6/cmake/os/SunOS.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. # # This 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(CheckCSourceCompiles) IF(NOT FORCE_UNSUPPORTED_COMPILER) IF(CMAKE_C_COMPILER_ID MATCHES "SunPro") # CC -V yields + # CC: Studio 12.6 Sun C++ 5.15 SunOS_sparc Beta 2016/12/19 # CC: Studio 12.5 Sun C++ 5.14 SunOS_sparc Dodona 2016/04/04 # CC: Sun C++ 5.13 SunOS_sparc Beta 2014/03/11 # CC: Sun C++ 5.11 SunOS_sparc 2010/08/13 @@ -32,7 +33,7 @@ IF(NOT FORCE_UNSUPPORTED_COMPILER) ) STRING(REGEX MATCH "CC: Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr}) IF (NOT CMAKE_MATCH_1 OR CMAKE_MATCH_1 STREQUAL "") - STRING(REGEX MATCH "CC: Studio 12\\.5 Sun C\\+\\+ 5\\.([0-9]+)" + STRING(REGEX MATCH "CC: Studio 12\\.[56] Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr}) ENDIF() SET(CC_MINOR_VERSION ${CMAKE_MATCH_1}) diff --git a/mysql-wsrep-5.6/cmake/os/Windows.cmake b/mysql-wsrep-5.6/cmake/os/Windows.cmake index 188982a8..92e4446c 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, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -65,6 +65,7 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4) ENDIF() IF(MSVC) + OPTION(LINK_STATIC_RUNTIME_LIBRARIES "Link with /MT" OFF) # Enable debug info also in Release build, # and create PDB to be able to analyze crashes. FOREACH(type EXE SHARED MODULE) @@ -94,7 +95,9 @@ IF(MSVC) 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) - STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + IF(LINK_STATIC_RUNTIME_LIBRARIES) + STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + ENDIF() STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}") SET("${flag}" "${${flag}} /EHsc") ENDFOREACH() diff --git a/mysql-wsrep-5.6/cmake/readline.cmake b/mysql-wsrep-5.6/cmake/readline.cmake index c4ead950..0b4e936c 100644 --- a/mysql-wsrep-5.6/cmake/readline.cmake +++ b/mysql-wsrep-5.6/cmake/readline.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -179,12 +179,28 @@ MACRO (FIND_SYSTEM_EDITLINE) completion_matches(0,0); return res; }" - EDITLINE_HAVE_COMPLETION) + EDITLINE_HAVE_COMPLETION_INT) - IF(EDITLINE_HAVE_COMPLETION) + CHECK_CXX_SOURCE_COMPILES(" + #include + #include + int main(int argc, char **argv) + { + typedef char* MYFunction(const char*, int); + MYFunction* myf= rl_completion_entry_function; + char *res= (myf)(NULL, 0); + completion_matches(0,0); + return res != NULL; + }" + EDITLINE_HAVE_COMPLETION_CHAR) + + IF(EDITLINE_HAVE_COMPLETION_INT OR EDITLINE_HAVE_COMPLETION_CHAR) SET(HAVE_HIST_ENTRY ${EDITLINE_HAVE_HIST_ENTRY}) SET(USE_LIBEDIT_INTERFACE 1) SET(EDITLINE_FOUND 1) + IF(EDITLINE_HAVE_COMPLETION_CHAR) + SET(USE_NEW_EDITLINE_INTERFACE 1) + ENDIF() ENDIF() ENDIF() ENDMACRO() diff --git a/mysql-wsrep-5.6/config.h.cmake b/mysql-wsrep-5.6/config.h.cmake index 3309fe3e..1f5fed4b 100644 --- a/mysql-wsrep-5.6/config.h.cmake +++ b/mysql-wsrep-5.6/config.h.cmake @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -119,6 +119,7 @@ /* Readline */ #cmakedefine HAVE_HIST_ENTRY 1 +#cmakedefine USE_NEW_EDITLINE_INTERFACE 1 #cmakedefine USE_LIBEDIT_INTERFACE 1 #cmakedefine FIONREAD_IN_SYS_IOCTL 1 diff --git a/mysql-wsrep-5.6/configure.cmake b/mysql-wsrep-5.6/configure.cmake index 6559406c..3d1dfae8 100644 --- a/mysql-wsrep-5.6/configure.cmake +++ b/mysql-wsrep-5.6/configure.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -153,6 +153,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND GET_FILENAME_COMPONENT(CXX_REALPATH ${CMAKE_CXX_COMPILER} REALPATH) # CC -V yields + # CC: Studio 12.6 Sun C++ 5.15 SunOS_sparc Beta 2016/12/19 # CC: Studio 12.5 Sun C++ 5.14 SunOS_sparc Dodona 2016/04/04 # CC: Sun C++ 5.13 SunOS_sparc Beta 2014/03/11 # CC: Sun C++ 5.11 SunOS_sparc 2010/08/13 @@ -169,7 +170,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND STRING(REGEX MATCH "CC: Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr}) IF (NOT CMAKE_MATCH_1 OR CMAKE_MATCH_1 STREQUAL "") - STRING(REGEX MATCH "CC: Studio 12\\.5 Sun C\\+\\+ 5\\.([0-9]+)" + STRING(REGEX MATCH "CC: Studio 12\\.[56] Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr}) ENDIF() SET(CC_MINOR_VERSION ${CMAKE_MATCH_1}) diff --git a/mysql-wsrep-5.6/include/mysql.h b/mysql-wsrep-5.6/include/mysql.h index 38b54de2..0aeed955 100644 --- a/mysql-wsrep-5.6/include/mysql.h +++ b/mysql-wsrep-5.6/include/mysql.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -175,7 +175,8 @@ enum mysql_option MYSQL_OPT_CONNECT_ATTR_DELETE, MYSQL_SERVER_PUBLIC_KEY, MYSQL_ENABLE_CLEARTEXT_PLUGIN, - MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS + MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, + MYSQL_OPT_SSL_MODE }; /** @@ -245,6 +246,11 @@ enum mysql_protocol_type MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY }; +enum mysql_ssl_mode +{ + SSL_MODE_REQUIRED= 3 +}; + typedef struct character_set { unsigned int number; /* character set number */ diff --git a/mysql-wsrep-5.6/include/mysql.h.pp b/mysql-wsrep-5.6/include/mysql.h.pp index 3a5c40d0..27696f89 100644 --- a/mysql-wsrep-5.6/include/mysql.h.pp +++ b/mysql-wsrep-5.6/include/mysql.h.pp @@ -272,7 +272,8 @@ enum mysql_option MYSQL_OPT_CONNECT_ATTR_DELETE, MYSQL_SERVER_PUBLIC_KEY, MYSQL_ENABLE_CLEARTEXT_PLUGIN, - MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS + MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, + MYSQL_OPT_SSL_MODE }; struct st_mysql_options_extention; struct st_mysql_options { @@ -319,6 +320,10 @@ enum mysql_protocol_type MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY }; +enum mysql_ssl_mode +{ + SSL_MODE_REQUIRED= 3 +}; typedef struct character_set { unsigned int number; diff --git a/mysql-wsrep-5.6/include/mysql_com.h b/mysql-wsrep-5.6/include/mysql_com.h index a25af23f..2c964398 100644 --- a/mysql-wsrep-5.6/include/mysql_com.h +++ b/mysql-wsrep-5.6/include/mysql_com.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #define USERNAME_CHAR_LENGTH 16 #define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN) #define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN) +#define CONNECT_STRING_MAXLEN 1024 #define MYSQL_AUTODETECT_CHARSET_NAME "auto" diff --git a/mysql-wsrep-5.6/include/sql_common.h b/mysql-wsrep-5.6/include/sql_common.h index c8ea820f..2cc6d658 100644 --- a/mysql-wsrep-5.6/include/sql_common.h +++ b/mysql-wsrep-5.6/include/sql_common.h @@ -1,7 +1,7 @@ #ifndef SQL_COMMON_INCLUDED #define SQL_COMMON_INCLUDED -/* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. This 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 @@ struct st_mysql_options_extention { char *server_public_key_path; size_t connection_attributes_length; my_bool enable_cleartext_plugin; + unsigned int ssl_mode; }; typedef struct st_mysql_methods diff --git a/mysql-wsrep-5.6/include/sslopt-case.h b/mysql-wsrep-5.6/include/sslopt-case.h index bf9cc039..7a42aa63 100644 --- a/mysql-wsrep-5.6/include/sslopt-case.h +++ b/mysql-wsrep-5.6/include/sslopt-case.h @@ -1,7 +1,7 @@ #ifndef SSLOPT_CASE_INCLUDED #define SSLOPT_CASE_INCLUDED -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ exit(1); } else - opt_ssl_required= 1; + opt_ssl_mode= SSL_MODE_REQUIRED; break; #endif /* MYSQL_CLIENT */ #endif diff --git a/mysql-wsrep-5.6/include/sslopt-vars.h b/mysql-wsrep-5.6/include/sslopt-vars.h index e840edce..7eebd86a 100644 --- a/mysql-wsrep-5.6/include/sslopt-vars.h +++ b/mysql-wsrep-5.6/include/sslopt-vars.h @@ -1,7 +1,7 @@ #ifndef SSLOPT_VARS_INCLUDED #define SSLOPT_VARS_INCLUDED -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This 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,10 +33,10 @@ SSL_STATIC char *opt_ssl_crlpath = 0; #ifdef MYSQL_CLIENT SSL_STATIC my_bool opt_ssl_verify_server_cert= 0; -SSL_STATIC my_bool opt_ssl_required= 0; +SSL_STATIC uint opt_ssl_mode= 0; #endif /* MYSQL_CLIENT */ #else /* HAVE_OPENSSL */ -#define opt_ssl_required 0 +#define opt_ssl_mode 0 #endif /* HAVE_OPENSSL */ #endif /* SSLOPT_VARS_INCLUDED */ diff --git a/mysql-wsrep-5.6/include/welcome_copyright_notice.h b/mysql-wsrep-5.6/include/welcome_copyright_notice.h index 7b6c28c2..0c17b5e6 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, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. This 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 "2016" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2017" /* This define specifies copyright notice which is displayed by every MySQL diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic b/mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic index 954f8b89..b2f5d52f 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic +++ b/mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic @@ -1,22 +1,13 @@ # Smaller batch of weekly run for tier2 platforms # Same as default.weekly, but all tests are run without big-test option. # big-test runs were leading to sporadic failures in tier2 platforms -# Comprises of the following -# 1. Repeat of daily runs -# 2. All suites in normal mode -# 3. nist suite -# 4. engine independant suite -# 5. Covers debug and non-debug runs -# 6. Covers all suites with Multi-Threaded-Slave and MIXED binlog-format -# 7. Covers all suites with innodb-page-size=4k and 8k -# Repeat daily run -# big-test option for normal runs -# Default suites (in modes binlog format stmt/mixed/row, parts), embedded and ps-protocol +# Default suites (in modes binlog format stmt/mixed/row, parts) perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug --vardir=var-normal-debug --report-features --skip-test-list=collections/disabled-daily.list --mysqld=--innodb_autoextend_increment=64 --unit-tests-report # Run all default suites with embedded server -# --debug-server is not used for embedded runs since debug build of embedded server is not available +# --debug-server is not used for embedded runs +# since debug build of embedded server is not available perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server # Run default suites with ps protocol @@ -47,23 +38,3 @@ perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment= #Memcached tests perl mysql-test-run.pl --timer --force --debug-server --comment=memcached-debug --vardir=var-debug-memcached --experimental=collections/default.experimental --parallel=1 --retry=0 --suite=memcached --skip-test-list=collections/disabled-weekly.list -# 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-daily.list - - - -# Multi-Thread Slave -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=MTS-debug --vardir=var-MTS-debug --suite=rpl --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --skip-test-list=collection/disabled-weekly.list - -# Run all default suites with 4K page size -perl mysql-test-run.pl --debug-server --timer --force --parallel=auto --comment=all_4k_size --vardir=var_all_4k_size --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list --mysqld=--innodb-page-size=4k - -# Run all default suites with 8K page size -perl mysql-test-run.pl --debug-server --timer --force --parallel=auto --comment=all_8k_size --vardir=var-all_8k_size --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list --mysqld=--innodb-page-size=8k - - - -# Additional run to test rpl HASH_SCAN & INDEX_SCAN -perl mysql-test-run.pl --force --debug-server --timer --parallel=auto --experimental=collections/default.experimental --comment=binlog_rpl_row_hash_scan --vardir=var-binlog_rpl_row_hash_scan --mysqld=--binlog-format=row --suite=binlog,rpl --mysqld=--slave-rows-search-algorithms=HASH_SCAN,INDEX_SCAN --skip-test-list=collection/disabled-weekly.list -perl mysql-test-run.pl --debug-server --timer --force --parallel=auto --comment=rpl_binlog_row_hash_MTS --vardir=var-mts-rpl-binlog-hash-n_mix --mysqld=--binlog-format=row --experimental=collections/default.experimental --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl,binlog -mysqld=--slave-rows-search-algorithms=HASH_SCAN,INDEX_SCAN --skip-test-list=collection/disabled-weekly.list - 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 b9e4fb1a..b2c6f92f 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, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -289,6 +289,7 @@ sub collect_one_suite($) $suitedir= my_find_dir($::basedir, ["share/mysql-test/suite", "mysql-test/suite", + "lib/mysql-test/suite", "internal/mysql-test/suite", "mysql-test", # Look in storage engine specific suite dirs 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 41fc1bf6..3be4e294 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, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -100,6 +100,8 @@ use mtr_results; use IO::Socket::INET; use IO::Select; +push @INC, "."; + require "lib/mtr_process.pl"; require "lib/mtr_io.pl"; require "lib/mtr_gcov.pl"; @@ -5746,16 +5748,14 @@ sub start_servers($) { my $mysqld_basedir= $mysqld->value('basedir'); if ( $basedir eq $mysqld_basedir ) { - if (! $opt_start_dirty) # If dirty, keep possibly grown system db + if (!$opt_start_dirty) # If dirty, keep possibly grown system db { - # Copy datadir from installed system db - for my $path ( "$opt_vardir", "$opt_vardir/..") { - my $install_db= "$path/install.db"; - copytree($install_db, $datadir) - if -d $install_db; - } - mtr_error("Failed to copy system db to '$datadir'") - unless -d $datadir; + # Copy datadir from installed system db + my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/.."; + my $install_db= "$path/install.db"; + copytree($install_db, $datadir) if -d $install_db; + mtr_error("Failed to copy system db to '$datadir'") + unless -d $datadir; } } else diff --git a/mysql-wsrep-5.6/mysql-test/r/distinct.result b/mysql-wsrep-5.6/mysql-test/r/distinct.result index a69d5247..da18ecc3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/distinct.result +++ b/mysql-wsrep-5.6/mysql-test/r/distinct.result @@ -982,3 +982,16 @@ LIMIT 1; t3_date NULL DROP TABLE t1,t2,t3; +# +# Bug#22686994 REGRESSION FOR A GROUPING QUERY WITH DISTINCT +# +CREATE TABLE t1 (a INTEGER, b INTEGER); +INSERT INTO t1 VALUES (1,3), (2,4), (1,5), +(1,3), (2,1), (1,5), (1,7), (3,1), +(3,2), (3,1), (2,4); +SELECT DISTINCT (COUNT(DISTINCT b) + 1) AS c FROM t1 GROUP BY a; +c +4 +3 +DROP TABLE t1; +# End of test for Bug#22686994 diff --git a/mysql-wsrep-5.6/mysql-test/r/events_2.result b/mysql-wsrep-5.6/mysql-test/r/events_2.result index 102cfee0..505d1172 100644 --- a/mysql-wsrep-5.6/mysql-test/r/events_2.result +++ b/mysql-wsrep-5.6/mysql-test/r/events_2.result @@ -1,10 +1,10 @@ drop database if exists events_test; create database events_test; use events_test; -create event e_26 on schedule at '2038-01-19 03:14:07' disable do set @a = 5; +create event e_26 on schedule at '2037-01-01 00:00:00' disable do set @a = 5; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion -events_test e_26 set @a = 5 root@localhost 2038-01-19 03:14:07 DROP +events_test e_26 set @a = 5 root@localhost 2037-01-01 00:00:00 DROP drop event e_26; create event e_26 on schedule at NULL disable do set @a = 5; ERROR HY000: Incorrect AT value: 'NULL' 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 a56dc011..ef4fe646 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 @@ -321,3 +321,241 @@ SET optimizer_trace_max_mem_size=DEFAULT; SET optimizer_trace=DEFAULT; SET end_markers_in_json=DEFAULT; DROP TABLE t0,t1,t2; +# +# Bug #21749123: SELECT DISTINCT, WRONG RESULTS COMBINED WITH +# USE_INDEX_EXTENSIONS=OFF +# +CREATE TABLE t1 ( +pk_col INT AUTO_INCREMENT PRIMARY KEY, +a1 CHAR(64), +KEY a1_idx (a1) +) ENGINE=INNODB; +INSERT INTO t1 (a1) VALUES ('a'),('a'),('a'),('a'),('a'),('a'),('a'),('a'); +CREATE TABLE t2 ( +pk_col1 INT NOT NULL, +pk_col2 INT NOT NULL, +a1 CHAR(64), +a2 CHAR(64), +PRIMARY KEY(pk_col1, pk_col2), +KEY a1_idx (a1), +KEY a1_a2_idx (a1, a2) +) ENGINE=INNODB; +INSERT INTO t2 (pk_col1, pk_col2, a1, a2) VALUES (1,1,'a','b'),(1,2,'a','b'), +(1,3,'a','c'),(1,4,'a','c'), +(2,1,'a','d'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref PRIMARY,a1_idx a1_idx 65 const 4 Using where; Using index +SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; +a1 +a +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a1_idx a1_idx 69 NULL 9 Using index for group-by (scanning) +SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; +COUNT(DISTINCT a1) +1 +1 +1 +1 +1 +1 +1 +1 +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range a1_idx,a1_a2_idx a1_idx 69 NULL 6 Using index for group-by (scanning) +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; +COUNT(DISTINCT a1) +1 +1 +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range a1_a2_idx a1_a2_idx 130 NULL 6 Using index for group-by (scanning) +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; +COUNT(DISTINCT a1) +1 +1 +1 +SET @optimizer_switch_save=@@optimizer_switch; +SET @@optimizer_switch= "use_index_extensions=off"; +EXPLAIN SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref PRIMARY,a1_idx a1_idx 65 const 8 Using where; Using index +SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; +a1 +a +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index a1_idx a1_idx 65 NULL 8 Using index +SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; +COUNT(DISTINCT a1) +1 +1 +1 +1 +1 +1 +1 +1 +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index a1_idx,a1_a2_idx a1_idx 65 NULL 5 Using index +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; +COUNT(DISTINCT a1) +1 +1 +EXPLAIN SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range a1_a2_idx a1_a2_idx 130 NULL 6 Using index for group-by (scanning) +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; +COUNT(DISTINCT a1) +1 +1 +1 +SET @@optimizer_switch= @optimizer_switch_save; +DROP TABLE t1, t2; +# +# Bug #24671968: WHEN THE OPTIMISER IS USING INDEX FOR GROUP-BY IT OFTEN +# OFTEN GIVES WRONG RESULTS +# +CREATE TABLE t1 ( +id int NOT NULL, +c1 int NOT NULL, +c2 int, +PRIMARY KEY(id), +INDEX c1_c2_idx(c1, c2)); +INSERT INTO t1 (id, c1, c2) VALUES (1,1,1), (2,2,2), (10,10,1), (11,10,8), +(12,10,1), (13,10,2), (3,1,1), (4,10,1), +(5,10,1), (6,10,8), (7,1,1), (8,10,1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT DISTINCT c1 +FROM t1 +WHERE EXISTS (SELECT * +FROM DUAL +WHERE (c2 = 2)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index c1_c2_idx c1_c2_idx 9 NULL # Using where; Using index +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL # No tables used +EXPLAIN SELECT DISTINCT c1 +FROM t1 +WHERE 1 IN (2, +(SELECT 1 +FROM DUAL +WHERE (c2 = 2)), +3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index c1_c2_idx c1_c2_idx 9 NULL # Using where; Using index +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL # No tables used +EXPLAIN SELECT DISTINCT c1 +FROM t1 +WHERE c2 = 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c1_c2_idx c1_c2_idx 9 NULL # Using where; Using index for group-by +EXPLAIN SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE EXISTS (SELECT * +FROM DUAL +WHERE (c2 = 2)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL c1_c2_idx NULL NULL NULL # Using where; Using temporary +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL # No tables used +EXPLAIN SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE 1 IN (2, +(SELECT 1 +FROM DUAL +WHERE (c2 = 2)), +3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL c1_c2_idx NULL NULL NULL # Using where; Using temporary +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL # No tables used +SET optimizer_trace="enabled=on"; +SELECT DISTINCT c1 +FROM t1 +WHERE EXISTS (SELECT * +FROM DUAL +WHERE (c2 = 2)); +c1 +2 +10 +SELECT TRACE INTO @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "keypart_reference_from_where_clause"; +@trace RLIKE "keypart_reference_from_where_clause" +1 +SET optimizer_trace="enabled=off"; +SELECT DISTINCT c1 +FROM t1 +WHERE 1 IN (2, +(SELECT 1 +FROM DUAL +WHERE (c2 = 2)), +3); +c1 +2 +10 +SELECT DISTINCT c1 +FROM t1 +WHERE c2 = 2; +c1 +2 +10 +SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE EXISTS (SELECT * +FROM DUAL +WHERE (c2 = 2)); +c1 +2 +10 +SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE 1 IN (2, +(SELECT 1 +FROM DUAL +WHERE (c2 = 2)), +3); +c1 +2 +10 +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/loaddata.result b/mysql-wsrep-5.6/mysql-test/r/loaddata.result index 8ccc1a3d..3cf3ae3c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/loaddata.result +++ b/mysql-wsrep-5.6/mysql-test/r/loaddata.result @@ -316,7 +316,7 @@ FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' (c0, c2); -ERROR HY000: Invalid column reference (v2.c0) in LOAD DATA +ERROR HY000: Column 'c0' is not updatable LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v3 FIELDS ESCAPED BY '\\' diff --git a/mysql-wsrep-5.6/mysql-test/r/log_tables-big.result b/mysql-wsrep-5.6/mysql-test/r/log_tables-big.result index 9b81127c..1e189a77 100644 --- a/mysql-wsrep-5.6/mysql-test/r/log_tables-big.result +++ b/mysql-wsrep-5.6/mysql-test/r/log_tables-big.result @@ -1,29 +1,31 @@ +set @@global.log_output = 'TABLE'; set session long_query_time=10; select get_lock('bug27638', 1); get_lock('bug27638', 1) 1 set session long_query_time=1; -truncate table mysql.slow_log; select get_lock('bug27638', 2); get_lock('bug27638', 2) 0 -select if (query_time between '00:00:01' and '00:00:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log +where sql_text = 'select get_lock(\'bug27638\', 2)'; qt sql_text OK select get_lock('bug27638', 2) -truncate table mysql.slow_log; select get_lock('bug27638', 60); get_lock('bug27638', 60) 0 -select if (query_time between '00:00:59' and '00:01:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log +where sql_text = 'select get_lock(\'bug27638\', 60)'; qt sql_text OK select get_lock('bug27638', 60) -truncate table mysql.slow_log; select get_lock('bug27638', 101); get_lock('bug27638', 101) 0 -select if (query_time between '00:01:40' and '00:01:50', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log +where sql_text = 'select get_lock(\'bug27638\', 101)'; qt sql_text OK select get_lock('bug27638', 101) select release_lock('bug27638'); release_lock('bug27638') 1 +set @@global.log_output=default; 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 9ddc4572..39504f74 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, 2016, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2012, 2017, 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/mysqldump.result b/mysql-wsrep-5.6/mysql-test/r/mysqldump.result index 4e3c6863..102e69ca 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqldump.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqldump.result @@ -5432,3 +5432,66 @@ a DROP TABLE t1; DROP TABLE t2; DROP DATABASE db_20772273; +# +# Bug #25717383: MYSQLDUMP MAY EXECUTE ANY ARBITRARY QUERY +# +CREATE DATABASE bug25717383; +use bug25717383; +CREATE TABLE `tab +one` (a int); +CREATE VIEW `view +one` as SELECT * FROM `tab +one`; +CREATE PROCEDURE `proc +one`() SELECT * from `tab +one`; +CREATE TEMPORARY TABLE `temp +one` (id INT); +CREATE TRIGGER `trig +one` BEFORE INSERT ON `tab +one` FOR EACH ROW SET NEW.a = 1; +CREATE EVENT `event +one` ON SCHEDULE AT '2030-01-01 00:00:00' DO SET @a=5; +SHOW TABLES FROM bug25717383; +Tables_in_bug25717383 +tab +one +view +one +SHOW TRIGGERS FROM bug25717383; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trig +one INSERT tab +one SET NEW.a = 1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +SHOW EVENTS FROM bug25717383; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +bug25717383 event +one root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE' + ORDER BY ROUTINE_NAME; +ROUTINE_NAME +proc +one +SHOW TABLES FROM bug25717383; +Tables_in_bug25717383 +tab +one +view +one +SHOW TRIGGERS FROM bug25717383; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +trig +one INSERT tab +one SET NEW.a = 1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +SHOW EVENTS FROM bug25717383; +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +bug25717383 event +one root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci +SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE' + ORDER BY ROUTINE_NAME; +ROUTINE_NAME +proc +one +DROP DATABASE bug25717383; diff --git a/mysql-wsrep-5.6/mysql-test/r/parser.result b/mysql-wsrep-5.6/mysql-test/r/parser.result index dc35a146..9e394354 100644 --- a/mysql-wsrep-5.6/mysql-test/r/parser.result +++ b/mysql-wsrep-5.6/mysql-test/r/parser.result @@ -443,6 +443,10 @@ select master_pos_wait(1); ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' select master_pos_wait(1, 2, 3, 4); ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' +SET @save_sql_mode_before_master_pos_wait=@@SESSION.SQL_MODE; +SET @@SESSION.SQL_MODE="STRICT_ALL_TABLES"; +select master_pos_wait('master-bin.999999', 4, -1); +SET @@SESSION.SQL_MODE=@save_sql_mode_before_master_pos_wait; select rand(1, 2, 3); ERROR 42000: Incorrect parameter count in the call to native function 'rand' select round(1, 2, 3); diff --git a/mysql-wsrep-5.6/mysql-test/r/ps.result b/mysql-wsrep-5.6/mysql-test/r/ps.result index 8347eeb9..43e6f1d8 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ps.result +++ b/mysql-wsrep-5.6/mysql-test/r/ps.result @@ -3920,3 +3920,30 @@ SELECT * FROM t1; ERROR 70100: Query execution was interrupted # Connection default DROP TABLE t1; +# +# Bug#19894382 - SERVER SIDE PREPARED STATEMENTS LEADS TO POTENTIAL OFF-BY-SECOND +# TIMESTAMP ON SLAVE. +# +CREATE TABLE bug19894382(f1 CHAR(64) DEFAULT 'slave', +f2 TIME, f3 TIMESTAMP NULL, f4 DATETIME, +f5 TIME(3), f6 TIMESTAMP(3) NULL, f7 DATETIME(3)); +# Execute prepared statements from mysql_client_test. +# Insert tuples from the client_test_db.bug19894382 to the test.bug19894382. +# Tuples in the client_test_db.bug19894382 are inserted from the mysql_client_test. +INSERT INTO bug19894382 SELECT * FROM client_test_db.bug19894382; +# Replay binlog events +# Insert tuples from the client_test_db.bug19894382 to the test.bug19894382. +# Tuples in the client_test_db.bug19894382 are inserted from the binlog. +INSERT INTO bug19894382(f2, f3, f4, f5, f6, f7) +SELECT f2, f3, f4, f5, f6, f7 FROM client_test_db.bug19894382; +# With fix, tuples of "master" and "slave" will be same. There will not be any difference +# in values inserted for time, timestamp and datetime type columns. +SELECT * FROM bug19894382 ORDER BY f2; +f1 f2 f3 f4 f5 f6 f7 +master 07:30:30 2015-04-24 13:30:30 2015-04-24 07:30:30 07:30:30.005 2015-04-24 13:30:30.005 2015-04-24 07:30:30.005 +slave 07:30:30 2015-04-24 13:30:30 2015-04-24 07:30:30 07:30:30.005 2015-04-24 13:30:30.005 2015-04-24 07:30:30.005 +master 07:30:31 2015-04-24 13:30:31 2015-04-24 07:30:31 07:30:30.502 2015-04-24 13:30:30.502 2015-04-24 07:30:30.502 +slave 07:30:31 2015-04-24 13:30:31 2015-04-24 07:30:31 07:30:30.502 2015-04-24 13:30:30.502 2015-04-24 07:30:30.502 +# Cleanup +DROP DATABASE client_test_db; +DROP TABLE bug19894382; diff --git a/mysql-wsrep-5.6/mysql-test/r/ssl_mode.result b/mysql-wsrep-5.6/mysql-test/r/ssl_mode.result index 6a95e208..6cf2f30e 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ssl_mode.result +++ b/mysql-wsrep-5.6/mysql-test/r/ssl_mode.result @@ -38,8 +38,8 @@ DROP TABLE t1; # mysql Unknown value to --ssl-mode: ''. Use --ssl-mode=REQUIRED Unknown value to --ssl-mode: 'DERIUQER'. Use --ssl-mode=REQUIRED -ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections -ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections -ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): SSL connection error: Client is not configured to use SSL +ERROR 2026 (HY000): SSL connection error: Client is not configured to use SSL +ERROR 2026 (HY000): SSL connection error: Client is not configured to use SSL End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/ssl_mode_no_ssl.result b/mysql-wsrep-5.6/mysql-test/r/ssl_mode_no_ssl.result index 4955efab..b0357499 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ssl_mode_no_ssl.result +++ b/mysql-wsrep-5.6/mysql-test/r/ssl_mode_no_ssl.result @@ -1,23 +1,23 @@ # negative client tests # mysql -ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections -ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections -ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections -ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): SSL connection error: Server doesn't support SSL +ERROR 2026 (HY000): SSL connection error: Server doesn't support SSL +ERROR 2026 (HY000): SSL connection error: Server doesn't support SSL +ERROR 2026 (HY000): SSL connection error: Server doesn't support SSL # mysqldump -mysqldump: Got error: 2026: --ssl-mode=REQUIRED option forbids non SSL connections when trying to connect +mysqldump: Got error: 2026: SSL connection error: Server doesn't support SSL when trying to connect # mysqladmin Warning: Using a password on the command line interface can be insecure. -mysqladmin: error: '--ssl-mode=REQUIRED option forbids non SSL connections' +mysqladmin: error: 'SSL connection error: Server doesn't support SSL' # mysqlcheck -mysqlcheck: Got error: 2026: --ssl-mode=REQUIRED option forbids non SSL connections when trying to connect +mysqlcheck: Got error: 2026: SSL connection error: Server doesn't support SSL when trying to connect # mysqlimport -mysqlimport: Error: 2026 --ssl-mode=REQUIRED option forbids non SSL connections +mysqlimport: Error: 2026 SSL connection error: Server doesn't support SSL # mysqlshow -mysqlshow: --ssl-mode=REQUIRED option forbids non SSL connections +mysqlshow: SSL connection error: Server doesn't support SSL # mysqlslap -mysqlslap: Error when connecting to server: --ssl-mode=REQUIRED option forbids non SSL connections +mysqlslap: Error when connecting to server: SSL connection error: Server doesn't support SSL # mysqltest -mysqltest: Could not open connection 'default': 2026 --ssl-mode=REQUIRED option forbids non SSL connections +mysqltest: Could not open connection 'default': 2026 SSL connection error: Server doesn't support SSL End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/symlink.result b/mysql-wsrep-5.6/mysql-test/r/symlink.result index 0318299d..61eb0f6c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/symlink.result +++ b/mysql-wsrep-5.6/mysql-test/r/symlink.result @@ -213,3 +213,14 @@ t2 CREATE TABLE `t2` ( PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop tables t1, t2; +# +# Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE +# WITH DATA DIRECTORY +# +# Make sure we have no current database +CREATE DATABASE x; +USE x; +DROP DATABASE x; +CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM +DATA DIRECTORY "MYSQLTEST_VARDIR/tmp"; +DROP TABLE test.t1; 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 index f001e471..7ca8c54e 100755 --- 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 @@ -1,6 +1,6 @@ -#!/usr/bin/perl +#!/usr/bin/env perl -# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or 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 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/end_range_check.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/end_range_check.result new file mode 100644 index 00000000..c9d9dbf6 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/end_range_check.result @@ -0,0 +1,54 @@ +# Bug #23481444 OPTIMISER CALL ROW_SEARCH_MVCC() AND READ +# THE INDEX APPLIED BY UNCOMMITTED ROWS. +CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +f2 INT NOT NULL, f3 INT NOT NULL, +KEY(f2, f3))ENGINE=INNODB; +CREATE PROCEDURE populate_t1(IN BASE INT, IN SIZE INT) +BEGIN +DECLARE i INT DEFAULT BASE; +WHILE (i <= SIZE) DO +INSERT INTO t1(f2, f3) values (i, i); +SET i = i + 1; +END WHILE; +END| +CALL populate_t1(1, 10000); +INSERT INTO t1(f2, f3) VALUES(10000, 10000); +BEGIN; +CALL populate_t1(10001, 20000); +SELECT SQL_NO_CACHE f2, f3 FROM t1 WHERE f2=10000 and f3 between 9999 and 10000; +f2 f3 +10000 10000 +10000 10000 +DROP TABLE t1; +CREATE TABLE t1(f2 INT NOT NULL, f3 INT NOT NULL, +PRIMARY KEY(f2, f3))ENGINE=INNODB; +CALL populate_t1(1, 10000); +BEGIN; +CALL populate_t1(10001, 20000); +SELECT SQL_NO_CACHE f2, f3 FROM t1 WHERE f2=10000 and f3 between 9999 and 10000; +f2 f3 +10000 10000 +DROP TABLE t1; +CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +f2 INT NOT NULL, f3 INT NOT NULL, +KEY(f2), KEY(f3))ENGINE=INNODB; +CALL populate_t1(1, 10000); +BEGIN; +CALL populate_t1(10001, 20000); +SELECT count(*) FROM t1 FORCE INDEX(f2, f3) WHERE f2 < 10000 or f3 < 10000; +count(*) +9999 +DROP TABLE t1; +CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +f2 INT NOT NULL, f3 INT NOT NULL, +KEY(f2, f3))ENGINE=INNODB; +CALL populate_t1(1, 10000); +CALL populate_t1(100000, 100200); +BEGIN; +CALL populate_t1(10001, 20000); +SELECT SQL_NO_CACHE COUNT(*) FROM t1 +WHERE f2 BETWEEN 9999 AND 10000 OR f2 >= 100000; +COUNT(*) +203 +DROP TABLE t1; +DROP PROCEDURE populate_t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/ibuf_not_empty.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/ibuf_not_empty.result new file mode 100644 index 00000000..88d0ea0a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/ibuf_not_empty.result @@ -0,0 +1,30 @@ +call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'".*".".*"\' in the cache'); +call mtr.add_suppression('InnoDB: Allocated tablespace [0-9]+, old maximum was [0-9]+'); +CREATE TABLE t1( +a INT AUTO_INCREMENT PRIMARY KEY, +b CHAR(1), +c INT, +INDEX(b)) +ENGINE=InnoDB STATS_PERSISTENT=0; +SET GLOBAL innodb_change_buffering_debug = 1; +INSERT INTO t1 VALUES(0,'x',1); +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +# Stop server +# Restart server. +insert into t1 values(0,'y',1); +ERROR HY000: Can't lock file (errno: 165 - Table is read only) +# Stop server +# Restart server. +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_force_recovery.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_force_recovery.result index fb36c986..fe60e3f3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_force_recovery.result +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_force_recovery.result @@ -1,7 +1,9 @@ call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'".*".".*"\' in the cache'); call mtr.add_suppression('InnoDB: Allocated tablespace [0-9]+, old maximum was [0-9]+'); create table t1(f1 int not null, f2 int not null, index idx(f2))engine=innodb; +create table t2(f1 int not null, f2 int not null, index idx(f2))engine=innodb; insert into t1 values(1, 2); +insert into t2 values(1, 2); SET GLOBAL innodb_fast_shutdown = 0; # Stop server # Restart server. @@ -29,3 +31,65 @@ ERROR HY000: Table 't1' is read only drop table t1; show tables; Tables_in_test +t2 +# Stop server +# Restart server. +select * from t2; +f1 f2 +1 2 +insert into t2 values(2, 3); +ERROR HY000: Table 't2' is read only +alter table t2 add f3 int not null, algorithm=copy; +ERROR HY000: InnoDB is in read only mode. +alter table t2 add f3 int not null, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY. +drop index idx on t2; +ERROR HY000: InnoDB is in read only mode. +update t2 set f1=3 where f2=2; +ERROR HY000: Table 't2' is read only +create table t4(f1 int not null)engine=innodb; +ERROR HY000: InnoDB is in read only mode. +drop table t4; +ERROR 42S02: Unknown table 'test.t4' +rename table t2 to t3; +ERROR HY000: Error on rename of './test/t2' to './test/t3' (errno: 165 - Table is read only) +truncate table t2; +ERROR HY000: Table 't2' is read only +drop table t2; +ERROR 42S02: Unknown table 'test.t2' +show tables; +Tables_in_test +t2 +# Stop server +# Restart server. +select * from t2; +f1 f2 +1 2 +insert into t2 values(2, 3); +ERROR HY000: Can't lock file (errno: 165 - Table is read only) +alter table t2 add f3 int not null, algorithm=copy; +ERROR HY000: Can't lock file (errno: 165 - Table is read only) +alter table t2 add f3 int not null, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY. +drop index idx on t2; +ERROR HY000: Can't lock file (errno: 165 - Table is read only) +update t2 set f1=3 where f2=2; +ERROR HY000: Can't lock file (errno: 165 - Table is read only) +create table t4(f1 int not null)engine=innodb; +ERROR HY000: InnoDB is in read only mode. +drop table t4; +ERROR 42S02: Unknown table 'test.t4' +rename table t2 to t3; +ERROR HY000: Error on rename of './test/t2' to './test/t3' (errno: 165 - Table is read only) +truncate table t2; +ERROR HY000: Table 't2' is read only +drop table t2; +ERROR 42S02: Unknown table 'test.t2' +show tables; +Tables_in_test +t2 +# Stop server +# Restart server. +drop table t2; +show tables; +Tables_in_test diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_io_pf.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_io_pf.result new file mode 100644 index 00000000..816bd474 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_io_pf.result @@ -0,0 +1,19 @@ +USE test; +CREATE TABLE t1(id INT); +INSERT INTO t1 VALUES(1),(2),(3),(4),(5); +SELECT * FROM t1; +id +1 +2 +3 +4 +5 +USE performance_schema; +SELECT EVENT_NAME,COUNT_STAR FROM performance_schema.file_summary_by_event_name +WHERE EVENT_NAME like "%inno%"; +EVENT_NAME COUNT_STAR +wait/io/file/innodb/innodb_data_file 5 +wait/io/file/innodb/innodb_log_file 5 +wait/io/file/innodb/innodb_temp_file 5 +USE test; +DROP table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/r/undo_space_id.result b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/undo_space_id.result new file mode 100644 index 00000000..b31e71d7 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/r/undo_space_id.result @@ -0,0 +1,11 @@ +# Start mysqld to create tablespaces according to my.cnf +ib_logfile0 +ib_logfile1 +ib_logfile2 +ibdata1 +ibdata2 +my.cnf +my_restart.err +undo003 +undo004 +undo005 diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/end_range_check.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/end_range_check.test new file mode 100644 index 00000000..a5502946 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/end_range_check.test @@ -0,0 +1,77 @@ +--source include/have_innodb.inc +--source include/not_embedded.inc +--source include/big_test.inc + +--echo # Bug #23481444 OPTIMISER CALL ROW_SEARCH_MVCC() AND READ +--echo # THE INDEX APPLIED BY UNCOMMITTED ROWS. + +CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + f2 INT NOT NULL, f3 INT NOT NULL, + KEY(f2, f3))ENGINE=INNODB; + +DELIMITER |; +CREATE PROCEDURE populate_t1(IN BASE INT, IN SIZE INT) +BEGIN + DECLARE i INT DEFAULT BASE; + WHILE (i <= SIZE) DO + INSERT INTO t1(f2, f3) values (i, i); + SET i = i + 1; + END WHILE; +END| +DELIMITER ;| +CALL populate_t1(1, 10000); +INSERT INTO t1(f2, f3) VALUES(10000, 10000); + +BEGIN; +CALL populate_t1(10001, 20000); + +connect (con1,localhost,root,,); +connection con1; +SELECT SQL_NO_CACHE f2, f3 FROM t1 WHERE f2=10000 and f3 between 9999 and 10000; +connection default; +DROP TABLE t1; + +CREATE TABLE t1(f2 INT NOT NULL, f3 INT NOT NULL, + PRIMARY KEY(f2, f3))ENGINE=INNODB; + +CALL populate_t1(1, 10000); + +BEGIN; +CALL populate_t1(10001, 20000); + +connection con1; +SELECT SQL_NO_CACHE f2, f3 FROM t1 WHERE f2=10000 and f3 between 9999 and 10000; +connection default; +DROP TABLE t1; + +CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + f2 INT NOT NULL, f3 INT NOT NULL, + KEY(f2), KEY(f3))ENGINE=INNODB; +CALL populate_t1(1, 10000); + +BEGIN; +CALL populate_t1(10001, 20000); + +connection con1; +SELECT count(*) FROM t1 FORCE INDEX(f2, f3) WHERE f2 < 10000 or f3 < 10000; +connection default; +DROP TABLE t1; + +CREATE TABLE t1(f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + f2 INT NOT NULL, f3 INT NOT NULL, + KEY(f2, f3))ENGINE=INNODB; + +CALL populate_t1(1, 10000); +CALL populate_t1(100000, 100200); + +BEGIN; +CALL populate_t1(10001, 20000); + +connection con1; +SELECT SQL_NO_CACHE COUNT(*) FROM t1 +WHERE f2 BETWEEN 9999 AND 10000 OR f2 >= 100000; +disconnect con1; +connection default; + +DROP TABLE t1; +DROP PROCEDURE populate_t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/ibuf_not_empty-master.opt b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/ibuf_not_empty-master.opt new file mode 100644 index 00000000..e5d7090c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/ibuf_not_empty-master.opt @@ -0,0 +1 @@ +--innodb_buffer_pool_size=24M diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/ibuf_not_empty.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/ibuf_not_empty.test new file mode 100644 index 00000000..1d3f8788 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/ibuf_not_empty.test @@ -0,0 +1,102 @@ +--source include/have_innodb.inc +# innodb_change_buffering_debug option is debug only +--source include/have_debug.inc +# Embedded server does not support crashing +--source include/not_embedded.inc + + +call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'".*".".*"\' in the cache'); +call mtr.add_suppression('InnoDB: Allocated tablespace [0-9]+, old maximum was [0-9]+'); + +CREATE TABLE t1( + a INT AUTO_INCREMENT PRIMARY KEY, + b CHAR(1), + c INT, + INDEX(b)) +ENGINE=InnoDB STATS_PERSISTENT=0; + +# The flag innodb_change_buffering_debug is only available in debug builds. +# 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. +SET GLOBAL innodb_change_buffering_debug = 1; + +# Create enough rows for the table, so that the change buffer will be +# used for modifying the secondary index page. There must be multiple +# index pages, because changes to the root page are never buffered. +INSERT INTO t1 VALUES(0,'x',1); +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; +INSERT INTO t1 SELECT 0,b,c FROM t1; + +# Restart the server in force recovery mode +--echo # Stop server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Request shutdown +-- send_shutdown + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again, ensure +# that no background threads are started, so that we can check that it +# shuts down properly. +--exec echo "restart:--innodb-force-recovery=6" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +--error ER_CANT_LOCK +insert into t1 values(0,'y',1); + +# Restart the server in force recovery mode +--echo # Stop server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Request shutdown +-- send_shutdown + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again, ensure +# that no background threads are started, so that we can check that it +# shuts down properly. +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +# Cleanup +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_force_recovery.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_force_recovery.test index 0feeafda..9912a907 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_force_recovery.test +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_force_recovery.test @@ -8,7 +8,9 @@ call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'".*".".* call mtr.add_suppression('InnoDB: Allocated tablespace [0-9]+, old maximum was [0-9]+'); create table t1(f1 int not null, f2 int not null, index idx(f2))engine=innodb; +create table t2(f1 int not null, f2 int not null, index idx(f2))engine=innodb; insert into t1 values(1, 2); +insert into t2 values(1, 2); SET GLOBAL innodb_fast_shutdown = 0; @@ -71,3 +73,156 @@ truncate table t1; drop table t1; show tables; + +# Restart the server in force recovery mode +--echo # Stop server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Request shutdown +-- send_shutdown + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again, ensure +# that no background threads are started, so that we can check that it +# shuts down properly. +--exec echo "restart:--innodb-force-recovery=5" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +select * from t2; + +--error ER_OPEN_AS_READONLY +insert into t2 values(2, 3); + +--error ER_INNODB_READ_ONLY +alter table t2 add f3 int not null, algorithm=copy; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +alter table t2 add f3 int not null, algorithm=inplace; + +--error ER_INNODB_READ_ONLY +drop index idx on t2; + +--error ER_OPEN_AS_READONLY +update t2 set f1=3 where f2=2; + +--error ER_INNODB_READ_ONLY +create table t4(f1 int not null)engine=innodb; + +--error ER_BAD_TABLE_ERROR +drop table t4; + +--error ER_ERROR_ON_RENAME +rename table t2 to t3; + +--error ER_OPEN_AS_READONLY +truncate table t2; + +--error ER_BAD_TABLE_ERROR +drop table t2; +show tables; + +# Restart the server in force recovery mode +--echo # Stop server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Request shutdown +-- send_shutdown + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again, ensure +# that no background threads are started, so that we can check that it +# shuts down properly. +--exec echo "restart:--innodb-force-recovery=6" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +select * from t2; + +--error ER_CANT_LOCK +insert into t2 values(2, 3); + +--error ER_CANT_LOCK +alter table t2 add f3 int not null, algorithm=copy; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +alter table t2 add f3 int not null, algorithm=inplace; + +--error ER_CANT_LOCK +drop index idx on t2; + +--error ER_CANT_LOCK +update t2 set f1=3 where f2=2; + +--error ER_INNODB_READ_ONLY +create table t4(f1 int not null)engine=innodb; + +--error ER_BAD_TABLE_ERROR +drop table t4; + +--error ER_ERROR_ON_RENAME +rename table t2 to t3; + +--error ER_OPEN_AS_READONLY +truncate table t2; + +--error ER_BAD_TABLE_ERROR +drop table t2; +show tables; + +# Restart the server without force recovery mode +--echo # Stop server + +# Write file to make mysql-test-run.pl wait for the server to stop +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Request shutdown +-- send_shutdown + +# Call script that will poll the server waiting for it to disapear +-- source include/wait_until_disconnected.inc + +--echo # Restart server. + +# Write file to make mysql-test-run.pl start up the server again, ensure +# that no background threads are started, so that we can check that it +# shuts down properly. +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +drop table t2; +show tables; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_io_pf.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_io_pf.test new file mode 100644 index 00000000..8d4b71ff --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_io_pf.test @@ -0,0 +1,15 @@ +--source include/have_innodb.inc +--source include/have_perfschema.inc +--source include/not_embedded.inc + +USE test; +CREATE TABLE t1(id INT); +INSERT INTO t1 VALUES(1),(2),(3),(4),(5); +SELECT * FROM t1; + +USE performance_schema; +--replace_column 2 5 +SELECT EVENT_NAME,COUNT_STAR FROM performance_schema.file_summary_by_event_name + WHERE EVENT_NAME like "%inno%"; +USE test; +DROP table t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/innodb/t/undo_space_id.test b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/undo_space_id.test new file mode 100644 index 00000000..f45a9563 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/innodb/t/undo_space_id.test @@ -0,0 +1,30 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +let bugdir= $MYSQLTEST_VARDIR/tmp/datadir1; +--mkdir $bugdir + +let SEARCH_FILE = $bugdir/my_restart.err; +let $args=--defaults-file=$bugdir/my.cnf --datadir=$bugdir --secure-file-priv="" --loose-console > $SEARCH_FILE 2>&1 ; + +--write_file $bugdir/my.cnf +[mysqld] +EOF + +--exec echo "innodb_data_home_dir = $bugdir" >> $bugdir/my.cnf + +--append_file $bugdir/my.cnf +innodb_data_file_path = ibdata1:10M;ibdata2:10M:autoextend +innodb_undo_tablespaces = 3 +innodb_log_files_in_group = 3 +EOF + +# Innodb creates system tablespaces according to my.cnf and aborts +# after creating undo tablespace. +--echo # Start mysqld to create tablespaces according to my.cnf +--error 2 +--exec $MYSQLD $args --skip-grant-tables --debug=d,innodb_undo_upgrade --innodb-unknown-parameter + +--list_files $bugdir +--remove_files_wildcard $bugdir +--rmdir $bugdir 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 dc8e4db5..ec6b8880 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 @@ -349,20 +349,19 @@ CREATE TABLE t1 ( ) ENGINE=INNODB; INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1), ('c',4),('d',3),('e',2),('f',2); +ANALYZE TABLE t1; SET @optimizer_switch_saved=@@session.optimizer_switch; SET @@session.optimizer_switch=default; -SET optimizer_trace="enabled=on"; # Uses "access_type_changed" to use range over ref despite b_idx not being the # cheapest in range. EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; # Output of table_scan in test_quick_select is not always reliable. ---replace_regex /"rows": 12/"rows": 11/ /"cost": 5.5/"cost": 5.3/ -SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; -SET optimizer_trace="enabled=off"; SET @@session.optimizer_switch=@optimizer_switch_saved; DROP TABLE t1; 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 08da7b99..d2f3ac88 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 @@ -2447,299 +2447,17 @@ KEY b_idx(b) ) ENGINE=INNODB; INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1), ('c',4),('d',3),('e',2),('f',2); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK SET @optimizer_switch_saved=@@session.optimizer_switch; SET @@session.optimizer_switch=default; -SET optimizer_trace="enabled=on"; EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,b_idx b_idx 35 NULL 2 Using index condition; Using where -SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2 { - "steps": [ - { - "join_preparation": { - "select#": 1, - "steps": [ - { - "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where ((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))" - } - ] /* steps */ - } /* join_preparation */ - }, - { - "join_optimization": { - "select#": 1, - "steps": [ - { - "condition_processing": { - "condition": "WHERE", - "original_condition": "((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - } - ] /* steps */ - } /* condition_processing */ - }, - { - "table_dependencies": [ - { - "table": "`t1`", - "row_may_be_null": false, - "map_bit": 0, - "depends_on_map_bits": [ - ] /* depends_on_map_bits */ - } - ] /* table_dependencies */ - }, - { - "ref_optimizer_key_uses": [ - { - "table": "`t1`", - "field": "b", - "equals": "2", - "null_rejecting": false - } - ] /* ref_optimizer_key_uses */ - }, - { - "rows_estimation": [ - { - "table": "`t1`", - "range_analysis": { - "table_scan": { - "rows": 11, - "cost": 5.3 - } /* table_scan */, - "potential_range_indices": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b_idx", - "usable": true, - "key_parts": [ - "b", - "a" - ] /* key_parts */ - } - ] /* potential_range_indices */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "PRIMARY", - "ranges": [ - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2", - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 2.41, - "chosen": true - }, - { - "index": "b_idx", - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 4.41, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "PRIMARY", - "rows": 2, - "ranges": [ - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2", - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 2.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - } - ] /* rows_estimation */ - }, - { - "considered_execution_plans": [ - { - "plan_prefix": [ - ] /* plan_prefix */, - "table": "`t1`", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "ref", - "index": "b_idx", - "rows": 2, - "cost": 2.4, - "chosen": true - }, - { - "access_type": "range", - "rows": 2, - "cost": 2.81, - "chosen": false - } - ] /* considered_access_paths */ - } /* best_access_path */, - "cost_for_plan": 2.4, - "rows_for_plan": 2, - "chosen": true - } - ] /* considered_execution_plans */ - }, - { - "attaching_conditions_to_tables": { - "original_condition": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))", - "attached_conditions_computation": [ - { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 11, - "cost": 5.3 - } /* table_scan */, - "potential_range_indices": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "b_idx", - "usable": true, - "key_parts": [ - "b", - "a" - ] /* key_parts */ - } - ] /* potential_range_indices */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "b_idx", - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 4.41, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "b_idx", - "rows": 2, - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 4.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "b_idx", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - } - ] /* attached_conditions_computation */, - "attached_conditions_summary": [ - { - "table": "`t1`", - "attached": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))" - } - ] /* attached_conditions_summary */ - } /* attaching_conditions_to_tables */ - }, - { - "refine_plan": [ - { - "table": "`t1`", - "pushed_index_condition": "(`t1`.`b` = 2)", - "table_condition_attached": "(`t1`.`a` in ('a','b'))", - "access_type": "range" - } - ] /* refine_plan */ - } - ] /* steps */ - } /* join_optimization */ - }, - { - "join_explain": { - "select#": 1, - "steps": [ - ] /* steps */ - } /* join_explain */ - } - ] /* steps */ -} 0 0 -SET optimizer_trace="enabled=off"; +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; +@trace RLIKE "rerunning_range_optimizer_for_single_index" +1 SET @@session.optimizer_switch=@optimizer_switch_saved; DROP TABLE t1; 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 1143d396..abb4c28c 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 @@ -1907,299 +1907,17 @@ KEY b_idx(b) ) ENGINE=INNODB; INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1), ('c',4),('d',3),('e',2),('f',2); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK SET @optimizer_switch_saved=@@session.optimizer_switch; SET @@session.optimizer_switch=default; -SET optimizer_trace="enabled=on"; EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,b_idx b_idx 35 NULL 2 Using index condition; Using where -SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2 { - "steps": [ - { - "join_preparation": { - "select#": 1, - "steps": [ - { - "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where ((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))" - } - ] /* steps */ - } /* join_preparation */ - }, - { - "join_optimization": { - "select#": 1, - "steps": [ - { - "condition_processing": { - "condition": "WHERE", - "original_condition": "((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - } - ] /* steps */ - } /* condition_processing */ - }, - { - "table_dependencies": [ - { - "table": "`t1`", - "row_may_be_null": false, - "map_bit": 0, - "depends_on_map_bits": [ - ] /* depends_on_map_bits */ - } - ] /* table_dependencies */ - }, - { - "ref_optimizer_key_uses": [ - { - "table": "`t1`", - "field": "b", - "equals": "2", - "null_rejecting": false - } - ] /* ref_optimizer_key_uses */ - }, - { - "rows_estimation": [ - { - "table": "`t1`", - "range_analysis": { - "table_scan": { - "rows": 11, - "cost": 5.3 - } /* table_scan */, - "potential_range_indices": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b_idx", - "usable": true, - "key_parts": [ - "b", - "a" - ] /* key_parts */ - } - ] /* potential_range_indices */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "PRIMARY", - "ranges": [ - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2", - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 2.41, - "chosen": true - }, - { - "index": "b_idx", - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 4.41, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "PRIMARY", - "rows": 2, - "ranges": [ - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2", - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 2.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - } - ] /* rows_estimation */ - }, - { - "considered_execution_plans": [ - { - "plan_prefix": [ - ] /* plan_prefix */, - "table": "`t1`", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "ref", - "index": "b_idx", - "rows": 2, - "cost": 2.4, - "chosen": true - }, - { - "access_type": "range", - "rows": 2, - "cost": 2.81, - "chosen": false - } - ] /* considered_access_paths */ - } /* best_access_path */, - "cost_for_plan": 2.4, - "rows_for_plan": 2, - "chosen": true - } - ] /* considered_execution_plans */ - }, - { - "attaching_conditions_to_tables": { - "original_condition": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))", - "attached_conditions_computation": [ - { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 11, - "cost": 5.3 - } /* table_scan */, - "potential_range_indices": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "b_idx", - "usable": true, - "key_parts": [ - "b", - "a" - ] /* key_parts */ - } - ] /* potential_range_indices */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "b_idx", - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 4.41, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "b_idx", - "rows": 2, - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 4.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "b_idx", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - } - ] /* attached_conditions_computation */, - "attached_conditions_summary": [ - { - "table": "`t1`", - "attached": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))" - } - ] /* attached_conditions_summary */ - } /* attaching_conditions_to_tables */ - }, - { - "refine_plan": [ - { - "table": "`t1`", - "pushed_index_condition": "(`t1`.`b` = 2)", - "table_condition_attached": "(`t1`.`a` in ('a','b'))", - "access_type": "range" - } - ] /* refine_plan */ - } - ] /* steps */ - } /* join_optimization */ - }, - { - "join_explain": { - "select#": 1, - "steps": [ - ] /* steps */ - } /* join_explain */ - } - ] /* steps */ -} 0 0 -SET optimizer_trace="enabled=off"; +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; +@trace RLIKE "rerunning_range_optimizer_for_single_index" +1 SET @@session.optimizer_switch=@optimizer_switch_saved; DROP TABLE t1; 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 08da7b99..d2f3ac88 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 @@ -2447,299 +2447,17 @@ KEY b_idx(b) ) ENGINE=INNODB; INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1), ('c',4),('d',3),('e',2),('f',2); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK SET @optimizer_switch_saved=@@session.optimizer_switch; SET @@session.optimizer_switch=default; -SET optimizer_trace="enabled=on"; EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,b_idx b_idx 35 NULL 2 Using index condition; Using where -SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2 { - "steps": [ - { - "join_preparation": { - "select#": 1, - "steps": [ - { - "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where ((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))" - } - ] /* steps */ - } /* join_preparation */ - }, - { - "join_optimization": { - "select#": 1, - "steps": [ - { - "condition_processing": { - "condition": "WHERE", - "original_condition": "((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - } - ] /* steps */ - } /* condition_processing */ - }, - { - "table_dependencies": [ - { - "table": "`t1`", - "row_may_be_null": false, - "map_bit": 0, - "depends_on_map_bits": [ - ] /* depends_on_map_bits */ - } - ] /* table_dependencies */ - }, - { - "ref_optimizer_key_uses": [ - { - "table": "`t1`", - "field": "b", - "equals": "2", - "null_rejecting": false - } - ] /* ref_optimizer_key_uses */ - }, - { - "rows_estimation": [ - { - "table": "`t1`", - "range_analysis": { - "table_scan": { - "rows": 11, - "cost": 5.3 - } /* table_scan */, - "potential_range_indices": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b_idx", - "usable": true, - "key_parts": [ - "b", - "a" - ] /* key_parts */ - } - ] /* potential_range_indices */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "PRIMARY", - "ranges": [ - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2", - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 2.41, - "chosen": true - }, - { - "index": "b_idx", - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 4.41, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "PRIMARY", - "rows": 2, - "ranges": [ - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2", - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 2.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - } - ] /* rows_estimation */ - }, - { - "considered_execution_plans": [ - { - "plan_prefix": [ - ] /* plan_prefix */, - "table": "`t1`", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "ref", - "index": "b_idx", - "rows": 2, - "cost": 2.4, - "chosen": true - }, - { - "access_type": "range", - "rows": 2, - "cost": 2.81, - "chosen": false - } - ] /* considered_access_paths */ - } /* best_access_path */, - "cost_for_plan": 2.4, - "rows_for_plan": 2, - "chosen": true - } - ] /* considered_execution_plans */ - }, - { - "attaching_conditions_to_tables": { - "original_condition": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))", - "attached_conditions_computation": [ - { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 11, - "cost": 5.3 - } /* table_scan */, - "potential_range_indices": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "b_idx", - "usable": true, - "key_parts": [ - "b", - "a" - ] /* key_parts */ - } - ] /* potential_range_indices */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "b_idx", - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 4.41, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "b_idx", - "rows": 2, - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 4.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "b_idx", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - } - ] /* attached_conditions_computation */, - "attached_conditions_summary": [ - { - "table": "`t1`", - "attached": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))" - } - ] /* attached_conditions_summary */ - } /* attaching_conditions_to_tables */ - }, - { - "refine_plan": [ - { - "table": "`t1`", - "pushed_index_condition": "(`t1`.`b` = 2)", - "table_condition_attached": "(`t1`.`a` in ('a','b'))", - "access_type": "range" - } - ] /* refine_plan */ - } - ] /* steps */ - } /* join_optimization */ - }, - { - "join_explain": { - "select#": 1, - "steps": [ - ] /* steps */ - } /* join_explain */ - } - ] /* steps */ -} 0 0 -SET optimizer_trace="enabled=off"; +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; +@trace RLIKE "rerunning_range_optimizer_for_single_index" +1 SET @@session.optimizer_switch=@optimizer_switch_saved; DROP TABLE t1; 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 e0f1e562..a4a886ef 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 @@ -1871,299 +1871,17 @@ KEY b_idx(b) ) ENGINE=INNODB; INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1), ('c',4),('d',3),('e',2),('f',2); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK SET @optimizer_switch_saved=@@session.optimizer_switch; SET @@session.optimizer_switch=default; -SET optimizer_trace="enabled=on"; EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY,b_idx b_idx 35 NULL 2 Using index condition; Using where -SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; -QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2 { - "steps": [ - { - "join_preparation": { - "select#": 1, - "steps": [ - { - "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where ((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))" - } - ] /* steps */ - } /* join_preparation */ - }, - { - "join_optimization": { - "select#": 1, - "steps": [ - { - "condition_processing": { - "condition": "WHERE", - "original_condition": "((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))", - "steps": [ - { - "transformation": "equality_propagation", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - }, - { - "transformation": "constant_propagation", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - }, - { - "transformation": "trivial_condition_removal", - "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))" - } - ] /* steps */ - } /* condition_processing */ - }, - { - "table_dependencies": [ - { - "table": "`t1`", - "row_may_be_null": false, - "map_bit": 0, - "depends_on_map_bits": [ - ] /* depends_on_map_bits */ - } - ] /* table_dependencies */ - }, - { - "ref_optimizer_key_uses": [ - { - "table": "`t1`", - "field": "b", - "equals": "2", - "null_rejecting": false - } - ] /* ref_optimizer_key_uses */ - }, - { - "rows_estimation": [ - { - "table": "`t1`", - "range_analysis": { - "table_scan": { - "rows": 11, - "cost": 5.3 - } /* table_scan */, - "potential_range_indices": [ - { - "index": "PRIMARY", - "usable": true, - "key_parts": [ - "a", - "b" - ] /* key_parts */ - }, - { - "index": "b_idx", - "usable": true, - "key_parts": [ - "b", - "a" - ] /* key_parts */ - } - ] /* potential_range_indices */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "PRIMARY", - "ranges": [ - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2", - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": true, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 2.41, - "chosen": true - }, - { - "index": "b_idx", - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 4.41, - "chosen": false, - "cause": "cost" - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "PRIMARY", - "rows": 2, - "ranges": [ - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2", - "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 2.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - } - ] /* rows_estimation */ - }, - { - "considered_execution_plans": [ - { - "plan_prefix": [ - ] /* plan_prefix */, - "table": "`t1`", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "ref", - "index": "b_idx", - "rows": 2, - "cost": 2.4, - "chosen": true - }, - { - "access_type": "range", - "rows": 2, - "cost": 2.81, - "chosen": false - } - ] /* considered_access_paths */ - } /* best_access_path */, - "cost_for_plan": 2.4, - "rows_for_plan": 2, - "chosen": true - } - ] /* considered_execution_plans */ - }, - { - "attaching_conditions_to_tables": { - "original_condition": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))", - "attached_conditions_computation": [ - { - "rerunning_range_optimizer_for_single_index": [ - { - "table_scan": { - "rows": 11, - "cost": 5.3 - } /* table_scan */, - "potential_range_indices": [ - { - "index": "PRIMARY", - "usable": false, - "cause": "not_applicable" - }, - { - "index": "b_idx", - "usable": true, - "key_parts": [ - "b", - "a" - ] /* key_parts */ - } - ] /* potential_range_indices */, - "setup_range_conditions": [ - ] /* setup_range_conditions */, - "group_index_range": { - "chosen": false, - "cause": "not_group_by_or_distinct" - } /* group_index_range */, - "analyzing_range_alternatives": { - "range_scan_alternatives": [ - { - "index": "b_idx", - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */, - "index_dives_for_eq_ranges": true, - "rowid_ordered": false, - "using_mrr": false, - "index_only": false, - "rows": 2, - "cost": 4.41, - "chosen": true - } - ] /* range_scan_alternatives */, - "analyzing_roworder_intersect": { - "usable": false, - "cause": "too_few_roworder_scans" - } /* analyzing_roworder_intersect */ - } /* analyzing_range_alternatives */, - "chosen_range_access_summary": { - "range_access_plan": { - "type": "range_scan", - "index": "b_idx", - "rows": 2, - "ranges": [ - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value", - "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value" - ] /* ranges */ - } /* range_access_plan */, - "rows_for_plan": 2, - "cost_for_plan": 4.41, - "chosen": true - } /* chosen_range_access_summary */ - } /* range_analysis */ - ] /* rerunning_range_optimizer_for_single_index */ - }, - { - "access_type_changed": { - "table": "`t1`", - "index": "b_idx", - "old_type": "ref", - "new_type": "range", - "cause": "uses_more_keyparts" - } /* access_type_changed */ - } - ] /* attached_conditions_computation */, - "attached_conditions_summary": [ - { - "table": "`t1`", - "attached": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))" - } - ] /* attached_conditions_summary */ - } /* attaching_conditions_to_tables */ - }, - { - "refine_plan": [ - { - "table": "`t1`", - "pushed_index_condition": "(`t1`.`b` = 2)", - "table_condition_attached": "(`t1`.`a` in ('a','b'))", - "access_type": "range" - } - ] /* refine_plan */ - } - ] /* steps */ - } /* join_optimization */ - }, - { - "join_explain": { - "select#": 1, - "steps": [ - ] /* steps */ - } /* join_explain */ - } - ] /* steps */ -} 0 0 -SET optimizer_trace="enabled=off"; +SELECT TRACE into @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "rerunning_range_optimizer_for_single_index"; +@trace RLIKE "rerunning_range_optimizer_for_single_index" +1 SET @@session.optimizer_switch=@optimizer_switch_saved; DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_1_digest.result b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_1_digest.result new file mode 100644 index 00000000..cf07022d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/r/start_server_1_digest.result @@ -0,0 +1,7 @@ +SELECT "Digest table has a size 1 and is full already." as use_case; +use_case +Digest table has a size 1 and is full already. +select SCHEMA_NAME, DIGEST, DIGEST_TEXT +from performance_schema.events_statements_summary_by_digest; +SCHEMA_NAME DIGEST DIGEST_TEXT +NULL NULL NULL diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt new file mode 100644 index 00000000..e59be3eb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_1_digest-master.opt @@ -0,0 +1 @@ +--performance-schema-digests-size=1 diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_1_digest.test b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_1_digest.test new file mode 100644 index 00000000..998d9a5e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/perfschema/t/start_server_1_digest.test @@ -0,0 +1,15 @@ +# ----------------------------------------------------------------------- +# Tests for the performance schema statement Digests. +# ----------------------------------------------------------------------- + +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source include/no_protocol.inc + +SELECT "Digest table has a size 1 and is full already." as use_case; + +select SCHEMA_NAME, DIGEST, DIGEST_TEXT + from performance_schema.events_statements_summary_by_digest; + + + diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_user.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_user.result new file mode 100644 index 00000000..911e525c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_alter_user.result @@ -0,0 +1,47 @@ +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 @old_sql_mode_master= @@session.sql_mode; +SET @@session.sql_mode= (select replace(@@session.sql_mode,'NO_BACKSLASH_ESCAPES','')); +SET @old_sql_mode_slave= @@session.sql_mode; +SET @@session.sql_mode= (select replace(@@session.sql_mode,'NO_BACKSLASH_ESCAPES','')); +SET GLOBAL DEBUG= '+d,force_hash_string_with_quote'; +CREATE USER 'user1'@'localhost' IDENTIFIED WITH sha256_password; +SET old_passwords= 2; +SET PASSWORD FOR 'user1'@'localhost' = PASSWORD('auth_secret'); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user1'@'localhost'='$5$BVZy9O>\'a+2MH]_?$fpWyabcdiHjfCVqId/quykZzjaA7adpkcen/uiQrtmOK4p4' +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`; SET PASSWORD FOR 'user1'@'localhost'='$5$BVZy9O>\'a+2MH]_?$fpWyabcdiHjfCVqId/quykZzjaA7adpkcen/uiQrtmOK4p4' +SET GLOBAL DEBUG= '-d,force_hash_string_with_quote'; +SET PASSWORD FOR 'user1'@'localhost' = PASSWORD('auth_secret1'); +include/sync_slave_sql_with_master.inc +SELECT USER(); +USER() +user1@localhost +SET GLOBAL DEBUG= '+d,force_hash_string_with_quote'; +SET @@session.sql_mode= 'NO_BACKSLASH_ESCAPES'; +SET @@session.sql_mode= 'NO_BACKSLASH_ESCAPES'; +SET PASSWORD FOR 'user1'@'localhost' = PASSWORD('auth_secret'); +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user1'@'localhost'='$5$BVZy9O>''a+2MH]_?$fpWyabcdiHjfCVqId/quykZzjaA7adpkcen/uiQrtmOK4p4' +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`; SET PASSWORD FOR 'user1'@'localhost'='$5$BVZy9O>''a+2MH]_?$fpWyabcdiHjfCVqId/quykZzjaA7adpkcen/uiQrtmOK4p4' +SET GLOBAL DEBUG= '-d,force_hash_string_with_quote'; +SET PASSWORD FOR 'user1'@'localhost' = PASSWORD('auth_secret2'); +include/sync_slave_sql_with_master.inc +SELECT USER(); +USER() +user1@localhost +SET @@session.sql_mode= @old_sql_mode_slave; +SET @@session.sql_mode= @old_sql_mode_master; +DROP USER 'user1'@'localhost'; +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 5416d278..67717b18 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 @@ -69,5 +69,28 @@ Sync slave with master include/start_slave.inc SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('MASTER_UUID:10'); include/assert.inc [Rows until 10 in t1 must be replicated now] +Test WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS function with negative timeout +value. When SQL_MODE is strict, then it will throw +WRONG_ARGUMENTS error. +SET @save_sql_mode=@@SESSION.SQL_MODE; +SET @@SESSION.SQL_MODE="STRICT_ALL_TABLES"; +SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('MASTER_UUID:100', -1);; +ERROR HY000: Incorrect arguments to WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS. +When SQL_MODE is non-strict mode, then it will return NULL immediately +without doing any work and generates WRONG_ARGUMENTS warning. +SET @@SESSION.SQL_MODE=""; +SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('MASTER_UUID:100', -1);; +WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('MASTER_UUID:100', -1) +NULL +Warnings: +Warning 1210 Incorrect arguments to WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS. +SET @@SESSION.SQL_MODE=@save_sql_mode; +Test WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS function with fractional timeout +value. Earlier(before fix), 0.4 is read as integer value '0' and +the function hanged forever (or till all the specified gtids are +executed). Now(after fix) 0.4 will be read as double 0.4 and will waitfor +atleast 0.4 seconds (or till all the specified gtids are executed). +Also check that function returns -1 if the timeout has been exceeded. +include/assert.inc [WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS returns -1 if the timeout has been exceeded.] DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_temp_table.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_temp_table.result index d234e729..04becaf9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_temp_table.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_gtid_temp_table.result @@ -1211,6 +1211,8 @@ END; DELETE FROM non_trans_table2; Got one of the listed errors DROP TRIGGER trigger1; +include/sync_slave_sql_with_master.inc +[connection master] include/diff_tables.inc [master:trans_table1, slave:trans_table1] include/diff_tables.inc [master:trans_table2, slave:trans_table2] include/diff_tables.inc [master:non_trans_table1, slave:non_trans_table1] 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 e9ea667c..e49f2d38 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 @@ -22,4 +22,26 @@ show slave status; select master_pos_wait('foo', 98); master_pos_wait('foo', 98) NULL +include/start_slave_sql.inc +Test MASTER_POS_WAIT function with negative timeout value. +When SQL_MODE is strict, then it will throw WRONG_ARGUMENTS +error. +SET @save_sql_mode=@@SESSION.SQL_MODE; +SET @@SESSION.SQL_MODE="STRICT_ALL_TABLES"; +SELECT MASTER_POS_WAIT('master-bin.999999', 4, -1); +ERROR HY000: Incorrect arguments to MASTER_POS_WAIT. +SET @@SESSION.SQL_MODE=""; +SELECT MASTER_POS_WAIT('master-bin.999999', 4, -1); +MASTER_POS_WAIT('master-bin.999999', 4, -1) +NULL +Warnings: +Warning 1210 Incorrect arguments to MASTER_POS_WAIT. +SET @@SESSION.SQL_MODE=@save_sql_mode; +Test WAIT_FOR_EXECUTED_GTID_SET function with fractional timeout value. +Earlier(before fix), 0.4 is read as integer value '0' and the function +hanged forever (or till all the specified gtids are executed). +Now(after fix) 0.4 will be read as doube 0.4 and will waitfor +atleast 0.4 seconds (or till all the specified gtids are executed). +Also check that in case of timeout, function returns -1. +include/assert.inc [MASTER_POS_WAIT returns -1 if the timeout has been exceeded.] include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_switch_sequential.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_switch_sequential.result index 8c425635..6b45132a 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_switch_sequential.result +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_parallel_switch_sequential.result @@ -7,6 +7,7 @@ SET @save_slave_parallel_workers= @@slave_parallel_workers; SET @save_default_storage_engine=@@global.default_storage_engine; SET @@global.default_storage_engine='innodb'; SET GLOBAL slave_parallel_workers= 4; +call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); call mtr.add_suppression("Request to stop slave SQL Thread received while applying a group that has non-transactional changes"); include/stop_slave.inc include/start_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sbm_fake_rotate_event.result b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sbm_fake_rotate_event.result new file mode 100644 index 00000000..6b222857 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_sbm_fake_rotate_event.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] +[connection slave] +SET @save_global_debug=@@GLOBAL.DEBUG; +SET @@GLOBAL.DEBUG= '+d,dbug.calculate_sbm_after_fake_rotate_log_event'; +include/start_slave.inc +[connection master] +FLUSH LOGS; +[connection slave] +SET DEBUG_SYNC="now wait_for signal.reached"; +include/assert.inc [Seconds Behind Master should be less than IO_THREAD's time.] +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 IO_THREAD's time.] +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +SET @@GLOBAL.DEBUG=@save_global_debug; +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_user.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_user.test new file mode 100644 index 00000000..13d1b4f3 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_alter_user.test @@ -0,0 +1,104 @@ +# +# === Purpose === +# This test script verifies that in a replication environment, +# the slave correctly parses the hash password in ALTER USER or +# SET PASSWORD query. It verifies that the slave doesn't +# encounter an error in parsing a hash string which contains a +# single quote. The fix ensures escaping the hash string correctly +# depending on the server mode. Since this issue is sporadic, +# we have used a debug flag to deterministically generate a +# hash string which contains a single quote. +# +# === Related bugs and worklogs === +# +# Bug#20228478: ON REPLICATION SLAVE, ALTER USER FAILING FOR USER +# WITH SHA256_PASSWORD PLUGIN +# + +--source include/have_ssl_communication.inc +--source include/have_openssl.inc +--source include/have_ssl.inc +--source include/master-slave.inc +--source include/have_debug.inc + +#Scenario 1: +# When NO_BACKSLASH_ESCAPES mode is not set on both master and the slave. +SET @old_sql_mode_master= @@session.sql_mode; +SET @@session.sql_mode= (select replace(@@session.sql_mode,'NO_BACKSLASH_ESCAPES','')); + +--connection slave +SET @old_sql_mode_slave= @@session.sql_mode; +SET @@session.sql_mode= (select replace(@@session.sql_mode,'NO_BACKSLASH_ESCAPES','')); + +--connection master +SET GLOBAL DEBUG= '+d,force_hash_string_with_quote'; +CREATE USER 'user1'@'localhost' IDENTIFIED WITH sha256_password; +SET old_passwords= 2; +# Save master position +--let $saved_master_pos= query_get_value('SHOW MASTER STATUS', Position, 1) +SET PASSWORD FOR 'user1'@'localhost' = PASSWORD('auth_secret'); +# Check the binlog contents on the master +--let $binlog_start= $saved_master_pos +--let $binlog_limit= 2 +--source include/show_binlog_events.inc +# Check the binlog contents on the slave +--source include/sync_slave_sql_with_master.inc +--source include/show_binlog_events.inc +# Reset the flag +--connection master +SET GLOBAL DEBUG= '-d,force_hash_string_with_quote'; + +# Scenario 2: +# Make sure that we are successfully able to login to the slave from a +# user whose password is changed and NO_BACKSLASH_ESCAPES mode is not +# set on both master and slave. The hash string generated here may or +# may not contain a single quote within it. +--connection master +SET PASSWORD FOR 'user1'@'localhost' = PASSWORD('auth_secret1'); +--source include/sync_slave_sql_with_master.inc +--connect(con1, localhost, user1,'auth_secret1',,,,SSL) +SELECT USER(); +disconnect con1; + +# Scenario 3: +# When NO_BACKSLASH_ESCAPES mode is set on both master and the slave. +--connection master +SET GLOBAL DEBUG= '+d,force_hash_string_with_quote'; +SET @@session.sql_mode= 'NO_BACKSLASH_ESCAPES'; +--connection slave +SET @@session.sql_mode= 'NO_BACKSLASH_ESCAPES'; +--connection master +# Save master position +--let $saved_master_pos= query_get_value('SHOW MASTER STATUS', Position, 1) +SET PASSWORD FOR 'user1'@'localhost' = PASSWORD('auth_secret'); +# Check the binlog contents on the master +--let $binlog_start= $saved_master_pos +--let $binlog_limit= 2 +--source include/show_binlog_events.inc +# Check the binlog contents on the slave +--source include/sync_slave_sql_with_master.inc +--source include/show_binlog_events.inc +# Reset the flag +--connection master +SET GLOBAL DEBUG= '-d,force_hash_string_with_quote'; + +# Scenario 4: +# Make sure that we are successfully able to login to the slave +# after the password is changed for a user and NO_BACKSLASH_ESCAPES +# mode is set on both master and slave. This scenario will generate +# the hash string which may or may not contain a single quote. +SET PASSWORD FOR 'user1'@'localhost' = PASSWORD('auth_secret2'); +--source include/sync_slave_sql_with_master.inc +--connect(con1, localhost, user1,'auth_secret2',,,,SSL) +SELECT USER(); +disconnect con1; + +#Restore the old sql_mode at the master and the slave +--connection slave +SET @@session.sql_mode= @old_sql_mode_slave; +--connection master +SET @@session.sql_mode= @old_sql_mode_master; + +#cleanup +DROP USER 'user1'@'localhost'; +--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 c1d21242..b3122907 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 @@ -144,6 +144,39 @@ while ($i != 11) --let $assert_text= Rows until 10 in t1 must be replicated now --source include/assert.inc +# +# Bug#24976304 WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS TIMEOUT VALUE HANDLES SOME +# INPUTS BADLY +# +--echo Test WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS function with negative timeout +--echo value. When SQL_MODE is strict, then it will throw +--echo WRONG_ARGUMENTS error. +SET @save_sql_mode=@@SESSION.SQL_MODE; +SET @@SESSION.SQL_MODE="STRICT_ALL_TABLES"; +--replace_result $master_uuid MASTER_UUID +--error ER_WRONG_ARGUMENTS +--eval SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('$master_uuid:100', -1); + +--echo When SQL_MODE is non-strict mode, then it will return NULL immediately +--echo without doing any work and generates WRONG_ARGUMENTS warning. +SET @@SESSION.SQL_MODE=""; +--replace_result $master_uuid MASTER_UUID +--eval SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('$master_uuid:100', -1); +SET @@SESSION.SQL_MODE=@save_sql_mode; + +--echo Test WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS function with fractional timeout +--echo value. Earlier(before fix), 0.4 is read as integer value '0' and +--echo the function hanged forever (or till all the specified gtids are +--echo executed). Now(after fix) 0.4 will be read as double 0.4 and will waitfor +--echo atleast 0.4 seconds (or till all the specified gtids are executed). +--echo Also check that function returns -1 if the timeout has been exceeded. +--let $assert_text= WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS returns -1 if the timeout has been exceeded. +--let $query_result= query_get_value("SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('$master_uuid:100', 0.4) AS VALUE", VALUE, 1) +--let $assert_cond= "$query_result" = "-1" +--source include/assert.inc + +# End of Test Bug#24976304 + # Cleanup --connection master DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_temp_table.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_temp_table.test index a77d0c04..3f4360d0 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_temp_table.test +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_gtid_temp_table.test @@ -75,6 +75,10 @@ INSERT INTO non_trans_table2 VALUES (1); --let $func_or_trig_body=CREATE TEMPORARY TABLE tt1(i INT) ENGINE=MyISAM; DROP TEMPORARY TABLE IF EXISTS tt1; INSERT INTO trans_table1 VALUES (12); --source extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc +# Sync slave with master before checking diff tables +--source include/sync_slave_sql_with_master.inc +--source include/rpl_connection_master.inc + # Test that all Slave tables are in sync with Master tables --let $diff_tables=master:trans_table1, slave:trans_table1 --source include/diff_tables.inc 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 be6d9986..94648935 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 @@ -31,6 +31,40 @@ query_vertical show slave status; echo "*** must be NULL ***"; select master_pos_wait('foo', 98); +# +# Bug#24976304 WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS TIMEOUT VALUE HANDLES SOME +# INPUTS BADLY +# +connection slave; +--source include/start_slave_sql.inc + +--echo Test MASTER_POS_WAIT function with negative timeout value. +--echo When SQL_MODE is strict, then it will throw WRONG_ARGUMENTS +--echo error. +SET @save_sql_mode=@@SESSION.SQL_MODE; +SET @@SESSION.SQL_MODE="STRICT_ALL_TABLES"; +--error ER_WRONG_ARGUMENTS +SELECT MASTER_POS_WAIT('master-bin.999999', 4, -1); + +#--echo When SQL_MODE is non-strict mode, then it will return NULL immediately +#--echo without doing any work and generates WRONG_ARGUMENTS warning. +SET @@SESSION.SQL_MODE=""; +SELECT MASTER_POS_WAIT('master-bin.999999', 4, -1); +SET @@SESSION.SQL_MODE=@save_sql_mode; + +--echo Test WAIT_FOR_EXECUTED_GTID_SET function with fractional timeout value. +--echo Earlier(before fix), 0.4 is read as integer value '0' and the function +--echo hanged forever (or till all the specified gtids are executed). +--echo Now(after fix) 0.4 will be read as doube 0.4 and will waitfor +--echo atleast 0.4 seconds (or till all the specified gtids are executed). +--echo Also check that in case of timeout, function returns -1. +--let $assert_text= MASTER_POS_WAIT returns -1 if the timeout has been exceeded. +--let $query_result= query_get_value("SELECT MASTER_POS_WAIT('master-bin.999999', 4, 0.4) AS VALUE", VALUE, 1) +--let $assert_cond= "$query_result" = "-1" +--source include/assert.inc + +# End of Test Bug#24976304 + # End of 4.1 tests --let $rpl_only_running_threads= 1 --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 4edc7b62..df382bc6 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 @@ -11,7 +11,11 @@ SET @save_default_storage_engine=@@global.default_storage_engine; SET @@global.default_storage_engine='innodb'; eval SET GLOBAL slave_parallel_workers= $max_workers; -#call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); +# As the test case is not going to do any synchronization with the master +# before issuing STOP SLAVE in the non-deterministic activity, there is a +# chance that the slave applier be in MTS mode and in a condition that it +# will throw the following error message: +call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state"); call mtr.add_suppression("Request to stop slave SQL Thread received while applying a group that has non-transactional changes"); --source include/stop_slave.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_fake_rotate_event.test b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_fake_rotate_event.test new file mode 100644 index 00000000..d178b8a4 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_sbm_fake_rotate_event.test @@ -0,0 +1,61 @@ +############################################################################### +# Bug#23532304 SECONDS_BEHIND_MASTER REPORTS IO_THREAD TIME WHEN USING MTS & +# ROTATING RELAY-LOG +# Problem: The value of 'Seconds_Behind_Master' (SBM) reports distorted number +# when rotating a relay-log. +# +# Steps to reproduce: +# 1) Fake that I/O thread is started 3 minutes ago using a debug point. +# 2) Flush the logs on the master which would have generated fake rotate +# event +# 3) While the fake rotate event is getting executing, calculate the SBM +# 4) Compare the executed SBM that it is not greater than or equal to I/O +# thread's active time. +# 5) Clean the debug point. +# +############################################################################### +--source include/have_debug_sync.inc +--let rpl_skip_start_slave=1 +--source include/master-slave.inc + +# Step-1 Set sync debug point to calculate sbm exactly after fake +# rotate log event. +--source include/rpl_connection_slave.inc +SET @save_global_debug=@@GLOBAL.DEBUG; +# This debug point internally fake that IO thread is started 3 minutes ago. +SET @@GLOBAL.DEBUG= '+d,dbug.calculate_sbm_after_fake_rotate_log_event'; +# Start slave threads after enabling the debug point. +--disable_warnings +--source include/start_slave.inc +--enable_warnings + +# Step-2 Flush logs on master which will generate a fake rotate event. +--source include/rpl_connection_master.inc +FLUSH LOGS; + +# Step-3 There will be two fake rotate events (first one while the initial setup +# in master-slave.inc and second one due to FLUSH LOGS execution on master). +# The following will test SBM calculation while both events are getting +# executed. +--source include/rpl_connection_slave.inc +--let $iter=0 +while ($iter < 2) +{ +# Step-4: Calcualte SBM while fake rotate log event is getting executed. +# It should be approximately zero (some times little more than zero +# if this test is run on a slow pb2 machine). Comparing with the +# I/O thread age that it should be atleast less +# than the age of I/O thread. +SET DEBUG_SYNC="now wait_for signal.reached"; +let $sbm= query_get_value("SHOW SLAVE STATUS", Seconds_Behind_Master, 1); +--let $assert_text= Seconds Behind Master should be less than IO_THREAD's time. +--let $assert_cond= $sbm < 180 +--source include/assert.inc +SET DEBUG_SYNC="now signal signal.done_sbm_calculation"; +--inc $iter +} + +# Step-5: Cleanup +SET @@GLOBAL.DEBUG=@save_global_debug; + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/t/disabled.def b/mysql-wsrep-5.6/mysql-test/t/disabled.def index df7a854a..88b65d1e 100644 --- a/mysql-wsrep-5.6/mysql-test/t/disabled.def +++ b/mysql-wsrep-5.6/mysql-test/t/disabled.def @@ -13,9 +13,8 @@ lowercase_table3 : Bug#11762269 2010-06-30 alik main.lowercase_table3 on read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists sum_distinct-big : Bug#11764126 2010-11-15 mattiasj was not tested archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc -log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists ds_mrr-big @solaris : Bug#14168107 2012-04-03 Hemant disabled new test added by Olav Sandstå,since this leads to timeout on Solaris on slow sparc servers -mysql_embedded_client_test : Bug#13964673 2012-04-16 amitbha since most of the test cases are failing +mysql_embedded_client_test : Bug#13964673 2012-04-16 amitbha since most of the test cases are failing mysql_client_test_embedded : Bug#16084066 2013-01-08 Disabled since this test is failing file_contents : Galera mysql-wsrep#4 2014-10-28 pstoev main.file_contents MTR test fails in mysql-wsrep bootstrap : Galera mysql-wsrep#19 2014-11-21 pstoev Crash in LOGGER::error_log_print when printing a WSREP message diff --git a/mysql-wsrep-5.6/mysql-test/t/distinct.test b/mysql-wsrep-5.6/mysql-test/t/distinct.test index 0c482f0f..02526263 100644 --- a/mysql-wsrep-5.6/mysql-test/t/distinct.test +++ b/mysql-wsrep-5.6/mysql-test/t/distinct.test @@ -762,3 +762,19 @@ eval EXPLAIN $query; eval $query; DROP TABLE t1,t2,t3; + +--echo # +--echo # Bug#22686994 REGRESSION FOR A GROUPING QUERY WITH DISTINCT +--echo # + +CREATE TABLE t1 (a INTEGER, b INTEGER); + +INSERT INTO t1 VALUES (1,3), (2,4), (1,5), +(1,3), (2,1), (1,5), (1,7), (3,1), +(3,2), (3,1), (2,4); + +SELECT DISTINCT (COUNT(DISTINCT b) + 1) AS c FROM t1 GROUP BY a; +DROP TABLE t1; + +--echo # End of test for Bug#22686994 + diff --git a/mysql-wsrep-5.6/mysql-test/t/events_2.test b/mysql-wsrep-5.6/mysql-test/t/events_2.test index 4e646702..4cc9788b 100644 --- a/mysql-wsrep-5.6/mysql-test/t/events_2.test +++ b/mysql-wsrep-5.6/mysql-test/t/events_2.test @@ -13,7 +13,7 @@ use events_test; # mysql.event intact checking end # -create event e_26 on schedule at '2038-01-19 03:14:07' disable do set @a = 5; +create event e_26 on schedule at '2037-01-01 00:00:00' disable do set @a = 5; select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event; drop event e_26; --error ER_WRONG_VALUE 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 eab60346..c41f2a6f 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 @@ -257,3 +257,165 @@ SET optimizer_trace=DEFAULT; SET end_markers_in_json=DEFAULT; DROP TABLE t0,t1,t2; + +--echo # +--echo # Bug #21749123: SELECT DISTINCT, WRONG RESULTS COMBINED WITH +--echo # USE_INDEX_EXTENSIONS=OFF +--echo # + +CREATE TABLE t1 ( + pk_col INT AUTO_INCREMENT PRIMARY KEY, + a1 CHAR(64), + KEY a1_idx (a1) +) ENGINE=INNODB; +INSERT INTO t1 (a1) VALUES ('a'),('a'),('a'),('a'),('a'),('a'),('a'),('a'); + +CREATE TABLE t2 ( + pk_col1 INT NOT NULL, + pk_col2 INT NOT NULL, + a1 CHAR(64), + a2 CHAR(64), + PRIMARY KEY(pk_col1, pk_col2), + KEY a1_idx (a1), + KEY a1_a2_idx (a1, a2) +) ENGINE=INNODB; +INSERT INTO t2 (pk_col1, pk_col2, a1, a2) VALUES (1,1,'a','b'),(1,2,'a','b'), + (1,3,'a','c'),(1,4,'a','c'), + (2,1,'a','d'); +ANALYZE TABLE t1; +ANALYZE TABLE t2; + +#Doesn't use loose index scan irrespective of index extensions. +let query1= +SELECT DISTINCT a1 +FROM t1 +WHERE (pk_col = 2 OR pk_col = 22) AND a1 = 'a'; + +#Doesn't use loose index scan when index extensions is off. +let query2= +SELECT COUNT(DISTINCT a1) +FROM t1 +GROUP BY a1,pk_col; + +#Doesn't use loose index scan when index extensions is off. +let query3= +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,pk_col1; + +#Uses loose index scan irrespective of index extensions. +let query4= +SELECT COUNT(DISTINCT a1) +FROM t2 +GROUP BY a1,a2; + +eval EXPLAIN $query1; +eval $query1; +eval EXPLAIN $query2; +eval $query2; +eval EXPLAIN $query3; +eval $query3; +eval EXPLAIN $query4; +eval $query4; + +SET @optimizer_switch_save=@@optimizer_switch; +SET @@optimizer_switch= "use_index_extensions=off"; + +eval EXPLAIN $query1; +eval $query1; +eval EXPLAIN $query2; +eval $query2; +eval EXPLAIN $query3; +eval $query3; +eval EXPLAIN $query4; +eval $query4; + +SET @@optimizer_switch= @optimizer_switch_save; +DROP TABLE t1, t2; + +--echo # +--echo # Bug #24671968: WHEN THE OPTIMISER IS USING INDEX FOR GROUP-BY IT OFTEN +--echo # OFTEN GIVES WRONG RESULTS +--echo # + +CREATE TABLE t1 ( +id int NOT NULL, +c1 int NOT NULL, +c2 int, +PRIMARY KEY(id), +INDEX c1_c2_idx(c1, c2)); + +INSERT INTO t1 (id, c1, c2) VALUES (1,1,1), (2,2,2), (10,10,1), (11,10,8), + (12,10,1), (13,10,2), (3,1,1), (4,10,1), + (5,10,1), (6,10,8), (7,1,1), (8,10,1); +ANALYZE TABLE t1; + +# Query similar to the one mentioned in the bug page. Incorrectly chooses +# loose index scan. +let query1= +SELECT DISTINCT c1 +FROM t1 +WHERE EXISTS (SELECT * + FROM DUAL + WHERE (c2 = 2)); + +# IN subquery. Incorrectly chooses loose index scan. +let query2= +SELECT DISTINCT c1 +FROM t1 +WHERE 1 IN (2, + (SELECT 1 + FROM DUAL + WHERE (c2 = 2)), + 3); + +# Similar to above queries but without subquery. +let query3= +SELECT DISTINCT c1 +FROM t1 +WHERE c2 = 2; + +# Same as query1 with IGNORE INDEX. So this will not choose loose index scan. +let query4= +SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE EXISTS (SELECT * + FROM DUAL + WHERE (c2 = 2)); + +# Same as query2 with IGNORE INDEX. So this will not choose loose index scan. +let query5= +SELECT DISTINCT c1 +FROM t1 IGNORE INDEX (c1_c2_idx) +WHERE 1 IN (2, + (SELECT 1 + FROM DUAL + WHERE (c2 = 2)), + 3); + +--replace_column 9 # +eval EXPLAIN $query1; +--replace_column 9 # +eval EXPLAIN $query2; +--replace_column 9 # +eval EXPLAIN $query3; +--replace_column 9 # +eval EXPLAIN $query4; +--replace_column 9 # +eval EXPLAIN $query5; + +# Looking for the tag in optimizer trace: "dependent_subquery_in_where". +SET optimizer_trace="enabled=on"; + +eval $query1; +SELECT TRACE INTO @trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE; +SELECT @trace RLIKE "keypart_reference_from_where_clause"; + +SET optimizer_trace="enabled=off"; + +eval $query2; +eval $query3; +eval $query4; +eval $query5; + +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/t/loaddata.test b/mysql-wsrep-5.6/mysql-test/t/loaddata.test index aa7be524..db21058d 100644 --- a/mysql-wsrep-5.6/mysql-test/t/loaddata.test +++ b/mysql-wsrep-5.6/mysql-test/t/loaddata.test @@ -292,7 +292,7 @@ SELECT * FROM v2; DELETE FROM t1; --echo ---error ER_LOAD_DATA_INVALID_COLUMN +--error ER_NONUPDATEABLE_COLUMN LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v2 FIELDS ESCAPED BY '\\' TERMINATED BY ',' diff --git a/mysql-wsrep-5.6/mysql-test/t/log_tables-big.test b/mysql-wsrep-5.6/mysql-test/t/log_tables-big.test index 8c956fa6..8936a163 100644 --- a/mysql-wsrep-5.6/mysql-test/t/log_tables-big.test +++ b/mysql-wsrep-5.6/mysql-test/t/log_tables-big.test @@ -7,6 +7,8 @@ # check that CSV engine was compiled in --source include/have_csv.inc +set @@global.log_output = 'TABLE'; + connect (con1,localhost,root,,); connect (con2,localhost,root,,); @@ -18,18 +20,20 @@ set session long_query_time=10; select get_lock('bug27638', 1); connection con2; set session long_query_time=1; -truncate table mysql.slow_log; select get_lock('bug27638', 2); -select if (query_time between '00:00:01' and '00:00:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; -truncate table mysql.slow_log; +select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log + where sql_text = 'select get_lock(\'bug27638\', 2)'; select get_lock('bug27638', 60); -select if (query_time between '00:00:59' and '00:01:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; -truncate table mysql.slow_log; +select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log + where sql_text = 'select get_lock(\'bug27638\', 60)'; select get_lock('bug27638', 101); -select if (query_time between '00:01:40' and '00:01:50', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log; +select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log + where sql_text = 'select get_lock(\'bug27638\', 101)'; connection con1; select release_lock('bug27638'); connection default; disconnect con1; disconnect con2; + +set @@global.log_output=default; diff --git a/mysql-wsrep-5.6/mysql-test/t/mysqldump.test b/mysql-wsrep-5.6/mysql-test/t/mysqldump.test index 1da8c202..54097b0a 100644 --- a/mysql-wsrep-5.6/mysql-test/t/mysqldump.test +++ b/mysql-wsrep-5.6/mysql-test/t/mysqldump.test @@ -2523,3 +2523,53 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; DROP DATABASE db_20772273; + +--echo # +--echo # Bug #25717383: MYSQLDUMP MAY EXECUTE ANY ARBITRARY QUERY +--echo # + + +CREATE DATABASE bug25717383; +use bug25717383; + +CREATE TABLE `tab +one` (a int); +CREATE VIEW `view +one` as SELECT * FROM `tab +one`; + +CREATE PROCEDURE `proc +one`() SELECT * from `tab +one`; + +CREATE TEMPORARY TABLE `temp +one` (id INT); + +CREATE TRIGGER `trig +one` BEFORE INSERT ON `tab +one` FOR EACH ROW SET NEW.a = 1; + +CREATE EVENT `event +one` ON SCHEDULE AT '2030-01-01 00:00:00' DO SET @a=5; + +SHOW TABLES FROM bug25717383; +SHOW TRIGGERS FROM bug25717383; +--replace_column 6 # +SHOW EVENTS FROM bug25717383; + +SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES + WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE' + ORDER BY ROUTINE_NAME; + +--exec $MYSQL_DUMP --triggers --events --routines --add-drop-database --databases bug25717383 > $MYSQLTEST_VARDIR/tmp/bug25717383.sql + +SHOW TABLES FROM bug25717383; +SHOW TRIGGERS FROM bug25717383; +--replace_column 6 # +SHOW EVENTS FROM bug25717383; + +SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES + WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE' + ORDER BY ROUTINE_NAME; + +DROP DATABASE bug25717383; diff --git a/mysql-wsrep-5.6/mysql-test/t/parser.test b/mysql-wsrep-5.6/mysql-test/t/parser.test index f07d9683..3ab5051f 100644 --- a/mysql-wsrep-5.6/mysql-test/t/parser.test +++ b/mysql-wsrep-5.6/mysql-test/t/parser.test @@ -555,6 +555,14 @@ select master_pos_wait(1); -- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT select master_pos_wait(1, 2, 3, 4); +--disable_result_log +SET @save_sql_mode_before_master_pos_wait=@@SESSION.SQL_MODE; +SET @@SESSION.SQL_MODE="STRICT_ALL_TABLES"; +--error 0, ER_WRONG_ARGUMENTS +select master_pos_wait('master-bin.999999', 4, -1); +SET @@SESSION.SQL_MODE=@save_sql_mode_before_master_pos_wait; +--enable_result_log + -- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT select rand(1, 2, 3); diff --git a/mysql-wsrep-5.6/mysql-test/t/ps.test b/mysql-wsrep-5.6/mysql-test/t/ps.test index ab28b1bb..0d5f6503 100644 --- a/mysql-wsrep-5.6/mysql-test/t/ps.test +++ b/mysql-wsrep-5.6/mysql-test/t/ps.test @@ -3520,3 +3520,41 @@ disconnect con1; --echo # Connection default connection default; DROP TABLE t1; + + +--echo # +--echo # Bug#19894382 - SERVER SIDE PREPARED STATEMENTS LEADS TO POTENTIAL OFF-BY-SECOND +--echo # TIMESTAMP ON SLAVE. +--echo # + +CREATE TABLE bug19894382(f1 CHAR(64) DEFAULT 'slave', + f2 TIME, f3 TIMESTAMP NULL, f4 DATETIME, + f5 TIME(3), f6 TIMESTAMP(3) NULL, f7 DATETIME(3)); + +--echo # Execute prepared statements from mysql_client_test. +--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/bug19894382.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST -d -u root test_bug19894382 >> $MYSQLTEST_VARDIR/log/bug19894382.out.log 2>&1 + +--echo # Insert tuples from the client_test_db.bug19894382 to the test.bug19894382. +--echo # Tuples in the client_test_db.bug19894382 are inserted from the mysql_client_test. +INSERT INTO bug19894382 SELECT * FROM client_test_db.bug19894382; + +--echo # Replay binlog events +let $MYSQLD_DATADIR= `select @@datadir`; +--let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1) +--exec $MYSQL_BINLOG --force-if-open -d client_test_db $MYSQLD_DATADIR/$master_log_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug19894382.binlog +--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug19894382.binlog" + +--echo # Insert tuples from the client_test_db.bug19894382 to the test.bug19894382. +--echo # Tuples in the client_test_db.bug19894382 are inserted from the binlog. +INSERT INTO bug19894382(f2, f3, f4, f5, f6, f7) + SELECT f2, f3, f4, f5, f6, f7 FROM client_test_db.bug19894382; +--echo # With fix, tuples of "master" and "slave" will be same. There will not be any difference +--echo # in values inserted for time, timestamp and datetime type columns. +SELECT * FROM bug19894382 ORDER BY f2; + +--echo # Cleanup +DROP DATABASE client_test_db; +DROP TABLE bug19894382; +--remove_file $MYSQLTEST_VARDIR/log/bug19894382.out.log +--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug19894382.binlog diff --git a/mysql-wsrep-5.6/mysql-test/t/symlink.test b/mysql-wsrep-5.6/mysql-test/t/symlink.test index 5109137e..5916d048 100644 --- a/mysql-wsrep-5.6/mysql-test/t/symlink.test +++ b/mysql-wsrep-5.6/mysql-test/t/symlink.test @@ -298,3 +298,19 @@ show create table t1; create table t2 like t1; show create table t2; drop tables t1, t2; + +--echo # +--echo # Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE +--echo # WITH DATA DIRECTORY +--echo # + +--echo # Make sure we have no current database +CREATE DATABASE x; +USE x; +DROP DATABASE x; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM +DATA DIRECTORY "$MYSQLTEST_VARDIR/tmp"; + +DROP TABLE test.t1; diff --git a/mysql-wsrep-5.6/mysql-test/valgrind.supp b/mysql-wsrep-5.6/mysql-test/valgrind.supp index a03643a9..381be3f4 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, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2017, Oracle and/or 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 @@ -915,6 +915,33 @@ fun:kill_server_thread } +{ + Bug#25391948 RPL_CHECK_GTID TEST FAILS SPORADICALLY ON PB2 - WEEKLY-5.6 FOR LINUX-VALGRIND + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + fun:_dl_close_worker + fun:_dl_close + fun:_dl_catch_error + fun:__libc_dlclose + ... +} + +{ + Bug#25391948 RPL_CHECK_GTID TEST FAILS SPORADICALLY ON PB2 - WEEKLY-5.6 FOR LINUX-VALGRIND + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + ... + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:do_dlopen + fun:_dl_catch_error + fun:__libc_dlopen_mode + ... +} + #Suppress warnings from glibc implementation of 'malloc_info' { Malloc_info uninitialised value of size 8 diff --git a/mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs b/mysql-wsrep-5.6/packaging/WiX/custom_ui.wxs index e96ab0fe..9475de92 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">