]> review.fuel-infra Code Review - packages/trusty/mysql-wsrep-5.6.git/commitdiff
mysql-wsrep-5.6.38 20/37120/2
authorDmitry Teselkin <dteselkin@mirantis.com>
Wed, 8 Nov 2017 14:09:54 +0000 (17:09 +0300)
committerDmitry Teselkin <dteselkin@mirantis.com>
Wed, 8 Nov 2017 16:56:05 +0000 (19:56 +0300)
* New mysql-wsrep 5.6.38-25.21
  https://github.com/codership/mysql-wsrep/tree/wsrep_5.6.38-25.21
* Disable debian spec generation
* Refresh patches

Related-Bug: #1727011

Change-Id: I2f9f18d974d5c2281f6d2662885cb1327e8b000e

397 files changed:
.gitignore [new file with mode: 0644]
debian/changelog
debian/patches/disable-deb-in.patch [new file with mode: 0644]
debian/patches/fix_standalone_tests.patch
debian/patches/scripts__mysqld_safe.sh__signals.patch
debian/patches/series
mysql-wsrep-5.6/VERSION
mysql-wsrep-5.6/client/mysql.cc
mysql-wsrep-5.6/client/mysqldump.c
mysql-wsrep-5.6/cmake/wsrep.cmake
mysql-wsrep-5.6/extra/yassl/README
mysql-wsrep-5.6/extra/yassl/certs/ca-cert.pem
mysql-wsrep-5.6/extra/yassl/certs/client-cert.pem
mysql-wsrep-5.6/extra/yassl/certs/server-cert.pem
mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h
mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp
mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp
mysql-wsrep-5.6/man/comp_err.1
mysql-wsrep-5.6/man/innochecksum.1
mysql-wsrep-5.6/man/msql2mysql.1
mysql-wsrep-5.6/man/my_print_defaults.1
mysql-wsrep-5.6/man/myisam_ftdump.1
mysql-wsrep-5.6/man/myisamchk.1
mysql-wsrep-5.6/man/myisamlog.1
mysql-wsrep-5.6/man/myisampack.1
mysql-wsrep-5.6/man/mysql-stress-test.pl.1
mysql-wsrep-5.6/man/mysql-test-run.pl.1
mysql-wsrep-5.6/man/mysql.1
mysql-wsrep-5.6/man/mysql.server.1
mysql-wsrep-5.6/man/mysql_client_test.1
mysql-wsrep-5.6/man/mysql_config.1
mysql-wsrep-5.6/man/mysql_config_editor.1
mysql-wsrep-5.6/man/mysql_convert_table_format.1
mysql-wsrep-5.6/man/mysql_find_rows.1
mysql-wsrep-5.6/man/mysql_fix_extensions.1
mysql-wsrep-5.6/man/mysql_install_db.1
mysql-wsrep-5.6/man/mysql_plugin.1
mysql-wsrep-5.6/man/mysql_secure_installation.1
mysql-wsrep-5.6/man/mysql_setpermission.1
mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1
mysql-wsrep-5.6/man/mysql_upgrade.1
mysql-wsrep-5.6/man/mysql_waitpid.1
mysql-wsrep-5.6/man/mysql_zap.1
mysql-wsrep-5.6/man/mysqlaccess.1
mysql-wsrep-5.6/man/mysqladmin.1
mysql-wsrep-5.6/man/mysqlbinlog.1
mysql-wsrep-5.6/man/mysqlbug.1
mysql-wsrep-5.6/man/mysqlcheck.1
mysql-wsrep-5.6/man/mysqld.8
mysql-wsrep-5.6/man/mysqld_multi.1
mysql-wsrep-5.6/man/mysqld_safe.1
mysql-wsrep-5.6/man/mysqldump.1
mysql-wsrep-5.6/man/mysqldumpslow.1
mysql-wsrep-5.6/man/mysqlhotcopy.1
mysql-wsrep-5.6/man/mysqlimport.1
mysql-wsrep-5.6/man/mysqlshow.1
mysql-wsrep-5.6/man/mysqlslap.1
mysql-wsrep-5.6/man/mysqltest.1
mysql-wsrep-5.6/man/ndb_mgmd.8 [new file with mode: 0644]
mysql-wsrep-5.6/man/ndbd.8 [new file with mode: 0644]
mysql-wsrep-5.6/man/ndbmtd.8 [new file with mode: 0644]
mysql-wsrep-5.6/man/perror.1
mysql-wsrep-5.6/man/replace.1
mysql-wsrep-5.6/man/resolve_stack_dump.1
mysql-wsrep-5.6/man/resolveip.1
mysql-wsrep-5.6/mysql-test/include/galera_cluster.inc
mysql-wsrep-5.6/mysql-test/include/galera_resume.inc
mysql-wsrep-5.6/mysql-test/include/galera_suspend.inc
mysql-wsrep-5.6/mysql-test/include/kill_galera.inc
mysql-wsrep-5.6/mysql-test/include/mtr_warnings.sql
mysql-wsrep-5.6/mysql-test/include/mysqlhotcopy.inc
mysql-wsrep-5.6/mysql-test/include/wait_until_connected_again.inc
mysql-wsrep-5.6/mysql-test/include/wait_wsrep_ready.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm
mysql-wsrep-5.6/mysql-test/mysql-test-run.pl
mysql-wsrep-5.6/mysql-test/r/case.result
mysql-wsrep-5.6/mysql-test/r/fulltext.result
mysql-wsrep-5.6/mysql-test/r/partition_locking.result
mysql-wsrep-5.6/mysql-test/r/query_cache_size_functionality.result
mysql-wsrep-5.6/mysql-test/r/query_cache_type_functionality.result
mysql-wsrep-5.6/mysql-test/std_data/checkDBI_DBD-mysql.pl
mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_trans.test
mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_master.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/galera_2nodes_as_slave.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/galera_3nodes_as_slave.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/galera_4nodes.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/r/GAL-401.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-329.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-336.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-357.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-360.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-362.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-369.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-388.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-402.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-416.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-86-wait1.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-86-wait8.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_applier_ftwrl_table.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_applier_ftwrl_table_alter.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_autoinc.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_gtid_replicate_do_db.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_gtid_replicate_do_db_cc.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_as_slave_nonprim.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_bf_abort_for_update.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_table_as_select.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ddl_multiline.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_defaults.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_insert_ignore.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_progress.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_many_rows.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_parallel_simple.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_sync_wait_show.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_unicode_identifiers.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_cluster_address.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_var_sync_wait.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#198.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/mysql-wsrep#201.result
mysql-wsrep-5.6/mysql-test/suite/galera/r/partition.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/GAL-401.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-329.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-336.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-357.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-360-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-360.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-362-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-362.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-369.inc [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-369.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-388.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-402.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-416.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait1-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait1.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait8-master.opt [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait8.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/disabled.def
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_autoinc.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_gtid_replicate_do_db.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_gtid_replicate_do_db_cc.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_as_slave_preordered.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_bf_abort_for_update.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_table_as_select.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ddl_multiline.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ftwrl.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gcs_fc_limit.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_gtid-master.opt
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_insert_ignore.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_progress.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_progress.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_many_rows.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_migrate.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_parallel_simple.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ssl.cnf
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_suspend_slave.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_sync_wait_show.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_unicode_identifiers.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_cluster_address.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_var_sync_wait.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/lp1376747-4.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#198.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/mysql-wsrep#201.test
mysql-wsrep-5.6/mysql-test/suite/galera/t/partition.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/GAL-501.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_var_dirty_reads2.result
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/GAL-501.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/GAL-501.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_garbd.test
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test [new file with mode: 0644]
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_var_dirty_reads2.test
mysql-wsrep-5.6/mysql-test/suite/innodb/r/innodb_buffer_pool_load.result
mysql-wsrep-5.6/mysql-test/suite/innodb/t/galera.skip
mysql-wsrep-5.6/mysql-test/suite/innodb/t/innodb_buffer_pool_load.test
mysql-wsrep-5.6/mysql-test/suite/innodb_fts/t/sync_block.test
mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/general_no_prot_all.result
mysql-wsrep-5.6/mysql-test/suite/opt_trace/r/general_ps_prot_all.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_avoid_temporal_upgrade.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_dump_thread_kill.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_mts_debug.result
mysql-wsrep-5.6/mysql-test/suite/rpl/r/rpl_row_hash_scan_sanity.result
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_avoid_temporal_upgrade.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_dump_thread_kill.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_mts_debug.test
mysql-wsrep-5.6/mysql-test/suite/rpl/t/rpl_row_hash_scan_sanity.test
mysql-wsrep-5.6/mysql-test/t/case.test
mysql-wsrep-5.6/mysql-test/t/disabled.def
mysql-wsrep-5.6/mysql-test/t/fulltext.test
mysql-wsrep-5.6/mysql-test/valgrind.supp
mysql-wsrep-5.6/packaging/WiX/mysql_server.wxs.in
mysql-wsrep-5.6/packaging/deb-in/CMakeLists.txt
mysql-wsrep-5.6/packaging/deb-in/README.Maintainer
mysql-wsrep-5.6/packaging/deb-in/changelog.in
mysql-wsrep-5.6/packaging/deb-in/control.in
mysql-wsrep-5.6/packaging/deb-in/deb_debug.cmake [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/Docs__Images__Makefile.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/Docs__Makefile.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/apparmor-profile
mysql-wsrep-5.6/packaging/deb-in/extra/configure-symlinks [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-in/extra/debian-start [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/debian-start.inc.sh [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/debian_create_root_user.sql [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/echo_stderr [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/innotop/changelog.innotop [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/innotop/innotop [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/innotop/innotop.1 [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/my.cnf.fallback
mysql-wsrep-5.6/packaging/deb-in/extra/mysql-systemd-start
mysql-wsrep-5.6/packaging/deb-in/extra/mysql.cnf
mysql-wsrep-5.6/packaging/deb-in/extra/mysql.conf.d/mysqld.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/mysql.conf.d/mysqld_safe_syslog.cnf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/mysqlreport [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/mysqlreport.1 [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/extra/source_mysql-5.6.py [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/gbp.conf [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.README.Maintainer.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.examples.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.install.in
mysql-wsrep-5.6/packaging/deb-in/libmysqlclient18.install.in
mysql-wsrep-5.6/packaging/deb-in/libmysqld-dev.install.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-client.install.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-bench.install.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-bench.lintian-overrides.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.README.Debian.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.docs.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.install.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.links.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.lintian-overrides.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client.lintian-overrides.in with 64% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.manpages.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client.conffiles.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.dirs.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-common.dirs.in with 100% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.install.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-common.install.in with 76% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.lintian-overrides.in [moved from mysql-wsrep-5.6/packaging/deb-in/libmysqld-dev.lintian-overrides.in with 65% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.maintscript.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.postinst.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-common.postinst.in with 100% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.postrm.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-common.postrm.in with 95% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.preinst.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.prerm.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.README.Debian.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.config.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.config.in with 100% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.dirs.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.dirs.in with 97% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.examples.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.install.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.install.in with 66% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.lintian-overrides.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-client.lintian-overrides.in with 62% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.paranoid.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.server.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.workstation.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.mysql-server.logrotate.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.init.in [new file with mode: 0755]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.service.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.mysql.service.in with 79% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.postinst.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.postinst.in with 100% similarity, mode: 0755]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.postrm.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.postrm.in with 100% similarity, mode: 0755]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.preinst.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.preinst.in with 100% similarity, mode: 0755]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.prerm.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.prerm.in with 100% similarity, mode: 0755]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.templates.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.upstart.disabled.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.lintian-overrides.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.mysql.init.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.templates.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source-SERIES.install.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source.install.in with 83% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source-SERIES.lintian-overrides.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source.lintian-overrides.in with 65% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test-SERIES.install.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test-SERIES.links.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.links.in with 100% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test-SERIES.lintian-overrides.in [moved from mysql-wsrep-5.6/packaging/deb-in/mysql-common.lintian-overrides.in with 66% similarity]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.install.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.lintian-overrides.in [deleted file]
mysql-wsrep-5.6/packaging/deb-in/patches/series [deleted file]
mysql-wsrep-5.6/packaging/deb-in/po/POTFILES.in [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/ar.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/ca.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/cs.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/da.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/de.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/es.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/eu.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/fr.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/gl.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/it.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/ja.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/nb.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/nl.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/pt.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/pt_BR.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/ro.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/ru.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/sk.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/sv.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/templates.pot [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/po/tr.po [new file with mode: 0644]
mysql-wsrep-5.6/packaging/deb-in/rules.in
mysql-wsrep-5.6/packaging/deb-in/source/include-binaries
mysql-wsrep-5.6/packaging/rpm-docker/mysql.spec.in
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/.gitignore [deleted file]
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/config.h [new file with mode: 0644]
mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/t/binary-sasl.t [new file with mode: 0644]
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/.gitignore [deleted file]
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/config.h [new file with mode: 0644]
mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/src/innodb_engine.c
mysql-wsrep-5.6/scripts/invoke-with-relative-paths.pl [changed mode: 0644->0755]
mysql-wsrep-5.6/scripts/mysqlaccess.conf [changed mode: 0644->0755]
mysql-wsrep-5.6/scripts/mysqld_safe.sh
mysql-wsrep-5.6/scripts/wsrep_sst_common.sh
mysql-wsrep-5.6/scripts/wsrep_sst_mysqldump.sh
mysql-wsrep-5.6/scripts/wsrep_sst_rsync.sh
mysql-wsrep-5.6/scripts/wsrep_sst_xtrabackup-v2.sh
mysql-wsrep-5.6/sql/event_data_objects.cc
mysql-wsrep-5.6/sql/events.cc
mysql-wsrep-5.6/sql/field.cc
mysql-wsrep-5.6/sql/ha_partition.cc
mysql-wsrep-5.6/sql/handler.cc
mysql-wsrep-5.6/sql/handler.h
mysql-wsrep-5.6/sql/hostname.cc
mysql-wsrep-5.6/sql/item.h
mysql-wsrep-5.6/sql/item_func.cc
mysql-wsrep-5.6/sql/item_func.h
mysql-wsrep-5.6/sql/log_event.cc
mysql-wsrep-5.6/sql/mysqld.cc
mysql-wsrep-5.6/sql/opt_sum.cc
mysql-wsrep-5.6/sql/partition_info.cc
mysql-wsrep-5.6/sql/rpl_gtid_cache.cc
mysql-wsrep-5.6/sql/rpl_master.cc
mysql-wsrep-5.6/sql/rpl_slave.cc
mysql-wsrep-5.6/sql/sql_acl.cc
mysql-wsrep-5.6/sql/sql_base.cc
mysql-wsrep-5.6/sql/sql_base.h
mysql-wsrep-5.6/sql/sql_class.cc
mysql-wsrep-5.6/sql/sql_class.h
mysql-wsrep-5.6/sql/sql_delete.cc
mysql-wsrep-5.6/sql/sql_executor.cc
mysql-wsrep-5.6/sql/sql_insert.cc
mysql-wsrep-5.6/sql/sql_lex.h
mysql-wsrep-5.6/sql/sql_optimizer.cc
mysql-wsrep-5.6/sql/sql_parse.cc
mysql-wsrep-5.6/sql/sql_parse.h
mysql-wsrep-5.6/sql/sql_partition.cc
mysql-wsrep-5.6/sql/sql_partition.h
mysql-wsrep-5.6/sql/sql_partition_admin.cc
mysql-wsrep-5.6/sql/sql_plugin.cc
mysql-wsrep-5.6/sql/sql_select.cc
mysql-wsrep-5.6/sql/sql_table.cc
mysql-wsrep-5.6/sql/sql_trigger.cc
mysql-wsrep-5.6/sql/sql_truncate.cc
mysql-wsrep-5.6/sql/sql_update.cc
mysql-wsrep-5.6/sql/sql_view.cc
mysql-wsrep-5.6/sql/sys_vars.cc
mysql-wsrep-5.6/sql/table_cache.cc
mysql-wsrep-5.6/sql/wsrep_applier.cc
mysql-wsrep-5.6/sql/wsrep_hton.cc
mysql-wsrep-5.6/sql/wsrep_mysqld.cc
mysql-wsrep-5.6/sql/wsrep_mysqld.h
mysql-wsrep-5.6/sql/wsrep_priv.h
mysql-wsrep-5.6/sql/wsrep_sst.cc
mysql-wsrep-5.6/sql/wsrep_utils.cc
mysql-wsrep-5.6/sql/wsrep_utils.h
mysql-wsrep-5.6/sql/wsrep_var.cc
mysql-wsrep-5.6/storage/innobase/buf/buf0dump.cc
mysql-wsrep-5.6/storage/innobase/dict/dict0stats_bg.cc
mysql-wsrep-5.6/storage/innobase/fts/fts0fts.cc
mysql-wsrep-5.6/storage/innobase/fts/fts0opt.cc
mysql-wsrep-5.6/storage/innobase/fts/fts0que.cc
mysql-wsrep-5.6/storage/innobase/handler/ha_innodb.cc
mysql-wsrep-5.6/storage/innobase/handler/handler0alter.cc
mysql-wsrep-5.6/storage/innobase/include/dict0dict.ic
mysql-wsrep-5.6/storage/innobase/include/dict0mem.h
mysql-wsrep-5.6/storage/innobase/include/dict0stats_bg.h
mysql-wsrep-5.6/storage/innobase/os/os0file.cc
mysql-wsrep-5.6/storage/innobase/row/row0ins.cc
mysql-wsrep-5.6/storage/innobase/row/row0mysql.cc
mysql-wsrep-5.6/storage/innobase/row/row0sel.cc
mysql-wsrep-5.6/storage/innobase/row/row0upd.cc
mysql-wsrep-5.6/storage/perfschema/pfs.cc
mysql-wsrep-5.6/support-files/mysql.spec.sh

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..128bf6a
--- /dev/null
@@ -0,0 +1,2 @@
+debian.bak
+debian.new
index c6a2cdaa940f9ff438b45ca5e2e7b73638986c5f..0eaf93f3fe4e623420c6a9c12b24c283edeed9d7 100644 (file)
@@ -1,3 +1,12 @@
+mysql-wsrep-5.6 (5.6.38-0~u14.04+mos0) mos; urgency=medium
+
+  * Update mysql-wsrep to 5.6.38-25.21
+    https://github.com/codership/mysql-wsrep/tree/wsrep_5.6.38-25.21
+  * Disable debian spec generation
+  * Refresh patches
+
+ -- Dmitry Teselkin <mos-linux@mirantis.com>  Wed, 08 Nov 2017 17:08:41 +0300
+
 mysql-wsrep-5.6 (5.6.37-0~u14.04+mos0) mos; urgency=medium
 
   * Update mysql to 5.6.37
diff --git a/debian/patches/disable-deb-in.patch b/debian/patches/disable-deb-in.patch
new file mode 100644 (file)
index 0000000..099673c
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -551,7 +551,7 @@
+   ADD_SUBDIRECTORY(packaging/rpm-fedora)
+   ADD_SUBDIRECTORY(packaging/rpm-sles)
+   ADD_SUBDIRECTORY(packaging/rpm-docker)
+-  ADD_SUBDIRECTORY(packaging/deb-in)
++#  ADD_SUBDIRECTORY(packaging/deb-in)
+ ENDIF()
+ INCLUDE(cmake/abi_check.cmake)
index a670351f75dea96e2c40e0a9c41709aae7537d20..1425113926aaa6ce9fe7ee165954fca1a51c043c 100644 (file)
@@ -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 @@
+@@ -329,7 +329,8 @@
      else
      {
        $suitedir= my_find_dir($::basedir,
index e46e1eaee064d6f06a5d4251e153c146f9095370..30c7cc67309161e8b0019f53ba7b6532417da668 100644 (file)
@@ -29,7 +29,7 @@ Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
        ;;
      *)
        echo "Internal program error (non-fatal):" \
-@@ -897,6 +894,13 @@
+@@ -906,6 +903,13 @@
  fi
  
  #
index 08ed2f90f446531e42e11465042d704012b851ef..b19b0805e90f79ccc5955f521c266854ba884e09 100644 (file)
@@ -1,3 +1,4 @@
+disable-deb-in.patch
 hurd.patch
 scripts__mysqld_safe.sh__signals.patch
 fix_standalone_tests.patch
index 134a01254421f2c3d3ff31fa6e75ae5651c98c5b..028a264dc668701c4a5dde0b1e14b7e597b71075 100644 (file)
@@ -1,4 +1,4 @@
 MYSQL_VERSION_MAJOR=5
 MYSQL_VERSION_MINOR=6
-MYSQL_VERSION_PATCH=37
+MYSQL_VERSION_PATCH=38
 MYSQL_VERSION_EXTRA=
index 71fba6a9d9da777cd845353105933e1cc5182398..dc4c3d03e09b6b88670639efc24220f47e4495b9 100644 (file)
@@ -2400,7 +2400,10 @@ static bool add_line(String &buffer, char *line, ulong line_length,
       if (*in_string || inchar == 'N') // \N is short for NULL
       {                                        // Don't allow commands in string
        *out++='\\';
-       *out++= (char) inchar;
+        if ((inchar == '`') && (*in_string == inchar))
+          pos--;
+        else
+         *out++= (char) inchar;
        continue;
       }
       if ((com= find_command((char) inchar)))
index f131324181ac62ecdd4031b977c313f05907f5a4..ff25a110f1cb981f92bea89ff25b86491f03cd2a 100644 (file)
@@ -5620,7 +5620,10 @@ static my_bool get_view_structure(char *table, char* db)
   if (path)
   {
     if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
+    {
+      mysql_free_result(table_res);
       DBUG_RETURN(1);
+    }
 
     write_header(sql_file, db);
   }
index 7c395168f0874701f07d2c855423c1ebe3469c16..28cb95b56ac2a33c87c83e4a35ae92276b980b36 100644 (file)
@@ -17,7 +17,7 @@
 # so WSREP_VERSION is produced regardless
 
 # Set the patch version
-SET(WSREP_PATCH_VERSION "19")
+SET(WSREP_PATCH_VERSION "21")
 
 # Obtain patch revision number
 SET(WSREP_REVISION $ENV{WSREP_REV})
index a3d4f60f56128c055e64f6cda5a23214cada55ae..de1bf5132aa2c881b44a0a5918ddf88d77efa669 100644 (file)
@@ -12,6 +12,14 @@ before calling SSL_new();
 
 *** end Note ***
 
+yaSSL Release notes, version 2.4.4 (8/8/2017)
+    This release of yaSSL fixes an interop issue. A fix for detecting cipher
+    suites with non leading zeros is included as yaSSL only supports cipher
+    suites with leading zeros.  Thanks for the report from Security Innovation
+    and Oracle.
+
+    Users interoping with other SSL stacks should update.
+
 yaSSL Release notes, version 2.4.2 (9/22/2016)
     This release of yaSSL fixes a medium security vulnerability. A fix for
     potential AES side channel leaks is included that a local user monitoring
index 7e64eb4796164a0413a40507f84fec0a45ea9390..8b34ea43dd2d9306bb37df6d28261d40297e01b2 100644 (file)
@@ -1,40 +1,13 @@
------BEGIN CERTIFICATE-----
-MIIEqjCCA5KgAwIBAgIJAJpBR82hFGKMMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
-VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G
-A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3
-dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
-Fw0xNDA3MTEwMzIwMDhaFw0xNzA0MDYwMzIwMDhaMIGUMQswCQYDVQQGEwJVUzEQ
-MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3
-dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
-LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAL8Myi0Ush6EQlvNOB9K8k11EPG2NZ/fyn0D
-mNOs3gNm7irx2LB9bgdUCxCYIU2AyxIg58xP3kV9yXJ3MurKkLtpUhADL6jzlcXx
-i2JWG+9nb6QQQZWtCpvjpcCw0nB2UDBbqOgILHztp6J6jTgpHKzH7fJ8lbCVgn1J
-XDjNdyXvvYB1U5Q8PcpjW58VtdMdEy8Z0TzbdjrMuH3J5cLX2kBv2CHccxtCLVOc
-/hr8fat6Nj+Y3oR8BWfOahQ4h6nxjLVoy2h/cSAr9aBj9VYvoybSt2+xWhfXOJkI
-/pNYb/7DE0kIFgunTWcAUjFnI06Y7VFFHbkE2Qvs2CizS73tNnkCAwEAAaOB/DCB
-+TAdBgNVHQ4EFgQUJ45nEXTDJh0/7TNjs6TYHTDl6NUwgckGA1UdIwSBwTCBvoAU
-J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
-VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290
-aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
-MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYD
-VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAeXgMbXmIkfw6FZz5J2IW8CEf
-+n0/oqgyHvfyEal0FnRe3BjK8AAq1QMGJjDxR4P9Mm787apPfQxjYDEvfAy/mWaH
-7ScIhi3EM+iYIxz+o9uaSU78WkLvccM/rdxKqNKjHQmsMwR7hvNtAFmjyNvRPHP2
-DpDWXkngvzZjCHulsI81O1aMETVJBBzQ57pWxQ0KkY3Wt2IZNBJSTNJtfMU9DxiB
-VMv2POWE0tZxFewaNAvwoCF0Q8ijsN/ZZ9rirZNI+KCHvXkU4GIK3/cxLjF70TIq
-Cv5dFO/ZZFDkg5G8cA3XiI3ZvIQOxRqzv2QCTlGRpKKFFYOv8FubKElfsrMD2A==
------END CERTIFICATE-----
 Certificate:
     Data:
         Version: 3 (0x2)
         Serial Number:
-            9a:41:47:cd:a1:14:62:8c
-    Signature Algorithm: sha1WithRSAEncryption
+            b7:b6:90:33:66:1b:6b:23
+    Signature Algorithm: sha256WithRSAEncryption
         Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
         Validity
-            Not Before: Jul 11 03:20:08 2014 GMT
-            Not After : Apr  6 03:20:08 2017 GMT
+            Not Before: Aug 11 20:07:37 2016 GMT
+            Not After : May  8 20:07:37 2019 GMT
         Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
         Subject Public Key Info:
             Public Key Algorithm: rsaEncryption
@@ -65,23 +38,50 @@ Certificate:
             X509v3 Authority Key Identifier: 
                 keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
                 DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
-                serial:9A:41:47:CD:A1:14:62:8C
+                serial:B7:B6:90:33:66:1B:6B:23
 
             X509v3 Basic Constraints: 
                 CA:TRUE
-    Signature Algorithm: sha1WithRSAEncryption
-         79:78:0c:6d:79:88:91:fc:3a:15:9c:f9:27:62:16:f0:21:1f:
-         fa:7d:3f:a2:a8:32:1e:f7:f2:11:a9:74:16:74:5e:dc:18:ca:
-         f0:00:2a:d5:03:06:26:30:f1:47:83:fd:32:6e:fc:ed:aa:4f:
-         7d:0c:63:60:31:2f:7c:0c:bf:99:66:87:ed:27:08:86:2d:c4:
-         33:e8:98:23:1c:fe:a3:db:9a:49:4e:fc:5a:42:ef:71:c3:3f:
-         ad:dc:4a:a8:d2:a3:1d:09:ac:33:04:7b:86:f3:6d:00:59:a3:
-         c8:db:d1:3c:73:f6:0e:90:d6:5e:49:e0:bf:36:63:08:7b:a5:
-         b0:8f:35:3b:56:8c:11:35:49:04:1c:d0:e7:ba:56:c5:0d:0a:
-         91:8d:d6:b7:62:19:34:12:52:4c:d2:6d:7c:c5:3d:0f:18:81:
-         54:cb:f6:3c:e5:84:d2:d6:71:15:ec:1a:34:0b:f0:a0:21:74:
-         43:c8:a3:b0:df:d9:67:da:e2:ad:93:48:f8:a0:87:bd:79:14:
-         e0:62:0a:df:f7:31:2e:31:7b:d1:32:2a:0a:fe:5d:14:ef:d9:
-         64:50:e4:83:91:bc:70:0d:d7:88:8d:d9:bc:84:0e:c5:1a:b3:
-         bf:64:02:4e:51:91:a4:a2:85:15:83:af:f0:5b:9b:28:49:5f:
-         b2:b3:03:d8
+    Signature Algorithm: sha256WithRSAEncryption
+         0e:93:48:44:4a:72:96:60:71:25:82:a9:2c:ca:60:5b:f2:88:
+         3e:cf:11:74:5a:11:4a:dc:d9:d8:f6:58:2c:05:d3:56:d9:e9:
+         8f:37:ef:8e:3e:3b:ff:22:36:00:ca:d8:e2:96:3f:a7:d1:ed:
+         1f:de:7a:b0:d7:8f:36:bd:41:55:1e:d4:b9:86:3b:87:25:69:
+         35:60:48:d6:e4:5a:94:ce:a2:fa:70:38:36:c4:85:b4:4b:23:
+         fe:71:9e:2f:db:06:c7:b5:9c:21:f0:3e:7c:eb:91:f8:5c:09:
+         fd:84:43:a4:b3:4e:04:0c:22:31:71:6a:48:c8:ab:bb:e8:ce:
+         fa:67:15:1a:3a:82:98:43:33:b5:0e:1f:1e:89:f8:37:de:1b:
+         e6:b5:a0:f4:a2:8b:b7:1c:90:ba:98:6d:94:21:08:80:5d:f3:
+         bf:66:ad:c9:72:28:7a:6a:48:ee:cf:63:69:31:8c:c5:8e:66:
+         da:4b:78:65:e8:03:3a:4b:f8:cc:42:54:d3:52:5c:2d:04:ae:
+         26:87:e1:7e:40:cb:45:41:16:4b:6e:a3:2e:4a:76:bd:29:7f:
+         1c:53:37:06:ad:e9:5b:6a:d6:b7:4e:94:a2:7c:e8:ac:4e:a6:
+         50:3e:2b:32:9e:68:42:1b:e4:59:67:61:ea:c7:9a:51:9c:1c:
+         55:a3:77:76
+-----BEGIN CERTIFICATE-----
+MIIEqjCCA5KgAwIBAgIJALe2kDNmG2sjMA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD
+VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G
+A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3
+dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
+Fw0xNjA4MTEyMDA3MzdaFw0xOTA1MDgyMDA3MzdaMIGUMQswCQYDVQQGEwJVUzEQ
+MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3
+dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
+LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAL8Myi0Ush6EQlvNOB9K8k11EPG2NZ/fyn0D
+mNOs3gNm7irx2LB9bgdUCxCYIU2AyxIg58xP3kV9yXJ3MurKkLtpUhADL6jzlcXx
+i2JWG+9nb6QQQZWtCpvjpcCw0nB2UDBbqOgILHztp6J6jTgpHKzH7fJ8lbCVgn1J
+XDjNdyXvvYB1U5Q8PcpjW58VtdMdEy8Z0TzbdjrMuH3J5cLX2kBv2CHccxtCLVOc
+/hr8fat6Nj+Y3oR8BWfOahQ4h6nxjLVoy2h/cSAr9aBj9VYvoybSt2+xWhfXOJkI
+/pNYb/7DE0kIFgunTWcAUjFnI06Y7VFFHbkE2Qvs2CizS73tNnkCAwEAAaOB/DCB
++TAdBgNVHQ4EFgQUJ45nEXTDJh0/7TNjs6TYHTDl6NUwgckGA1UdIwSBwTCBvoAU
+J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
+VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290
+aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
+MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAt7aQM2YbayMwDAYD
+VR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEADpNIREpylmBxJYKpLMpgW/KI
+Ps8RdFoRStzZ2PZYLAXTVtnpjzfvjj47/yI2AMrY4pY/p9HtH956sNePNr1BVR7U
+uYY7hyVpNWBI1uRalM6i+nA4NsSFtEsj/nGeL9sGx7WcIfA+fOuR+FwJ/YRDpLNO
+BAwiMXFqSMiru+jO+mcVGjqCmEMztQ4fHon4N94b5rWg9KKLtxyQuphtlCEIgF3z
+v2atyXIoempI7s9jaTGMxY5m2kt4ZegDOkv4zEJU01JcLQSuJofhfkDLRUEWS26j
+Lkp2vSl/HFM3Bq3pW2rWt06UonzorE6mUD4rMp5oQhvkWWdh6seaUZwcVaN3dg==
+-----END CERTIFICATE-----
index 38330d5380e5c626b5e242641a8980c1a3c5128d..9262ad60991dad453df0251c78f650263ffeac6c 100644 (file)
@@ -2,13 +2,13 @@ Certificate:
     Data:
         Version: 3 (0x2)
         Serial Number:
-            b6:63:af:8f:5d:62:57:a0
-    Signature Algorithm: sha1WithRSAEncryption
-        Issuer: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Programming, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
+            b9:bc:90:ed:ad:aa:0a:8c
+    Signature Algorithm: sha256WithRSAEncryption
+        Issuer: C=US, ST=Montana, L=Bozeman, O=wolfSSL_2048, OU=Programming-2048, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
         Validity
-            Not Before: Jul 11 17:39:44 2014 GMT
-            Not After : Apr  6 17:39:44 2017 GMT
-        Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Programming, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
+            Not Before: Aug 11 20:07:37 2016 GMT
+            Not After : May  8 20:07:37 2019 GMT
+        Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL_2048, OU=Programming-2048, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
         Subject Public Key Info:
             Public Key Algorithm: rsaEncryption
                 Public-Key: (2048 bit)
@@ -37,51 +37,52 @@ Certificate:
                 33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
             X509v3 Authority Key Identifier: 
                 keyid:33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
-                DirName:/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Programming/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
-                serial:B6:63:AF:8F:5D:62:57:A0
+                DirName:/C=US/ST=Montana/L=Bozeman/O=wolfSSL_2048/OU=Programming-2048/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
+                serial:B9:BC:90:ED:AD:AA:0A:8C
 
             X509v3 Basic Constraints: 
                 CA:TRUE
-    Signature Algorithm: sha1WithRSAEncryption
-         85:10:90:c5:5d:de:25:8c:f2:57:7b:2d:14:1c:05:f9:71:63:
-         40:b0:e3:c1:c1:2e:13:2a:7a:b7:d6:24:58:87:eb:03:fb:0d:
-         af:e0:f4:d0:c8:bc:51:36:10:4f:79:cc:4f:66:7d:af:99:cb:
-         7b:ce:68:94:c6:36:aa:42:6e:8c:78:5b:b2:85:ca:d1:e1:a8:
-         31:d1:81:d9:f9:c1:a3:9e:34:43:ef:0a:79:7d:3e:83:61:fc:
-         14:5c:d1:dd:bc:0e:d7:51:b7:71:6e:41:7e:8b:2c:5a:9a:cb:
-         77:4b:6a:f5:06:ff:02:af:1e:e6:63:4f:bc:44:d9:3f:56:9e:
-         09:9c:43:f9:55:21:32:46:82:09:86:a9:7b:74:1c:9e:5a:2a:
-         bf:03:79:91:cb:f2:29:7f:c9:15:82:89:b9:53:cd:7e:07:90:
-         a9:5d:76:e1:19:5e:0d:58:b8:59:d5:0d:df:23:ab:6b:63:76:
-         19:9e:9c:df:b0:57:49:6c:d0:86:97:c3:6c:3c:fa:e0:56:c2:
-         1b:e3:a1:42:1a:58:62:85:9d:74:19:83:08:af:59:90:f8:99:
-         bd:67:d3:4a:ea:0e:c9:ca:61:8a:0d:8a:42:cc:90:e9:2e:c2:
-         54:73:7f:5e:af:8d:e2:32:cb:45:20:d6:19:4d:5b:77:31:cc:
-         0f:2d:c0:7e
+    Signature Algorithm: sha256WithRSAEncryption
+         33:85:08:b4:58:0e:a2:00:03:74:de:77:fb:d1:2b:76:9c:97:
+         90:20:21:a2:e8:2e:22:50:26:04:76:ba:5b:47:79:e5:52:f7:
+         c4:0d:79:ff:62:3f:05:7c:c3:08:6c:e0:b7:81:d0:ce:c6:c9:
+         46:b9:8e:4b:5f:56:79:4b:13:b6:d1:6b:66:4b:ce:00:0d:e3:
+         76:5e:fb:cb:b5:5d:12:31:05:f1:bb:39:f6:86:90:ca:92:56:
+         a4:a0:75:21:b6:1d:4c:96:c3:45:eb:5a:91:94:32:d3:59:b8:
+         c9:73:1f:03:a9:81:63:e0:43:c0:1e:c8:65:be:3b:a7:53:c3:
+         44:ff:b3:fb:47:84:a8:b6:9d:00:d5:6b:ae:87:f8:bb:35:b2:
+         6c:66:0b:11:ee:6f:fe:12:ed:59:79:f1:3e:f2:d3:61:27:8b:
+         95:7e:99:75:8d:a4:9f:34:85:f1:25:4d:48:1e:9b:6b:70:f6:
+         66:cc:56:b1:a3:02:52:8a:7c:aa:af:07:da:97:c6:0c:a5:8f:
+         ed:cb:f5:d8:04:5d:97:0a:5d:5a:2b:49:f5:bd:93:e5:23:9b:
+         99:b5:0c:ff:0c:7e:38:82:b2:6e:ab:8a:c9:a7:45:ab:d6:d7:
+         93:35:70:07:7e:c8:3d:a5:fe:33:8f:d9:85:c0:c7:5a:02:e4:
+         7c:d6:35:9e
 -----BEGIN CERTIFICATE-----
-MIIEqjCCA5KgAwIBAgIJALZjr49dYlegMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
-VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEQMA4G
-A1UECgwHd29sZlNTTDEUMBIGA1UECwwLUHJvZ3JhbW1pbmcxGDAWBgNVBAMMD3d3
-dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
-Fw0xNDA3MTExNzM5NDRaFw0xNzA0MDYxNzM5NDRaMIGUMQswCQYDVQQGEwJVUzEQ
-MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEQMA4GA1UECgwHd29s
-ZlNTTDEUMBIGA1UECwwLUHJvZ3JhbW1pbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
-LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAMMD0Sv+OaQyRTtTyIQrKnx0mr2qKlIHR9am
-NrIHMo7Quml7xsNEntSBSP0taKKLZ7uhdcg2LErSG/eLus8N+e/s8YEee5sDR5q/
-Zcx/ZSRppugUiVvkNPfFsBST9Wd7Onp44QFWVpGmE0KN0jxAnEzv0YbfN1EbDKE7
-9fGjSjXk4c6W3xt+v06X0BDoqAgwga8gC0MUxXRntDKCb42GwohAmTaDuh5AciIX
-11JlJHOwzu8Zza7/eGx7wBID1E5yDVBtO6M7o5lencjZDIWz2YrZVCbbbfqsu/8l
-TMTRefRx04ZAGBOwY7VyTjDEl4SGLVYv1xX3f8Cu9fxb5fuhutMCAwEAAaOB/DCB
-+TAdBgNVHQ4EFgQUM9hFZtdohxh+VA1wJ5HHJteFZcAwgckGA1UdIwSBwTCBvoAU
-M9hFZtdohxh+VA1wJ5HHJteFZcChgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
-VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMRAwDgYDVQQKDAd3b2xmU1NM
-MRQwEgYDVQQLDAtQcm9ncmFtbWluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
-MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAtmOvj11iV6AwDAYD
-VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAhRCQxV3eJYzyV3stFBwF+XFj
-QLDjwcEuEyp6t9YkWIfrA/sNr+D00Mi8UTYQT3nMT2Z9r5nLe85olMY2qkJujHhb
-soXK0eGoMdGB2fnBo540Q+8KeX0+g2H8FFzR3bwO11G3cW5BfossWprLd0tq9Qb/
-Aq8e5mNPvETZP1aeCZxD+VUhMkaCCYape3QcnloqvwN5kcvyKX/JFYKJuVPNfgeQ
-qV124RleDVi4WdUN3yOra2N2GZ6c37BXSWzQhpfDbDz64FbCG+OhQhpYYoWddBmD
-CK9ZkPiZvWfTSuoOycphig2KQsyQ6S7CVHN/Xq+N4jLLRSDWGU1bdzHMDy3Afg==
+MIIEyjCCA7KgAwIBAgIJALm8kO2tqgqMMA0GCSqGSIb3DQEBCwUAMIGeMQswCQYD
+VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjEVMBMG
+A1UECgwMd29sZlNTTF8yMDQ4MRkwFwYDVQQLDBBQcm9ncmFtbWluZy0yMDQ4MRgw
+FgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29s
+ZnNzbC5jb20wHhcNMTYwODExMjAwNzM3WhcNMTkwNTA4MjAwNzM3WjCBnjELMAkG
+A1UEBhMCVVMxEDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xFTAT
+BgNVBAoMDHdvbGZTU0xfMjA0ODEZMBcGA1UECwwQUHJvZ3JhbW1pbmctMjA0ODEY
+MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdv
+bGZzc2wuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwwPRK/45
+pDJFO1PIhCsqfHSavaoqUgdH1qY2sgcyjtC6aXvGw0Se1IFI/S1oootnu6F1yDYs
+StIb94u6zw357+zxgR57mwNHmr9lzH9lJGmm6BSJW+Q098WwFJP1Z3s6enjhAVZW
+kaYTQo3SPECcTO/Rht83URsMoTv18aNKNeThzpbfG36/TpfQEOioCDCBryALQxTF
+dGe0MoJvjYbCiECZNoO6HkByIhfXUmUkc7DO7xnNrv94bHvAEgPUTnINUG07ozuj
+mV6dyNkMhbPZitlUJttt+qy7/yVMxNF59HHThkAYE7BjtXJOMMSXhIYtVi/XFfd/
+wK71/Fvl+6G60wIDAQABo4IBBzCCAQMwHQYDVR0OBBYEFDPYRWbXaIcYflQNcCeR
+xybXhWXAMIHTBgNVHSMEgcswgciAFDPYRWbXaIcYflQNcCeRxybXhWXAoYGkpIGh
+MIGeMQswCQYDVQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96
+ZW1hbjEVMBMGA1UECgwMd29sZlNTTF8yMDQ4MRkwFwYDVQQLDBBQcm9ncmFtbWlu
+Zy0yMDQ4MRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEW
+EGluZm9Ad29sZnNzbC5jb22CCQC5vJDtraoKjDAMBgNVHRMEBTADAQH/MA0GCSqG
+SIb3DQEBCwUAA4IBAQAzhQi0WA6iAAN03nf70St2nJeQICGi6C4iUCYEdrpbR3nl
+UvfEDXn/Yj8FfMMIbOC3gdDOxslGuY5LX1Z5SxO20WtmS84ADeN2XvvLtV0SMQXx
+uzn2hpDKklakoHUhth1MlsNF61qRlDLTWbjJcx8DqYFj4EPAHshlvjunU8NE/7P7
+R4Sotp0A1Wuuh/i7NbJsZgsR7m/+Eu1ZefE+8tNhJ4uVfpl1jaSfNIXxJU1IHptr
+cPZmzFaxowJSinyqrwfal8YMpY/ty/XYBF2XCl1aK0n1vZPlI5uZtQz/DH44grJu
+q4rJp0Wr1teTNXAHfsg9pf4zj9mFwMdaAuR81jWe
 -----END CERTIFICATE-----
index f56cba9de70f38032d556c67e8cd686e79c04d1f..5504c822fae5cd48bac5a039ce27717e6c0ca5e1 100644 (file)
@@ -2,11 +2,11 @@ Certificate:
     Data:
         Version: 3 (0x2)
         Serial Number: 1 (0x1)
-    Signature Algorithm: sha1WithRSAEncryption
+    Signature Algorithm: sha256WithRSAEncryption
         Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
         Validity
-            Not Before: Jul 11 17:20:14 2014 GMT
-            Not After : Apr  6 17:20:14 2017 GMT
+            Not Before: Aug 11 20:07:37 2016 GMT
+            Not After : May  8 20:07:37 2019 GMT
         Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Support, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
         Subject Public Key Info:
             Public Key Algorithm: rsaEncryption
@@ -37,32 +37,32 @@ Certificate:
             X509v3 Authority Key Identifier: 
                 keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
                 DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
-                serial:9A:41:47:CD:A1:14:62:8C
+                serial:B7:B6:90:33:66:1B:6B:23
 
             X509v3 Basic Constraints: 
                 CA:TRUE
-    Signature Algorithm: sha1WithRSAEncryption
-         3d:8c:70:05:5b:62:4b:bf:6c:b6:48:61:01:10:1d:5e:05:ba:
-         55:94:2c:ae:59:6f:97:80:5d:6c:86:ec:9a:eb:15:45:44:e4:
-         56:f8:75:ca:8a:45:32:f4:c7:e1:fa:f2:98:1c:91:d3:3f:e8:
-         0e:c9:1b:fa:e1:79:99:67:0e:0d:6b:8a:ec:1a:2c:59:c4:34:
-         04:8d:39:77:cd:b5:e9:60:5b:82:bf:34:ce:ed:c6:4f:3f:b4:
-         5c:4d:8a:b4:f4:0a:04:12:a0:56:c1:e1:33:37:a1:54:87:48:
-         e9:81:c2:0f:8f:6f:d3:52:4c:4c:32:4c:6b:9f:3a:04:8f:77:
-         5d:ad:dc:3d:2b:f2:c9:df:3c:60:5d:d8:fc:86:72:7c:3d:d0:
-         84:4b:8c:df:26:43:fe:c0:cc:5b:e1:36:b3:3d:32:28:a3:ef:
-         0c:20:d6:b1:50:39:d6:67:a9:8b:84:bc:92:34:eb:19:23:e8:
-         10:8f:ea:bd:18:8c:93:27:3c:74:75:8e:58:04:fa:2a:74:44:
-         7d:fc:4d:39:df:54:17:ba:78:e1:5d:6a:70:d3:7c:a2:80:81:
-         e6:19:51:91:c3:44:51:ec:bb:88:a9:53:e1:d7:a9:8c:28:f4:
-         21:1c:42:51:09:b4:12:6d:a0:d6:25:09:85:c6:2a:0c:af:a7:
-         58:e6:52:8b
+    Signature Algorithm: sha256WithRSAEncryption
+         51:fe:2a:df:07:7e:43:ca:66:8d:15:c4:2b:db:57:b2:06:6d:
+         0d:90:66:ff:a5:24:9c:14:ef:81:f2:a4:ab:99:a9:6a:49:20:
+         a5:d2:71:e7:1c:3c:99:07:c7:47:fc:e8:96:b4:f5:42:30:ce:
+         39:01:4b:d1:c2:e8:bc:95:84:87:ce:55:5d:97:9f:cf:78:f3:
+         56:9b:a5:08:6d:ac:f6:a5:5c:c4:ef:3e:2a:39:a6:48:26:29:
+         7b:2d:e0:cd:a6:8c:57:48:0b:bb:31:32:c2:bf:d9:43:4c:47:
+         25:18:81:a8:c9:33:82:41:9b:ba:61:86:d7:84:93:17:24:25:
+         36:ca:4d:63:6b:4f:95:79:d8:60:e0:1e:f5:ac:c1:8a:a1:b1:
+         7e:85:8e:87:20:2f:08:31:ad:5e:c6:4a:c8:61:f4:9e:07:1e:
+         a2:22:ed:73:7c:85:ee:fa:62:dc:50:36:aa:fd:c7:9d:aa:18:
+         04:fb:ea:cc:2c:68:9b:b3:a9:c2:96:d8:c1:cc:5a:7e:f7:0d:
+         9e:08:e0:9d:29:8b:84:46:8f:d3:91:6a:b5:b8:7a:5c:cc:4f:
+         55:01:b8:9a:48:a0:94:43:ca:25:47:52:0a:f7:f4:be:b0:d1:
+         71:6d:a5:52:4a:65:50:b2:ad:4e:1d:e0:6c:01:d8:fb:43:80:
+         e6:e4:0c:37
 -----BEGIN CERTIFICATE-----
-MIIEnjCCA4agAwIBAgIBATANBgkqhkiG9w0BAQUFADCBlDELMAkGA1UEBhMCVVMx
+MIIEnjCCA4agAwIBAgIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMx
 EDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNh
 d3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
-bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTQwNzEx
-MTcyMDE0WhcNMTcwNDA2MTcyMDE0WjCBkDELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
+bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTYwODEx
+MjAwNzM3WhcNMTkwNTA4MjAwNzM3WjCBkDELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
 B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xEDAOBgNVBAoMB3dvbGZTU0wxEDAO
 BgNVBAsMB1N1cHBvcnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
 SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
@@ -76,24 +76,24 @@ sxEyyZKYhOLJ+NA7bgNCyh8OjjwwgckGA1UdIwSBwTCBvoAUJ45nEXTDJh0/7TNj
 s6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5h
 MRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwK
 Q29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcN
-AQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYDVR0TBAUwAwEB/zAN
-BgkqhkiG9w0BAQUFAAOCAQEAPYxwBVtiS79stkhhARAdXgW6VZQsrllvl4BdbIbs
-musVRUTkVvh1yopFMvTH4frymByR0z/oDskb+uF5mWcODWuK7BosWcQ0BI05d821
-6WBbgr80zu3GTz+0XE2KtPQKBBKgVsHhMzehVIdI6YHCD49v01JMTDJMa586BI93
-Xa3cPSvyyd88YF3Y/IZyfD3QhEuM3yZD/sDMW+E2sz0yKKPvDCDWsVA51mepi4S8
-kjTrGSPoEI/qvRiMkyc8dHWOWAT6KnREffxNOd9UF7p44V1qcNN8ooCB5hlRkcNE
-Uey7iKlT4depjCj0IRxCUQm0Em2g1iUJhcYqDK+nWOZSiw==
+AQkBFhBpbmZvQHdvbGZzc2wuY29tggkAt7aQM2YbayMwDAYDVR0TBAUwAwEB/zAN
+BgkqhkiG9w0BAQsFAAOCAQEAUf4q3wd+Q8pmjRXEK9tXsgZtDZBm/6UknBTvgfKk
+q5mpakkgpdJx5xw8mQfHR/zolrT1QjDOOQFL0cLovJWEh85VXZefz3jzVpulCG2s
+9qVcxO8+KjmmSCYpey3gzaaMV0gLuzEywr/ZQ0xHJRiBqMkzgkGbumGG14STFyQl
+NspNY2tPlXnYYOAe9azBiqGxfoWOhyAvCDGtXsZKyGH0ngceoiLtc3yF7vpi3FA2
+qv3HnaoYBPvqzCxom7OpwpbYwcxafvcNngjgnSmLhEaP05Fqtbh6XMxPVQG4mkig
+lEPKJUdSCvf0vrDRcW2lUkplULKtTh3gbAHY+0OA5uQMNw==
 -----END CERTIFICATE-----
 Certificate:
     Data:
         Version: 3 (0x2)
         Serial Number:
-            9a:41:47:cd:a1:14:62:8c
-    Signature Algorithm: sha1WithRSAEncryption
+            b7:b6:90:33:66:1b:6b:23
+    Signature Algorithm: sha256WithRSAEncryption
         Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
         Validity
-            Not Before: Jul 11 03:20:08 2014 GMT
-            Not After : Apr  6 03:20:08 2017 GMT
+            Not Before: Aug 11 20:07:37 2016 GMT
+            Not After : May  8 20:07:37 2019 GMT
         Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
         Subject Public Key Info:
             Public Key Algorithm: rsaEncryption
@@ -124,32 +124,32 @@ Certificate:
             X509v3 Authority Key Identifier: 
                 keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
                 DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
-                serial:9A:41:47:CD:A1:14:62:8C
+                serial:B7:B6:90:33:66:1B:6B:23
 
             X509v3 Basic Constraints: 
                 CA:TRUE
-    Signature Algorithm: sha1WithRSAEncryption
-         79:78:0c:6d:79:88:91:fc:3a:15:9c:f9:27:62:16:f0:21:1f:
-         fa:7d:3f:a2:a8:32:1e:f7:f2:11:a9:74:16:74:5e:dc:18:ca:
-         f0:00:2a:d5:03:06:26:30:f1:47:83:fd:32:6e:fc:ed:aa:4f:
-         7d:0c:63:60:31:2f:7c:0c:bf:99:66:87:ed:27:08:86:2d:c4:
-         33:e8:98:23:1c:fe:a3:db:9a:49:4e:fc:5a:42:ef:71:c3:3f:
-         ad:dc:4a:a8:d2:a3:1d:09:ac:33:04:7b:86:f3:6d:00:59:a3:
-         c8:db:d1:3c:73:f6:0e:90:d6:5e:49:e0:bf:36:63:08:7b:a5:
-         b0:8f:35:3b:56:8c:11:35:49:04:1c:d0:e7:ba:56:c5:0d:0a:
-         91:8d:d6:b7:62:19:34:12:52:4c:d2:6d:7c:c5:3d:0f:18:81:
-         54:cb:f6:3c:e5:84:d2:d6:71:15:ec:1a:34:0b:f0:a0:21:74:
-         43:c8:a3:b0:df:d9:67:da:e2:ad:93:48:f8:a0:87:bd:79:14:
-         e0:62:0a:df:f7:31:2e:31:7b:d1:32:2a:0a:fe:5d:14:ef:d9:
-         64:50:e4:83:91:bc:70:0d:d7:88:8d:d9:bc:84:0e:c5:1a:b3:
-         bf:64:02:4e:51:91:a4:a2:85:15:83:af:f0:5b:9b:28:49:5f:
-         b2:b3:03:d8
+    Signature Algorithm: sha256WithRSAEncryption
+         0e:93:48:44:4a:72:96:60:71:25:82:a9:2c:ca:60:5b:f2:88:
+         3e:cf:11:74:5a:11:4a:dc:d9:d8:f6:58:2c:05:d3:56:d9:e9:
+         8f:37:ef:8e:3e:3b:ff:22:36:00:ca:d8:e2:96:3f:a7:d1:ed:
+         1f:de:7a:b0:d7:8f:36:bd:41:55:1e:d4:b9:86:3b:87:25:69:
+         35:60:48:d6:e4:5a:94:ce:a2:fa:70:38:36:c4:85:b4:4b:23:
+         fe:71:9e:2f:db:06:c7:b5:9c:21:f0:3e:7c:eb:91:f8:5c:09:
+         fd:84:43:a4:b3:4e:04:0c:22:31:71:6a:48:c8:ab:bb:e8:ce:
+         fa:67:15:1a:3a:82:98:43:33:b5:0e:1f:1e:89:f8:37:de:1b:
+         e6:b5:a0:f4:a2:8b:b7:1c:90:ba:98:6d:94:21:08:80:5d:f3:
+         bf:66:ad:c9:72:28:7a:6a:48:ee:cf:63:69:31:8c:c5:8e:66:
+         da:4b:78:65:e8:03:3a:4b:f8:cc:42:54:d3:52:5c:2d:04:ae:
+         26:87:e1:7e:40:cb:45:41:16:4b:6e:a3:2e:4a:76:bd:29:7f:
+         1c:53:37:06:ad:e9:5b:6a:d6:b7:4e:94:a2:7c:e8:ac:4e:a6:
+         50:3e:2b:32:9e:68:42:1b:e4:59:67:61:ea:c7:9a:51:9c:1c:
+         55:a3:77:76
 -----BEGIN CERTIFICATE-----
-MIIEqjCCA5KgAwIBAgIJAJpBR82hFGKMMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
+MIIEqjCCA5KgAwIBAgIJALe2kDNmG2sjMA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD
 VQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8G
 A1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3
 dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTAe
-Fw0xNDA3MTEwMzIwMDhaFw0xNzA0MDYwMzIwMDhaMIGUMQswCQYDVQQGEwJVUzEQ
+Fw0xNjA4MTEyMDA3MzdaFw0xOTA1MDgyMDA3MzdaMIGUMQswCQYDVQQGEwJVUzEQ
 MA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjERMA8GA1UECgwIU2F3
 dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3Ns
 LmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZI
@@ -163,11 +163,11 @@ XDjNdyXvvYB1U5Q8PcpjW58VtdMdEy8Z0TzbdjrMuH3J5cLX2kBv2CHccxtCLVOc
 J45nEXTDJh0/7TNjs6TYHTDl6NWhgZqkgZcwgZQxCzAJBgNVBAYTAlVTMRAwDgYD
 VQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREwDwYDVQQKDAhTYXd0b290
 aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
-MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYD
-VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAeXgMbXmIkfw6FZz5J2IW8CEf
-+n0/oqgyHvfyEal0FnRe3BjK8AAq1QMGJjDxR4P9Mm787apPfQxjYDEvfAy/mWaH
-7ScIhi3EM+iYIxz+o9uaSU78WkLvccM/rdxKqNKjHQmsMwR7hvNtAFmjyNvRPHP2
-DpDWXkngvzZjCHulsI81O1aMETVJBBzQ57pWxQ0KkY3Wt2IZNBJSTNJtfMU9DxiB
-VMv2POWE0tZxFewaNAvwoCF0Q8ijsN/ZZ9rirZNI+KCHvXkU4GIK3/cxLjF70TIq
-Cv5dFO/ZZFDkg5G8cA3XiI3ZvIQOxRqzv2QCTlGRpKKFFYOv8FubKElfsrMD2A==
+MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAt7aQM2YbayMwDAYD
+VR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEADpNIREpylmBxJYKpLMpgW/KI
+Ps8RdFoRStzZ2PZYLAXTVtnpjzfvjj47/yI2AMrY4pY/p9HtH956sNePNr1BVR7U
+uYY7hyVpNWBI1uRalM6i+nA4NsSFtEsj/nGeL9sGx7WcIfA+fOuR+FwJ/YRDpLNO
+BAwiMXFqSMiru+jO+mcVGjqCmEMztQ4fHon4N94b5rWg9KKLtxyQuphtlCEIgF3z
+v2atyXIoempI7s9jaTGMxY5m2kt4ZegDOkv4zEJU01JcLQSuJofhfkDLRUEWS26j
+Lkp2vSl/HFM3Bq3pW2rWt06UonzorE6mUD4rMp5oQhvkWWdh6seaUZwcVaN3dg==
 -----END CERTIFICATE-----
index 068fcdab9c051219702fe50b9a15ad443a167d4b..3d5f7867c46c1b54308225bbd847242b304a123e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   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
@@ -34,7 +34,7 @@
 #include "rsa.h"
 
 
-#define YASSL_VERSION "2.4.2"
+#define YASSL_VERSION "2.4.4"
 
 
 #if defined(__cplusplus)
index f190761604df47ae7dc9d6afa1edba35dc54581e..c5892388eaf032cb2dc682c4629267daabd3ee77 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   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
@@ -1578,6 +1578,10 @@ void ServerHello::Process(input_buffer& input, SSL& ssl)
         ssl.SetError(badVersion_error);
         return;
     }
+    if (cipher_suite_[0] != 0x00) {
+        ssl.SetError(unknown_cipher);
+        return;
+    }
     ssl.set_pending(cipher_suite_[1]);
     ssl.set_random(random_, server_end);
     if (id_len_)
index 17d68989b2fdc5b10ae4b91293d882e065e1f0ee..cef1236424174fceba34a9600d45ba2c02d34c4e 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -1451,12 +1451,17 @@ void SSL::matchSuite(const opaque* peer, uint length)
     // start with best, if a match we are good, Ciphers are at odd index
     // since all SSL and TLS ciphers have 0x00 first byte
     for (uint i = 1; i < secure_.get_parms().suites_size_; i += 2)
-        for (uint j = 1; j < length; j+= 2)
-            if (secure_.use_parms().suites_[i] == peer[j]) {
+        for (uint j = 0; (j + 1) < length; j+= 2) {
+            if (peer[j] != 0x00) {
+                continue; // only 0x00 first byte supported
+            }
+
+            if (secure_.use_parms().suites_[i] == peer[j + 1]) {
                 secure_.use_parms().suite_[0] = 0x00;
-                secure_.use_parms().suite_[1] = peer[j];
+                secure_.use_parms().suite_[1] = peer[j + 1];
                 return;
             }
+        }
 
     SetError(match_error);
 }
index 35f2caee16287a697ba2152a9a311e7ffe82b4d3..66bfce5c32fc981c656cde93ed4ef180b8e0a871 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBcomp_err\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBCOMP_ERR\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBCOMP_ERR\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -241,7 +241,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 26dee3e682491a4207c4f7146d0ee235ab00656c..b4e296bfb0d39f3d075b0318bfaa7f9b942c4a8f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBinnochecksum\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBINNOCHECKSUM\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBINNOCHECKSUM\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -39,15 +39,18 @@ prints checksums for
 InnoDB
 files\&. This tool reads an
 InnoDB
-tablespace file, calculates the checksum for each page, compares the calculated checksum to the stored checksum, and reports mismatches, which indicate damaged pages\&. It was originally developed to speed up verifying the integrity of tablespace files after power outages but can also be used after file copies\&. Because checksum mismatches will cause
+tablespace file, calculates the checksum for each page, compares the calculated checksum to the stored checksum, and reports mismatches, which indicate damaged pages\&. It was originally developed to speed up verifying the integrity of tablespace files after power outages but can also be used after file copies\&. Because checksum mismatches cause
 InnoDB
-to deliberately shut down a running server, it can be preferable to use this tool rather than waiting for a server in production usage to encounter the damaged pages\&. As of MySQL 5\&.6\&.16,
+to deliberately shut down a running server, it may be preferable to use this tool rather than waiting for an in\-production server to encounter the damaged pages\&. As of MySQL 5\&.6\&.16,
 \fBinnochecksum\fR
 supports files greater than 2GB in size\&. Previously,
 \fBinnochecksum\fR
 only supported files up to 2GB in size\&.
 .PP
 \fBinnochecksum\fR
+does not support tablespaces that contain compressed pages\&.
+.PP
+\fBinnochecksum\fR
 cannot be used on tablespace files that the server already has open\&. For such files, you should use
 CHECK TABLE
 to check tables within the tablespace\&.
@@ -153,7 +156,7 @@ Verbose mode; print a progress indicator every five seconds\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index d2c1c5be6a784a91bcc6136336e0a7f28ffeba70..2f0205cab6956f0ee07aeac4935613d58a357bbb 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmsql2mysql\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMSQL2MYSQL\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMSQL2MYSQL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -84,7 +84,7 @@ utility to make the function name substitutions\&. See
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index b083cbbab815c4c911390116d1ddfc814742ccdb..b06c268a40cfae553c0c52e5bbe834c76e16c494 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmy_print_defaults\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMY_PRINT_DEFAULTS" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMY_PRINT_DEFAULTS" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -220,7 +220,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 5c129d583af7e50d5070f26fccb50bb6b4744648..5aa4c4166fdceb44fe9b452f38491fe42ddbd723 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmyisam_ftdump\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYISAM_FTDUMP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAM_FTDUMP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -238,7 +238,7 @@ Verbose mode\&. Print more output about what the program does\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 5ed1b29175e3d39c423d563b5c8fa18d58d11482..26cf522a1872d9cd07c44b0343ad5461021af7c4 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmyisamchk\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYISAMCHK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMCHK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -627,7 +627,7 @@ myisam_stats_method
 system variable\&. For more information, see the description of
 myisam_stats_method
 in
-Section\ \&5.1.4, \(lqServer System Variables\(rq, and
+Section\ \&5.1.5, \(lqServer System Variables\(rq, and
 Section\ \&8.3.7, \(lqInnoDB and MyISAM Index Statistics Collection\(rq\&.
 .PP
 ft_min_word_len
@@ -975,7 +975,7 @@ Overwrite old intermediate files (files with names like
 \fB\-k \fR\fB\fIval\fR\fR
 .sp
 For
-\fBmyisamchk\fR, the option value is a bit\-value that indicates which indexes to update\&. Each binary bit of the option value corresponds to a table index, where the first index is bit 0\&. An option value of 0 disables updates to all indexes, which can be used to get faster inserts\&. Deactivated indexes can be reactivated by using
+\fBmyisamchk\fR, the option value is a bit value that indicates which indexes to update\&. Each binary bit of the option value corresponds to a table index, where the first index is bit 0\&. An option value of 0 disables updates to all indexes, which can be used to get faster inserts\&. Deactivated indexes can be reactivated by using
 \fBmyisamchk \-r\fR\&.
 .RE
 .sp
@@ -1142,7 +1142,7 @@ uses the value of the
 TMPDIR
 environment variable\&.
 \fB\-\-tmpdir\fR
-can be set to a list of directory paths that are used successively in round\-robin fashion for creating temporary files\&. The separator character between directory names is the colon (\(lq:\(rq) on Unix and the semicolon (\(lq;\(rq) on Windows\&.
+can be set to a list of directory paths that are used successively in round\-robin fashion for creating temporary files\&. The separator character between directory names is the colon (:) on Unix and the semicolon (;) on Windows\&.
 .RE
 .sp
 .RS 4
@@ -1379,7 +1379,7 @@ CREATE TABLE person
   PRIMARY KEY (id),
   INDEX (last_name, first_name),
   INDEX (birth)
-) MAX_ROWS = 1000000;
+) MAX_ROWS = 1000000 ENGINE=MYISAM;
 .fi
 .if n \{\
 .RE
@@ -2463,7 +2463,7 @@ instead of
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index dbc7b278666edee5dac58746c22732b5563a8465..9d80561efd828bdb7e5fa8765a1d3ce6197caa45 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmyisamlog\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYISAMLOG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMLOG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -227,7 +227,7 @@ Display version information\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 6a86a12792b8ec8a7e06bae0ddd0efbe4fd5234b..925b1b6e361562a2766b1487d8323c2cc7232308 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmyisampack\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYISAMPACK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMPACK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -825,7 +825,7 @@ option to
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 9b1116b8582b0e5ed0bfeda3099341fc08cc3f1d..736826aa00eb2e5d1f959d4d92ef57752dd6e046 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql-stress-test.pl\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/01/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL
 .\"  Language: English
 .\"
-.TH "\FBMYSQL\-STRESS\-TE" "1" "08/25/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL\-STRESS\-TE" "1" "06/01/2017" "MySQL" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -445,7 +445,7 @@ Verbose mode\&. Print more information about what the program does\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 553fa257edf87a01e9eb814ea4e7cd65e12947ed..3203d7942d2fcf313c28bd3c3a088dc6d8f43c55 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql-test-run.pl\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/01/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL
 .\"  Language: English
 .\"
-.TH "\FBMYSQL\-TEST\-RUN\" "1" "08/25/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL\-TEST\-RUN\" "1" "06/01/2017" "MySQL" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -33,6 +33,24 @@ mysql-test-run.pl \- run MySQL test suite
 .HP \w'\fBmysql\-test\-run\&.pl\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u
 \fBmysql\-test\-run\&.pl [\fR\fB\fIoptions\fR\fR\fB]\fR
 .SH "DESCRIPTION"
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.PP
+\fIThis content is no longer updated\&.\fR
+Any further updates to test framework documention take place in the MySQL Source Code documentation and can be accessed at
+\m[blue]\fBThe MySQL Test Framework, Version 2\&.0\fR\m[]\&\s-2\u[1]\d\s+2\&.
+.sp .5v
+.RE
 .PP
 The
 \fBmysql\-test\-run\&.pl\fR
@@ -262,6 +280,7 @@ l l
 l l
 l l
 l l
+l l
 l l.
 T{
 MTR_BUILD_THREAD
@@ -293,7 +312,7 @@ Setting of a timeout in minutes or seconds, corresponding to command
                 CTEST (all in seconds)\&.
                 MTR_CTEST_TIMEOUT is for
                 \fBctest\fR unit tests; it was added in
-                MySQL 5\&.8\&.0\&.
+                MySQL 8\&.0\&.0\&.
 T}
 T{
 MTR_PARALLEL
@@ -365,6 +384,12 @@ T}:T{
 Path name to the var directory that is used for
                 logs, temporary files, and so forth
 T}
+T{
+TSAN_OPTIONS
+T}:T{
+Path name to a file containing ThreadSanitizer suppressions\&. Supported
+                as of MySQL 8\&.0\&.1\&.
+T}
 .TE
 .sp 1
 .PP
@@ -428,6 +453,14 @@ BIG_TEST
 is set to 1\&.
 .sp
 This is typically done for tests that take very long to run, or that use very much resources, so that they are not suitable for running as part of a normal test suite run\&.
+.sp
+If both
+\fB\-\-big\-test\fR
+and
+\fB\-\-only\-big\-tests\fR
+are given,
+\fB\-\-only\-big\-tests\fR
+is ignored\&.
 .RE
 .sp
 .RS 4
@@ -536,9 +569,29 @@ to use
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-charset\-for\-testdb=\fR\fB\fIcharset_name\fR\fR
+.sp
+Specify the default character set for the
+test
+database\&. The default value is
+latin1\&.
+.sp
+This option was added in MySQL 8\&.0\&.1\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-check\-testcases\fR
 .sp
-Check test cases for side effects\&. This is done by checking system state before and after each test case; if there is any difference, a warning to that effect will be written, but the test case will not be marked as failed because of it\&. This check is enabled by default\&.
+Check test cases for side effects\&. This is done by checking the system state before and after each test case; if there is any difference, a warning to that effect is written, but the test case is not marked as failed because of it\&. This check is enabled by default\&. To disable it, use the
+\fB\-\-nocheck\-testcases\fR
+option\&.
 .RE
 .sp
 .RS 4
@@ -849,7 +902,7 @@ prefix is used so that
 does not fail if Debug Sync is not compiled in\&.
 .sp
 For information about using the Debug Sync facility for testing, see
-Section\ \&4.14, \(lqThread Synchronization in Test Cases\(rq\&.
+Section\ \&4.15, \(lqThread Synchronization in Test Cases\(rq\&.
 .RE
 .sp
 .RS 4
@@ -862,7 +915,10 @@ Section\ \&4.14, \(lqThread Synchronization in Test Cases\(rq\&.
 .\}
 \fB\-\-default\-myisam\fR
 .sp
-Use MyISAM as default engine for all except InnoDB\-specific tests\&. This option is on by default in MySQL 5\&.5 and 5\&.6 but it off by default from MySQL 5\&.7\&. See also
+Use
+MyISAM
+as the default storage engine for all except
+InnoDB\-specific tests\&. This option is on by default in MySQL 5\&.5 and 5\&.6, but is off by default as of MySQL 5\&.7\&. See also
 \fB\-\-nodefault\-myisam\fR\&.
 .RE
 .sp
@@ -900,6 +956,26 @@ Add setting from the named file to all generated configs\&.
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-discover\fR
+.sp
+Attempt to preload
+discover, the Developer Studio Memory Error Discovery Tool when starting
+\fBmysqld\fR\&. Reports from
+discover
+may be found in
+log/mysqld\&.%p\&.txt
+under the directory given by
+\fB\-\-vardir\fR\&. This option was added in MySQL 8\&.0\&.1\&. It is supported only on SPARC\-M7 systems\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-do\-suite=\fR\fB\fIprefix or regex\fR\fR
 .sp
 Run all test cases from suites having a name that begins with the given
@@ -987,7 +1063,7 @@ option is available from MySQL 5\&.7\&.
 .sp
 Use a version of
 \fBmysqltest\fR
-built with the embedded server\&.
+built with the embedded server\&. This option was removed in MySQL 8\&.0\&.
 .RE
 .sp
 .RS 4
@@ -1040,7 +1116,13 @@ It is also possible to supply more than one
 .sp
 Run
 EXPLAIN EXTENDED
-on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&.
+on all
+SELECT,
+INSERT,
+REPLACE,
+UPDATE, and
+DELETE
+statements\&.
 .RE
 .sp
 .RS 4
@@ -1099,6 +1181,25 @@ Do not perform controlled shutdown when servers need to be restarted or at the e
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-fail\-check\-testcases\fR
+.sp
+Enabling this option when a test is run, causes it to fail if MTR\*(Aqs internal check of the test case fails\&. If this option is disabled, only a warning is generated while the test passes\&. This option is enabled by default\&. For additional information, see the description of the
+\fB\-\-check\-testcases\fR
+option\&.
+.sp
+The
+\fB\-\-fail\-check\-testcases\fR
+option was added in MySQL 8\&.0\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-force\fR
 .sp
 Normally,
@@ -1427,7 +1528,7 @@ options to set more than one variable\&.
 Extra options to pass to
 \fBmysqltest\fR\&.
 .sp
-This option was added in MySQL 5\&.8\&.0\&.
+This option was added in MySQL 8\&.0\&.0\&.
 .RE
 .sp
 .RS 4
@@ -1457,9 +1558,9 @@ from starting a cluster\&. It is assumed that there is already a cluster running
 .\}
 \fB\-\-nocheck\-testcases\fR
 .sp
-Disable the check for test case side effects; see
+Disable the check for test case side effects\&. For additional information, see the description of the
 \fB\-\-check\-testcases\fR
-for a description\&.
+option\&.
 .RE
 .sp
 .RS 4
@@ -1498,6 +1599,39 @@ Do not reorder tests to reduce number of restarts, but run them in exactly the o
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-no\-skip\fR
+.sp
+This option forces all tests to run, ignoring any
+\fB\-\-skip\fR
+commands used in the test\&. This ensures that all tests are run\&. An excluded list (excludenoskip\&.list) is maintained to track which tests should continue to be skipped\&. The
+\fB\-\-no\-skip\fR
+option continues to skip the tests that are named in the excluded list\&. The default value of
+\fB\-\-no\-skip\fR
+introduced variable is OFF, which implies users are not forced to run all tests unless the
+\fB\-\-no\-skip\fR
+is explicitly used\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+shell> \fBmysql\-test\-run\&.pl\fR
+          \fB\-\-suite=innodb\fR
+          \fB\-\-no\-skip\fR
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-notimer\fR
 .sp
 Cause
@@ -1543,6 +1677,28 @@ Do not look for and report errors and warning in the server logs\&.
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-only\-big\-tests\fR
+.sp
+This option causes only big tests to run\&. Normal (non\-big) tests are skipped\&. If both
+\fB\-\-big\-test\fR
+and
+\fB\-\-only\-big\-tests\fR
+are given,
+\fB\-\-only\-big\-tests\fR
+is ignored\&.
+.sp
+\fB\-\-only\-big\-tests\fR
+was added in MySQL 8\&.0\&.1\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-parallel={\fR\fB\fIN\fR\fR\fB|auto}\fR
 .sp
 Run tests using
@@ -1754,6 +1910,26 @@ Allow a failed and retried test to fail more than the default 2 times before giv
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-sanitize\fR
+.sp
+Scan the server log files for warnings from various sanitizers\&. Use of this option assumes that MySQL was configured with
+\fB\-DWITH_ASAN\fR
+or
+\fB\-DWITH_UBSAN\fR\&.
+.sp
+This option was added in MySQL 8\&.0\&.0\&. As of MySQL 8\&.0\&.1, the
+TSAN_OPTIONS
+environment variable can be set to specify the path name of a file containing ThreadSanitizer suppressions\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-shutdown\-timeout=\fR\fB\fIseconds\fR\fR
 .sp
 Max number of seconds to wait for servers to do controlled shutdown before killing them\&. Default is 10\&.
@@ -2120,6 +2296,32 @@ Specify the maximum test suite runtime in minutes\&.
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-summary\-report=\fR\fB\fIfile_name\fR\fR
+.sp
+Generate a plain text version of the test summary only and write it to the file named as the option argument\&. The file is suitable for sending by email\&. This option was added in MySQL 8\&.0\&.1\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-test\-progress\fR
+.sp
+Display the percentage of tests remaining\&. This option was added in MySQL 5\&.7\&.19\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-testcase\-timeout=\fR\fB\fIminutes\fR\fR
 .sp
 Specify the maximum test case runtime in minutes\&.
@@ -2499,7 +2701,7 @@ The hostname resolves to 127\&.0\&.0\&.1 and not to the actual IP address\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
@@ -2507,6 +2709,12 @@ This documentation is distributed in the hope that it will be useful, but WITHOU
 .PP
 You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
 .sp
+.SH "NOTES"
+.IP " 1." 4
+The MySQL Test Framework, Version 2.0
+.RS 4
+\%http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_MYSQL_TEST_RUN.html
+.RE
 .SH "SEE ALSO"
 For more information, please refer to the MySQL Reference Manual,
 which may already be installed locally and which is also available
index f3c703b1914021f4989414b4c7173de561ea1272..7cb8fb915af441770644b77cb3622fab40bbf020 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -66,14 +66,15 @@ Or:
 .RS 4
 .\}
 .nf
-shell> \fBmysql \-\-user=\fR\fB\fIuser_name\fR\fR\fB \-\-password=\fR\fB\fIyour_password\fR\fR\fB \fR\fB\fIdb_name\fR\fR
+shell> \fBmysql \-\-user=\fR\fB\fIuser_name\fR\fR\fB \-\-password \fR\fB\fIdb_name\fR\fR
+Enter password: \fIyour_password\fR
 .fi
 .if n \{\
 .RE
 .\}
 .PP
 Then type an SQL statement, end it with
-\(lq;\(rq,
+;,
 \eg, or
 \eG
 and press Enter\&.
@@ -216,6 +217,24 @@ option\&.
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-binary\-as\-hex\fR,
+\fB\-b\fR
+.sp
+When this option is given,
+\fBmysql\fR
+displays binary data using hexadecimal notation (0x\fIvalue\fR)\&. This occurs whether the overall output dislay format is tabular, vertical, HTML, or XML\&.
+.sp
+This option was added in MySQL 5\&.6\&.37\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-binary\-mode\fR
 .sp
 This option helps when processing
@@ -313,7 +332,11 @@ Display result set metadata\&.
 \fB\-\-comments\fR,
 \fB\-c\fR
 .sp
-Whether to preserve comments in statements sent to the server\&. The default is \-\-skip\-comments (discard comments), enable with \-\-comments (preserve comments)\&.
+Whether to preserve comments in statements sent to the server\&. The default is
+\fB\-\-skip\-comments\fR
+(discard comments), enable with
+\fB\-\-comments\fR
+(preserve comments)\&.
 .RE
 .sp
 .RS 4
@@ -443,7 +466,7 @@ This option can be useful if the operating system uses one character set and the
 client by default uses another\&. In this case, output may be formatted incorrectly\&. You can usually fix such issues by using this option to force the client to use the system character set instead\&.
 .sp
 For more information, see
-Section\ \&10.1.5, \(lqConnection Character Sets and Collations\(rq, and
+Section\ \&10.1.4, \(lqConnection Character Sets and Collations\(rq, and
 Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
 .RE
 .sp
@@ -475,6 +498,10 @@ is interpreted relative to the current directory if given as a relative path nam
 Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
 \fIfile_name\fR
 is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
+.sp
+Exception: Even with
+\fB\-\-defaults\-file\fR, client programs read
+\&.mylogin\&.cnf\&.
 .RE
 .sp
 .RS 4
@@ -515,7 +542,7 @@ groups\&.
 .\}
 \fB\-\-delimiter=\fR\fB\fIstr\fR\fR
 .sp
-Set the statement delimiter\&. The default is the semicolon character (\(lq;\(rq)\&.
+Set the statement delimiter\&. The default is the semicolon character (;)\&.
 .RE
 .sp
 .RS 4
@@ -530,7 +557,7 @@ Set the statement delimiter\&. The default is the semicolon character (\(lq;\(rq
 .sp
 Disable named commands\&. Use the
 \e*
-form only, or use named commands only at the beginning of a line ending with a semicolon (\(lq;\(rq)\&.
+form only, or use named commands only at the beginning of a line ending with a semicolon (;)\&.
 \fBmysql\fR
 starts with this option
 \fIenabled\fR
@@ -551,7 +578,7 @@ the section called \(lqMYSQL COMMANDS\(rq\&.
 Enable the
 mysql_clear_password
 cleartext authentication plugin\&. (See
-Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
 .RE
 .sp
 .RS 4
@@ -642,7 +669,7 @@ Produce HTML output\&.
 Ignore spaces after function names\&. The effect of this is described in the discussion for the
 IGNORE_SPACE
 SQL mode (see
-Section\ \&5.1.7, \(lqServer SQL Modes\(rq)\&.
+Section\ \&5.1.8, \(lqServer SQL Modes\(rq)\&.
 .RE
 .sp
 .RS 4
@@ -685,15 +712,15 @@ Write line numbers for errors\&. Disable this with
 Enable or disable
 LOCAL
 capability for
-LOAD DATA INFILE\&. With no value, the option enables
+LOAD DATA INFILE\&. For
+\fBmysql\fR, this capability is disabled by default\&. With no value, the option enables
 LOCAL\&. The option may be given as
 \fB\-\-local\-infile=0\fR
 or
 \fB\-\-local\-infile=1\fR
 to explicitly disable or enable
-LOCAL\&. Enabling
-LOCAL
-has no effect if the server does not also support it\&.
+LOCAL\&. Enabling local data loading has no effect if the server does not also support it; see
+Section\ \&6.1.6, \(lqSecurity Issues with LOAD DATA LOCAL\(rq
 .RE
 .sp
 .RS 4
@@ -1201,12 +1228,9 @@ The server sends the public key to the client as needed, so it is not necessary
 For additional discussion regarding use of the
 sha256_password
 plugin, including how to get the RSA public key, see
-Section\ \&6.5.1.4, \(lqThe SHA-256 Authentication Plugin\(rq\&.
+Section\ \&6.5.1.4, \(lqSHA-256 Pluggable Authentication\(rq\&.
 .sp
-This option is available only if MySQL was built using OpenSSL\&. It was added in MySQL 5\&.6\&.6 under the name
-\fB\-\-server\-public\-key\fR
-and renamed in 5\&.6\&.7 to
-\fB\-\-server\-public\-key\-path\fR\&.
+This option is available only if MySQL was built using OpenSSL\&.
 .RE
 .sp
 .RS 4
@@ -1744,11 +1768,11 @@ delimiter \fIstr\fR,
 .sp
 Change the string that
 \fBmysql\fR
-interprets as the separator between SQL statements\&. The default is the semicolon character (\(lq;\(rq)\&.
+interprets as the separator between SQL statements\&. The default is the semicolon character (;)\&.
 .sp
 The delimiter string can be specified as an unquoted or quoted argument on the
 delimiter
-command line\&. Quoting can be done with either single quote (\*(Aq), double quote ("), or backtick (`) characters\&. To include a quote within a quoted string, either quote the string with a different quote character or escape the quote with a backslash (\(lq\e\(rq) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MySQL\&. For an unquoted argument, the delimiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&.
+command line\&. Quoting can be done with either single quote (\*(Aq), double quote ("), or backtick (`) characters\&. To include a quote within a quoted string, either quote the string with a different quote character or escape the quote with a backslash (\e) character\&. Backslash should be avoided outside of quoted strings because it is the escape character for MySQL\&. For an unquoted argument, the delimiter is read up to the first space or end of line\&. For a quoted argument, the delimiter is read up to the matching quote on the line\&.
 .sp
 \fBmysql\fR
 interprets instances of the delimiter string as a statement delimiter anywhere it occurs, except within quoted strings\&. Be careful about defining a delimiter that might occur within other words\&. For example, if you define the delimiter as
@@ -1764,8 +1788,8 @@ X\&.
 When the delimiter recognized by
 \fBmysql\fR
 is set to something other than the default of
-\(lq;\(rq, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets
-\(lq;\(rq
+;, instances of that character are sent to the server without interpretation\&. However, the server itself still interprets
+;
 as a statement delimiter and processes statements accordingly\&. This behavior on the server side comes into play for multiple\-statement execution (see
 Section\ \&23.8.17, \(lqC API Support for Multiple Statement Execution\(rq), and for parsing the body of stored procedures and functions, triggers, and events (see
 Section\ \&20.1, \(lqDefining Stored Programs\(rq)\&.
@@ -2445,7 +2469,7 @@ T}
 T{
 \e\e
 T}:T{
-A literal \(lq\e\(rq backslash character
+A literal \e backslash character
 T}
 T{
 \e\fIx\fR
@@ -2820,7 +2844,7 @@ command,
 uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. The proper operation of this command requires that the help tables in the
 mysql
 database be initialized with help topic information (see
-Section\ \&5.1.9, \(lqServer-Side Help\(rq)\&.
+Section\ \&5.1.10, \(lqServer-Side Help\(rq)\&.
 .PP
 If there is no match for the search string, the search fails:
 .sp
@@ -2917,9 +2941,9 @@ mysql> SHOW BINARY LOGS;
 .\}
 .PP
 The search string can contain the wildcard characters
-\(lq%\(rq
+%
 and
-\(lq_\(rq\&. These have the same meaning as for pattern\-matching operations performed with the
+_\&. These have the same meaning as for pattern\-matching operations performed with the
 LIKE
 operator\&. For example,
 HELP rep%
@@ -3260,7 +3284,7 @@ SET sql_safe_updates=1, sql_select_limit=1000, max_join_size=1000000;
 .\}
 .PP
 See
-Section\ \&5.1.4, \(lqServer System Variables\(rq\&.
+Section\ \&5.1.5, \(lqServer System Variables\(rq\&.
 .PP
 The
 SET
@@ -3386,7 +3410,7 @@ Section\ \&23.8.16, \(lqControlling Automatic Reconnection Behavior\(rq\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index ee23019f5829179818790b4b150faae9849a742b..fd61f6e014570cecde27e9cfed70b6e974e9aec3 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql.server\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL\&.SERVER\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL\&.SERVER\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -34,13 +34,21 @@ mysql.server \- MySQL server startup script
 \fBmysql {start|stop}\fR
 .SH "DESCRIPTION"
 .PP
-MySQL distributions on Unix include a script named
-\fBmysql\&.server\fR, which starts the server using
-\fBmysqld_safe\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the OS X Startup Item for MySQL\&.
+MySQL distributions on Unix and Unix\-like system include a script named
+\fBmysql\&.server\fR, which starts the MySQL server using
+\fBmysqld_safe\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the macOS Startup Item for MySQL\&.
+.PP
+\fBmysql\&.server\fR
+is the script name as used within the MySQL source tree\&. The installed name might be different; for example,
+\fBmysqld\fR
+or
+\fBmysql\fR\&. In the following discussion, adjust the name
+\fBmysql\&.server\fR
+as appropriate for your system\&.
 .PP
 To start or stop the server manually using the
 \fBmysql\&.server\fR
-script, invoke it with
+script, invoke it from the command line with
 start
 or
 stop
@@ -57,21 +65,20 @@ shell> \fBmysql\&.server stop\fR
 .RE
 .\}
 .PP
-Before
 \fBmysql\&.server\fR
-starts the server, it changes location to the MySQL installation directory, and then invokes
+changes location to the MySQL installation directory, then invokes
 \fBmysqld_safe\fR\&. To run the server as some specific user, add an appropriate
 user
 option to the
 [mysqld]
-group of the
+group of the global
 /etc/my\&.cnf
 option file, as shown later in this section\&. (It is possible that you must edit
 \fBmysql\&.server\fR
 if you\*(Aqve installed a binary distribution of MySQL in a nonstandard location\&. Modify it to change location into the proper directory before it runs
 \fBmysqld_safe\fR\&. If you do this, your modified version of
 \fBmysql\&.server\fR
-may be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall\&.)
+may be overwritten if you upgrade MySQL in the future; make a copy of your edited version that you can reinstall\&.)
 .PP
 \fBmysql\&.server stop\fR
 stops the server by sending a signal to it\&. You can also stop the server manually by executing
@@ -79,27 +86,44 @@ stops the server by sending a signal to it\&. You can also stop the server manua
 .PP
 To start and stop MySQL automatically on your server, you must add start and stop commands to the appropriate places in your
 /etc/rc*
-files\&.
-.PP
+files:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 If you use the Linux server RPM package (MySQL\-server\-\fIVERSION\fR\&.rpm), or a native Linux package installation, the
 \fBmysql\&.server\fR
 script may be installed in the
 /etc/init\&.d
 directory with the name
+mysqld
+or
 mysql\&. See
 Section\ \&2.5.5, \(lqInstalling MySQL on Linux Using RPM Packages from Oracle\(rq, for more information on the Linux RPM packages\&.
-.PP
-Some vendors provide RPM packages that install a startup script under a different name such as
-\fBmysqld\fR\&.
-.PP
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 If you install MySQL from a source distribution or using a binary distribution format that does not install
 \fBmysql\&.server\fR
-automatically, you can install it manually\&. The script can be found in the
+automatically, you can install the script manually\&. It can be found in the
 support\-files
-directory under the MySQL installation directory or in a MySQL source tree\&. Copy it to the
+directory under the MySQL installation directory or in a MySQL source tree\&. Copy the script to the
 /etc/init\&.d
 directory with the name
-\fBmysql\fR, and then make it executable:
+\fBmysql\fR
+and make it executable:
 .sp
 .if n \{\
 .RS 4
@@ -112,40 +136,6 @@ shell> \fBchmod +x /etc/init\&.d/mysql\fR
 .RE
 .\}
 .sp
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-.PP
-Older Red Hat systems use the
-/etc/rc\&.d/init\&.d
-directory rather than
-/etc/init\&.d\&. Adjust the preceding commands accordingly\&. Alternatively, first create
-/etc/init\&.d
-as a symbolic link that points to
-/etc/rc\&.d/init\&.d:
-.sp .5v
-.RE
-.sp
-.if n \{\
-.RS 4
-.\}
-.nf
-shell> \fBcd /etc\fR
-shell> \fBln \-s rc\&.d/init\&.d \&.\fR
-.fi
-.if n \{\
-.RE
-.\}
-.PP
 After installing the script, the commands needed to activate it to run at system startup depend on your operating system\&. On Linux, you can use
 \fBchkconfig\fR:
 .sp
@@ -158,7 +148,7 @@ shell> \fBchkconfig \-\-add mysql\fR
 .if n \{\
 .RE
 .\}
-.PP
+.sp
 On some Linux systems, the following command also seems to be necessary to fully enable the
 \fBmysql\fR
 script:
@@ -172,18 +162,36 @@ shell> \fBchkconfig \-\-level 345 mysql on\fR
 .if n \{\
 .RE
 .\}
-.PP
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 On FreeBSD, startup scripts generally should go in
-/usr/local/etc/rc\&.d/\&. The
-rc(8)
-manual page states that scripts in this directory are executed only if their base name matches the
-*\&.sh
-shell file name pattern\&. Any other files or directories present within the directory are silently ignored\&. In other words, on FreeBSD, you should install the
+/usr/local/etc/rc\&.d/\&. Install the
 mysql\&.server
 script as
 /usr/local/etc/rc\&.d/mysql\&.server\&.sh
-to enable automatic startup\&.
-.PP
+to enable automatic startup\&. The
+rc(8)
+manual page states that scripts in this directory are executed only if their base name matches the
+*\&.sh
+shell file name pattern\&. Any other files or directories present within the directory are silently ignored\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 As an alternative to the preceding setup, some operating systems also use
 /etc/rc\&.local
 or
@@ -199,8 +207,18 @@ to start additional services on startup\&. To start up MySQL using this method,
 .if n \{\
 .RE
 .\}
-.PP
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 For other systems, consult your operating system documentation to see how to install startup scripts\&.
+.RE
 .PP
 \fBmysql\&.server\fR
 reads options from the
@@ -217,7 +235,7 @@ You can add options for
 in a global
 /etc/my\&.cnf
 file\&. A typical
-/etc/my\&.cnf
+my\&.cnf
 file might look like this:
 .sp
 .if n \{\
@@ -238,7 +256,7 @@ basedir=/usr/local/mysql
 .PP
 The
 \fBmysql\&.server\fR
-script supports the following options\&. If specified, they
+script supports the options shown in the following table\&. If specified, they
 \fImust\fR
 be placed in an option file, not on the command line\&.
 \fBmysql\&.server\fR
@@ -248,6 +266,57 @@ and
 stop
 as command\-line arguments\&.
 .sp
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.B Table\ \&4.3.\ \&mysql\&.server Option\-File Options
+.TS
+allbox tab(:);
+lB lB lB.
+T{
+Option Name
+T}:T{
+Description
+T}:T{
+Type
+T}
+.T&
+l l l
+l l l
+l l l
+l l l.
+T{
+basedir
+T}:T{
+Path to MySQL installation directory
+T}:T{
+directory name
+T}
+T{
+datadir
+T}:T{
+Path to MySQL data directory
+T}:T{
+directory name
+T}
+T{
+pid\-file
+T}:T{
+File in which server should write its process ID
+T}:T{
+file name
+T}
+T{
+service\-startup\-timeout
+T}:T{
+How long to wait for server startup
+T}:T{
+integer
+T}
+.TE
+.sp 1
+.sp
 .RS 4
 .ie n \{\
 \h'-04'\(bu\h'+03'\c
@@ -256,7 +325,7 @@ as command\-line arguments\&.
 .sp -1
 .IP \(bu 2.3
 .\}
-\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
+\fBbasedir=\fR\fB\fIdir_name\fR\fR
 .sp
 The path to the MySQL installation directory\&.
 .RE
@@ -269,7 +338,7 @@ The path to the MySQL installation directory\&.
 .sp -1
 .IP \(bu 2.3
 .\}
-\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
+\fBdatadir=\fR\fB\fIdir_name\fR\fR
 .sp
 The path to the MySQL data directory\&.
 .RE
@@ -282,7 +351,7 @@ The path to the MySQL data directory\&.
 .sp -1
 .IP \(bu 2.3
 .\}
-\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
+\fBpid\-file=\fR\fB\fIfile_name\fR\fR
 .sp
 The path name of the file in which the server should write its process ID\&.
 .sp
@@ -301,7 +370,7 @@ option file group but not the
 [mysqld_safe]
 group, you can ensure that
 \fBmysqld_safe\fR
-gets the same value when invoke using
+gets the same value when invoked from
 \fBmysql\&.server\fR
 as when invoked manually by putting the same
 pid\-file
@@ -320,7 +389,7 @@ groups\&.
 .sp -1
 .IP \(bu 2.3
 .\}
-\fB\-\-service\-startup\-timeout=\fR\fB\fIseconds\fR\fR
+\fBservice\-startup\-timeout=\fR\fB\fIseconds\fR\fR
 .sp
 How long in seconds to wait for confirmation of server startup\&. If the server does not start within this time,
 \fBmysql\&.server\fR
@@ -329,7 +398,7 @@ exits with an error\&. The default value is 900\&. A value of 0 means not to wai
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 25fa050ef181bd2ba8cf230327aed25195731f41..49cf9fc5a93d9928602efd60288276f0afa388b8 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_client_test\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/01/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_CLIENT_TEST" "1" "08/25/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL_CLIENT_TEST" "1" "06/01/2017" "MySQL" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -43,8 +43,11 @@ The
 program is used for testing aspects of the MySQL client API that cannot be tested using
 \fBmysqltest\fR
 and its test language\&.
+\fBmysql_client_test\fR
+is run as part of the test suite\&.
+.PP
 \fBmysql_client_test_embedded\fR
-is similar but used for testing the embedded server\&. Both programs are run as part of the test suite\&.
+is similar but is used for testing the embedded server\&. This program is available only prior to MySQL 8\&.0\&.
 .PP
 The source code for the programs can be found in in
 tests/mysql_client_test\&.c
@@ -208,7 +211,7 @@ The TCP/IP port number to use for the connection\&.
 \fB\-\-server\-arg=\fR\fB\fIarg\fR\fR,
 \fB\-A \fR\fB\fIarg\fR\fR
 .sp
-Argument to send to the embedded server\&.
+Argument to send to the embedded server\&. This option was removed in MySQL 8\&.0\&.
 .RE
 .sp
 .RS 4
@@ -303,7 +306,7 @@ mysql\-test/var\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 926f47c3b4ff0cb82b86b57331a3198d70547eec..6c9172d5f816e1cb972a2be9ea08b3592e238551 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_config\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_CONFIG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -93,9 +93,11 @@ Compiler options to find MySQL include files\&.
 .IP \(bu 2.3
 .\}
 \fB\-\-libmysqld\-libs\fR,
+\fB\-\-embedded\-libs\fR,
 \fB\-\-embedded\fR
 .sp
-Libraries and options required to link with the MySQL embedded server\&.
+Libraries and options required to link with
+libmysqld, the MySQL embedded server\&.
 .RE
 .sp
 .RS 4
@@ -251,7 +253,7 @@ gcc \-o progname progname\&.o `mysql_config \-\-libs`
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index a225cced5f4bd8757e6e781a12476ac988052344..e2d08f00d0f307b201227450ce676887b8d6fd0f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_config_editor\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_CONFIG_EDIT" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG_EDIT" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -1064,7 +1064,7 @@ to disable it\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index faf26db596ef5eb76e7e5fca1a6fb5726728f2e3..a2372ad674a17d0cd738180a976ebcbc67417faf 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_convert_table_format\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_CONVERT_TAB" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONVERT_TAB" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -59,7 +59,7 @@ DBI
 and
 DBD::mysql
 Perl modules be installed (see
-Section\ \&2.13, \(lqPerl Installation Notes\(rq)\&.
+Section\ \&2.12, \(lqPerl Installation Notes\(rq)\&.
 .PP
 Invoke
 \fBmysql_convert_table_format\fR
@@ -131,7 +131,7 @@ Connect to the MySQL server on the given host\&.
 .\}
 \fB\-\-password=\fR\fB\fIpassword\fR\fR
 .sp
-The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&.
+The password to use when connecting to the server\&. The password value is not optional for this option, unlike for other MySQL programs\&.
 .sp
 Specifying a password on the command line should be considered insecure\&. See
 Section\ \&6.1.2.1, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
@@ -220,7 +220,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index fa34538b92df16cef2f6b03663a7f52c3d177a4b..3b081dcac5201b7296ff9baeed48d0881cab7991 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_find_rows\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_FIND_ROWS\F" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_FIND_ROWS\F" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -165,7 +165,7 @@ Start output from this row\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 3fa5d65e76edef99f8cf02fadce280c4bad9f9f9..9d5c4a0083ff73b8f9221f8e04b1aaf1c984062b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_fix_extensions\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_FIX_EXTENSI" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_FIX_EXTENSI" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -85,7 +85,7 @@ shell> \fBmysql_fix_extensions \fR\fB\fIdata_dir\fR\fR
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 8b2462658a7523c6f794b02344ddef91b94f9748..5385d00c6b426d7a0add4efafe3fd81cf3ed4edb 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_install_db\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_INSTALL_DB\" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_INSTALL_DB\" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -63,7 +63,7 @@ With one exception, the settings in the default option file are commented and ha
 sql_mode
 system variable to
 NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES\&. This setting produces a server configuration that results in errors rather than warnings for bad data in operations that modify transactional tables\&. See
-Section\ \&5.1.7, \(lqServer SQL Modes\(rq\&.
+Section\ \&5.1.8, \(lqServer SQL Modes\(rq\&.
 .PP
 To invoke
 \fBmysql_install_db\fR, use the following syntax:
@@ -549,7 +549,7 @@ For internal use\&. This option is used for creating Windows distributions\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index a458b0aabb74c950a8ff042a8bb4a92eeda46ba3..33b7d22c507267176ad677ae140f2b79fa5cdbe4 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_plugin\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_PLUGIN\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_PLUGIN\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -347,7 +347,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index bec33429c15301f867220346b52c5de36af38e7e..bf6309547762432044e565c42c3e955dc9d02006 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_secure_installation\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_SECURE_INST" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_SECURE_INST" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -109,7 +109,7 @@ When executed, the script prompts you to determine which actions to perform\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 299e04061ec08f0f47f63b3622a78f320d14b4e0..50ce03a97dce7294ddd8d636209a613ac503a60f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_setpermission\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_SETPERMISSI" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_SETPERMISSI" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -58,7 +58,7 @@ DBI
 and
 DBD::mysql
 Perl modules be installed (see
-Section\ \&2.13, \(lqPerl Installation Notes\(rq)\&.
+Section\ \&2.12, \(lqPerl Installation Notes\(rq)\&.
 .PP
 Invoke
 \fBmysql_setpermission\fR
@@ -127,7 +127,7 @@ Connect to the MySQL server on the given host\&.
 .\}
 \fB\-\-password=\fR\fB\fIpassword\fR\fR
 .sp
-The password to use when connecting to the server\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&.
+The password to use when connecting to the server\&. The password value is not optional for this option, unlike for other MySQL programs\&.
 .sp
 Specifying a password on the command line should be considered insecure\&. See
 Section\ \&6.1.2.1, \(lqEnd-User Guidelines for Password Security\(rq\&. You can use an option file to avoid giving the password on the command line\&.
@@ -175,7 +175,7 @@ The MySQL user name to use when connecting to the server\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 08199e2f86052a96eb72b8689fe8a14626678468..fd32cf5c1111d2c0cbbfae8cf9722b271d3d6532 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_tzinfo_to_sql\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_TZINFO_TO_S" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_TZINFO_TO_S" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -120,7 +120,7 @@ After running
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 174c720236fa718434ff2218e363cde2d2cf33d9..8f0a96e3c7f97ccd2fa8886370276ef796251776 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_upgrade\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_UPGRADE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_UPGRADE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -42,7 +42,7 @@ also upgrades the system tables so that you can take advantage of new privileges
 If
 \fBmysql_upgrade\fR
 finds that a table has a possible incompatibility, it performs a table check and, if problems are found, attempts a table repair\&. If the table cannot be repaired, see
-Section\ \&2.11.4, \(lqRebuilding or Repairing Tables or Indexes\(rq
+Section\ \&2.11.3, \(lqRebuilding or Repairing Tables or Indexes\(rq
 for manual table repair strategies\&.
 .PP
 You should execute
@@ -241,7 +241,7 @@ option\&.
 .PP
 \fBmysql_upgrade\fR
 does not upgrade the contents of the help tables\&. For upgrade instructions, see
-Section\ \&5.1.9, \(lqServer-Side Help\(rq\&.
+Section\ \&5.1.10, \(lqServer-Side Help\(rq\&.
 .PP
 By default,
 \fBmysql_upgrade\fR
@@ -819,7 +819,7 @@ Section\ \&17.1.3.4, \(lqRestrictions on Replication with GTIDs\(rq, for more in
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 43c115c4e1137efcb145eaa4206caf45e66dc6de..ac55609b1930962aa30e30d17a307007ff644ea5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_waitpid\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_WAITPID\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_WAITPID\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -124,7 +124,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index f63098fc7409aae1568d27c4bd44937e4f4a1f75..8433f441019058e61d84e0b4f72ed2a9b5919ca3 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysql_zap\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQL_ZAP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_ZAP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -126,7 +126,7 @@ Test mode\&. Display information about each process but do not kill it\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 8e62209209810d806402d8e96b4b1ff201975607..d2df37febf7cc0128eeb0bcb6e533d3f088591d1 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlaccess\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLACCESS\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLACCESS\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -51,7 +51,7 @@ This utility is deprecated in MySQL 5\&.6\&.17 and removed in MySQL 5\&.7
 .RE
 .PP
 \fBmysqlaccess\fR
-is a diagnostic tool that Yves Carlier has provided for the MySQL distribution\&. It checks the access privileges for a host name, user name, and database combination\&. Note that
+is a diagnostic tool that Yves Carlier has provided for the MySQL distribution\&. It checks the access privileges for a host name, user name, and database combination\&.
 \fBmysqlaccess\fR
 checks access using only the
 user
@@ -77,8 +77,45 @@ shell> \fBmysqlaccess [\fR\fB\fIhost_name\fR\fR\fB [\fR\fB\fIuser_name\fR\fR\fB
 .RE
 .\}
 .PP
+When
 \fBmysqlaccess\fR
-supports the following options\&.
+runs, it loads and executes the contents of its configuration file,
+mysqlaccess\&.conf\&.
+\fBmysqlaccess\fR
+looks for the configuration file in these locations, in order:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+The directory named by the
+\fBSYSCONFDIR\fR
+option to
+\fBCMake\fR
+when MySQL was built\&. By default, this is the
+etc
+directory located under the compiled\-in installation directory\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+The
+/etc
+directory\&.
+.RE
+.PP
+\fBmysqlaccess\fR
+supports the options shown in the following table\&.
 .sp
 .RS 4
 .ie n \{\
@@ -407,7 +444,7 @@ error will occur when you run
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 1a1ff339ca90ac10558931cc398afd3742d97dce..b384b339cd97713c5c5b4cc5e50a544916522fe8 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqladmin\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLADMIN\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLADMIN\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -738,6 +738,10 @@ is interpreted relative to the current directory if given as a relative path nam
 Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
 \fIfile_name\fR
 is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
+.sp
+Exception: Even with
+\fB\-\-defaults\-file\fR, client programs read
+\&.mylogin\&.cnf\&.
 .RE
 .sp
 .RS 4
@@ -781,7 +785,7 @@ groups\&.
 Enable the
 mysql_clear_password
 cleartext authentication plugin\&. (See
-Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
 .RE
 .sp
 .RS 4
@@ -1226,7 +1230,7 @@ The maximum number of seconds to wait for server shutdown\&. The default value i
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index d941d5983071ad8e32e1a80f432bd78facbf1a1d..24ff71341eb3b20a9f2bb6caaee9c4d1553fc420 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlbinlog\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLBINLOG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLBINLOG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -610,6 +610,10 @@ is interpreted relative to the current directory if given as a relative path nam
 Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
 \fIfile_name\fR
 is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
+.sp
+Exception: Even with
+\fB\-\-defaults\-file\fR, client programs read
+\&.mylogin\&.cnf\&.
 .RE
 .sp
 .RS 4
@@ -1134,7 +1138,7 @@ set to 32 enables this data to be seen\&.
 .sp
 This option is supported only by the versions of
 \fBmysqlbinlog\fR
-supplied with the MySQL Cluster distribution, or built from the MySQL Cluster sources\&.
+supplied with the NDB Cluster distribution, or built from the NDB Cluster sources\&.
 .RE
 .sp
 .RS 4
@@ -1236,6 +1240,22 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi
 .sp -1
 .IP \(bu 2.3
 .\}
+\fB\-\-ssl*\fR
+.sp
+Options that begin with
+\fB\-\-ssl\fR
+specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fB\-\-start\-datetime=\fR\fB\fIdatetime\fR\fR
 .sp
 Start reading the binary log at the first event having a timestamp equal to or later than the
@@ -1413,7 +1433,7 @@ The MySQL user name to use when connecting to a remote server\&.
 \fB\-\-verbose\fR,
 \fB\-v\fR
 .sp
-Reconstruct row events and display them as commented SQL statements\&. If this option is given twice, the output includes comments to indicate column data types and some metadata\&.
+Reconstruct row events and display them as commented SQL statements\&. If this option is given twice (by passing in either "\-vv" or "\-\-verbose \-\-verbose"), the output includes comments to indicate column data types and some metadata, and row query log events if so configured\&.
 .sp
 For examples that show the effect of
 \fB\-\-base64\-output\fR
@@ -2882,7 +2902,7 @@ specifies a nonzero server ID\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 583fb3f09314ffab664f0cee5392f49fb5948fad..b62abf10f3736c438fbf3c3ecf354f5a3fdd8ef5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlbug\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLBUG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLBUG\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -41,7 +41,7 @@ The normal way to report bugs is to visit
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 1af8de8dba1ce0eb90ae1524387f35a66842f159..0b1332ea5bae2b389b4a4ab53770cdd22d13ac2b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlcheck\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLCHECK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLCHECK\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -105,7 +105,7 @@ note     : The storage engine for the table doesn\*(Aqt support check
 If
 \fBmysqlcheck\fR
 is unable to repair a table, see
-Section\ \&2.11.4, \(lqRebuilding or Repairing Tables or Indexes\(rq
+Section\ \&2.11.3, \(lqRebuilding or Repairing Tables or Indexes\(rq
 for manual table repair strategies\&. This will be the case, for example, for
 InnoDB
 tables, which can be checked with
@@ -233,7 +233,7 @@ option and naming all the databases on the command line, except that the
 INFORMATION_SCHEMA
 and
 performace_schema
-databases are not dumped\&. They can be dumped by explicitly naming them with the
+databases are not checked\&. They can be checked by explicitly naming them with the
 \fB\-\-databases\fR
 option\&.
 .RE
@@ -385,16 +385,6 @@ Compress all information sent between the client and the server if both support
 Process all tables in the named databases\&. Normally,
 \fBmysqlcheck\fR
 treats the first name argument on the command line as a database name and any following names as table names\&. With this option, it treats all name arguments as database names\&.
-.sp
-This option may be used to dump the
-INFORMATION_SCHEMA
-and
-performace_schema
-databases, which normally are not dumped even with the
-\fB\-\-all\-databases\fR
-option\&. (Also use the
-\fB\-\-skip\-lock\-tables\fR
-option\&.)
 .RE
 .sp
 .RS 4
@@ -485,6 +475,10 @@ is interpreted relative to the current directory if given as a relative path nam
 Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
 \fIfile_name\fR
 is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
+.sp
+Exception: Even with
+\fB\-\-defaults\-file\fR, client programs read
+\&.mylogin\&.cnf\&.
 .RE
 .sp
 .RS 4
@@ -560,7 +554,7 @@ This option was added in MySQL 5\&.6\&.2\&.
 Enable the
 mysql_clear_password
 cleartext authentication plugin\&. (See
-Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.)
 .sp
 This option was added in MySQL 5\&.6\&.28\&.
 .RE
@@ -1068,7 +1062,7 @@ when these statements should not be sent to replication slaves or run when using
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 5d715687d6003d03c12813336ee9e998cbd99af3..b491a96098626c9ef25c6e24691cf6a1df681e3e 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqld\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLD\FR" "8" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -60,7 +60,7 @@ Chapter\ \&2, Installing and Upgrading MySQL\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index cc86616658ee07fa618a54d48c9b0f5f6b6590d9..f491a450a305ce881e1977bbdf55343816653507 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqld_multi\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLD_MULTI\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD_MULTI\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -435,16 +435,6 @@ what you are doing\&. Starting multiple servers with the same data directory doe
 \fInot\fR
 give you extra performance in a threaded system\&. See
 Section\ \&5.6, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
-.RE
-.sp
-.RS 4
-.ie n \{\
-\h'-04'\(bu\h'+03'\c
-.\}
-.el \{\
-.sp -1
-.IP \(bu 2.3
-.\}
 .if n \{\
 .sp
 .\}
@@ -658,7 +648,7 @@ Section\ \&4.2.6, \(lqUsing Option Files\(rq\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index af424af2664ad53be2c9ff13ae80429f17cea61a..6fdf0d349e3843b0250ae59fa3fbaaf5df247e0b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqld_safe\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLD_SAFE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD_SAFE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -58,7 +58,7 @@ Many of the options to
 \fBmysqld_safe\fR
 are the same as the options to
 \fBmysqld\fR\&. See
-Section\ \&5.1.3, \(lqServer Command Options\(rq\&.
+Section\ \&5.1.4, \(lqServer Command Options\(rq\&.
 .PP
 Options unknown to
 \fBmysqld_safe\fR
@@ -169,7 +169,12 @@ The path to the data directory\&.
 .\}
 \fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
 .sp
-The name of an option file to be read in addition to the usual option files\&. This must be the first option on the command line if it is used\&. If the file does not exist or is otherwise inaccessible, the server will exit with an error\&.
+Read this option file in addition to the usual option files\&. If the file does not exist or is otherwise inaccessible, the server will exit with an error\&.
+\fIfile_name\fR
+is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. This must be the first option on the command line if it is used\&.
+.sp
+For additional information about this option, see
+Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
 .RE
 .sp
 .RS 4
@@ -182,7 +187,12 @@ The name of an option file to be read in addition to the usual option files\&. T
 .\}
 \fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
 .sp
-The name of an option file to be read instead of the usual option files\&. This must be the first option on the command line if it is used\&.
+Use only the given option file\&. If the file does not exist or is otherwise inaccessible, the server will exit with an error\&.
+\fIfile_name\fR
+is interpreted relative to the current directory if given as a relative path name rather than a full path name\&. This must be the first option on the command line if it is used\&.
+.sp
+For additional information about this option, see
+Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
 .RE
 .sp
 .RS 4
@@ -198,6 +208,8 @@ The name of an option file to be read instead of the usual option files\&. This
 If
 \fBmysqld_safe\fR
 cannot find the server, use this option to indicate the path name to the directory where the server is located\&.
+.sp
+As of MySQL 5\&.6\&.35, this option is accepted only on the command line, not in option files\&.
 .RE
 .sp
 .RS 4
@@ -386,7 +398,7 @@ cannot find the server, use the
 \fB\-\-ledir\fR
 option to indicate the path name to the directory where the server is located\&.
 .sp
-As of MySQL 5\&.6\&.33, this option can be given only on the command line and not in an option file\&.
+As of MySQL 5\&.6\&.33, this option is accepted only on the command line, not in option files\&.
 .RE
 .sp
 .RS 4
@@ -419,7 +431,7 @@ in the
 ledir
 directory\&.
 .sp
-As of MySQL 5\&.6\&.33, this option can be given only on the command line and not in an option file\&.
+As of MySQL 5\&.6\&.33, this option is accepted only on the command line, not in option files\&.
 .RE
 .sp
 .RS 4
@@ -447,7 +459,12 @@ program to set the server\*(Aqs scheduling priority to the given value\&.
 .\}
 \fB\-\-no\-defaults\fR
 .sp
-Do not read any option files\&. This must be the first option on the command line if it is used\&.
+Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
+\fB\-\-no\-defaults\fR
+can be used to prevent them from being read\&. This must be the first option on the command line if it is used\&.
+.sp
+For additional information about this option, see
+Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&.
 .RE
 .sp
 .RS 4
@@ -495,7 +512,9 @@ for this to function properly\&.
 .\}
 \fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
 .sp
-The path name of the process ID file\&.
+The path name that
+\fBmysqld\fR
+should use for its process ID file\&.
 .RE
 .sp
 .RS 4
@@ -828,7 +847,7 @@ stderr\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 6088a23c73ad34760bab0e97e57c581ca636e999..d4055a7c4435d4586d303eade6376e93f4af29be 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqldump\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLDUMP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLDUMP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -277,7 +277,7 @@ shell> \fBmysqldump [options] > dump\&.sql\fR
 .\}
 .PP
 However, UTF\-16 is not permitted as a connection character set (see
-Section\ \&10.1.5, \(lqConnection Character Sets and Collations\(rq), so the dump file will not load correctly\&. To work around this issue, use the
+Section\ \&10.1.4, \(lqConnection Character Sets and Collations\(rq), so the dump file will not load correctly\&. To work around this issue, use the
 \fB\-\-result\-file\fR
 option, which creates the output in ASCII format:
 .sp
@@ -462,7 +462,7 @@ Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&.
 Enable the
 mysql_clear_password
 cleartext authentication plugin\&. (See
-Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.)
 .sp
 This option was added in MySQL 5\&.6\&.28\&.
 .RE
@@ -752,6 +752,10 @@ is interpreted relative to the current directory if given as a relative path nam
 Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
 \fIfile_name\fR
 is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
+.sp
+Exception: Even with
+\fB\-\-defaults\-file\fR, client programs read
+\&.mylogin\&.cnf\&.
 .RE
 .sp
 .RS 4
@@ -895,7 +899,7 @@ statement\&.
 Adds to a table dump all SQL statements needed to create any tablespaces used by an
 NDB
 table\&. This information is not otherwise included in the output from
-\fBmysqldump\fR\&. This option is currently relevant only to MySQL Cluster tables\&.
+\fBmysqldump\fR\&. This option is currently relevant only to NDB Cluster tables\&.
 .RE
 .sp
 .RS 4
@@ -1559,7 +1563,7 @@ maxdb,
 no_key_options,
 no_table_options, or
 no_field_options\&. To use several values, separate them by commas\&. These values have the same meaning as the corresponding options for setting the server SQL mode\&. See
-Section\ \&5.1.7, \(lqServer SQL Modes\(rq\&.
+Section\ \&5.1.8, \(lqServer SQL Modes\(rq\&.
 .sp
 This option does not guarantee compatibility with other servers\&. It only enables those SQL mode values that are currently available for making dump output more compatible\&. For example,
 \fB\-\-compatible=oracle\fR
@@ -1673,11 +1677,11 @@ Section\ \&13.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
 \fB\-Q\fR
 .sp
 Quote identifiers (such as database, table, and column names) within
-\(lq`\(rq
+`
 characters\&. If the
 ANSI_QUOTES
 SQL mode is enabled, identifiers are quoted within
-\(lq"\(rq
+"
 characters\&. This option is enabled by default\&. It can be disabled with
 \fB\-\-skip\-quote\-names\fR, but this option should be given after any option such as
 \fB\-\-compatible\fR
@@ -1699,9 +1703,9 @@ that may enable
 Direct output to the named file\&. The result file is created and its previous contents overwritten, even if an error occurs while generating the dump\&.
 .sp
 This option should be used on Windows to prevent newline
-\(lq\en\(rq
+\en
 characters from being converted to
-\(lq\er\en\(rq
+\er\en
 carriage return/newline sequences\&.
 .RE
 .sp
@@ -1741,9 +1745,9 @@ This option should be used only when
 \fBmysqldump\fR
 is run on the same machine as the
 \fBmysqld\fR
-server\&. Because the server creates files
+server\&. Because the server creates
 *\&.txt
-file in the directory that you specify, the directory must be writable by the server and the MySQL account that you use must have the
+files in the directory that you specify, the directory must be writable by the server and the MySQL account that you use must have the
 FILE
 privilege\&. Because
 \fBmysqldump\fR
@@ -1946,6 +1950,16 @@ CREATE DATABASE
 and
 USE
 statements are included in the output before each new database\&.
+.sp
+This option may be used to dump the
+INFORMATION_SCHEMA
+and
+performace_schema
+databases, which normally are not dumped even with the
+\fB\-\-all\-databases\fR
+option\&. (Also use the
+\fB\-\-skip\-lock\-tables\fR
+option\&.)
 .RE
 .sp
 .RS 4
@@ -2017,7 +2031,7 @@ statement for the table (for example, to create an empty copy of the table by lo
 \fB\-\-routines\fR,
 \fB\-R\fR
 .sp
-Include stored routines (procedures and functions) for the dumped databases in the output\&. Use of this option requires the
+Include stored routines (procedures and functions) for the dumped databases in the output\&. This option requires the
 SELECT
 privilege for the
 mysql\&.proc
@@ -2279,7 +2293,7 @@ LOCK TABLES
 and
 UNLOCK TABLES
 statements\&. This results in faster inserts when the dump file is reloaded\&. See
-Section\ \&8.2.2.1, \(lqSpeed of INSERT Statements\(rq\&.
+Section\ \&8.2.4.1, \(lqOptimizing INSERT Statements\(rq\&.
 .RE
 .sp
 .RS 4
@@ -2301,7 +2315,8 @@ option, the logs are flushed
 \fIfor each database dumped\fR\&. The exception is when using
 \fB\-\-lock\-all\-tables\fR,
 \fB\-\-master\-data\fR, or
-\fB\-\-single\-transaction\fR: In this case, the logs are flushed only once, corresponding to the moment that all tables are locked\&. If you want your dump and the log flush to happen at exactly the same moment, you should use
+\fB\-\-single\-transaction\fR: In this case, the logs are flushed only once, corresponding to the moment that all tables are locked by
+FLUSH TABLES WITH READ LOCK\&. If you want your dump and the log flush to happen at exactly the same moment, you should use
 \fB\-\-flush\-logs\fR
 together with
 \fB\-\-lock\-all\-tables\fR,
@@ -2717,7 +2732,7 @@ option\&. Also, use the
 option\&.
 .PP
 \fBmysqldump\fR
-does not dump the MySQL Cluster
+does not dump the NDB Cluster
 ndbinfo
 information database\&.
 .PP
@@ -2737,7 +2752,7 @@ for a workaround\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 6cdc05b8ce1038f985018fc26b2d5121002993dd..51babb5e819241d00086b86cd4785d015c745c67 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqldumpslow\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLDUMPSLOW\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLDUMPSLOW\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -316,7 +316,7 @@ Count: 3  Time=2\&.13s (6s)  Lock=0\&.00s (0s)  Rows=0\&.0 (0), root[root]@local
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index b9ebe60a01519bb2cd094830d47ca7bbe89fc3a4..669ed8a9681cc38e66122472a30a361759b647f2 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlhotcopy\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLHOTCOPY\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLHOTCOPY\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -107,7 +107,7 @@ shell> \fBmysqlhotcopy \fR\fB\fIdb_name\fR\fR\fB\&./\fR\fB\fIregex\fR\fR\fB/\fR
 .RE
 .\}
 .PP
-The regular expression for the table name can be negated by prefixing it with a tilde (\(lq~\(rq):
+The regular expression for the table name can be negated by prefixing it with a tilde (~):
 .sp
 .if n \{\
 .RS 4
@@ -505,7 +505,7 @@ shell> \fBperldoc mysqlhotcopy\fR
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 93ee02d6ecb7417908a2b4c5927e58ecde967dd4..664eaff1737d238fa30e4087b7729251243407b3 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlimport\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLIMPORT\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLIMPORT\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -251,6 +251,10 @@ is interpreted relative to the current directory if given as a relative path nam
 Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
 \fIfile_name\fR
 is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
+.sp
+Exception: Even with
+\fB\-\-defaults\-file\fR, client programs read
+\&.mylogin\&.cnf\&.
 .RE
 .sp
 .RS 4
@@ -308,7 +312,7 @@ Empty the table before importing the text file\&.
 Enable the
 mysql_clear_password
 cleartext authentication plugin\&. (See
-Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.)
 .sp
 This option was added in MySQL 5\&.6\&.28\&.
 .RE
@@ -421,7 +425,10 @@ Section\ \&13.2.6, \(lqLOAD DATA INFILE Syntax\(rq\&.
 \fB\-\-local\fR,
 \fB\-L\fR
 .sp
-Read input files locally from the client host\&.
+By default, files are read by the server on the server host\&. With this option,
+\fBmysqlimport\fR
+reads input files locally on the client host\&. Enabling local data loading has no effect if the server does not also support it; see
+Section\ \&6.1.6, \(lqSecurity Issues with LOAD DATA LOCAL\(rq
 .RE
 .sp
 .RS 4
@@ -827,7 +834,7 @@ shell> \fBmysql \-e \*(AqSELECT * FROM imptest\*(Aq test\fR
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 236dc2a39232e8766eace2257f6ccbb952a9c36b..45f0ee7502dc05694ed742d04e7d55c8d1ae67f5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlshow\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLSHOW\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLSHOW\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -95,23 +95,23 @@ If no column is given, all matching columns and column types in the table are sh
 .PP
 The output displays only the names of those databases, tables, or columns for which you have some privileges\&.
 .PP
-If the last argument contains shell or SQL wildcard characters (\(lq*\(rq,
-\(lq?\(rq,
-\(lq%\(rq, or
-\(lq_\(rq), only those names that are matched by the wildcard are shown\&. If a database name contains any underscores, those should be escaped with a backslash (some Unix shells require two) to get a list of the proper tables or columns\&.
-\(lq*\(rq
+If the last argument contains shell or SQL wildcard characters (*,
+?,
+%, or
+_), only those names that are matched by the wildcard are shown\&. If a database name contains any underscores, those should be escaped with a backslash (some Unix shells require two) to get a list of the proper tables or columns\&.
+*
 and
-\(lq?\(rq
+?
 characters are converted into SQL
-\(lq%\(rq
+%
 and
-\(lq_\(rq
+_
 wildcard characters\&. This might cause some confusion when you try to display the columns for a table with a
-\(lq_\(rq
+_
 in the name, because in this case,
 \fBmysqlshow\fR
 shows you only the table names that match the pattern\&. This is easily fixed by adding an extra
-\(lq%\(rq
+%
 last on the command line as a separate argument\&.
 .PP
 \fBmysqlshow\fR
@@ -297,6 +297,10 @@ is interpreted relative to the current directory if given as a relative path nam
 Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
 \fIfile_name\fR
 is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
+.sp
+Exception: Even with
+\fB\-\-defaults\-file\fR, client programs read
+\&.mylogin\&.cnf\&.
 .RE
 .sp
 .RS 4
@@ -340,7 +344,7 @@ groups\&.
 Enable the
 mysql_clear_password
 cleartext authentication plugin\&. (See
-Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.)
 .sp
 This option was added in MySQL 5\&.6\&.28\&.
 .RE
@@ -691,7 +695,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index c23fecfd0c65e5a258efcbbd2875291b38af18a4..66bfc74c1a5f4458099d1e545570ed052fb48abc 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqlslap\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBMYSQLSLAP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLSLAP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -501,6 +501,10 @@ is interpreted relative to the current directory if given as a relative path nam
 Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
 \fIfile_name\fR
 is interpreted relative to the current directory if given as a relative path name rather than a full path name\&.
+.sp
+Exception: Even with
+\fB\-\-defaults\-file\fR, client programs read
+\&.mylogin\&.cnf\&.
 .RE
 .sp
 .RS 4
@@ -573,7 +577,7 @@ statements\&. The default is 0 (connections are not detached)\&.
 Enable the
 mysql_clear_password
 cleartext authentication plugin\&. (See
-Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.5, \(lqClient-Side Cleartext Pluggable Authentication\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
 .RE
 .sp
 .RS 4
@@ -1079,7 +1083,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 41a447dab5342108d982847ac77da28232e05166..9e395d87ba07ab12769da0383f2596a62beac17d 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBmysqltest\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/01/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL
 .\"  Language: English
 .\"
-.TH "\FBMYSQLTEST\FR" "1" "08/25/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQLTEST\FR" "1" "06/01/2017" "MySQL" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -49,7 +49,7 @@ rather than invoking it directly\&.
 \fBmysqltest_embedded\fR
 is similar but is built with support for the
 libmysqld
-embedded server\&.
+embedded server\&. This program is available only prior to MySQL 8\&.0\&.
 .PP
 Features of
 \fBmysqltest\fR:
@@ -613,7 +613,7 @@ updates the given file by writing the actual test results to it\&.
 Pass the argument as an argument to the embedded server\&. For example,
 \fB\-\-server\-arg=\-\-tmpdir=/tmp\fR
 or
-\fB\-\-server\-arg=\-\-core\fR\&. Up to 64 arguments can be given\&.
+\fB\-\-server\-arg=\-\-core\fR\&. Up to 64 arguments can be given\&. This option was removed in MySQL 8\&.0\&.
 .RE
 .sp
 .RS 4
@@ -627,7 +627,7 @@ or
 \fB\-\-server\-file=\fR\fB\fIfile_name\fR\fR,
 \fB\-F \fR\fB\fIfile_name\fR\fR
 .sp
-Read arguments for the embedded server from the given file\&. The file should contain one argument per line\&.
+Read arguments for the embedded server from the given file\&. The file should contain one argument per line\&. This option was removed in MySQL 8\&.0\&.
 .RE
 .sp
 .RS 4
@@ -649,7 +649,7 @@ The server sends the public key to the client as needed, so it is not necessary
 For additional discussion regarding use of the
 sha256_password
 plugin, including how to get the RSA public key, see
-\m[blue]\fBThe SHA\-256 Authentication Plugin\fR\m[]\&\s-2\u[1]\d\s+2\&.
+\m[blue]\fBSHA\-256 Pluggable Authentication\fR\m[]\&\s-2\u[1]\d\s+2\&.
 .sp
 This option is available only if MySQL was built using OpenSSL\&. It was added in MySQL 5\&.6\&.6 under the name
 \fB\-\-server\-public\-key\fR
@@ -826,7 +826,7 @@ If enabled, this option causes
 to immediately display the output from executed programs to
 stdout\&.
 .sp
-This option was added in MySQL 5\&.8\&.0\&.
+This option was added in MySQL 8\&.0\&.0\&.
 .RE
 .sp
 .RS 4
@@ -888,7 +888,7 @@ statement is wrapped inside a view\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 2006, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
@@ -898,9 +898,9 @@ You should have received a copy of the GNU General Public License along with the
 .sp
 .SH "NOTES"
 .IP " 1." 4
-The SHA-256 Authentication Plugin
+SHA-256 Pluggable Authentication
 .RS 4
-\%http://dev.mysql.com/doc/refman/5.7/en/sha256-authentication-plugin.html
+\%http://dev.mysql.com/doc/refman/8.0/en/sha256-pluggable-authentication.html
 .RE
 .SH "SEE ALSO"
 For more information, please refer to the MySQL Reference Manual,
diff --git a/mysql-wsrep-5.6/man/ndb_mgmd.8 b/mysql-wsrep-5.6/man/ndb_mgmd.8
new file mode 100644 (file)
index 0000000..62ea38d
--- /dev/null
@@ -0,0 +1,1098 @@
+'\" t
+.\"     Title: \fBndb_mgmd\fR
+.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\"      Date: 06/02/2017
+.\"    Manual: MySQL Database System
+.\"    Source: MySQL 5.6
+.\"  Language: English
+.\"
+.TH "\FBNDB_MGMD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+ndb_mgmd \- the NDB Cluster management server daemon
+.SH "SYNOPSIS"
+.HP \w'\fBndb_mgmd\ \fR\fB\fIoptions\fR\fR\ 'u
+\fBndb_mgmd \fR\fB\fIoptions\fR\fR
+.SH "DESCRIPTION"
+.PP
+The management server is the process that reads the cluster configuration file and distributes this information to all nodes in the cluster that request it\&. It also maintains a log of cluster activities\&. Management clients can connect to the management server and check the cluster\*(Aqs status\&.
+.PP
+The following table includes options that are specific to the NDB Cluster management server program
+\fBndb_mgmd\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including
+\fBndb_mgmd\fR), see
+Options Common to NDB Cluster Programs(1)\&.
+.sp
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.B Table\ \&18.85.\ \& This table describes command\-line options for the ndb_mgmd program
+.TS
+allbox tab(:);
+.
+.TE
+.sp 1
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-bind\-address=\fR\fB\fIhost\fR\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-bind\-address=host
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+string
+T}
+:T{
+\fBDefault\fR
+T}:T{
+[none]
+T}
+.TE
+.sp 1
+Causes the management server to bind to a specific network interface (host name or IP address)\&. This option has no default value\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-no\-nodeid\-checks\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-no\-nodeid\-checks
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Do not perform any checks of node IDs\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-configdir=\fR\fB\fIdir_name\fR\fR
+.TS
+allbox tab(:);
+l l s s
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-configdir=directory
+T}
+T{
+\ \&
+T}:T{
+\-\-config\-dir=directory
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+file name
+T}
+:T{
+\fBDefault\fR
+T}:T{
+$INSTALLDIR/mysql\-cluster
+T}
+.TE
+.sp 1
+Specifies the cluster management server\*(Aqs configuration cache directory\&.
+\fB\-\-config\-dir\fR
+is an alias for this option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-config\-cache\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-config\-cache[=TRUE|FALSE]
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+TRUE
+T}
+.TE
+.sp 1
+This option, whose default value is
+1
+(or
+TRUE, or
+ON), can be used to disable the management server\*(Aqs configuration cache, so that it reads its configuration from
+config\&.ini
+every time it starts (see
+Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. You can do this by starting the
+\fBndb_mgmd\fR
+process with any one of the following options:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-config\-cache=0\fR
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-config\-cache=FALSE\fR
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-config\-cache=OFF\fR
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-skip\-config\-cache\fR
+.RE
+.sp
+Using one of the options just listed is effective only if the management server has no stored configuration at the time it is started\&. If the management server finds any configuration cache files, then the
+\fB\-\-config\-cache\fR
+option or the
+\fB\-\-skip\-config\-cache\fR
+option is ignored\&. Therefore, to disable configuration caching, the option should be used the
+\fIfirst\fR
+time that the management server is started\&. Otherwise\(emthat is, if you wish to disable configuration caching for a management server that has
+\fIalready\fR
+created a configuration cache\(emyou must stop the management server, delete any existing configuration cache files manually, then restart the management server with
+\fB\-\-skip\-config\-cache\fR
+(or with
+\fB\-\-config\-cache\fR
+set equal to 0,
+OFF, or
+FALSE)\&.
+.sp
+Configuration cache files are normally created in a directory named
+mysql\-cluster
+under the installation directory (unless this location has been overridden using the
+\fB\-\-configdir\fR
+option)\&. Each time the management server updates its configuration data, it writes a new cache file\&. The files are named sequentially in order of creation using the following format:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+ndb_\fInode\-id\fR_config\&.bin\&.\fIseq\-number\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+\fInode\-id\fR
+is the management server\*(Aqs node ID;
+\fIseq\-number\fR
+is a sequence number, beginning with 1\&. For example, if the management server\*(Aqs node ID is 5, then the first three configuration cache files would, when they are created, be named
+ndb_5_config\&.bin\&.1,
+ndb_5_config\&.bin\&.2, and
+ndb_5_config\&.bin\&.3\&.
+.sp
+If your intent is to purge or reload the configuration cache without actually disabling caching, you should start
+\fBndb_mgmd\fR
+with one of the options
+\fB\-\-reload\fR
+or
+\fB\-\-initial\fR
+instead of
+\fB\-\-skip\-config\-cache\fR\&.
+.sp
+To re\-enable the configuration cache, simply restart the management server, but without the
+\fB\-\-config\-cache\fR
+or
+\fB\-\-skip\-config\-cache\fR
+option that was used previously to disable the configuration cache\&.
+.sp
+\fBndb_mgmd\fR
+does not check for the configuration directory (\fB\-\-configdir\fR) or attempts to create one when
+\fB\-\-skip\-config\-cache\fR
+is used\&. (Bug #13428853)
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-config\-file=\fR\fB\fIfilename\fR\fR,
+\fB\-f \fR\fB\fIfilename\fR\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-config\-file=file
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+file name
+T}
+:T{
+\fBDefault\fR
+T}:T{
+[none]
+T}
+.TE
+.sp 1
+Instructs the management server as to which file it should use for its configuration file\&. By default, the management server looks for a file named
+config\&.ini
+in the same directory as the
+\fBndb_mgmd\fR
+executable; otherwise the file name and location must be specified explicitly\&.
+.sp
+This option has no default value, and is ignored unless the management server is forced to read the configuration file, either because
+\fBndb_mgmd\fR
+was started with the
+\fB\-\-reload\fR
+or
+\fB\-\-initial\fR
+option, or because the management server could not find any configuration cache\&. This option is also read if
+\fBndb_mgmd\fR
+was started with
+\fB\-\-config\-cache=OFF\fR\&. See
+Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq, for more information\&.
+.sp
+Formerly, using this option together with
+\fB\-\-initial\fR
+caused removal of the configuration cache even if the file was not found\&. This issue was resolved in NDB 7\&.3\&.2\&. (Bug #1299289)
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-mycnf\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-mycnf
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Read configuration data from the
+my\&.cnf
+file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-daemon\fR,
+\fB\-d\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-daemon
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+TRUE
+T}
+.TE
+.sp 1
+Instructs
+\fBndb_mgmd\fR
+to start as a daemon process\&. This is the default behavior\&.
+.sp
+This option has no effect when running
+\fBndb_mgmd\fR
+on Windows platforms\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-interactive\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-interactive
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Starts
+\fBndb_mgmd\fR
+in interactive mode; that is, an
+\fBndb_mgm\fR
+client session is started as soon as the management server is running\&. This option does not start any other NDB Cluster nodes\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-initial\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-initial
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Configuration data is cached internally, rather than being read from the cluster global configuration file each time the management server is started (see
+Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. Using the
+\fB\-\-initial\fR
+option overrides this behavior, by forcing the management server to delete any existing cache files, and then to re\-read the configuration data from the cluster configuration file and to build a new cache\&.
+.sp
+This differs in two ways from the
+\fB\-\-reload\fR
+option\&. First,
+\fB\-\-reload\fR
+forces the server to check the configuration file against the cache and reload its data only if the contents of the file are different from the cache\&. Second,
+\fB\-\-reload\fR
+does not delete any existing cache files\&.
+.sp
+If
+\fBndb_mgmd\fR
+is invoked with
+\fB\-\-initial\fR
+but cannot find a global configuration file, the management server cannot start\&.
+.sp
+When a management server starts, it checks for another management server in the same NDB Cluster and tries to use the other management server\*(Aqs configuration data;
+\fBndb_mgmd\fR
+ignores
+\fB\-\-initial\fR
+unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of an NDB Cluster with multiple management nodes\&. See
+Section\ \&18.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for more information\&.
+.sp
+Formerly, using this option together with the
+\fB\-\-config\-file\fR
+option caused removal of the configuration cache even if the file was not found\&. Starting with NDB 7\&.3\&.2, the cache is cleared in such cases only if the configuration file is actually found\&. (Bug #1299289)
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-log\-name=\fR\fB\fIname\fR\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-log\-name=name
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+string
+T}
+:T{
+\fBDefault\fR
+T}:T{
+MgmtSrvr
+T}
+.TE
+.sp 1
+Provides a name to be used for this node in the cluster log\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-nodaemon\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-nodaemon
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Instructs
+\fBndb_mgmd\fR
+not to start as a daemon process\&.
+.sp
+The default behavior for
+\fBndb_mgmd\fR
+on Windows is to run in the foreground, making this option unnecessary on Windows platforms\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-print\-full\-config\fR,
+\fB\-P\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-print\-full\-config
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Shows extended information regarding the configuration of the cluster\&. With this option on the command line the
+\fBndb_mgmd\fR
+process prints information about the cluster setup including an extensive list of the cluster configuration sections as well as parameters and their values\&. Normally used together with the
+\fB\-\-config\-file\fR
+(\fB\-f\fR) option\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-reload\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-reload
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+In NDB Cluster 7\&.3, configuration data is stored internally rather than being read from the cluster global configuration file each time the management server is started (see
+Section\ \&18.3.3, \(lqNDB Cluster Configuration Files\(rq)\&. Using this option forces the management server to check its internal data store against the cluster configuration file and to reload the configuration if it finds that the configuration file does not match the cache\&. Existing configuration cache files are preserved, but not used\&.
+.sp
+This differs in two ways from the
+\fB\-\-initial\fR
+option\&. First,
+\fB\-\-initial\fR
+causes all cache files to be deleted\&. Second,
+\fB\-\-initial\fR
+forces the management server to re\-read the global configuration file and construct a new cache\&.
+.sp
+If the management server cannot find a global configuration file, then the
+\fB\-\-reload\fR
+option is ignored\&.
+.sp
+When a management server starts, it checks for another management server in the same NDB Cluster and tries to use the other management server\*(Aqs configuration data;
+\fBndb_mgmd\fR
+ignores
+\fB\-\-reload\fR
+unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of an NDB Cluster with multiple management nodes\&. See
+Section\ \&18.5.5, \(lqPerforming a Rolling Restart of an NDB Cluster\(rq, for more information\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-nowait\-nodes\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s
+^ l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-nowait\-nodes=list
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+numeric
+T}
+:T{
+\fBDefault\fR
+T}:T{
+T}
+:T{
+\fBMin Value\fR
+T}:T{
+1
+T}
+:T{
+\fBMax Value\fR
+T}:T{
+255
+T}
+.TE
+.sp 1
+When starting an NDB Cluster is configured with two management nodes, each management server normally checks to see whether the other
+\fBndb_mgmd\fR
+is also operational and whether the other management server\*(Aqs configuration is identical to its own\&. However, it is sometimes desirable to start the cluster with only one management node (and perhaps to allow the other
+\fBndb_mgmd\fR
+to be started later)\&. This option causes the management node to bypass any checks for any other management nodes whose node IDs are passed to this option, permitting the cluster to start as though configured to use only the management node that was started\&.
+.sp
+For purposes of illustration, consider the following portion of a
+config\&.ini
+file (where we have omitted most of the configuration parameters that are not relevant to this example):
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+[ndbd]
+NodeId = 1
+HostName = 192\&.168\&.0\&.101
+[ndbd]
+NodeId = 2
+HostName = 192\&.168\&.0\&.102
+[ndbd]
+NodeId = 3
+HostName = 192\&.168\&.0\&.103
+[ndbd]
+NodeId = 4
+HostName = 192\&.168\&.0\&.104
+[ndb_mgmd]
+NodeId = 10
+HostName = 192\&.168\&.0\&.150
+[ndb_mgmd]
+NodeId = 11
+HostName = 192\&.168\&.0\&.151
+[api]
+NodeId = 20
+HostName = 192\&.168\&.0\&.200
+[api]
+NodeId = 21
+HostName = 192\&.168\&.0\&.201
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Assume that you wish to start this cluster using only the management server having node ID
+10
+and running on the host having the IP address 192\&.168\&.0\&.150\&. (Suppose, for example, that the host computer on which you intend to the other management server is temporarily unavailable due to a hardware failure, and you are waiting for it to be repaired\&.) To start the cluster in this way, use a command line on the machine at 192\&.168\&.0\&.150 to enter the following command:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+shell> \fBndb_mgmd \-\-ndb\-nodeid=10 \-\-nowait\-nodes=11\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+As shown in the preceding example, when using
+\fB\-\-nowait\-nodes\fR, you must also use the
+\fB\-\-ndb\-nodeid\fR
+option to specify the node ID of this
+\fBndb_mgmd\fR
+process\&.
+.sp
+You can then start each of the cluster\*(Aqs data nodes in the usual way\&. If you wish to start and use the second management server in addition to the first management server at a later time without restarting the data nodes, you must start each data node with a connection string that references both management servers, like this:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+shell> \fBndbd \-c 192\&.168\&.0\&.150,192\&.168\&.0\&.151\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+The same is true with regard to the connection string used with any
+\fBmysqld\fR
+processes that you wish to start as NDB Cluster SQL nodes connected to this cluster\&. See
+Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for more information\&.
+.sp
+When used with
+\fBndb_mgmd\fR, this option affects the behavior of the management node with regard to other management nodes only\&. Do not confuse it with the
+\fB\-\-nowait\-nodes\fR
+option used with
+\fBndbd\fR
+or
+\fBndbmtd\fR
+to permit a cluster to start with fewer than its full complement of data nodes; when used with data nodes, this option affects their behavior only with regard to other data nodes\&.
+.sp
+Multiple management node IDs may be passed to this option as a comma\-separated list\&. Each node ID must be no less than 1 and no greater than 255\&. In practice, it is quite rare to use more than two management servers for the same NDB Cluster (or to have any need for doing so); in most cases you need to pass to this option only the single node ID for the one management server that you do not wish to use when starting the cluster\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+When you later start the
+\(lqmissing\(rq
+management server, its configuration must match that of the management server that is already in use by the cluster\&. Otherwise, it fails the configuration check performed by the existing management server, and does not start\&.
+.sp .5v
+.RE
+.RE
+.PP
+It is not strictly necessary to specify a connection string when starting the management server\&. However, if you are using more than one management server, a connection string should be provided and each node in the cluster should specify its node ID explicitly\&.
+.PP
+See
+Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for information about using connection strings\&.
+\fBndb_mgmd\fR(8), describes other options for
+\fBndb_mgmd\fR\&.
+.PP
+The following files are created or used by
+\fBndb_mgmd\fR
+in its starting directory, and are placed in the
+DataDir
+as specified in the
+config\&.ini
+configuration file\&. In the list that follows,
+\fInode_id\fR
+is the unique node identifier\&.
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+config\&.ini
+is the configuration file for the cluster as a whole\&. This file is created by the user and read by the management server\&.
+Section\ \&18.3, \(lqConfiguration of NDB Cluster\(rq, discusses how to set up this file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR_cluster\&.log
+is the cluster events log file\&. Examples of such events include checkpoint startup and completion, node startup events, node failures, and levels of memory usage\&. A complete listing of cluster events with descriptions may be found in
+Section\ \&18.5, \(lqManagement of NDB Cluster\(rq\&.
+.sp
+By default, when the size of the cluster log reaches one million bytes, the file is renamed to
+ndb_\fInode_id\fR_cluster\&.log\&.\fIseq_id\fR, where
+\fIseq_id\fR
+is the sequence number of the cluster log file\&. (For example: If files with the sequence numbers 1, 2, and 3 already exist, the next log file is named using the number
+4\&.) You can change the size and number of files, and other characteristics of the cluster log, using the
+LogDestination
+configuration parameter\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR_out\&.log
+is the file used for
+stdout
+and
+stderr
+when running the management server as a daemon\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR\&.pid
+is the process ID file used when running the management server as a daemon\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-install[=\fR\fB\fIname\fR\fR\fB]\fR
+.TS
+allbox tab(:);
+l l s s
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-install[=name]
+T}
+T{
+\fBPlatform Specific\fR
+T}:T{
+Windows
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+string
+T}
+:T{
+\fBDefault\fR
+T}:T{
+ndb_mgmd
+T}
+.TE
+.sp 1
+Causes
+\fBndb_mgmd\fR
+to be installed as a Windows service\&. Optionally, you can specify a name for the service; if not set, the service name defaults to
+ndb_mgmd\&. Although it is preferable to specify other
+\fBndb_mgmd\fR
+program options in a
+my\&.ini
+or
+my\&.cnf
+configuration file, it is possible to use them together with
+\fB\-\-install\fR\&. However, in such cases, the
+\fB\-\-install\fR
+option must be specified first, before any other options are given, for the Windows service installation to succeed\&.
+.sp
+It is generally not advisable to use this option together with the
+\fB\-\-initial\fR
+option, since this causes the configuration cache to be wiped and rebuilt every time the service is stopped and started\&. Care should also be taken if you intend to use any other
+\fBndb_mgmd\fR
+options that affect the starting of the management server, and you should make absolutely certain you fully understand and allow for any possible consequences of doing so\&.
+.sp
+The
+\fB\-\-install\fR
+option has no effect on non\-Windows platforms\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-remove[=\fR\fB\fIname\fR\fR\fB]\fR
+.TS
+allbox tab(:);
+l l s s
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-remove[=name]
+T}
+T{
+\fBPlatform Specific\fR
+T}:T{
+Windows
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+string
+T}
+:T{
+\fBDefault\fR
+T}:T{
+ndb_mgmd
+T}
+.TE
+.sp 1
+Causes an
+\fBndb_mgmd\fR
+process that was previously installed as a Windows service to be removed\&. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to
+ndb_mgmd\&.
+.sp
+The
+\fB\-\-remove\fR
+option has no effect on non\-Windows platforms\&.
+.RE
+.SH "COPYRIGHT"
+.br
+.PP
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+.PP
+This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
+.PP
+This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+.PP
+You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
+.sp
+.SH "SEE ALSO"
+For more information, please refer to the MySQL Reference Manual,
+which may already be installed locally and which is also available
+online at http://dev.mysql.com/doc/.
+.SH AUTHOR
+Oracle Corporation (http://dev.mysql.com/).
diff --git a/mysql-wsrep-5.6/man/ndbd.8 b/mysql-wsrep-5.6/man/ndbd.8
new file mode 100644 (file)
index 0000000..ff83031
--- /dev/null
@@ -0,0 +1,1089 @@
+'\" t
+.\"     Title: \fBndbd\fR
+.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\"      Date: 06/02/2017
+.\"    Manual: MySQL Database System
+.\"    Source: MySQL 5.6
+.\"  Language: English
+.\"
+.TH "\FBNDBD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+ndbd \- the NDB Cluster data node daemon
+.SH "SYNOPSIS"
+.HP \w'\fBndbd\ \fR\fB\fIoptions\fR\fR\ 'u
+\fBndbd \fR\fB\fIoptions\fR\fR
+.SH "DESCRIPTION"
+.PP
+\fBndbd\fR
+is the process that is used to handle all the data in tables using the NDB Cluster storage engine\&. This is the process that empowers a data node to accomplish distributed transaction handling, node recovery, checkpointing to disk, online backup, and related tasks\&.
+.PP
+In an NDB Cluster, a set of
+\fBndbd\fR
+processes cooperate in handling data\&. These processes can execute on the same computer (host) or on different computers\&. The correspondences between data nodes and Cluster hosts is completely configurable\&.
+.PP
+The following table includes command options specific to the NDB Cluster data node program
+\fBndbd\fR\&. Additional descriptions follow the table\&. For options common to most NDB Cluster programs (including
+\fBndbd\fR), see
+Options Common to NDB Cluster Programs(1)\&.
+.sp
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.B Table\ \&18.83.\ \& This table describes command\-line options for the ndbd program
+.TS
+allbox tab(:);
+.
+.TE
+.sp 1
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.PP
+All of these options also apply to the multi\-threaded version of this program (\fBndbmtd\fR) and you may substitute
+\(lq\fBndbmtd\fR\(rq
+for
+\(lq\fBndbd\fR\(rq
+wherever the latter occurs in this section\&.
+.sp .5v
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-bind\-address\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-bind\-address=name
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+string
+T}
+:T{
+\fBDefault\fR
+T}:T{
+T}
+.TE
+.sp 1
+Causes
+\fBndbd\fR
+to bind to a specific network interface (host name or IP address)\&. This option has no default value\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-daemon\fR,
+\fB\-d\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-daemon
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+TRUE
+T}
+.TE
+.sp 1
+Instructs
+\fBndbd\fR
+or
+\fBndbmtd\fR
+to execute as a daemon process\&. This is the default behavior\&.
+\fB\-\-nodaemon\fR
+can be used to prevent the process from running as a daemon\&.
+.sp
+This option has no effect when running
+\fBndbd\fR
+or
+\fBndbmtd\fR
+on Windows platforms\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-nodaemon\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-nodaemon
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Prevents
+\fBndbd\fR
+or
+\fBndbmtd\fR
+from executing as a daemon process\&. This option overrides the
+\fB\-\-daemon\fR
+option\&. This is useful for redirecting output to the screen when debugging the binary\&.
+.sp
+The default behavior for
+\fBndbd\fR
+and
+\fBndbmtd\fR
+on Windows is to run in the foreground, making this option unnecessary on Windows platforms, where it has no effect\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-foreground\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-foreground
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Causes
+\fBndbd\fR
+or
+\fBndbmtd\fR
+to execute as a foreground process, primarily for debugging purposes\&. This option implies the
+\fB\-\-nodaemon\fR
+option\&.
+.sp
+This option has no effect when running
+\fBndbd\fR
+or
+\fBndbmtd\fR
+on Windows platforms\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-initial\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-initial
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Instructs
+\fBndbd\fR
+to perform an initial start\&. An initial start erases any files created for recovery purposes by earlier instances of
+\fBndbd\fR\&. It also re\-creates recovery log files\&. On some operating systems, this process can take a substantial amount of time\&.
+.sp
+An
+\fB\-\-initial\fR
+start is to be used
+\fIonly\fR
+when starting the
+\fBndbd\fR
+process under very special circumstances; this is because this option causes all files to be removed from the NDB Cluster file system and all redo log files to be re\-created\&. These circumstances are listed here:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+When performing a software upgrade which has changed the contents of any files\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+When restarting the node with a new version of
+\fBndbd\fR\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+As a measure of last resort when for some reason the node restart or system restart repeatedly fails\&. In this case, be aware that this node can no longer be used to restore data due to the destruction of the data files\&.
+.RE
+.sp
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBWarning\fR
+.ps -1
+.br
+To avoid the possibility of eventual data loss, it is recommended that you
+\fInot\fR
+use the
+\fB\-\-initial\fR
+option together with
+StopOnError = 0\&. Instead, set
+StopOnError
+to 0 in
+config\&.ini
+only after the cluster has been started, then restart the data nodes normally\(emthat is, without the
+\fB\-\-initial\fR
+option\&. See the description of the
+StopOnError
+parameter for a detailed explanation of this issue\&. (Bug #24945638)
+.sp .5v
+.RE
+Use of this option prevents the
+StartPartialTimeout
+and
+StartPartitionedTimeout
+configuration parameters from having any effect\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBImportant\fR
+.ps -1
+.br
+This option does
+\fInot\fR
+affect either of the following types of files:
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+Backup files that have already been created by the affected node
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+NDB Cluster Disk Data files (see
+Section\ \&18.5.12, \(lqNDB Cluster Disk Data Tables\(rq)\&.
+.RE
+.sp
+This option also has no effect on recovery of data by a data node that is just starting (or restarting) from data nodes that are already running\&. This recovery of data occurs automatically, and requires no user intervention in an NDB Cluster that is running normally\&.
+.sp .5v
+.RE
+It is permissible to use this option when starting the cluster for the very first time (that is, before any data node files have been created); however, it is
+\fInot\fR
+necessary to do so\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-initial\-start\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-initial\-start
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+This option is used when performing a partial initial start of the cluster\&. Each node should be started with this option, as well as
+\fB\-\-nowait\-nodes\fR\&.
+.sp
+Suppose that you have a 4\-node cluster whose data nodes have the IDs 2, 3, 4, and 5, and you wish to perform a partial initial start using only nodes 2, 4, and 5\(emthat is, omitting node 3:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+shell> \fBndbd \-\-ndb\-nodeid=2 \-\-nowait\-nodes=3 \-\-initial\-start\fR
+shell> \fBndbd \-\-ndb\-nodeid=4 \-\-nowait\-nodes=3 \-\-initial\-start\fR
+shell> \fBndbd \-\-ndb\-nodeid=5 \-\-nowait\-nodes=3 \-\-initial\-start\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+When using this option, you must also specify the node ID for the data node being started with the
+\fB\-\-ndb\-nodeid\fR
+option\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBImportant\fR
+.ps -1
+.br
+Do not confuse this option with the
+\fB\-\-nowait\-nodes\fR
+option for
+\fBndb_mgmd\fR, which can be used to enable a cluster configured with multiple management servers to be started without all management servers being online\&.
+.sp .5v
+.RE
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-nowait\-nodes=\fR\fB\fInode_id_1\fR\fR\fB[, \fR\fB\fInode_id_2\fR\fR\fB[, \&.\&.\&.]]\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-nowait\-nodes=list
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+string
+T}
+:T{
+\fBDefault\fR
+T}:T{
+T}
+.TE
+.sp 1
+This option takes a list of data nodes which for which the cluster will not wait for before starting\&.
+.sp
+This can be used to start the cluster in a partitioned state\&. For example, to start the cluster with only half of the data nodes (nodes 2, 3, 4, and 5) running in a 4\-node cluster, you can start each
+\fBndbd\fR
+process with
+\fB\-\-nowait\-nodes=3,5\fR\&. In this case, the cluster starts as soon as nodes 2 and 4 connect, and does
+\fInot\fR
+wait
+StartPartitionedTimeout
+milliseconds for nodes 3 and 5 to connect as it would otherwise\&.
+.sp
+If you wanted to start up the same cluster as in the previous example without one
+\fBndbd\fR
+(say, for example, that the host machine for node 3 has suffered a hardware failure) then start nodes 2, 4, and 5 with
+\fB\-\-nowait\-nodes=3\fR\&. Then the cluster will start as soon as nodes 2, 4, and 5 connect and will not wait for node 3 to start\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-nostart\fR,
+\fB\-n\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-nostart
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+boolean
+T}
+:T{
+\fBDefault\fR
+T}:T{
+FALSE
+T}
+.TE
+.sp 1
+Instructs
+\fBndbd\fR
+not to start automatically\&. When this option is used,
+\fBndbd\fR
+connects to the management server, obtains configuration data from it, and initializes communication objects\&. However, it does not actually start the execution engine until specifically requested to do so by the management server\&. This can be accomplished by issuing the proper
+START
+command in the management client (see
+Section\ \&18.5.2, \(lqCommands in the NDB Cluster Management Client\(rq)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-install[=\fR\fB\fIname\fR\fR\fB]\fR
+.TS
+allbox tab(:);
+l l s s
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-install[=name]
+T}
+T{
+\fBPlatform Specific\fR
+T}:T{
+Windows
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+string
+T}
+:T{
+\fBDefault\fR
+T}:T{
+ndbd
+T}
+.TE
+.sp 1
+Causes
+\fBndbd\fR
+to be installed as a Windows service\&. Optionally, you can specify a name for the service; if not set, the service name defaults to
+ndbd\&. Although it is preferable to specify other
+\fBndbd\fR
+program options in a
+my\&.ini
+or
+my\&.cnf
+configuration file, it is possible to use together with
+\fB\-\-install\fR\&. However, in such cases, the
+\fB\-\-install\fR
+option must be specified first, before any other options are given, for the Windows service installation to succeed\&.
+.sp
+It is generally not advisable to use this option together with the
+\fB\-\-initial\fR
+option, since this causes the data node file system to be wiped and rebuilt every time the service is stopped and started\&. Extreme care should also be taken if you intend to use any of the other
+\fBndbd\fR
+options that affect the starting of data nodes\(emincluding
+\fB\-\-initial\-start\fR,
+\fB\-\-nostart\fR, and
+\fB\-\-nowait\-nodes\fR\(emtogether with
+\fB\-\-install\fR, and you should make absolutely certain you fully understand and allow for any possible consequences of doing so\&.
+.sp
+The
+\fB\-\-install\fR
+option has no effect on non\-Windows platforms\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-remove[=\fR\fB\fIname\fR\fR\fB]\fR
+.TS
+allbox tab(:);
+l l s s
+l l s s
+l l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-remove[=name]
+T}
+T{
+\fBPlatform Specific\fR
+T}:T{
+Windows
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+string
+T}
+:T{
+\fBDefault\fR
+T}:T{
+ndbd
+T}
+.TE
+.sp 1
+Causes an
+\fBndbd\fR
+process that was previously installed as a Windows service to be removed\&. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to
+ndbd\&.
+.sp
+The
+\fB\-\-remove\fR
+option has no effect on non\-Windows platforms\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-connect\-retries=\fR\fB\fI#\fR\fR
+.TS
+allbox tab(:);
+l l s s
+l l l s
+^ l l s
+^ l l s
+^ l l s.
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-connect\-retries=#
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+numeric
+T}
+:T{
+\fBDefault\fR
+T}:T{
+12
+T}
+:T{
+\fBMin Value\fR
+T}:T{
+0
+T}
+:T{
+\fBMax Value\fR
+T}:T{
+65535
+T}
+.TE
+.sp 1
+Set the number of times to retry a connection before giving up; 0 means 1 attempt only (and no retries)\&. The default is 12 attempts\&. The time to wait between attempts is controlled by the
+\fB\-\-connect\-retry\-delay\fR
+option in MySQL NDB 7\&.4\&.9 and later (previously, this was
+\fB\-\-connect\-delay\fR)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-connect\-delay=\fR\fB\fI#\fR\fR
+.TS
+allbox tab(:);
+l l s s
+l l s s
+l l l s
+^ l l s
+^ l l s
+^ l l s.
+T{
+\fBDeprecated\fR
+T}:T{
+5\&.6\&.28\-ndb\-7\&.4\&.9
+T}
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-connect\-delay=#
+T}
+T{
+\fBPermitted Values\fR
+T}:T{
+\fBType\fR
+T}:T{
+numeric
+T}
+:T{
+\fBDefault\fR
+T}:T{
+5
+T}
+:T{
+\fBMin Value\fR
+T}:T{
+0
+T}
+:T{
+\fBMax Value\fR
+T}:T{
+3600
+T}
+.TE
+.sp 1
+Determines the time to wait between attempts to contact a management server when starting (the number of attempts is controlled by the
+\fB\-\-connect\-retries\fR
+option)\&. The default is 5 seconds\&.
+.sp
+This option is deprecated in NDB 7\&.4\&.9, and is subject to removal in a future release of NDB Cluster\&. Use
+\fB\-\-connect\-retry\-delay\fR
+instead\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fB\-\-connect\-retry\-delay=\fR\fB\fI#\fR\fR
+.TS
+allbox tab(:);
+l l s s
+l l s s
+l l l s
+^ l l s
+^ l l s
+^ l l s.
+T{
+\fBIntroduced\fR
+T}:T{
+5\&.6\&.28\-ndb\-7\&.4\&.9
+T}
+T{
+\fBCommand\-Line Format\fR
+T}:T{
+\-\-connect\-retry\-delay=#
+T}
+T{
+\fBPermitted Values\fR (>= 5\&.6\&.28\-ndb\-7\&.4\&.9)
+T}:T{
+\fBType\fR
+T}:T{
+numeric
+T}
+:T{
+\fBDefault\fR
+T}:T{
+5
+T}
+:T{
+\fBMin Value\fR
+T}:T{
+0
+T}
+:T{
+\fBMax Value\fR
+T}:T{
+4294967295
+T}
+.TE
+.sp 1
+Determines the time to wait between attempts to contact a management server when starting (the time between attempts is controlled by the
+\fB\-\-connect\-retries\fR
+option)\&. The default is 5 seconds\&.
+.sp
+This option was added in NDB 7\&.4\&.9, and is intended to take the place of the
+\fB\-\-connect\-delay\fR
+option, which is now deprecated and subject to removal in a future release of NDB Cluster\&.
+.RE
+.PP
+\fBndbd\fR
+generates a set of log files which are placed in the directory specified by
+DataDir
+in the
+config\&.ini
+configuration file\&.
+.PP
+These log files are listed below\&.
+\fInode_id\fR
+is and represents the node\*(Aqs unique identifier\&. For example,
+ndb_2_error\&.log
+is the error log generated by the data node whose node ID is
+2\&.
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR_error\&.log
+is a file containing records of all crashes which the referenced
+\fBndbd\fR
+process has encountered\&. Each record in this file contains a brief error string and a reference to a trace file for this crash\&. A typical entry in this file might appear as shown here:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+Date/Time: Saturday 30 July 2004 \- 00:20:01
+Type of error: error
+Message: Internal program error (failed ndbrequire)
+Fault ID: 2341
+Problem data: DbtupFixAlloc\&.cpp
+Object of reference: DBTUP (Line: 173)
+ProgramName: NDB Kernel
+ProcessID: 14909
+TraceFile: ndb_2_trace\&.log\&.2
+***EOM***
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Listings of possible
+\fBndbd\fR
+exit codes and messages generated when a data node process shuts down prematurely can be found in
+\m[blue]\fBData Node Error Messages\fR\m[]\&\s-2\u[1]\d\s+2\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBImportant\fR
+.ps -1
+.br
+\fIThe last entry in the error log file is not necessarily the newest one\fR
+(nor is it likely to be)\&. Entries in the error log are
+\fInot\fR
+listed in chronological order; rather, they correspond to the order of the trace files as determined in the
+ndb_\fInode_id\fR_trace\&.log\&.next
+file (see below)\&. Error log entries are thus overwritten in a cyclical and not sequential fashion\&.
+.sp .5v
+.RE
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR_trace\&.log\&.\fItrace_id\fR
+is a trace file describing exactly what happened just before the error occurred\&. This information is useful for analysis by the NDB Cluster development team\&.
+.sp
+It is possible to configure the number of these trace files that will be created before old files are overwritten\&.
+\fItrace_id\fR
+is a number which is incremented for each successive trace file\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR_trace\&.log\&.next
+is the file that keeps track of the next trace file number to be assigned\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR_out\&.log
+is a file containing any data output by the
+\fBndbd\fR
+process\&. This file is created only if
+\fBndbd\fR
+is started as a daemon, which is the default behavior\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR\&.pid
+is a file containing the process ID of the
+\fBndbd\fR
+process when started as a daemon\&. It also functions as a lock file to avoid the starting of nodes with the same identifier\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+ndb_\fInode_id\fR_signal\&.log
+is a file used only in debug versions of
+\fBndbd\fR, where it is possible to trace all incoming, outgoing, and internal messages with their data in the
+\fBndbd\fR
+process\&.
+.RE
+.PP
+It is recommended not to use a directory mounted through NFS because in some environments this can cause problems whereby the lock on the
+\&.pid
+file remains in effect even after the process has terminated\&.
+.PP
+To start
+\fBndbd\fR, it may also be necessary to specify the host name of the management server and the port on which it is listening\&. Optionally, one may also specify the node ID that the process is to use\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+shell> \fBndbd \-\-connect\-string="nodeid=2;host=ndb_mgmd\&.mysql\&.com:1186"\fR
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+See
+Section\ \&18.3.3.3, \(lqNDB Cluster Connection Strings\(rq, for additional information about this issue\&.
+Options Common to NDB Cluster Programs(1), describes other command\-line options which can be used with
+\fBndbd\fR\&. For information about data node configuration parameters, see
+Section\ \&18.3.3.6, \(lqDefining NDB Cluster Data Nodes\(rq\&.
+.PP
+When
+\fBndbd\fR
+starts, it actually initiates two processes\&. The first of these is called the
+\(lqangel process\(rq; its only job is to discover when the execution process has been completed, and then to restart the
+\fBndbd\fR
+process if it is configured to do so\&. Thus, if you attempt to kill
+\fBndbd\fR
+using the Unix
+\fBkill\fR
+command, it is necessary to kill both processes, beginning with the angel process\&. The preferred method of terminating an
+\fBndbd\fR
+process is to use the management client and stop the process from there\&.
+.PP
+The execution process uses one thread for reading, writing, and scanning data, as well as all other activities\&. This thread is implemented asynchronously so that it can easily handle thousands of concurrent actions\&. In addition, a watch\-dog thread supervises the execution thread to make sure that it does not hang in an endless loop\&. A pool of threads handles file I/O, with each thread able to handle one open file\&. Threads can also be used for transporter connections by the transporters in the
+\fBndbd\fR
+process\&. In a multi\-processor system performing a large number of operations (including updates), the
+\fBndbd\fR
+process can consume up to 2 CPUs if permitted to do so\&.
+.PP
+For a machine with many CPUs it is possible to use several
+\fBndbd\fR
+processes which belong to different node groups; however, such a configuration is still considered experimental and is not supported for MySQL 5\&.6 in a production setting\&. See
+Section\ \&18.1.6, \(lqKnown Limitations of NDB Cluster\(rq\&.
+.SH "COPYRIGHT"
+.br
+.PP
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+.PP
+This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
+.PP
+This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+.PP
+You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
+.sp
+.SH "NOTES"
+.IP " 1." 4
+Data Node Error Messages
+.RS 4
+\%http://dev.mysql.com/doc/ndb-internals/en/ndb-node-error-messages.html
+.RE
+.SH "SEE ALSO"
+For more information, please refer to the MySQL Reference Manual,
+which may already be installed locally and which is also available
+online at http://dev.mysql.com/doc/.
+.SH AUTHOR
+Oracle Corporation (http://dev.mysql.com/).
diff --git a/mysql-wsrep-5.6/man/ndbmtd.8 b/mysql-wsrep-5.6/man/ndbmtd.8
new file mode 100644 (file)
index 0000000..74af262
--- /dev/null
@@ -0,0 +1,215 @@
+'\" t
+.\"     Title: \fBndbmtd\fR
+.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\"      Date: 06/02/2017
+.\"    Manual: MySQL Database System
+.\"    Source: MySQL 5.6
+.\"  Language: English
+.\"
+.TH "\FBNDBMTD\FR" "8" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+ndbmtd \- the NDB Cluster data node daemon (multi\-threaded version)
+.SH "SYNOPSIS"
+.HP \w'\fBndbmtd\ \fR\fB\fIoptions\fR\fR\ 'u
+\fBndbmtd \fR\fB\fIoptions\fR\fR
+.SH "DESCRIPTION"
+.PP
+\fBndbmtd\fR
+is a multi\-threaded version of
+\fBndbd\fR, the process that is used to handle all the data in tables using the
+NDBCLUSTER
+storage engine\&.
+\fBndbmtd\fR
+is intended for use on host computers having multiple CPU cores\&. Except where otherwise noted,
+\fBndbmtd\fR
+functions in the same way as
+\fBndbd\fR; therefore, in this section, we concentrate on the ways in which
+\fBndbmtd\fR
+differs from
+\fBndbd\fR, and you should consult
+\fBndbd\fR(8), for additional information about running NDB Cluster data nodes that apply to both the single\-threaded and multi\-threaded versions of the data node process\&.
+.PP
+Command\-line options and configuration parameters used with
+\fBndbd\fR
+also apply to
+\fBndbmtd\fR\&. For more information about these options and parameters, see
+\fBndbd\fR(8), and
+Section\ \&18.3.3.6, \(lqDefining NDB Cluster Data Nodes\(rq, respectively\&.
+.PP
+\fBndbmtd\fR
+is also file system\-compatible with
+\fBndbd\fR\&. In other words, a data node running
+\fBndbd\fR
+can be stopped, the binary replaced with
+\fBndbmtd\fR, and then restarted without any loss of data\&. (However, when doing this, you must make sure that
+MaxNoOfExecutionThreads
+is set to an apppriate value before restarting the node if you wish for
+\fBndbmtd\fR
+to run in multi\-threaded fashion\&.) Similarly, an
+\fBndbmtd\fR
+binary can be replaced with
+\fBndbd\fR
+simply by stopping the node and then starting
+\fBndbd\fR
+in place of the multi\-threaded binary\&. It is not necessary when switching between the two to start the data node binary using
+\fB\-\-initial\fR\&.
+.PP
+Using
+\fBndbmtd\fR
+differs from using
+\fBndbd\fR
+in two key respects:
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 1.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  1." 4.2
+.\}
+Because
+\fBndbmtd\fR
+runs by default in single\-threaded mode (that is, it behaves like
+\fBndbd\fR), you must configure it to use multiple threads\&. This can be done by setting an appropriate value in the
+config\&.ini
+file for the
+MaxNoOfExecutionThreads
+configuration parameter or the
+ThreadConfig
+configuration parameter\&. Using
+MaxNoOfExecutionThreads
+is simpler, but
+ThreadConfig
+offers more flexibility\&. For more information about these configuration parameters and their use, see
+Multi-Threading Configuration Parameters (ndbmtd)\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 2.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  2." 4.2
+.\}
+Trace files are generated by critical errors in
+\fBndbmtd\fR
+processes in a somewhat different fashion from how these are generated by
+\fBndbd\fR
+failures\&. These differences are discussed in more detail in the next few paragraphs\&.
+.RE
+.PP
+Like
+\fBndbd\fR,
+\fBndbmtd\fR
+generates a set of log files which are placed in the directory specified by
+DataDir
+in the
+config\&.ini
+configuration file\&. Except for trace files, these are generated in the same way and have the same names as those generated by
+\fBndbd\fR\&.
+.PP
+In the event of a critical error,
+\fBndbmtd\fR
+generates trace files describing what happened just prior to the error\*(Aq occurrence\&. These files, which can be found in the data node\*(Aqs
+DataDir, are useful for analysis of problems by the NDB Cluster Development and Support teams\&. One trace file is generated for each
+\fBndbmtd\fR
+thread\&. The names of these files have the following pattern:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+ndb_\fInode_id\fR_trace\&.log\&.\fItrace_id\fR_t\fIthread_id\fR,
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+In this pattern,
+\fInode_id\fR
+stands for the data node\*(Aqs unique node ID in the cluster,
+\fItrace_id\fR
+is a trace sequence number, and
+\fIthread_id\fR
+is the thread ID\&. For example, in the event of the failure of an
+\fBndbmtd\fR
+process running as an NDB Cluster data node having the node ID 3 and with
+MaxNoOfExecutionThreads
+equal to 4, four trace files are generated in the data node\*(Aqs data directory\&. If the is the first time this node has failed, then these files are named
+ndb_3_trace\&.log\&.1_t1,
+ndb_3_trace\&.log\&.1_t2,
+ndb_3_trace\&.log\&.1_t3, and
+ndb_3_trace\&.log\&.1_t4\&. Internally, these trace files follow the same format as
+\fBndbd\fR
+trace files\&.
+.PP
+The
+\fBndbd\fR
+exit codes and messages that are generated when a data node process shuts down prematurely are also used by
+\fBndbmtd\fR\&. See
+\m[blue]\fBData Node Error Messages\fR\m[]\&\s-2\u[1]\d\s+2, for a listing of these\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+.PP
+It is possible to use
+\fBndbd\fR
+and
+\fBndbmtd\fR
+concurrently on different data nodes in the same NDB Cluster\&. However, such configurations have not been tested extensively; thus, we cannot recommend doing so in a production setting at this time\&.
+.sp .5v
+.RE
+.SH "COPYRIGHT"
+.br
+.PP
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+.PP
+This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
+.PP
+This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+.PP
+You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
+.sp
+.SH "NOTES"
+.IP " 1." 4
+Data Node Error Messages
+.RS 4
+\%http://dev.mysql.com/doc/ndb-internals/en/ndb-node-error-messages.html
+.RE
+.SH "SEE ALSO"
+For more information, please refer to the MySQL Reference Manual,
+which may already be installed locally and which is also available
+online at http://dev.mysql.com/doc/.
+.SH AUTHOR
+Oracle Corporation (http://dev.mysql.com/).
index 08e4b64560c94cfd8871c814e6923447668f0759..0e9475cc1c97ef315a663c686def80d20073cbff 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBperror\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBPERROR\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBPERROR\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -82,7 +82,7 @@ OS error code  64:  Machine is not on the network
 .RE
 .\}
 .PP
-To obtain the error message for a MySQL Cluster error code, invoke
+To obtain the error message for an NDB Cluster error code, invoke
 \fBperror\fR
 with the
 \fB\-\-ndb\fR
@@ -129,7 +129,7 @@ Display a help message and exit\&.
 .\}
 \fB\-\-ndb\fR
 .sp
-Print the error message for a MySQL Cluster error code\&.
+Print the error message for an NDB Cluster error code\&.
 .RE
 .sp
 .RS 4
@@ -176,7 +176,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 42e523b86734bbf841c2fbda736cbb7cea66e18a..4115be50fdd1441b76b93221458c54804061d1a8 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBreplace\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBREPLACE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBREPLACE\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -167,7 +167,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 355c686138fedc0f3d7ec68c0b1c04fe45f2ea22..f53361e299e5a9a9dd4a164107203fed232352b6 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBresolve_stack_dump\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBRESOLVE_STACK_DUM" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBRESOLVE_STACK_DUM" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -120,7 +120,7 @@ Section\ \&24.5.1.5, \(lqUsing a Stack Trace\(rq\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index 6c9e032141c9b141de2e6f9c749e468a9ae58e94..9e0f17709a20a17d6b7a5d70ace589bb4cbb4aa9 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: \fBresolveip\fR
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 08/25/2016
+.\"      Date: 06/02/2017
 .\"    Manual: MySQL Database System
 .\"    Source: MySQL 5.6
 .\"  Language: English
 .\"
-.TH "\FBRESOLVEIP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBRESOLVEIP\FR" "1" "06/02/2017" "MySQL 5\&.6" "MySQL Database System"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -101,7 +101,7 @@ Display version information and exit\&.
 .SH "COPYRIGHT"
 .br
 .PP
-Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+Copyright \(co 1997, 2017, Oracle and/or its affiliates. All rights reserved.
 .PP
 This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
 .PP
index bc6522257226b47e5533ec52944d67392e487b0a..c1834c3c26f2c7d6f74f0c74e2886d009c292b15 100644 (file)
@@ -8,3 +8,5 @@
 
 --let $galera_cluster_size = 2
 --source include/galera_init.inc
+
+--source include/have_innodb.inc
index 232cb46479e05e6fa8aa526df784ec1d9713d0f1..af8f2b956fd93be8301da8a8c0074ad490d0b8d7 100644 (file)
@@ -3,7 +3,7 @@
         my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'};
         my $mysqld_pid = `cat $pid_filename`;
         chomp($mysqld_pid);
-        system("kill -18 $mysqld_pid");
+        system("kill -SIGCONT $mysqld_pid");
         exit(0);
 EOF
 
index 3495ad2342b12671e553460e0cce33503e884380..d4037d8958ca19aac805ce7a2c34648e45c8faa0 100644 (file)
@@ -9,6 +9,6 @@
         my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'};
         my $mysqld_pid = `cat $pid_filename`;
         chomp($mysqld_pid);
-        system("kill -19 $mysqld_pid");
+        system("kill -SIGSTOP $mysqld_pid");
         exit(0);
 EOF
index c61bad8e19d3aa374eeebaf1930b33aa1dce44bc..d7f665df6c750c610c19f7125bf70cd96901b23e 100644 (file)
@@ -1,7 +1,6 @@
 --echo Killing server ...
 
 # Write file to make mysql-test-run.pl expect the crash, but don't start it
---source include/wait_until_connected_again.inc
 --let $_server_id= `SELECT @@server_id`
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
 --exec echo "wait" > $_expect_file_name
index 6c3563d1b39d4ddefe50169e588725f189c0d96a..6bb2c9af52cdb0c3385cb6b350b773c18562303e 100644 (file)
@@ -285,13 +285,16 @@ INSERT INTO global_suppressions VALUES
  ("WSREP: no nodes coming from prim view, prim not possible"),
  ("WSREP: Failed to prepare for incremental state transfer: Local state seqno is undefined:"),
  ("WSREP: gcs_caused\\(\\) returned -107 \\(Transport endpoint is not connected\\)"),
+ ("WSREP: gcs_caused\\(\\) returned -57 \\(Socket is not connected\\)"),
  ("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)"),
  ("Action message in non-primary configuration from member"),
+ ("SYNC message from member"),
  ("InnoDB: Resizing redo log from"),
  ("InnoDB: Starting to delete and rewrite log files"),
  ("InnoDB: New log files created, LSN="),
 -- WSREP: Send action {0x7f86280147f0, 73, STATE_REQUEST} returned -107 (Transport endpoint is not connected)
  ("Transport endpoint is not connected"),
+ ("Socket is not connected"),
 -- "WSREP: Protocol violation. JOIN message sender 1.0 (host-91-221-67-96) is not in state transfer (SYNCED). Message ignored.
  ("is not in state transfer"),
  ("JOIN message from member .* in non-primary configuration"),
index 79bb82cae7e1747664a7cab864065f4057ae42bb..a5cfe4cc05d8cbfab4fefba68821ecef583ba974 100644 (file)
@@ -107,7 +107,7 @@ DROP DATABASE hotcopy_save;
 --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
 --list_files $MYSQLD_DATADIR/hotcopy_save
 --replace_result $MASTER_MYSOCK MASTER_MYSOCK
---error 9,11,110,2304,255
+--error 9,11,110,255,2304
 --exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
 --replace_result $MASTER_MYSOCK MASTER_MYSOCK
 --exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
index c45917e7776c00867fa012f7643143d91eb88bc0..1e93009d1a1b779512bc1cd6f13d6d848e848efb 100644 (file)
@@ -1,35 +1,33 @@
 #
 # Include this script to wait until the connection to the
 # server has been restored or timeout occurs
-
-#
-# We require two consequtive connection successes in order to
-# work around a race condition on Galera startup where the server
-# can temporarily accept queries before starting to reject them again
-#
-
 --disable_result_log
 --disable_query_log
-let $counter= 1200;
+let $counter= 500;
 let $mysql_errno= 9999;
-let $successes= 2;
+while ($mysql_errno)
+{
+  # Strangely enough, the server might return "Too many connections"
+  # while being shutdown, thus 1040 is an "allowed" error
+  # See BUG#36228
 
-while ($successes) {
-  while ($mysql_errno) {
-    # Strangely enough, the server might return "Too many connections"
-    # while being shutdown, thus 1040 is an "allowed" error
-    # See BUG#36228
-    --error 0,1040,1047,1053,1205,2002,2003,2006,2013,1205
-    show status;
+  # WSREP: allow error 1205, as SHOW STATUS may fail if
+  #        wsrep_sync_wait is enabled
+  --error 0,1040,1053,1205,2002,2003,2006,2013
+  show status;
 
-    --dec $counter
-    if (!$counter) {
-      --die Server failed to restart
-    }
-     --sleep 0.1
+  dec $counter;
+  if (!$counter)
+  {
+    --die Server failed to restart
   }
-  --dec $successes
   --sleep 0.1
 }
 --enable_query_log
 --enable_result_log
+
+# WSREP: SHOW STATUS queries are allowed even if wsrep
+#        is not ready. Make sure wsrep is ready before
+#        returning from this script
+
+--source include/wait_wsrep_ready.inc
diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_wsrep_ready.inc b/mysql-wsrep-5.6/mysql-test/include/wait_wsrep_ready.inc
new file mode 100644 (file)
index 0000000..0e666af
--- /dev/null
@@ -0,0 +1,15 @@
+#
+# If the wsrep plugin is loaded, wait until the wsrep provider becomes
+# ready for use.
+#
+
+--disable_query_log
+--disable_result_log
+
+if (`SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`)
+{
+  --source include/galera_wait_ready.inc
+}
+
+--enable_query_log
+--enable_result_log
index b2c6f92f01a5eab7b5824c212e10f7902ec408d8..1a6fc81ef6b044f855f2cf528c4bcf1c72cbbfb6 100644 (file)
@@ -143,7 +143,13 @@ sub collect_test_cases ($$$$) {
 
   if ( @$opt_cases )
   {
-    # A list of tests was specified on the command line
+    # A list of tests was specified on the command line.
+    # Among those, the tests which are not already collected will be
+    # collected and stored temporarily in an array of hashes pointed
+    # by the below reference. This array is eventually appeneded to
+    # the one having all collected test cases.
+    my $cmdline_cases;
+
     # Check that the tests specified was found
     # in at least one suite
     foreach my $test_name_spec ( @$opt_cases )
@@ -162,20 +168,56 @@ sub collect_test_cases ($$$$) {
       }
       if ( not $found )
       {
-       $sname= "main" if !$opt_reorder and !$sname;
-       mtr_error("Could not find '$tname' in '$suites' suite(s)") unless $sname;
-       # If suite was part of name, find it there, may come with combinations
-       my @this_case = collect_one_suite($sname, [ $tname ]);
-       if (@this_case)
+        if ( $sname )
         {
-         push (@$cases, @this_case);
-       }
-       else
-       {
-         mtr_error("Could not find '$tname' in '$sname' suite");
+         # If suite was part of name, find it there, may come with combinations
+         my @this_case = collect_one_suite($sname, [ $tname ]);
+
+          # If a test is specified multiple times on the command line, all
+          # instances of the test need to be picked. Hence, such tests are
+          # stored in the temporary array instead of adding them to $cases
+          # directly so that repeated tests are not run only once
+         if (@this_case)
+          {
+           push (@$cmdline_cases, @this_case);
+         }
+         else
+         {
+           mtr_error("Could not find '$tname' in '$sname' suite");
+          }
+        }
+        else
+        {
+          if ( !$opt_reorder )
+          {
+            # If --no-reorder is passed and if suite was not part of name,
+            # search in all the suites
+            foreach my $suite (split(",", $suites))
+            {
+              my @this_case = collect_one_suite($suite, [ $tname ]);
+              if ( @this_case )
+              {
+                push (@$cmdline_cases, @this_case);
+                $found= 1;
+              }
+              @this_case= collect_one_suite("i_".$suite, [ $tname ]);
+              if ( @this_case )
+              {
+                push (@$cmdline_cases, @this_case);
+                $found= 1;
+              }
+            }
+          }
+          if ( !$found )
+          {
+            mtr_error("Could not find '$tname' in '$suites' suite(s)");
+          }
         }
       }
     }
+    # Add test cases collected in the temporary array to the one
+    # containing all previously collected test cases
+    push (@$cases, @$cmdline_cases) if $cmdline_cases;
   }
 
   if ( $opt_reorder && !$quick_collect)
index effc86fcb491b85e39963a5cd660c20162ade9d4..44e3a0fd0e53314e87af0d90895dd19ebbaff72d 100755 (executable)
@@ -3809,21 +3809,62 @@ sub run_query {
 }
 
 
-sub sleep_until_returns_true($$$) {
-  my ($tinfo, $mysqld, $query)= @_;
+sub run_query_output {
+  my ($mysqld, $query, $outfile)= @_;
+
+  my $args;
+  mtr_init_args(\$args);
+  mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+  mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
+
+  mtr_add_arg($args, "--silent");
+  mtr_add_arg($args, "--execute=%s", $query);
+
+  my $res= My::SafeProcess->run
+    (
+     name          => "run_query_output -> ".$mysqld->name(),
+     path          => $exe_mysql,
+     args          => \$args,
+     output        => $outfile,
+     error         => $outfile
+    );
+
+  return $res
+}
+
+
+sub wait_wsrep_ready($$) {
+  my ($tinfo, $mysqld)= @_;
 
-  my $timeout = $opt_start_timeout;
   my $sleeptime= 100; # Milliseconds
-  my $loops= ($timeout * 1000) / $sleeptime;
+  my $loops= ($opt_start_timeout * 1000) / $sleeptime;
 
-  for ( my $loop= 1; $loop <= $loops; $loop++ ) {
-    my $query_result = run_query($tinfo, $mysqld, $query);
-    if (run_query($tinfo, $mysqld, $query) == 1) {
+  my $name= $mysqld->name();
+  my $outfile= "$opt_vardir/tmp/$name.wsrep_ready";
+  my $query= "SET SESSION wsrep_sync_wait = 0;
+              SELECT VARIABLE_VALUE
+              FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+              WHERE VARIABLE_NAME = 'wsrep_ready'";
+
+  for (my $loop= 1; $loop <= $loops; $loop++)
+  {
+    if (run_query_output($mysqld, $query, $outfile) != 0)
+    {
+      $tinfo->{logfile}= "WSREP error while trying to determine node state";
       return 0;
     }
+
+    if (mtr_grab_file($outfile) =~ /^ON/)
+    {
+      unlink($outfile);
+      return 1;
+    }
+
+    mtr_milli_sleep($sleeptime);
   }
-  
-  return 1;
+
+  $tinfo->{logfile}= "WSREP did not transition to state READY";
+  return 0;
 }
 
 
@@ -4367,11 +4408,10 @@ sub run_testcase ($) {
   my @procs;
   while (1)
   {
-    if ($test_timeout > $print_timeout)
+    if (!@procs && $test_timeout > $print_timeout)
     {
       my $proc = My::SafeProcess->wait_any_timeout($print_timeout);
       mtr_verbose("Got $proc");
-      push @procs, $proc;
       if ( $proc->{timeout} )
       {
         #print out that the test is still on
@@ -4380,6 +4420,10 @@ sub run_testcase ($) {
         $print_timeout= start_timer($print_freq * 60);
         next;
       }
+      else
+      {
+        push @procs, $proc;
+      }
     }
     else
     {
@@ -5873,11 +5917,9 @@ sub start_servers($) {
       return 1;
     }
 
-    if (have_wsrep()) {
-      if(sleep_until_returns_true($tinfo, $mysqld, 'SELECT @@wsrep_ready')) {
-         $tinfo->{logfile}= "WSREP did not transition to state READY";
-         return 1;
-      }
+    if (have_wsrep() && !wait_wsrep_ready($tinfo, $mysqld))
+    {
+      return 1;
     }
   }
 
index 6485a0684d2e698ac4d44f2af8baea203e0e5629..7b66d4577a88d012a64d1103909c477216e91805 100644 (file)
@@ -224,3 +224,19 @@ CREATE TABLE t1(a YEAR);
 SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
 1
 DROP TABLE t1;
+#
+# Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
+#              (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
+#
+set @@sql_mode='';
+CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2) engine=innodb;
+Warnings:
+Note   1291    Column 'c1' has duplicated value '' in SET
+INSERT INTO t1 VALUES(990101.102);
+Warnings:
+Warning        1265    Data truncated for column 'c1' at row 1
+SELECT COALESCE(c1)FROM t1 ORDER BY 1;
+COALESCE(c1)
+
+DROP TABLE t1;
+set @@sql_mode=default;
index 175c1807639594d5997f5d55b181ed7f2f9f3807..34e567e117d149d5b558c2f6e90918bef2a10065 100644 (file)
@@ -689,3 +689,9 @@ EXECUTE stmt;
 DEALLOCATE PREPARE stmt;
 DROP TABLE t1;
 End of 5.1 tests
+# Bug#21140111: Explain ... match against: Assertion failed: ret ...
+CREATE TABLE z(a INTEGER) engine=innodb;
+CREATE TABLE q(b TEXT CHARSET latin1, fulltext(b)) engine=innodb;
+explain format=json SELECT 1 FROM q WHERE (SELECT MATCH(b) AGAINST ('*') FROM z);
+ERROR HY000: Incorrect arguments to MATCH
+DROP TABLE z, q;
index 63c852f2ffbbce46d12a6b952527938c1a99bbdb..e44b637cf785d7b75bcb8862ec6ffc21ff0efaad 100644 (file)
@@ -5612,7 +5612,7 @@ HANDLER_WRITE     17
 UNLOCK TABLES;
 EXPLAIN PARTITIONS SELECT * FROM t2 WHERE a = sf_a_from_t1b_d('1') AND a = 2;
 id     select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
-1      SIMPLE  t2      p2      const   PRIMARY PRIMARY 4       const   #       NULL
+1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    #       Impossible WHERE
 FLUSH STATUS;
 START TRANSACTION;
 SELECT * FROM t2 WHERE a = sf_a_from_t1b_d('1') AND a = 2;
@@ -5622,7 +5622,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 1
 HANDLER_EXTERNAL_LOCK  12
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 FLUSH STATUS;
@@ -5635,7 +5635,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 2
 HANDLER_EXTERNAL_LOCK  8
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 UNLOCK TABLES;
@@ -5945,7 +5945,7 @@ HANDLER_WRITE     17
 UNLOCK TABLES;
 EXPLAIN PARTITIONS SELECT sf_add_1(a) - 1, sf_add_hello(b) FROM t2 WHERE a = sf_a_from_t1b_d('1') AND a = 2;
 id     select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
-1      SIMPLE  t2      p2      const   PRIMARY PRIMARY 4       const   #       NULL
+1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    #       Impossible WHERE
 FLUSH STATUS;
 START TRANSACTION;
 SELECT sf_add_1(a) - 1, sf_add_hello(b) FROM t2 WHERE a = sf_a_from_t1b_d('1') AND a = 2;
@@ -5955,7 +5955,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 1
 HANDLER_EXTERNAL_LOCK  12
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 FLUSH STATUS;
@@ -5968,7 +5968,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 2
 HANDLER_EXTERNAL_LOCK  8
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 UNLOCK TABLES;
@@ -6352,7 +6352,7 @@ ROLLBACK;
 UNLOCK TABLES;
 EXPLAIN PARTITIONS UPDATE t2 SET b = CONCAT('+', b) WHERE a = sf_a_from_t1b_d('1') AND a = 2;
 id     select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
-1      SIMPLE  t2      p2      range   PRIMARY PRIMARY 4       const   #       Using where
+1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    #       Impossible WHERE
 FLUSH STATUS;
 START TRANSACTION;
 UPDATE t2 SET b = CONCAT('+', b) WHERE a = sf_a_from_t1b_d('1') AND a = 2;
@@ -6361,7 +6361,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 1
 HANDLER_EXTERNAL_LOCK  12
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 SELECT * FROM t2;
@@ -6379,7 +6379,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 2
 HANDLER_EXTERNAL_LOCK  8
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 SELECT * FROM t2;
@@ -6790,7 +6790,7 @@ ROLLBACK;
 UNLOCK TABLES;
 EXPLAIN PARTITIONS UPDATE t2 SET b = sf_add_hello(b) WHERE a = sf_a_from_t1b_d('1') AND a = 2;
 id     select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
-1      SIMPLE  t2      p2      range   PRIMARY PRIMARY 4       const   #       Using where
+1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    #       Impossible WHERE
 FLUSH STATUS;
 START TRANSACTION;
 UPDATE t2 SET b = sf_add_hello(b) WHERE a = sf_a_from_t1b_d('1') AND a = 2;
@@ -6799,7 +6799,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 1
 HANDLER_EXTERNAL_LOCK  12
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 SELECT * FROM t2;
@@ -6817,7 +6817,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 2
 HANDLER_EXTERNAL_LOCK  8
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 SELECT * FROM t2;
@@ -7236,7 +7236,7 @@ ROLLBACK;
 UNLOCK TABLES;
 EXPLAIN PARTITIONS UPDATE t2 SET a = sf_add_1(a) + 4 WHERE a = sf_a_from_t1b_d('1') AND a = 2;
 id     select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
-1      SIMPLE  t2      p2      range   PRIMARY PRIMARY 4       const   #       Using where; Using temporary
+1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    #       Impossible WHERE
 FLUSH STATUS;
 START TRANSACTION;
 UPDATE t2 SET a = sf_add_1(a) + 4 WHERE a = sf_a_from_t1b_d('1') AND a = 2;
@@ -7245,7 +7245,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 1
 HANDLER_EXTERNAL_LOCK  16
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 SELECT * FROM t2;
@@ -7263,7 +7263,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 2
 HANDLER_EXTERNAL_LOCK  8
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 SELECT * FROM t2;
@@ -7665,7 +7665,7 @@ ROLLBACK;
 UNLOCK TABLES;
 EXPLAIN PARTITIONS DELETE FROM t2 WHERE a = sf_a_from_t1b_d('1') AND a = 2;
 id     select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
-1      SIMPLE  t2      p2      range   PRIMARY PRIMARY 4       const   #       Using where
+1      SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    #       Impossible WHERE
 FLUSH STATUS;
 START TRANSACTION;
 DELETE FROM t2 WHERE a = sf_a_from_t1b_d('1') AND a = 2;
@@ -7674,7 +7674,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 1
 HANDLER_EXTERNAL_LOCK  12
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 SELECT * FROM t2;
@@ -7692,7 +7692,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
 VARIABLE_NAME  VARIABLE_VALUE
 HANDLER_COMMIT 2
 HANDLER_EXTERNAL_LOCK  8
-HANDLER_READ_KEY       4
+HANDLER_READ_KEY       3
 HANDLER_READ_NEXT      1
 HANDLER_WRITE  17
 SELECT * FROM t2;
index 87bb0391b27f7bca34cef5478009b463f69cb871..7563b3e61eb8bbfdce20e9735644e53cc0467087 100644 (file)
@@ -112,7 +112,7 @@ variable_value
 0 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-17
+19
 17 Expected
 select 1 from tab1 limit 1;
 1
@@ -132,7 +132,7 @@ variable_value
 0 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-22
+24
 22 Expected
 select 1 from tab1 limit 2;
 1
@@ -153,7 +153,7 @@ variable_value
 0 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-27
+29
 27 Expected
 # Restart server with query_cache_type ON
 select 1 from tab1 limit 1;
@@ -174,7 +174,7 @@ variable_value
 1 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-8
+10
 8 Expected
 select 1 from tab1 limit 2;
 1
@@ -195,7 +195,7 @@ variable_value
 2 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-12
+14
 12 Expected
 select 1 from tab1 limit 1;
 1
@@ -215,12 +215,12 @@ variable_value
 2 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-16
+18
 16 Expected
 # opening another client session
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-17
+19
 17 Expected
 #cleanup
 DROP TABLE IF EXISTS tab1;
index 81d8f7ad853e8d526e8c434fe353e98ea2003cd0..134d8c3a066a63b109ab9e00db6ad0df3d104911 100644 (file)
@@ -136,7 +136,7 @@ variable_value
 0 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-25
+27
 25 Expected
 select 1 from tab1 limit 1;
 1
@@ -156,7 +156,7 @@ variable_value
 0 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-30
+32
 30 Expected
 select 1 from tab1 limit 2;
 1
@@ -177,7 +177,7 @@ variable_value
 0 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-35
+37
 35 Expected
 # Restart server with query_cache_type ON
 select 1 from tab1 limit 1;
@@ -198,7 +198,7 @@ variable_value
 1 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-8
+10
 8 Expected
 select 1 from tab1 limit 2;
 1
@@ -219,7 +219,7 @@ variable_value
 2 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-12
+14
 12 Expected
 select 1 from tab1 limit 1;
 1
@@ -239,12 +239,12 @@ variable_value
 2 Expected
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-16
+18
 16 Expected
 # opening another client session
 select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
 variable_value
-17
+19
 17 Expected
 #cleanup
 DROP TABLE IF EXISTS tab1;
index 7ca8c54efa88669a4d40bf4493bacea43fd92e9d..52bcaf302dfb755fec227876a1fba0aea6e27155 100755 (executable)
 #         --source $resultFile
 #         if (!$dbidbd) {
 #             --skip Test needs Perl modules DBI and DBD::mysql
-#         } 
+#         }
 #
 #       The calling script is also responsible for cleaning up after use:
 #
 #         --remove_file $resultFile
 #
-# Windows notes: 
+# Windows notes:
 #   - shebangs may work differently - call this script with "perl " in front.
 #
 # See mysql-test/include/have_dbi_dbd-mysql.inc for example use of this script.
@@ -80,8 +80,8 @@ BEGIN {
 };
 
 # Open a file to be used for transfer of result back to mysql-test.
-# The file must be created whether we write to it or not, otherwise mysql-test 
-# will complain if trying to source it. 
+# The file must be created whether we write to it or not, otherwise mysql-test
+# will complain if trying to source it.
 # An empty file indicates failure to load modules.
 open(FILE, ">", $ENV{'MYSQL_TMP_DIR'}.'/dbidbd-mysql.txt');
 
index 6ca571383be82b0ac2687b27d684091a5ad8cab1..eae2bc8b85baa83b189673d52001ede53a67413c 100644 (file)
@@ -469,3 +469,17 @@ ROLLBACK /* added by mysqlbinlog */;
 # Cleanup.
 #
 DROP TABLE t1, t2;
+#
+# Bug#22350047: IF CLIENT KILLED AFTER ROLLBACK TO SAVEPOINT PREVIOUS
+#               STMTS COMMITTED
+#
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+SAVEPOINT tx_0;
+ROLLBACK TO SAVEPOINT tx_0;
+KILL CONNECTION CONN_ID;
+# Without the patch, field 'a' contained the value 1
+SELECT * FROM t1;
+a
+DROP TABLE t1;
index 1e47591e7981cbc118cab1aef7d0d1f107768b54..7c1612358fd094231207f7742f4db9ac651ac5f8 100644 (file)
@@ -162,4 +162,24 @@ let $MYSQLD_DATADIR= `select @@datadir`;
 --echo #
 DROP TABLE t1, t2;
 
+--echo #
+--echo # Bug#22350047: IF CLIENT KILLED AFTER ROLLBACK TO SAVEPOINT PREVIOUS
+--echo #               STMTS COMMITTED
+--echo #
+
+connect(connection1, localhost, root,,);
+--let $connection_id=`SELECT CONNECTION_ID()`
 
+--eval CREATE TABLE t1(a INT) ENGINE=$engine_type
+BEGIN;
+INSERT INTO t1 VALUES(1);
+SAVEPOINT tx_0;
+ROLLBACK TO SAVEPOINT tx_0;
+
+connection default;
+--replace_result $connection_id CONN_ID
+--eval KILL CONNECTION $connection_id
+
+--echo # Without the patch, field 'a' contained the value 1
+SELECT * FROM t1;
+DROP TABLE t1;
index 143e89c9a0420f3c91fb80010899269ebbc68323..66315d944df29d9f95d68ae11ef66dd10b2e8b33 100644 (file)
@@ -13,7 +13,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#gale
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
@@ -33,7 +33,7 @@ wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#gale
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
index 51f6207c11bd471e82842f590af6b793537031be..1057b300982a818a12c42eb12fbad9ad4c2c7a73 100644 (file)
@@ -20,7 +20,7 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port'
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
@@ -43,7 +43,7 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port'
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
index 716a790fea6f4a74a6e509437076c5a252942d53..f68fe5249044de14eac065cf54834d99b67506b5 100644 (file)
@@ -29,7 +29,7 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = P
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
@@ -49,7 +49,7 @@ wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = P
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
index 5f0af2e58e55e8191ecdebfc2c761681f881cd08..d5490280ab24dc124348c3c16c82eedb0a6fef43 100644 (file)
@@ -23,7 +23,7 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port'
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
@@ -49,7 +49,7 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port'
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
index ae762d234e6e75b018d00e9e1f8153b8f4ce911f..0a4378e7e8cd665aeaf54dce669c7f5021d01650 100644 (file)
@@ -23,7 +23,7 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = P
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
@@ -41,7 +41,7 @@ wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = P
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
index 4f3fdb020452630a986a9f1988984574a09d9ff5..e97dc11a09f1ff3a247f4c693ac174276b793146 100644 (file)
@@ -22,7 +22,7 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = P
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
@@ -40,7 +40,7 @@ wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = P
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
@@ -58,7 +58,7 @@ wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.install_timeout = P
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port
@@ -79,8 +79,8 @@ NODE_MYSOCK_2= @mysqld.2.socket
 NODE_MYPORT_3= @mysqld.3.port
 NODE_MYSOCK_3= @mysqld.3.socket
 
-NODE_MYPORT_3= @mysqld.4.port
-NODE_MYSOCK_3= @mysqld.4.socket
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
 
 NODE_GALERAPORT_2= @mysqld.2.#galera_port
 NODE_GALERAPORT_3= @mysqld.3.#galera_port
index 068c73421b69696fb21ce55cdfa8e1a7cb22ae30..0d9a835e4e92c23711fa67b6a28fd87c35b20b62 100644 (file)
@@ -10,7 +10,7 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port'
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
@@ -28,7 +28,7 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port'
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
@@ -46,7 +46,7 @@ wsrep_provider_options='base_port=@mysqld.3.#galera_port'
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
@@ -64,7 +64,7 @@ wsrep_provider_options='base_port=@mysqld.4.#galera_port'
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port
index bcf83e7e1ffa5d2cdee443117aa99c6fe4df667b..7d6ecd08b57efbdc593c34dc9c4576d794321547 100644 (file)
@@ -8,7 +8,7 @@ SHOW STATUS LIKE 'wsrep_desync_count';
 Variable_name  Value
 wsrep_desync_count     0
 SET @@global.wsrep_desync = 0;
-SET SESSION wsrep_sync_wait=7;
+SET SESSION wsrep_sync_wait=15;
 SHOW CREATE TABLE t1;
 Table  Create Table
 t1     CREATE TABLE `t1` (
index 655d8e9e2917eea4435bbdf40b0f4027b872019e..652ef91fdb58a58d5d43083fd64cc7c3071ca446 100644 (file)
@@ -1,9 +1,5 @@
 CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
 INSERT INTO t1 (f1) VALUES (1),(65535);
-FLUSH STATUS;
-SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
-VARIABLE_VALUE = 0
-1
 CREATE PROCEDURE proc_insert ()
 BEGIN
 DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
@@ -13,8 +9,8 @@ INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 ));
 END WHILE;
 END|
 CALL proc_insert();;
-SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
-VARIABLE_VALUE > 0
+wsrep_local_replays
 1
 DROP PROCEDURE proc_insert;
 DROP TABLE t1;
+CALL mtr.add_suppression("conflict state 3 after post commit");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-336.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-336.result
new file mode 100644 (file)
index 0000000..9bdb61c
--- /dev/null
@@ -0,0 +1,42 @@
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+SET GLOBAL wsrep_slave_threads = 10;
+SET GLOBAL wsrep_slave_threads = 1;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_slave_threads = 10;
+SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = 11
+1
+SET GLOBAL wsrep_slave_threads = 20;
+SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = 21
+1
+SET GLOBAL wsrep_slave_threads = 1;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+SET GLOBAL wsrep_slave_threads = 10;
+SET GLOBAL wsrep_slave_threads = 0;
+Warnings:
+Warning        1292    Truncated incorrect wsrep_slave_threads value: '0'
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (18);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (20);
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+COUNT(*) = 2
+1
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-357.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-357.result
new file mode 100644 (file)
index 0000000..d249d59
--- /dev/null
@@ -0,0 +1,6 @@
+SET GLOBAL wsrep_slave_threads = 0;
+Warnings:
+Warning        1292    Truncated incorrect wsrep_slave_threads value: '0'
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-360.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-360.result
new file mode 100644 (file)
index 0000000..4195b8f
--- /dev/null
@@ -0,0 +1,161 @@
+SET GLOBAL wsrep_on=OFF;
+RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+SET GLOBAL wsrep_on=OFF;
+RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+DROP TABLE t1, t2;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+DROP TABLE t1, t2;
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+CREATE TEMPORARY TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3);
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3);
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2);
+DROP TABLE t1;
+DROP TABLE t1;
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+mysqld-bin.000001      120     Previous_gtids  1       151     
+mysqld-bin.000001      151     Gtid    1       199     SET @@SESSION.GTID_NEXT= '<local_uuid>:1'
+mysqld-bin.000001      199     Query   1       339     use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+mysqld-bin.000001      339     Gtid    1       387     SET @@SESSION.GTID_NEXT= '<cluster_uuid>:1'
+mysqld-bin.000001      387     Query   1       503     use `test`; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      503     Gtid    1       551     SET @@SESSION.GTID_NEXT= '<cluster_uuid>:2'
+mysqld-bin.000001      551     Query   1       628     BEGIN
+mysqld-bin.000001      628     Table_map       1       673     table_id: # (test.t2)
+mysqld-bin.000001      673     Write_rows      1       713     table_id: # flags: STMT_END_F
+mysqld-bin.000001      713     Xid     1       744     COMMIT /* xid=# */
+mysqld-bin.000001      744     Gtid    1       792     SET @@SESSION.GTID_NEXT= '<local_uuid>:2'
+mysqld-bin.000001      792     Query   1       927     use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+mysqld-bin.000001      927     Gtid    1       975     SET @@SESSION.GTID_NEXT= '<cluster_uuid>:3'
+mysqld-bin.000001      975     Query   1       1090    use `test`; DROP TABLE `t2` /* generated by server */
+mysqld-bin.000001      1090    Gtid    1       1138    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:4'
+mysqld-bin.000001      1138    Query   1       1254    use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      1254    Gtid    1       1302    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:5'
+mysqld-bin.000001      1302    Query   1       1379    BEGIN
+mysqld-bin.000001      1379    Table_map       1       1424    table_id: # (test.t1)
+mysqld-bin.000001      1424    Write_rows      1       1464    table_id: # flags: STMT_END_F
+mysqld-bin.000001      1464    Xid     1       1495    COMMIT /* xid=# */
+mysqld-bin.000001      1495    Gtid    1       1543    SET @@SESSION.GTID_NEXT= '<local_uuid>:3'
+mysqld-bin.000001      1543    Query   1       1678    use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
+mysqld-bin.000001      1678    Gtid    1       1726    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:6'
+mysqld-bin.000001      1726    Query   1       1841    use `test`; DROP TABLE `t1` /* generated by server */
+mysqld-bin.000001      1841    Gtid    1       1889    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:7'
+mysqld-bin.000001      1889    Query   1       2005    use `test`; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      2005    Gtid    1       2053    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:8'
+mysqld-bin.000001      2053    Query   1       2130    BEGIN
+mysqld-bin.000001      2130    Table_map       1       2175    table_id: # (test.t2)
+mysqld-bin.000001      2175    Write_rows      1       2215    table_id: # flags: STMT_END_F
+mysqld-bin.000001      2215    Xid     1       2246    COMMIT /* xid=# */
+mysqld-bin.000001      2246    Gtid    1       2294    SET @@SESSION.GTID_NEXT= '<local_uuid>:4'
+mysqld-bin.000001      2294    Query   1       2434    use `test`; DROP TEMPORARY TABLE IF EXISTS `t1`,`t3` /* generated by server */
+mysqld-bin.000001      2434    Gtid    1       2482    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:9'
+mysqld-bin.000001      2482    Query   1       2597    use `test`; DROP TABLE `t2` /* generated by server */
+mysqld-bin.000001      2597    Gtid    1       2645    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:10'
+mysqld-bin.000001      2645    Query   1       2761    use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      2761    Gtid    1       2809    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:11'
+mysqld-bin.000001      2809    Query   1       2886    BEGIN
+mysqld-bin.000001      2886    Table_map       1       2931    table_id: # (test.t1)
+mysqld-bin.000001      2931    Write_rows      1       2971    table_id: # flags: STMT_END_F
+mysqld-bin.000001      2971    Xid     1       3002    COMMIT /* xid=# */
+mysqld-bin.000001      3002    Gtid    1       3050    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:12'
+mysqld-bin.000001      3050    Query   1       3166    use `test`; CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      3166    Gtid    1       3214    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:13'
+mysqld-bin.000001      3214    Query   1       3291    BEGIN
+mysqld-bin.000001      3291    Table_map       1       3336    table_id: # (test.t3)
+mysqld-bin.000001      3336    Write_rows      1       3376    table_id: # flags: STMT_END_F
+mysqld-bin.000001      3376    Xid     1       3407    COMMIT /* xid=# */
+mysqld-bin.000001      3407    Gtid    1       3455    SET @@SESSION.GTID_NEXT= '<local_uuid>:5'
+mysqld-bin.000001      3455    Query   1       3590    use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
+mysqld-bin.000001      3590    Gtid    1       3638    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:14'
+mysqld-bin.000001      3638    Query   1       3758    use `test`; DROP TABLE `t1`,`t3` /* generated by server */
+mysqld-bin.000001      3758    Gtid    1       3806    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:15'
+mysqld-bin.000001      3806    Query   1       3922    use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      3922    Gtid    1       3970    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:16'
+mysqld-bin.000001      3970    Query   1       4047    BEGIN
+mysqld-bin.000001      4047    Table_map       1       4092    table_id: # (test.t1)
+mysqld-bin.000001      4092    Write_rows      1       4132    table_id: # flags: STMT_END_F
+mysqld-bin.000001      4132    Xid     1       4163    COMMIT /* xid=# */
+mysqld-bin.000001      4163    Gtid    1       4211    SET @@SESSION.GTID_NEXT= '<local_uuid>:6'
+mysqld-bin.000001      4211    Query   1       4351    use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+mysqld-bin.000001      4351    Gtid    1       4399    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:17'
+mysqld-bin.000001      4399    Query   1       4514    use `test`; DROP TABLE `t1` /* generated by server */
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+mysqld-bin.000001      120     Previous_gtids  2       151     
+mysqld-bin.000001      151     Gtid    1       199     SET @@SESSION.GTID_NEXT= '<cluster_uuid>:1'
+mysqld-bin.000001      199     Query   1       315     use `test`; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      315     Gtid    1       363     SET @@SESSION.GTID_NEXT= '<cluster_uuid>:2'
+mysqld-bin.000001      363     Query   1       431     BEGIN
+mysqld-bin.000001      431     Table_map       1       476     table_id: # (test.t2)
+mysqld-bin.000001      476     Write_rows      1       516     table_id: # flags: STMT_END_F
+mysqld-bin.000001      516     Xid     1       547     COMMIT /* xid=# */
+mysqld-bin.000001      547     Gtid    1       595     SET @@SESSION.GTID_NEXT= '<cluster_uuid>:3'
+mysqld-bin.000001      595     Query   1       710     use `test`; DROP TABLE `t2` /* generated by server */
+mysqld-bin.000001      710     Gtid    1       758     SET @@SESSION.GTID_NEXT= '<cluster_uuid>:4'
+mysqld-bin.000001      758     Query   1       874     use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      874     Gtid    1       922     SET @@SESSION.GTID_NEXT= '<cluster_uuid>:5'
+mysqld-bin.000001      922     Query   1       990     BEGIN
+mysqld-bin.000001      990     Table_map       1       1035    table_id: # (test.t1)
+mysqld-bin.000001      1035    Write_rows      1       1075    table_id: # flags: STMT_END_F
+mysqld-bin.000001      1075    Xid     1       1106    COMMIT /* xid=# */
+mysqld-bin.000001      1106    Gtid    1       1154    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:6'
+mysqld-bin.000001      1154    Query   1       1269    use `test`; DROP TABLE `t1` /* generated by server */
+mysqld-bin.000001      1269    Gtid    1       1317    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:7'
+mysqld-bin.000001      1317    Query   1       1433    use `test`; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      1433    Gtid    1       1481    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:8'
+mysqld-bin.000001      1481    Query   1       1549    BEGIN
+mysqld-bin.000001      1549    Table_map       1       1594    table_id: # (test.t2)
+mysqld-bin.000001      1594    Write_rows      1       1634    table_id: # flags: STMT_END_F
+mysqld-bin.000001      1634    Xid     1       1665    COMMIT /* xid=# */
+mysqld-bin.000001      1665    Gtid    1       1713    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:9'
+mysqld-bin.000001      1713    Query   1       1828    use `test`; DROP TABLE `t2` /* generated by server */
+mysqld-bin.000001      1828    Gtid    1       1876    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:10'
+mysqld-bin.000001      1876    Query   1       1992    use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      1992    Gtid    1       2040    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:11'
+mysqld-bin.000001      2040    Query   1       2108    BEGIN
+mysqld-bin.000001      2108    Table_map       1       2153    table_id: # (test.t1)
+mysqld-bin.000001      2153    Write_rows      1       2193    table_id: # flags: STMT_END_F
+mysqld-bin.000001      2193    Xid     1       2224    COMMIT /* xid=# */
+mysqld-bin.000001      2224    Gtid    1       2272    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:12'
+mysqld-bin.000001      2272    Query   1       2388    use `test`; CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      2388    Gtid    1       2436    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:13'
+mysqld-bin.000001      2436    Query   1       2504    BEGIN
+mysqld-bin.000001      2504    Table_map       1       2549    table_id: # (test.t3)
+mysqld-bin.000001      2549    Write_rows      1       2589    table_id: # flags: STMT_END_F
+mysqld-bin.000001      2589    Xid     1       2620    COMMIT /* xid=# */
+mysqld-bin.000001      2620    Gtid    1       2668    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:14'
+mysqld-bin.000001      2668    Query   1       2788    use `test`; DROP TABLE `t1`,`t3` /* generated by server */
+mysqld-bin.000001      2788    Gtid    1       2836    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:15'
+mysqld-bin.000001      2836    Query   1       2952    use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001      2952    Gtid    1       3000    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:16'
+mysqld-bin.000001      3000    Query   1       3068    BEGIN
+mysqld-bin.000001      3068    Table_map       1       3113    table_id: # (test.t1)
+mysqld-bin.000001      3113    Write_rows      1       3153    table_id: # flags: STMT_END_F
+mysqld-bin.000001      3153    Xid     1       3184    COMMIT /* xid=# */
+mysqld-bin.000001      3184    Gtid    1       3232    SET @@SESSION.GTID_NEXT= '<cluster_uuid>:17'
+mysqld-bin.000001      3232    Query   1       3347    use `test`; DROP TABLE `t1` /* generated by server */
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-362.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-362.result
new file mode 100644 (file)
index 0000000..13552f6
--- /dev/null
@@ -0,0 +1,13 @@
+RESET MASTER;
+ERROR 42000: RESET MASTER not allowed when node is in cluster
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+DROP TABLE t1;
+SET GLOBAL WSREP_ON=OFF;
+RESET MASTER;
+SET GLOBAL WSREP_ON=ON;
+SHOW BINARY LOGS;
+Log_name       File_size
+mysqld-bin.000001      151
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name       Pos     Event_type      Server_id       End_log_pos     Info
+mysqld-bin.000001      120     Previous_gtids  1       151     
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-369.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-369.result
new file mode 100644 (file)
index 0000000..516904d
--- /dev/null
@@ -0,0 +1,155 @@
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1))  ;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+DELETE FROM p WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+INSERT INTO c VALUES (1, 1);
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1     f2
+1      0
+2      0
+SELECT * FROM c;
+f1     p_id
+1      1
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1))  ;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE c SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SELECT * FROM p;
+f1     f2
+1      1
+2      0
+SELECT * FROM c;
+f1     p_id    f2
+1      1       1
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1))  ;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+DELETE FROM c WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SELECT * FROM p;
+f1     f2
+1      1
+2      0
+SELECT * FROM c;
+f1     p_id
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER UNIQUE KEY) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f2))  ;
+INSERT INTO p VALUES (1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+INSERT INTO c VALUES (1, 0);;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1     f2
+1      0
+SELECT * FROM c;
+f1     p_id
+1      0
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)
+ON DELETE CASCADE)  ;
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+DELETE FROM p WHERE f1 = 1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE c SET f2 = 1 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1     f2
+1      0
+2      0
+SELECT * FROM c;
+f1     p_id    f2
+1      1       1
+DROP TABLE c;
+DROP TABLE p;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-388.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-388.result
new file mode 100644 (file)
index 0000000..117b0fe
--- /dev/null
@@ -0,0 +1,35 @@
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) Engine=InnoDB;
+CREATE PROCEDURE insert_proc ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+BEGIN
+GET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;
+END;
+INSERT INTO t1 VALUES (1, 'node 1'),(2, 'node 1');
+INSERT INTO t1 VALUES (3, 'node 1');
+END|
+SET GLOBAL wsrep_slave_threads = 2;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+INSERT INTO t1 VALUES (1, 'node 2');;
+SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION DEBUG_SYNC = 'wsrep_after_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
+CALL insert_proc ();;
+SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+SELECT @errno = 1213;
+@errno = 1213
+1
+SELECT * FROM t1;
+f1     f2
+1      node 2
+3      node 1
+SELECT * FROM t1;
+f1     f2
+1      node 2
+3      node 1
+SET GLOBAL wsrep_slave_threads = DEFAULT;
+DROP TABLE t1;
+DROP PROCEDURE insert_proc;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-402.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-402.result
new file mode 100644 (file)
index 0000000..fdcf6e3
--- /dev/null
@@ -0,0 +1,192 @@
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON DELETE CASCADE);
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE c SET f2=1 where f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+DELETE FROM p WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1     f2
+2      0
+SELECT * FROM c;
+f1     p_id    f2
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE c SET f2=2 where f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE p set f1=11 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1     f2
+2      0
+11     0
+SELECT * FROM c;
+f1     p_id    f2
+1      11      0
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE c SET p_id=2 where f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE p set f1=11 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1     f2
+2      0
+11     0
+SELECT * FROM c;
+f1     p_id    f2
+1      11      0
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p set f1=21 WHERE f1 = 11;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+UPDATE c SET p_id=2 where f1=1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p;
+f1     f2
+2      0
+11     0
+SELECT * FROM c;
+f1     p_id    f2
+1      2       0
+DROP TABLE c;
+DROP TABLE p;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ON DELETE CASCADE,
+CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1));
+INSERT INTO p1 VALUES (1, 0);
+INSERT INTO p2 VALUES (1, 0);
+INSERT INTO c VALUES (1, 1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE p2 SET f2=2 where f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+DELETE FROM p1 WHERE f1 = 1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SELECT * FROM p1;
+f1     f2
+SELECT * FROM p2;
+f1     f2
+1      2
+SELECT * FROM c;
+f1     p1_id   p2_id   f2
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+f2 INTEGER,
+CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+ON DELETE CASCADE,
+CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+ON DELETE CASCADE);
+INSERT INTO p1 VALUES (1, 0);
+INSERT INTO p2 VALUES (1, 0);
+INSERT INTO c VALUES (1, 1, 1, 0);
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+DELETE FROM p2 WHERE f1=1;
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+DELETE FROM p1 WHERE f1=1;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_enter_sync';
+COMMIT;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=local_monitor_enter_sync';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT * FROM p1;
+f1     f2
+SELECT * FROM p2;
+f1     f2
+1      0
+SELECT * FROM c;
+f1     p1_id   p2_id   f2
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-416.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-416.result
new file mode 100644 (file)
index 0000000..3b2eb79
--- /dev/null
@@ -0,0 +1,110 @@
+CREATE USER 'userMW416'@'localhost';
+GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost';
+ALTER DATABASE db CHARACTER SET = utf8;
+ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'db'
+ALTER EVENT ev1 RENAME TO ev2;
+ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'test'
+ALTER FUNCTION fun1 COMMENT 'foo';
+ERROR 42000: alter routine command denied to user 'userMW416'@'localhost' for routine 'test.fun1'
+ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
+Got one of the listed errors
+ALTER PROCEDURE proc1 COMMENT 'foo';
+Got one of the listed errors
+ALTER SERVER srv OPTIONS (USER 'sally');
+Got one of the listed errors
+ALTER TABLE tbl DROP COLUMN col;
+Got one of the listed errors
+ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
+Got one of the listed errors
+ALTER VIEW vw AS SELECT 1;
+Got one of the listed errors
+CREATE DATABASE db;
+Got one of the listed errors
+CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP  DO SELECT 1;
+Got one of the listed errors
+CREATE FUNCTION fun1() RETURNS int RETURN(1);
+Got one of the listed errors
+CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so';
+Got one of the listed errors
+CREATE PROCEDURE proc1()  BEGIN END;
+Got one of the listed errors
+CREATE INDEX idx ON tbl(id);
+Got one of the listed errors
+CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
+Got one of the listed errors
+CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
+Got one of the listed errors
+CREATE TABLE t (i int);
+Got one of the listed errors
+CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
+Got one of the listed errors
+CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
+Got one of the listed errors
+CREATE VIEW vw AS SELECT 1;
+Got one of the listed errors
+DROP DATABASE db;
+Got one of the listed errors
+DROP EVENT ev;
+Got one of the listed errors
+DROP FUNCTION fun1;
+Got one of the listed errors
+DROP INDEX idx ON t0;
+Got one of the listed errors
+DROP LOGFILE GROUP lfg;
+Got one of the listed errors
+DROP PROCEDURE proc1;
+Got one of the listed errors
+DROP SERVEr srv;
+Got one of the listed errors
+DROP TABLE t0;
+Got one of the listed errors
+DROP TABLESPACE tblspc;
+Got one of the listed errors
+DROP TRIGGER trg;
+Got one of the listed errors
+DROP VIEW vw;
+Got one of the listed errors
+RENAME TABLE t0 TO t1;
+Got one of the listed errors
+TRUNCATE TABLE t0;
+Got one of the listed errors
+ALTER USER myuser PASSWORD EXPIRE;
+Got one of the listed errors
+CREATE USER myuser IDENTIFIED BY 'pass';
+Got one of the listed errors
+DROP USER myuser;
+Got one of the listed errors
+GRANT ALL ON *.* TO 'myuser';
+Got one of the listed errors
+RENAME USER myuser TO mariauser;
+Got one of the listed errors
+REVOKE SELECT ON test FROM myuser;
+Got one of the listed errors
+REVOKE ALL, GRANT OPTION FROM myuser;
+Got one of the listed errors
+REVOKE PROXY ON myuser FROM myuser;
+Got one of the listed errors
+ANALYZE TABLE db.tbl;
+Got one of the listed errors
+CHECK TABLE db.tbl;
+Got one of the listed errors
+CHECKSUM TABLE db.tbl;
+Got one of the listed errors
+OPTIMIZE TABLE db.tbl;
+Got one of the listed errors
+REPAIR TABLE db.tbl;
+Got one of the listed errors
+INSTALL PLUGIN plg SONAME 'plg.so';
+Got one of the listed errors
+UNINSTALL PLUGIN plg;
+Got one of the listed errors
+DROP USER 'userMW416'@'localhost';
+SHOW DATABASES;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+wsrep_replicated_after_diff
+1
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-86-wait1.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-86-wait1.result
new file mode 100644 (file)
index 0000000..ee9ae00
--- /dev/null
@@ -0,0 +1,40 @@
+SELECT @@debug_sync;
+@@debug_sync
+ON - signals: ''
+SET SESSION wsrep_sync_wait = 1;
+SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
+CREATE TABLE t_wait1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t_wait1 VALUES (1);
+SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+SHOW BINARY LOGS;
+SHOW BINLOG EVENTS;
+SHOW COLUMNS FROM t1;
+SHOW CREATE EVENT e1;
+SHOW CREATE FUNCTION f1;
+SHOW CREATE PROCEDURE p1;
+SHOW CREATE TABLE t1;
+SHOW CREATE TRIGGER tr1;
+SHOW CREATE VIEW v1;
+SHOW DATABASES;
+SHOW ENGINE InnoDB STATUS;
+SHOW FUNCTION CODE f1;
+SHOW FUNCTION STATUS;
+SHOW GRANTS FOR 'root'@'localhost';
+SHOW INDEX FROM t1;
+SHOW OPEN TABLES;
+SHOW PROCEDURE CODE p1;
+SHOW PROCEDURE STATUS;
+SHOW PRIVILEGES;
+SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW TABLE STATUS;
+SHOW TABLES;
+SHOW TRIGGERS;
+SHOW GLOBAL VARIABLES LIKE 'foo_bar';
+SHOW WARNINGS;
+SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
+SET SESSION debug_sync = "now SIGNAL signal.wsrep_apply_cb";
+SET SESSION wsrep_sync_wait = default;
+DROP TABLE t_wait1;
+SELECT @@debug_sync;
+@@debug_sync
+ON - signals: ''
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-86-wait8.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/MW-86-wait8.result
new file mode 100644 (file)
index 0000000..093f462
--- /dev/null
@@ -0,0 +1,42 @@
+SELECT @@debug_sync;
+@@debug_sync
+ON - signals: ''
+SET SESSION wsrep_sync_wait = 8;
+SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
+CREATE TABLE t_wait8 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t_wait8 VALUES (1);
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT0.1S";
+SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+SHOW BINARY LOGS;
+SHOW BINLOG EVENTS;
+SHOW COLUMNS FROM t1;
+SHOW CREATE DATABASE db1;
+SHOW CREATE EVENT e1;
+SHOW CREATE FUNCTION f1;
+SHOW CREATE PROCEDURE p1;
+SHOW CREATE TABLE t1;
+SHOW CREATE TRIGGER tr1;
+SHOW CREATE VIEW v1;
+SHOW DATABASES;
+SHOW ENGINE InnoDB STATUS;
+SHOW FUNCTION CODE f1;
+SHOW FUNCTION STATUS;
+SHOW GRANTS FOR 'root'@'localhost';
+SHOW INDEX FROM t1;
+SHOW OPEN TABLES;
+SHOW PROCEDURE CODE p1;
+SHOW PROCEDURE STATUS;
+SHOW PRIVILEGES;
+SHOW STATUS LIKE 'wsrep_cluster_size';
+SHOW TABLE STATUS;
+SHOW TABLES;
+SHOW TRIGGERS;
+SHOW GLOBAL VARIABLES LIKE 'foo_bar';
+SHOW WARNINGS;
+SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+SET SESSION wsrep_sync_wait = default;
+DROP TABLE t_wait8;
+SELECT @@debug_sync;
+@@debug_sync
+ON - signals: ''
index cecbfc1f3cf126820c1cf9becd259ff65bd7ed8f..1b2a3b937bb92110c5992fa94887542f8b5727d7 100644 (file)
@@ -8,7 +8,7 @@ SELECT COUNT(*) = 0 FROM t1;
 COUNT(*) = 0
 1
 UNLOCK TABLES;
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 SELECT COUNT(*) = 2 FROM t1;
 COUNT(*) = 2
 1
index ee967356c85074d0cf271ed0d21093a7e9cfb2b9..c30f78896e51ff0d429ee222f71f7608cb383e4c 100644 (file)
@@ -12,7 +12,7 @@ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system use
 COUNT(*) = 1
 1
 UNLOCK TABLES;
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 SHOW CREATE TABLE t1;
 Table  Create Table
 t1     CREATE TABLE `t1` (
index a8f5ec8e37e32e570e85766b8228700ccbde60a4..f52f0d2211dbe8a7cd3e30b5c24d9adbc2267794 100644 (file)
@@ -37,11 +37,9 @@ i    c
 show variables like 'binlog_format';
 Variable_name  Value
 binlog_format  STATEMENT
-show variables like '%auto_increment%';
+show variables like 'auto_increment_increment';
 Variable_name  Value
 auto_increment_increment       7
-auto_increment_offset  5
-wsrep_auto_increment_control   ON
 select * from t1;
 i      c
 1      dummy_text
index 27bebf2ff6ec8203c552be58731416d9c83a07c7..b148128935cc33df405daa0d61686e29779fd44a 100644 (file)
@@ -1,6 +1,10 @@
 RESET MASTER;
+SET GLOBAL wsrep_on=OFF;
 RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+SET GLOBAL wsrep_on=OFF;
 RESET MASTER;
+SET GLOBAL wsrep_on=ON;
 START SLAVE USER='root';
 Warnings:
 Note   1759    Sending passwords in plain text without SSL/TLS is extremely insecure.
index c968312b1848a6fbdd2fbe3a12dd21e8d1a2173b..10bce66e51cdf399ddf921535a315dc789e9a40b 100644 (file)
@@ -1,6 +1,10 @@
 RESET MASTER;
+SET GLOBAL wsrep_on=OFF;
 RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+SET GLOBAL wsrep_on=OFF;
 RESET MASTER;
+SET GLOBAL wsrep_on=ON;
 START SLAVE USER='root';
 Warnings:
 Note   1759    Sending passwords in plain text without SSL/TLS is extremely insecure.
@@ -167,7 +171,7 @@ USE test2;
 ERROR 42000: Unknown database 'test2'
 SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
 Log_name       Pos     Event_type      Server_id       End_log_pos     Info
-mysqld-bin.000001      120     Previous_gtids  4       151     
+mysqld-bin.000001      120     Previous_gtids  3       151     
 mysqld-bin.000001      151     Gtid    1       199     SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
 mysqld-bin.000001      199     Query   1       294     CREATE SCHEMA test1
 mysqld-bin.000001      294     Gtid    1       342     SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
index 99cb48403461bf762b622e1c5350e83da1488ed4..1624560041b4c43d3fb79486ec539e71b6935f7b 100644 (file)
@@ -14,7 +14,7 @@ STOP SLAVE;
 RESET SLAVE ALL;
 CALL mtr.add_suppression("Slave SQL: Error 'WSREP has not yet prepared node for application use' on query");
 CALL mtr.add_suppression("Slave: WSREP has not yet prepared node for application use Error_code: 1047");
-CALL mtr.add_suppression("Transport endpoint is not connected");
+CALL mtr.add_suppression("(Transport endpoint is not connected|Socket is not connected)");
 CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213");
 CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
 RESET MASTER;
index 96ed226c3ab93922672260e50b88a5aa0beeb3fb..3c5c07ae396fec8fe24b46535b2f276ec8f8fdf2 100644 (file)
@@ -6,7 +6,7 @@ SET SESSION wsrep_sync_wait = 0;
 UNLOCK TABLES;
 COMMIT;
 SET AUTOCOMMIT=ON;
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 SELECT COUNT(*) = 1 FROM t1;
 COUNT(*) = 1
 1
index 3978a3df193f811481531e9814f561a386c66569..2367924466c4d0737dedb3e86be658eed01ef647 100644 (file)
@@ -1,10 +1,21 @@
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t1 VALUES (1);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, 10);
+BEGIN;
 SELECT * FROM t1 FOR UPDATE;
+f1     f2
+1      10
+UPDATE t1 SET f1 = 2;
+COMMIT;
 ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-wsrep_local_aborts_increment
+wsrep_local_bf_aborts_diff
+1
+BEGIN;
+SELECT * FROM t1 FOR UPDATE;
+f1     f2
+2      10
+UPDATE t1 SET f2 = 20;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+wsrep_local_bf_aborts_diff
 1
 DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_table_as_select.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_create_table_as_select.result
new file mode 100644 (file)
index 0000000..68f30d3
--- /dev/null
@@ -0,0 +1,78 @@
+SET SESSION default_storage_engine=InnoDB;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t1 AS SELECT * FROM t2;
+ERROR 42S01: Table 't1' already exists
+DROP TABLE t1,t2;
+CREATE TABLE t1 AS SELECT * FROM t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
+CREATE TABLE t1 AS SELECT 1 FROM DUAL;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t1 AS SELECT * FROM t2;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1,t2;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+CREATE TABLE t1 AS SELECT * FROM t2;
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+DROP TABLE t1,t2;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+CREATE TABLE t1 AS SELECT MAX(f1) AS f1 FROM t2;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT f1 = 5 FROM t1;
+f1 = 5
+1
+DROP TABLE t1,t2;
+CREATE PROCEDURE sp1 ()
+BEGIN
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+CREATE TABLE t1 AS SELECT * FROM t2;
+END|
+CALL sp1();
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+DROP TABLE t1, t2;
+DROP PROCEDURE sp1;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+PREPARE stmt FROM 'CREATE TABLE t1 AS SELECT * FROM t2';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+LOCK TABLE t2 WRITE;
+CREATE TABLE t1 AS SELECT * FROM t2;;
+SELECT COUNT(*) = 5 FROM t2;
+COUNT(*) = 5
+1
+CREATE TABLE t1 AS SELECT * FROM t2;
+UNLOCK TABLES;
+Got one of the listed errors
+DROP TABLE t1, t2;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+CREATE TEMPORARY TABLE t1 AS SELECT * FROM t2;
+SELECT * FROM t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t1'' on query");
+DROP TABLE t1, t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ddl_multiline.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ddl_multiline.result
new file mode 100644 (file)
index 0000000..602f183
--- /dev/null
@@ -0,0 +1,80 @@
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table  Create Table
+t2     CREATE TABLE `t2` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table  Create Table
+t2     CREATE TABLE `t2` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t4 (f1 INTEGER) ENGINE=InnoDB;;
+SHOW CREATE TABLE t3;
+Table  Create Table
+t3     CREATE TABLE `t3` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t4;
+Table  Create Table
+t4     CREATE TABLE `t4` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t3;
+Table  Create Table
+t3     CREATE TABLE `t3` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t4;
+Table  Create Table
+t4     CREATE TABLE `t4` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t5 (f1 INTEGER) ENGINE=InnoDB;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t5;
+Table  Create Table
+t5     CREATE TABLE `t5` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t5;
+Table  Create Table
+t5     CREATE TABLE `t5` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+CREATE TABLE t6 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t2 VALUES (1);;
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t6;
+Table  Create Table
+t6     CREATE TABLE `t6` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT COUNT(*) = 1 FROM t2;
+COUNT(*) = 1
+1
+SHOW CREATE TABLE t6;
+Table  Create Table
+t6     CREATE TABLE `t6` (
+  `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1, t2, t3, t4, t5, t6;
index 4fd231ed109d0b53830bd12b0620743a87912473..8db446f4e20fadc31710c200ccea7f7d473d4205 100644 (file)
@@ -46,7 +46,7 @@ WSREP_SST_AUTH
 WSREP_SST_DONOR        
 WSREP_SST_DONOR_REJECTS_QUERIES        OFF
 WSREP_SST_METHOD       rsync
-WSREP_SYNC_WAIT        7
+WSREP_SYNC_WAIT        15
 <BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <RECV_Q_HARD_LIMIT>;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992; 
 SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
 WHERE VARIABLE_NAME LIKE 'wsrep_%'
index 2d6e38e0bc1254ff0766f49f1f0110113f84aa39..290ccc01a46d5bae8beed1c08dab52dc4a04ec0d 100644 (file)
@@ -1,5 +1,5 @@
-SET GLOBAL wsrep_sync_wait = 7;
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
+SET GLOBAL wsrep_sync_wait = 15;
 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
 INSERT INTO t1 VALUES (1);
 INSERT IGNORE INTO t1 VALUES (1), (2);
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_progress.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/galera_ist_progress.result
new file mode 100644 (file)
index 0000000..9fc7feb
--- /dev/null
@@ -0,0 +1,19 @@
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+INSERT INTO t1 VALUES (10);
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
+include/assert_grep.inc [Receiving IST: 11 writesets, seqnos]
+include/assert_grep.inc [Receiving IST\.\.\.  0\.0% \( 0/11 events\) complete]
+include/assert_grep.inc [Receiving IST\.\.\.100\.0% \(11/11 events\) complete]
+DROP TABLE t1;
index f7a1386e7f8281854833d2cc4dc07bb9036f80a4..ca6848fb925adf070b7a814108ed8ba920337e5b 100644 (file)
@@ -4,16 +4,11 @@ Unloading wsrep provider ...
 SET GLOBAL wsrep_provider = 'none';
 UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
 UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
-SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx';
-SET SESSION wsrep_sync_wait = 0;
 Loading wsrep_provider ...
-SHOW STATUS LIKE 'wsrep_debug_sync_waiters';
-Variable_name  Value
-wsrep_debug_sync_waiters       recv_IST_after_apply_trx
+SET SESSION wsrep_on=OFF;
+SET SESSION wsrep_on=ON;
 UPDATE t1 SET f2 = 'd' WHERE f1 > 3;
-CREATE TABLE t2 (f1 INTEGER);
 UPDATE t1 SET f2 = 'e' WHERE f1 > 4;
-CREATE TABLE t3 (f1 INTEGER);
 Performing --wsrep-recover ...
 Starting server ...
 Using --wsrep-start-position when starting mysqld ...
@@ -34,10 +29,4 @@ f1   f2
 4      d
 5      e
 6      f
-SELECT COUNT(*) = 0 FROM t2;
-COUNT(*) = 0
-1
-SELECT COUNT(*) = 0 FROM t3;
-COUNT(*) = 0
-1
-DROP TABLE t1, t2, t3;
+DROP TABLE t1;
index a34367d6e464371ca52338808045e39880997554..e650dd6f5defa44f8d1e0c0b97c0fa46d6511664 100644 (file)
@@ -5,7 +5,7 @@ INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
 CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
 INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
 SET SESSION wsrep_sync_wait = 0;
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';
 SELECT COUNT(*) = 100000 FROM t1;
 COUNT(*) = 100000
index 85ba022a31b4716f093f7a6732ad120260565f4a..98786ffa4b3a9984f9c3c9628c16a8efcbd10688 100644 (file)
@@ -18,7 +18,7 @@ SELECT COUNT(*) = 0 FROM t2;
 COUNT(*) = 0
 1
 UNLOCK TABLES;
-SET SESSION wsrep_sync_wait = 7;;
+SET SESSION wsrep_sync_wait = 15;;
 SELECT COUNT(*) = 1 FROM t1;
 COUNT(*) = 1
 1
index 6d023c38a572be39a59f37a6b867c6d256402675..3b10815c63d295cf57395e382b363719527842c6 100644 (file)
@@ -16,7 +16,7 @@ INSERT INTO t1 VALUES (1);
 INSERT INTO t2 VALUES (1);
 SET SESSION wsrep_sync_wait = 0;
 UNLOCK TABLES;
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 SELECT COUNT(*) = 10 FROM t1;
 COUNT(*) = 10
 0
index e9faff8be8bcd5292913686c92eeb9a116e97324..57e14667878a999456da9a8c0da76b0693475b07 100644 (file)
@@ -2,7 +2,6 @@ CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
 INSERT INTO t1 VALUES (1);
 SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
 SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
-SET SESSION wsrep_sync_wait = 7;
 SELECT MAX(id) FROM t1;
 MAX(id)
 1
@@ -12,7 +11,6 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 SET GLOBAL DEBUG = "";
 SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
 FLUSH QUERY CACHE;
-SET SESSION wsrep_sync_wait = 7;
 SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
 INSERT INTO t1 VALUES (3);
 SELECT MAX(id) FROM t1;
@@ -20,11 +18,9 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 SET GLOBAL DEBUG = "";
 SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
 INSERT INTO t1 VALUES (4);
-SET SESSION wsrep_sync_wait = 7;
 SELECT MAX(id) FROM t1;
 MAX(id)
 4
-SET SESSION wsrep_sync_wait = 7;
 FLUSH STATUS;
 SELECT MAX(id) FROM t1;
 MAX(id)
@@ -34,7 +30,6 @@ VARIABLE_VALUE = 1
 1
 SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
 INSERT INTO t1 VALUES (5);
-SET SESSION wsrep_sync_wait = 7;
 SELECT MAX(id) FROM t1 ;
 SET GLOBAL DEBUG = "";
 SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
index 6602d499412bc86849bcb58defeb8faf5f0e7973..cb4f0eae190ea29dbca9f68ae0ed9df49458d387 100644 (file)
@@ -1,4 +1,4 @@
-SET SESSION wsrep_sync_wait = 1;
+SET SESSION wsrep_sync_wait = 8;
 CREATE DATABASE db1;
 SHOW CREATE DATABASE db1;
 Database       Create Database
index 212c6c65b674a16583388859f1cb83da37c2e5cb..78c04a2306d4e1c628c4e321de8e6c084c692230 100644 (file)
@@ -1,5 +1,5 @@
-SET GLOBAL wsrep_sync_wait = 7;
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
+SET GLOBAL wsrep_sync_wait = 15;
 CREATE DATABASE `database with space`;
 USE `database with space`;
 CREATE TABLE `table with space` (
index 8100962793600b7e8aa7811d6188b2ab036f6b4f..83d8de0e842be5d079acef250cf971a4a96454dd 100644 (file)
@@ -34,7 +34,7 @@ CALL mtr.add_suppression("Failed to initialize backend using 'foo");
 CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo");
 CALL mtr.add_suppression("gcs connect failed: Socket type not supported");
 CALL mtr.add_suppression("wsrep::connect\\(\\) failed: 7");
-CALL mtr.add_suppression("gcs_caused\\(\\) returned -103 \\(Software caused connection abort\\)");
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -[0-9]+ \\(Software caused connection abort\\)");
 CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110");
 CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
 CALL mtr.add_suppression("gcs connect failed: Connection timed out");
index f6136a4ddc48f1287e199953a2d28a7a61d09391..f573c251bdd59c07363cebb156b9564ed255484c 100644 (file)
@@ -1,8 +1,5 @@
 CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
 SET GLOBAL wsrep_sync_wait = 1;
-SHOW TABLES LIKE '%t1';
-Tables_in_test (%t1)
-t1
 SELECT COUNT(*) = 0 FROM t1;
 COUNT(*) = 0
 1
@@ -15,7 +12,7 @@ SET GLOBAL wsrep_sync_wait = 2;
 UPDATE t3 SET f1 = 2;
 affected rows: 1
 info: Rows matched: 1  Changed: 1  Warnings: 0
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
 DROP TABLE t1;
 DROP TABLE t2;
 DROP TABLE t3;
index 25ba2cb615cf3cb5b4ad6e338ca8df170bb0b214..a278c492372f4c1ba1466dbdc9f5783e02530073 100644 (file)
@@ -1,5 +1,8 @@
 CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
 CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
+SELECT 1 FROM DUAL;
+1
+1
 LOCK TABLE t2 WRITE;
 OPTIMIZE TABLE t1,t2;;
 REPAIR TABLE t1,t2;;
index 1c0998e35ac8c11327664d984fafd87704bc41a4..34d184d8ec1ceb33cd4105df0c46332bcf5723e7 100644 (file)
@@ -1,4 +1,3 @@
 CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
 INSERT INTO t1 VALUES (DEFAULT);
 SET GLOBAL query_cache_size=1355776;
-SET SESSION wsrep_sync_wait = 7;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/r/partition.result b/mysql-wsrep-5.6/mysql-test/suite/galera/r/partition.result
new file mode 100644 (file)
index 0000000..3907b4f
--- /dev/null
@@ -0,0 +1,140 @@
+#
+# MDEV#4953 Galera: DELETE from a partitioned table is not replicated
+#
+USE test;
+CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,100), (2,200);
+SELECT * FROM t1;
+pk     i
+2      200
+1      100
+DELETE FROM t1;
+SELECT * FROM t1;
+pk     i
+
+# On node_1
+SELECT * FROM t1;
+pk     i
+
+# On node_2
+SELECT * FROM t1;
+pk     i
+DROP TABLE t1;
+#
+# MDEV#7501 : alter table exchange partition is not replicated in
+#             galera cluster
+#
+
+# On node_1
+CREATE TABLE test.t1 (
+i INT UNSIGNED NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (i)
+) ENGINE=INNODB
+PARTITION BY RANGE (i)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = INNODB,
+PARTITION p2 VALUES LESS THAN (20) ENGINE = INNODB,
+PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = INNODB);
+INSERT INTO test.t1 (i) VALUE (9),(19);
+CREATE TABLE test.p1 LIKE test.t1;
+ALTER TABLE test.p1 REMOVE PARTITIONING;
+ALTER TABLE test.t1 EXCHANGE PARTITION p1 WITH TABLE test.p1;
+SELECT * FROM test.t1;
+i
+19
+SELECT * FROM test.p1;
+i
+9
+
+# On node_2
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `i` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (`i`)
+) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION p2 VALUES LESS THAN (20) ENGINE = InnoDB,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+SHOW CREATE TABLE p1;
+Table  Create Table
+p1     CREATE TABLE `p1` (
+  `i` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (`i`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
+SELECT * FROM test.t1;
+i
+19
+SELECT * FROM test.p1;
+i
+9
+
+# On node_1
+ALTER TABLE t1 TRUNCATE PARTITION p2;
+SELECT * FROM test.t1;
+i
+
+# On node_2
+SELECT * FROM test.t1;
+i
+
+# On node_1
+ALTER TABLE t1 DROP PARTITION p2;
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `i` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+
+# On node_2
+SHOW CREATE TABLE t1;
+Table  Create Table
+t1     CREATE TABLE `t1` (
+  `i` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p1 VALUES LESS THAN (10) ENGINE = InnoDB,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
+DROP TABLE t1, p1;
+#
+# MDEV-5146: Bulk loads into partitioned table not working
+#
+# Case 1: wsrep_load_data_splitting = ON & LOAD DATA with 20002
+# entries.
+SET GLOBAL wsrep_load_data_splitting = ON;
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+SELECT COUNT(*) = 20002 FROM t1;
+COUNT(*) = 20002
+1
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
+# Case 2: wsrep_load_data_splitting = ON & LOAD DATA with 101 entries.
+SET GLOBAL wsrep_load_data_splitting = ON;
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+SELECT COUNT(*) = 101 FROM t1;
+COUNT(*) = 101
+1
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
+# Case 3: wsrep_load_data_splitting = OFF & LOAD DATA with 20002
+# entries.
+SET GLOBAL wsrep_load_data_splitting = OFF;
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+SELECT COUNT(*) = 20002 FROM t1;
+COUNT(*) = 20002
+1
+wsrep_last_committed_diff
+1
+DROP TABLE t1;
+SET GLOBAL wsrep_load_data_splitting = 1;;
+# End of test
index 4b7ec95eb680ba51a6167fd1842e971914e6fb30..cc6bf872f76fe8f16b7af993a5a32531c1da73fb 100644 (file)
@@ -31,6 +31,8 @@ SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
 --source include/wait_condition.inc
 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
 --source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
 
 # Must return 0:
 SHOW STATUS LIKE 'wsrep_desync_count';
@@ -41,7 +43,7 @@ SET @@global.wsrep_desync = 0;
 --let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
 --source include/wait_condition.inc
 
-SET SESSION wsrep_sync_wait=7;
+SET SESSION wsrep_sync_wait=15;
 SHOW CREATE TABLE t1;
 DROP TABLE t1;
 CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
index 445f8795dff699ee09bba562856db993c78d5f73..a3956961e13a417b6d1420b776b17f851b5c8fea 100644 (file)
@@ -9,11 +9,6 @@ CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
 # We start with a populated table
 INSERT INTO t1 (f1) VALUES (1),(65535);
 
-# Clear the wsrep_local_replays counter
-
-FLUSH STATUS;
-SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
-
 #
 # Run concurrent INSERTs 
 #
@@ -41,6 +36,8 @@ DELIMITER ;|
 
 --connection node_2
 --let $count = 10
+--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+
 while ($count)
 {
        --let $signature = `SELECT LEFT(MD5(RAND()), 10)`
@@ -54,14 +51,28 @@ while ($count)
                        --die ROW_COUNT() = 0
                }
        }
-       --dec $count
+
+        #
+        # Ensure at least one replay happens
+        #
+
+        --let $wsrep_replays = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+        --disable_query_log
+        if (`SELECT $wsrep_replays - $wsrep_local_replays_old > 0`) {
+                --dec $count
+        }
+        --enable_query_log
 }
 
 #
 # Confirm that some transaction replays occurred
 #
 
-SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
+--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+--disable_query_log
+--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old > 0 AS wsrep_local_replays;
+--enable_query_log
+
 
 #
 # Terminate the stored procedure
@@ -79,3 +90,6 @@ SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
 --connection node_1
 DROP PROCEDURE proc_insert;
 DROP TABLE t1;
+
+# Due to MW-330, Multiple "conflict state 3 after post commit" warnings if table is dropped while SP is running
+CALL mtr.add_suppression("conflict state 3 after post commit");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-336.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-336.test
new file mode 100644 (file)
index 0000000..79d8951
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# MW-336 Slave threads may leak if variable wsrep_slave_threads is set repeatedly
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+--connection node_1
+SET GLOBAL wsrep_slave_threads = 10;
+SET GLOBAL wsrep_slave_threads = 1;
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+
+--connection node_1
+--sleep 0.5
+SET GLOBAL wsrep_slave_threads = 10;
+--sleep 0.5
+SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+
+SET GLOBAL wsrep_slave_threads = 20;
+--sleep 0.5
+SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+
+
+SET GLOBAL wsrep_slave_threads = 1;
+
+--connection node_2
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+
+
+--connection node_1
+SET GLOBAL wsrep_slave_threads = 10;
+SET GLOBAL wsrep_slave_threads = 0;
+
+--connection node_2
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (11);
+INSERT INTO t1 VALUES (12);
+INSERT INTO t1 VALUES (13);
+INSERT INTO t1 VALUES (14);
+INSERT INTO t1 VALUES (15);
+INSERT INTO t1 VALUES (16);
+INSERT INTO t1 VALUES (17);
+INSERT INTO t1 VALUES (18);
+INSERT INTO t1 VALUES (19);
+INSERT INTO t1 VALUES (20);
+
+--connection node_1
+--sleep 0.5
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
+
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-357.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-357.test
new file mode 100644 (file)
index 0000000..d13cf05
--- /dev/null
@@ -0,0 +1,13 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_2
+SET GLOBAL wsrep_slave_threads = 0;
+
+--connection node_1
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-360-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-360-master.opt
new file mode 100644 (file)
index 0000000..6cfaed1
--- /dev/null
@@ -0,0 +1,2 @@
+--gtid-mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-360.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-360.test
new file mode 100644 (file)
index 0000000..7ea743c
--- /dev/null
@@ -0,0 +1,103 @@
+#
+# MW-360 DROP TABLE containing temporary tables results in binlog divergence
+#
+
+--source include/galera_cluster.inc
+--source include/have_binlog_format_row.inc
+
+--connection node_1
+SET GLOBAL wsrep_on=OFF;
+RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+
+--connection node_2
+SET GLOBAL wsrep_on=OFF;
+RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+
+--connection node_1
+
+#
+# Straightforward temporary table
+#
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+--let $local_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
+
+#
+# A mix of normal and temporary tables
+#
+
+# Temp table first, normal table second
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+
+DROP TABLE t1, t2;
+
+# Normal table first, temporary table second
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+
+DROP TABLE t1, t2;
+
+# Temporary table first, normal table second, temp table third
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+
+CREATE TEMPORARY TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3);
+
+DROP TABLE t1, t2, t3;
+
+# Normal table first, temporary table second, normal table third
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TEMPORARY TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (2);
+
+CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t3 VALUES (3);
+
+DROP TABLE t1, t2, t3;
+
+#
+# A temporary table masking a normal one
+# 
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (2);
+
+DROP TABLE t1;
+DROP TABLE t1;
+
+--connection node_2
+--let $cluster_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
+
+--connection node_1
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+--replace_result $local_uuid <local_uuid> $cluster_uuid <cluster_uuid>
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
+--connection node_2
+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/
+--replace_result $local_uuid <local_uuid> $cluster_uuid <cluster_uuid>
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-362-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-362-master.opt
new file mode 100644 (file)
index 0000000..6cfaed1
--- /dev/null
@@ -0,0 +1,2 @@
+--gtid-mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-362.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-362.test
new file mode 100644 (file)
index 0000000..d758b4f
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# MW-362 RESET MASTER initializes GTID sequence only in master node
+#
+
+--source include/galera_cluster.inc
+--source include/have_binlog_format_row.inc
+
+# Running RESET MASTER on a live cluster results in an error
+
+--error 1148
+RESET MASTER;
+
+# But is allowed if WSREP_ON=OFF;
+
+# Put some events in binary log
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+DROP TABLE t1;
+
+SET GLOBAL WSREP_ON=OFF;
+--error 0
+RESET MASTER;
+SET GLOBAL WSREP_ON=ON;
+
+# The CREATE above is no longer in the binlog
+
+SHOW BINARY LOGS;
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-369.inc b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-369.inc
new file mode 100644 (file)
index 0000000..5fd9ef1
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# This file should be included from tests for MW-369 to run concurrent
+# transaction from node_1 with autocommit query from node_2.
+#
+# The parameters:
+# * $mw_369_parent_query - the parent query to be run inside transaction
+# * $mw_369_child_query - the child query
+#
+# The operations are the following:
+#
+# node_1:
+# START TRANSACTION;
+# $mw_369_parent_query
+# node_2
+# $mw_369_child_query - will be blocked on node_1 in apply monitor
+# node_1:
+# COMMIT;             - will be blocked on node_1 in local monitor
+#
+# The $mw_369_child_query is always expected to succeed. The caller is
+# responsible for checking if the final COMMIT on connection node_1
+# succeeds.
+#
+
+--connection node_1
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+--eval $mw_369_parent_query
+
+#
+# Block the $mw_369_child_query from node_2
+#
+# --connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--let $galera_sync_point = apply_monitor_slave_enter_sync
+--source include/galera_set_sync_point.inc
+
+#
+# insert client row, which will make it impossible to replay the
+# delete on parent
+#
+--connection node_2
+--eval $mw_369_child_query
+
+#
+# Wait until $mw_369_child_query from node_2 reaches the sync point and
+# block the 'COMMIT' from node_1 before it certifies.
+#
+--connection node_1a
+--source include/galera_wait_sync_point.inc
+--source include/galera_clear_sync_point.inc
+
+--let $galera_sync_point = local_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send COMMIT
+
+#
+# Wait until both sync points have been reached
+#
+--connection node_1a
+--let $galera_sync_point = apply_monitor_slave_enter_sync local_monitor_enter_sync
+--source include/galera_wait_sync_point.inc
+
+#
+# both threads are now parked in sync points, signal them to continue
+#
+--let $galera_sync_point = apply_monitor_slave_enter_sync
+--source include/galera_signal_sync_point.inc
+
+--let $galera_sync_point = local_monitor_enter_sync
+--source include/galera_signal_sync_point.inc
+--source include/galera_clear_sync_point.inc
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-369.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-369.test
new file mode 100644 (file)
index 0000000..720d6da
--- /dev/null
@@ -0,0 +1,246 @@
+#
+# Test A Outline:
+# ===============
+#
+# This test tests the scenario for MW-369 where a new child table
+# row referring to parent table row is inserted concurrently from
+# another node while the transaction which tries to delete a
+# referred row from the parent table is committing.
+#
+# The p table will originally have rows (1, 0), (2, 0).
+# The c table will be empty.
+#
+# A new row (1, 1) pointing to parent row (1, 0) is inserted from
+# connection node_2, the transaction which tries to remove the
+# parent row (1, 0) is run from connection node_1.
+#
+# Expected outcome:
+# ================
+#
+# The transaction on node_1 will fail. The parent table will contain
+# rows (1, 0), (2, 0) and the child table will contain row (1, 1).
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1))  ;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+--let $mw_369_parent_query = DELETE FROM p WHERE f1 = 1
+--let $mw_369_child_query = INSERT INTO c VALUES (1, 1)
+
+#
+# we must open connection node_1a here, MW-369.inc will use it later
+#
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# Test B Outline:
+# ===============
+#
+# This test tests the scenario for MW-369 where a existing
+# child table row is updated concurrently from another node
+# with a transaction which updates the parent table.
+#
+# The p table will originally have rows (1, 0), (2, 0).
+# The c table will originally have rows (1, 1, 0) which points
+# to parent table row (1, 0).
+#
+# Expected outcome:
+# ================
+#
+# Both updates should succeed since they are done to separate tables and
+# rows. The parent table will contain rows (1, 1), (2, 0). The child
+# table will contain row (1, 1, 1).
+#
+
+--connection node_1
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+                f2 INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1))  ;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+
+--let mw_369_parent_query = UPDATE p SET f2 = 1 WHERE f1 = 1
+--let $mw_369_child_query = UPDATE c SET f2 = 1 WHERE f1 = 1
+--source MW-369.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# Test C Outline:
+# ===============
+#
+# This test tests the scenario for MW-369 where a child table row is
+# deleted concurrently from the other node while a transaction updates
+# the parent table referred by the child table row.
+#
+# The p table will originally have rows (1, 0), (2, 0)
+# The c table will originally have row (1, 1) which points to parent
+# table row (1, 0).
+#
+# A row (1, 1) pointing to parent row (1, 0) is deleted from
+# connection node_2, the transaction which tries to update the
+# parent row (1, 0) is run from connection node_1.
+#
+# Expected Outcome:
+# ================
+# Both operations on node_1 and node_2 should succeed without conflicts.
+# The parent table should contain values (1, 1), (2, 0) and the child
+# table should be empty.
+
+--connection node_1
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1))  ;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1);
+
+--let $mw_369_parent_query = UPDATE p SET f2 = 1 WHERE f1 = 1
+--let $mw_369_child_query = DELETE FROM c WHERE f1 = 1
+--source MW-369.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+
+#
+# Test D Outline:
+# ===============
+#
+# This test is similar to test A, where parent row is deleted while a child row
+# is inserted simultaneously on node 2. However, in this test case the FK
+# constraint's target column is a unique key, and parent row is not delete,
+# but this key value is changed so that insert on node 2 will cause FK
+# violation
+#
+# The p table will originally have rows (1, 0)
+# The c table will originally be empty 
+#
+# in node_1, parent row is updated to value (1,1)
+# A row (1, 0) pointing to the old version of parent row (1, 0) is inserted
+# in connection node_2
+#
+# Expected Outcome:
+# ================
+# This is a true conflict and one transaciton must abort. In this case it is node_1
+# transaction, which was scheduled later.
+#    Parent table should have row (1,0)
+#    child table should have row (1,0)
+#
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER UNIQUE KEY) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f2))  ;
+
+INSERT INTO p VALUES (1, 0);
+
+--let $mw_369_parent_query = UPDATE p SET f2 = 1 WHERE f1 = 1
+--let $mw_369_child_query = INSERT INTO c VALUES (1, 0);
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# Test E Outline:
+# ===============
+#
+# This test is similar to test B, where parent row is deleted while a child row
+# is updated simultaneously on node 2. However, in this test case the FK
+# constraint has ON DELETE CASCADE option, and the delete on parent row will
+# cascade a delete on child row as well. This will cause true conflict with 
+# connection node_2, which tries to update unrelated column on child table.
+#
+# The p table will originally have rows (1, 0), (2,0)
+# The c table will originally have row (1,1,0)
+#
+# in node_1, parent row (1,0) is deleted and cascaded delete will happen on
+# child table row (1,1,0).
+# in connection node_2 child table row is update to value (1,1,1)
+#
+# Expected Outcome:
+# ================
+# This is a true conflict and one transaciton must abort. In this case it is node_1
+# transaction, which was scheduled later.
+#    Parent table should have rows (1,0), (2,0)
+#    child table should have row (1,1,1)
+#
+
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1)
+                ON DELETE CASCADE)  ;
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+INSERT INTO c VALUES (1, 1, 0);
+
+--let $mw_369_parent_query = DELETE FROM p WHERE f1 = 1
+--let $mw_369_child_query = UPDATE c SET f2 = 1 WHERE f1 = 1
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-388.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-388.test
new file mode 100644 (file)
index 0000000..5446731
--- /dev/null
@@ -0,0 +1,68 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) Engine=InnoDB;
+
+DELIMITER |;
+CREATE PROCEDURE insert_proc ()
+BEGIN
+        DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+        BEGIN
+                GET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;
+        END;
+        INSERT INTO t1 VALUES (1, 'node 1'),(2, 'node 1');
+        INSERT INTO t1 VALUES (3, 'node 1');
+END|
+DELIMITER ;|
+
+# We need two slave threads here to guarantee progress.
+# If we use only one thread the following could happen
+# in node_1:
+# We block the only slave thread in wsrep_apply_cb and we
+# issue an INSERT (by calling the stored procedure) that will
+# try to acquire galera's local monitor in pre_commit().
+# This usually works fine, except for when a commit cut event
+# sneaks in the slave queue and gets a local seqno smaller than
+# that of the INSERT. Because there is only one slave thread,
+# commit cut is not processed and therefore does not advance
+# local monitor, and our INSERT remains stuck there.
+SET GLOBAL wsrep_slave_threads = 2;
+SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
+
+--connection node_2
+--send INSERT INTO t1 VALUES (1, 'node 2');
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION DEBUG_SYNC = 'wsrep_after_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
+--send CALL insert_proc ();
+
+--connection node_1a
+SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
+
+
+SET GLOBAL DEBUG = "";
+SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+--connection node_2
+--reap
+
+--connection node_1
+# We expect no errors here, because the handler in insert_proc() caught the deadlock error
+--reap
+SELECT @errno = 1213;
+SELECT * FROM t1;
+
+--connection node_2
+SELECT * FROM t1;
+
+--connection node_1
+SET GLOBAL wsrep_slave_threads = DEFAULT;
+DROP TABLE t1;
+DROP PROCEDURE insert_proc;
\ No newline at end of file
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-402.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-402.test
new file mode 100644 (file)
index 0000000..80f368b
--- /dev/null
@@ -0,0 +1,228 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+#
+# we must open connection node_1a here, MW-369.inc will use it later
+#
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+#
+# cascading delete operation is replicated from node2
+# and this conflicts with an update for child table in node1
+#
+# As a result, the update should fail for certification error
+#
+--connection node_1
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON DELETE CASCADE);
+                
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+INSERT INTO c VALUES (1, 1, 0);
+
+--let $mw_369_parent_query = UPDATE c SET f2=1 where f1=1
+--let $mw_369_child_query = DELETE FROM p WHERE f1 = 1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# cascading update operation is replicated from node2
+# and this conflicts with an update for child table in node1
+#
+# As a result, the update should fail for certification error
+#
+--connection node_1
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
+                
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+INSERT INTO c VALUES (1, 1, 0);
+
+--let $mw_369_parent_query = UPDATE c SET f2=2 where f1=1
+--let $mw_369_child_query = UPDATE p set f1=11 WHERE f1 = 1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# ON UPDATE CASCADE tests
+# Here we update primary key of parent table to cause cascaded update
+# on child table
+#
+# cascading update operation is replicated from node2
+# and this conflicts with an update for child table in node1
+#
+# As a result, the update should fail for certification error
+#
+--connection node_1
+
+CREATE TABLE p (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p_id INTEGER, f2 INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p_id) REFERENCES p (f1) ON UPDATE CASCADE);
+                
+
+INSERT INTO p VALUES (1, 0);
+INSERT INTO p VALUES (2, 0);
+
+INSERT INTO c VALUES (1, 1, 0);
+
+--let $mw_369_parent_query = UPDATE c SET p_id=2 where f1=1
+--let $mw_369_child_query = UPDATE p set f1=11 WHERE f1 = 1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+# same as previous, but statements in different order
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+--let $mw_369_parent_query = UPDATE p set f1=21 WHERE f1 = 11
+--let $mw_369_child_query = UPDATE c SET p_id=2 where f1=1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit fails
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+
+--connection node_2
+SELECT * FROM p;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p;
+
+#
+# CASCADE DELETE tests with two parent tables
+# Here we cause cascaded operation on child table through
+# one parent table and have other operation on the other
+# parent table
+#
+# cascading update operation is replicated from node2
+# but this does not conflict with an update for the other parent table in node1
+#
+# As a result, the update on p2 should succeed
+#
+--connection node_1
+
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+                f2 INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+                    ON DELETE CASCADE,
+                CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1));
+
+INSERT INTO p1 VALUES (1, 0);
+INSERT INTO p2 VALUES (1, 0);
+
+INSERT INTO c VALUES (1, 1, 1, 0);
+
+--let $mw_369_parent_query = UPDATE p2 SET f2=2 where f1=1
+--let $mw_369_child_query = DELETE FROM p1 WHERE f1 = 1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit succeeds
+--connection node_1
+--reap
+
+--connection node_2
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
+
+#
+# CASCADE DELETE tests with two parent tables
+# Here we cause cascaded operation on child table through
+# one parent table and issue other delete operation through the 
+# other parent table. The cascade progresses to same child table row where
+# we should see the conflict to happen
+#
+# As a result, the update on p2 should fail
+#
+--connection node_1
+
+CREATE TABLE p1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE p2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=INNODB;
+CREATE TABLE c (f1 INTEGER PRIMARY KEY, p1_id INTEGER, p2_id INTEGER,
+                f2 INTEGER,
+                CONSTRAINT fk_1 FOREIGN KEY (p1_id) REFERENCES p1 (f1)
+                    ON DELETE CASCADE,
+                CONSTRAINT fk_2 FOREIGN KEY (p2_id) REFERENCES p2 (f1)
+                    ON DELETE CASCADE);
+
+INSERT INTO p1 VALUES (1, 0);
+INSERT INTO p2 VALUES (1, 0);
+
+INSERT INTO c VALUES (1, 1, 1, 0);
+
+--let $mw_369_parent_query = DELETE FROM p2 WHERE f1=1
+--let $mw_369_child_query  = DELETE FROM p1 WHERE f1=1
+
+--connection node_1a
+--source MW-369.inc
+
+# Commit succeeds
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT * FROM p1;
+SELECT * FROM p2;
+SELECT * FROM c;
+
+DROP TABLE c;
+DROP TABLE p1;
+DROP TABLE p2;
\ No newline at end of file
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-416.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-416.test
new file mode 100644 (file)
index 0000000..9d04dde
--- /dev/null
@@ -0,0 +1,130 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE USER 'userMW416'@'localhost';
+GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost';
+
+--let $wsrep_replicated_before = `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'wsrep_replicated'`
+
+--connect userMW416, localhost, userMW416,, test, $NODE_MYPORT_1
+--connection userMW416
+
+# DDL
+
+--error ER_DBACCESS_DENIED_ERROR
+ALTER DATABASE db CHARACTER SET = utf8;
+--error ER_DBACCESS_DENIED_ERROR
+ALTER EVENT ev1 RENAME TO ev2;
+--error ER_PROCACCESS_DENIED_ERROR
+ALTER FUNCTION fun1 COMMENT 'foo';
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR
+ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+ALTER PROCEDURE proc1 COMMENT 'foo';
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+ALTER SERVER srv OPTIONS (USER 'sally');
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+ALTER TABLE tbl DROP COLUMN col;
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+ALTER VIEW vw AS SELECT 1;
+
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE DATABASE db;
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP  DO SELECT 1;
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE FUNCTION fun1() RETURNS int RETURN(1);
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so';
+--error ER_DBACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE PROCEDURE proc1()  BEGIN END;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE INDEX idx ON tbl(id);
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE TABLE t (i int);
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE VIEW vw AS SELECT 1;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP DATABASE db;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP EVENT ev;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP FUNCTION fun1;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP INDEX idx ON t0;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP LOGFILE GROUP lfg;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP PROCEDURE proc1;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP SERVEr srv;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP TABLE t0;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP TABLESPACE tblspc;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_TRG_DOES_NOT_EXIST,ER_PROCACCESS_DENIED_ERROR
+DROP TRIGGER trg;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP VIEW vw;
+
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+RENAME TABLE t0 TO t1;
+
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+TRUNCATE TABLE t0;
+
+# DCL
+
+# account management
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+ALTER USER myuser PASSWORD EXPIRE;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CREATE USER myuser IDENTIFIED BY 'pass';
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+DROP USER myuser;
+--error ER_DBACCESS_DENIED_ERROR,ER_ACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+GRANT ALL ON *.* TO 'myuser';
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+RENAME USER myuser TO mariauser;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+REVOKE SELECT ON test FROM myuser;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR,ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+REVOKE ALL, GRANT OPTION FROM myuser;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR,ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+REVOKE PROXY ON myuser FROM myuser;
+
+# table maintenance
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+ANALYZE TABLE db.tbl;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CHECK TABLE db.tbl;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+CHECKSUM TABLE db.tbl;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+OPTIMIZE TABLE db.tbl;
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+REPAIR TABLE db.tbl;
+
+# plugin and user defined functions
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+INSTALL PLUGIN plg SONAME 'plg.so';
+--error ER_DBACCESS_DENIED_ERROR,ER_TABLEACCESS_DENIED_ERROR,ER_SPECIFIC_ACCESS_DENIED_ERROR,ER_PROCACCESS_DENIED_ERROR
+UNINSTALL PLUGIN plg;
+
+--connection node_1
+DROP USER 'userMW416'@'localhost';
+SHOW DATABASES;
+--let $wsrep_replicated_after = `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'wsrep_replicated'`
+--disable_query_log
+--eval SELECT $wsrep_replicated_after - $wsrep_replicated_before AS wsrep_replicated_after_diff
+--enable_query_log
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-master.opt
new file mode 100644 (file)
index 0000000..8a755e9
--- /dev/null
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait1-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait1-master.opt
new file mode 100644 (file)
index 0000000..8a755e9
--- /dev/null
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait1.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait1.test
new file mode 100644 (file)
index 0000000..7443ad9
--- /dev/null
@@ -0,0 +1,103 @@
+#
+# SHOW commands no longer obey wsrep_sync_wait = 1 (WSREP_SYNC_WAIT_BEFORE_READ)
+# (they do not wait for the background INSERT in the applier in node_2 to
+# complete)
+#
+--source include/galera_cluster.inc
+--source include/have_binlog_format_row.inc
+--source include/have_debug_sync.inc
+
+--connection node_2
+# Make sure no signals have been leftover from previous tests to surprise us.
+SELECT @@debug_sync;
+
+SET SESSION wsrep_sync_wait = 1;
+SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
+
+--connection node_1
+CREATE TABLE t_wait1 (f1 INTEGER) ENGINE=InnoDB;
+# This will complete in node_1 but will start a background apply in node_2
+# which will stop because of sync.wsrep_apply_cb we set above.
+INSERT INTO t_wait1 VALUES (1);
+
+--connection node_2
+
+SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+
+--disable_result_log
+
+SHOW BINARY LOGS;
+
+SHOW BINLOG EVENTS;
+
+--error ER_NO_SUCH_TABLE
+SHOW COLUMNS FROM t1;
+
+--error ER_EVENT_DOES_NOT_EXIST
+SHOW CREATE EVENT e1;
+
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE FUNCTION f1;
+
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PROCEDURE p1;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE t1;
+
+--error ER_TRG_DOES_NOT_EXIST
+SHOW CREATE TRIGGER tr1;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE VIEW v1;
+
+SHOW DATABASES;
+
+SHOW ENGINE InnoDB STATUS;
+
+--error ER_SP_DOES_NOT_EXIST
+SHOW FUNCTION CODE f1;
+
+SHOW FUNCTION STATUS;
+
+SHOW GRANTS FOR 'root'@'localhost';
+
+--error ER_NO_SUCH_TABLE
+SHOW INDEX FROM t1;
+
+SHOW OPEN TABLES;
+
+--error ER_SP_DOES_NOT_EXIST
+SHOW PROCEDURE CODE p1;
+
+SHOW PROCEDURE STATUS;
+
+SHOW PRIVILEGES;
+
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+SHOW TABLE STATUS;
+
+SHOW TABLES;
+
+SHOW TRIGGERS;
+
+SHOW GLOBAL VARIABLES LIKE 'foo_bar';
+
+--error 0
+SHOW WARNINGS;
+
+--enable_result_log
+
+# Unblock the background INSERT and remove the sync point.
+SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
+SET SESSION debug_sync = "now SIGNAL signal.wsrep_apply_cb";
+
+SET SESSION wsrep_sync_wait = default;
+
+# This will wait for the background INSERT to complete before we quit
+# from the test.
+DROP TABLE t_wait1;
+
+# Make sure no pending signals are leftover to surprise subsequent tests.
+SELECT @@debug_sync;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait8-master.opt b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait8-master.opt
new file mode 100644 (file)
index 0000000..8a755e9
--- /dev/null
@@ -0,0 +1 @@
+--log-bin --log-slave-updates
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait8.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/MW-86-wait8.test
new file mode 100644 (file)
index 0000000..9680d46
--- /dev/null
@@ -0,0 +1,125 @@
+#
+# SHOW commands now obey wsrep_sync_wait = 8 (WSREP_SYNC_WAIT_BEFORE_SHOW)
+#
+--source include/galera_cluster.inc
+--source include/have_binlog_format_row.inc
+--source include/have_debug_sync.inc
+
+--connection node_2
+# Make sure no signals have been leftover from previous tests to surprise us.
+SELECT @@debug_sync;
+
+SET SESSION wsrep_sync_wait = 8;
+SET GLOBAL debug = "+d,sync.wsrep_apply_cb";
+
+--connection node_1
+CREATE TABLE t_wait8 (f1 INTEGER) ENGINE=InnoDB;
+# This will complete in node_1 but will start a background apply in node_2
+# which will stop because of sync.wsrep_apply_cb we set above.
+INSERT INTO t_wait8 VALUES (1);
+
+--connection node_2
+
+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT0.1S";
+
+SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";
+
+--disable_result_log
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW BINARY LOGS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW BINLOG EVENTS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW COLUMNS FROM t1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE DATABASE db1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE EVENT e1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE FUNCTION f1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE PROCEDURE p1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE TABLE t1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE TRIGGER tr1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW CREATE VIEW v1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW DATABASES;
+
+--error 0
+SHOW ENGINE InnoDB STATUS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW FUNCTION CODE f1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW FUNCTION STATUS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW GRANTS FOR 'root'@'localhost';
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW INDEX FROM t1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW OPEN TABLES;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW PROCEDURE CODE p1;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW PROCEDURE STATUS;
+
+--error 0
+SHOW PRIVILEGES;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW TABLE STATUS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW TABLES;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW TRIGGERS;
+
+--error ER_LOCK_WAIT_TIMEOUT
+SHOW GLOBAL VARIABLES LIKE 'foo_bar';
+
+--error 0
+SHOW WARNINGS;
+
+--enable_result_log
+
+--disable_query_log
+--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig"
+--enable_query_log
+
+# Unblock the background INSERT and remove the sync point.
+SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
+SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
+
+SET SESSION wsrep_sync_wait = default;
+
+# This will wait for the background INSERT to complete before we quit
+# from the test.
+DROP TABLE t_wait8;
+
+# Make sure no pending signals are leftover to surprise subsequent tests.
+SELECT @@debug_sync;
index 120d7a422cbd5ef4338f68d87020495ae6c56934..205be60a0c80a90d51f3676320d0a457cdb0b9d9 100644 (file)
@@ -1,5 +1,4 @@
 galera_wsrep_provider_unset_set : lp1379204 'Unsupported protocol downgrade: incremental data collection disabled. Expect abort.'
 galera_kill_nochanges : mysql-wsrep#24 Galera server does not restart properly if killed
-galera_bf_abort_for_update : mysql-wsrep#26 SELECT FOR UPDATE sometimes allowed to proceed in the face of a concurrent update
 galera_toi_ddl_fk_insert : qa#39 galera_toi_ddl_fk_insert fails sporadically
 galera_sst_xtrabackup-v2-options : SST Encryption does not work with xtrabackup 2.4.2
index 6747977812b179195c911c436029043108d8f04c..97819384a7537dfa2f658178e25e877cba7354b0 100644 (file)
@@ -28,7 +28,7 @@ SELECT COUNT(*) = 0 FROM t1;
 --connection node_1
 UNLOCK TABLES;
 
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 SELECT COUNT(*) = 2 FROM t1;
 
 DROP TABLE t1;
index 99c45c04ba008fcc5c86f84abcd82c7bac7b195d..67f2108d263b305238d1b944ee22a249e018cce8 100644 (file)
@@ -29,7 +29,7 @@ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system use
 
 UNLOCK TABLES;
 
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 
 SHOW CREATE TABLE t1;
 SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'Waiting for table metadata lock';
index bf04b274ca7d1d03243fa37e441c29dca8544a21..639a518ad6f633ee5682370e52a1fb170cc76184 100644 (file)
@@ -49,7 +49,7 @@ insert into t1(i) values(null), (null), (null);
 select * from t1;
 
 show variables like 'binlog_format';
-show variables like '%auto_increment%';
+show variables like 'auto_increment_increment';
 
 --connection node_2
 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
index 5f3fbd5e6bbded140d19994572b7cc7c673f418a..a176bd75bb1e97b21a4ac0f2c70ec821df52abfc 100644 (file)
@@ -14,10 +14,15 @@ RESET MASTER;
 
 --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
 --connection node_3
+SET GLOBAL wsrep_on=OFF;
 RESET MASTER;
+SET GLOBAL wsrep_on=ON;
 
 --connection node_2
+SET GLOBAL wsrep_on=OFF;
 RESET MASTER;
+SET GLOBAL wsrep_on=ON;
+
 --disable_query_log
 --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
 --enable_query_log
index 0324c8d5ec232d30eb13e4c60abd9b8f2e7ccc15..b85464ccdf039a23b4604365051d98897557e6c2 100644 (file)
@@ -16,10 +16,14 @@ RESET MASTER;
 
 --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
 --connection node_3
+SET GLOBAL wsrep_on=OFF;
 RESET MASTER;
+SET GLOBAL wsrep_on=ON;
 
 --connection node_2
+SET GLOBAL wsrep_on=OFF;
 RESET MASTER;
+SET GLOBAL wsrep_on=ON;
 
 --connection node_2
 --disable_query_log
index 0c06941f344ef12dae9fcf52e7bbad04422e6125..a54074547d94af94a4f279a4e8ae59dd84d42cc1 100644 (file)
@@ -88,7 +88,7 @@ RESET SLAVE ALL;
 
 CALL mtr.add_suppression("Slave SQL: Error 'WSREP has not yet prepared node for application use' on query");
 CALL mtr.add_suppression("Slave: WSREP has not yet prepared node for application use Error_code: 1047");
-CALL mtr.add_suppression("Transport endpoint is not connected");
+CALL mtr.add_suppression("(Transport endpoint is not connected|Socket is not connected)");
 CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213");
 CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
 
index 6f221f83b3a7ea9618233cdae5dd01361f2fc8a9..d9def6bfba912fe58c2e69d77ad1e3f9dd12996f 100644 (file)
@@ -80,5 +80,8 @@ DROP TABLE ten;
 --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
 --source include/wait_condition.inc
 
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ten';
+--source include/wait_condition.inc
+
 STOP SLAVE;
 RESET SLAVE ALL;
index 86de404d7b120791fcbb8143ddce138dbd30be93..b4f55a2397f06dea38a961c74c7decbcbb2620a3 100644 (file)
@@ -27,7 +27,7 @@ UNLOCK TABLES;
 
 COMMIT;
 SET AUTOCOMMIT=ON;
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 SELECT COUNT(*) = 1 FROM t1;
 
 --let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
index 24c29778e5d28ea3d1fd9e7ba55be22fc9ed27f9..13e48f8f3cecc2726f85b19da8724579c0254dab 100644 (file)
@@ -5,25 +5,52 @@
 # Test a local transaction being aborted by a slave one while it is running a SELECT FOR UPDATE
 #
 
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INT) ENGINE=InnoDB;
 
---connection node_2
---let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
-SET AUTOCOMMIT=OFF;
-START TRANSACTION;
-INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (1, 10);
+
+# Test updating the PK
 
 --connection node_1
-INSERT INTO t1 VALUES (1);
+--let $wsrep_local_bf_aborts_before = `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'`
+BEGIN;
+SELECT * FROM t1 FOR UPDATE;
 
 --connection node_2
+UPDATE t1 SET f1 = 2;
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--let $wait_condition = SELECT COUNT(*) FROM t1 WHERE f1 = 2
+--source include/wait_condition.inc
+
+--connection node_1
 --error ER_LOCK_DEADLOCK
+COMMIT;
+
+--disable_query_log
+--eval SELECT variable_value - $wsrep_local_bf_aborts_before AS wsrep_local_bf_aborts_diff FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'
+--enable_query_log
+
+# Test updating non-indexed column
+
+--connection node_1
+--let $wsrep_local_bf_aborts_before = `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'`
+BEGIN;
 SELECT * FROM t1 FOR UPDATE;
 
---let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
+--connection node_2
+UPDATE t1 SET f2 = 20;
+
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) FROM t1 WHERE f2 = 20
+--source include/wait_condition.inc
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+COMMIT;
 
 --disable_query_log
---eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
+--eval SELECT variable_value - $wsrep_local_bf_aborts_before AS wsrep_local_bf_aborts_diff FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'
 --enable_query_log
 
 DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_table_as_select.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_create_table_as_select.test
new file mode 100644 (file)
index 0000000..a6c1f65
--- /dev/null
@@ -0,0 +1,145 @@
+#
+# CREATE TABLE AS SELECT tests
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+SET SESSION default_storage_engine=InnoDB;
+
+# Left table already exists
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 AS SELECT * FROM t2;
+DROP TABLE t1,t2;
+
+# Right table does not exist
+--error ER_NO_SUCH_TABLE
+CREATE TABLE t1 AS SELECT * FROM t2;
+
+# No right table at all
+CREATE TABLE t1 AS SELECT 1 FROM DUAL;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+
+--connection node_1
+DROP TABLE t1;
+
+# Empty right table
+--connection node_1
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t1 AS SELECT * FROM t2;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+DROP TABLE t1,t2;
+
+# Right table is MyISAM
+
+CREATE TABLE t2 (f1 INTEGER) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+CREATE TABLE t1 AS SELECT * FROM t2;
+SELECT COUNT(*) = 5 FROM t1;
+
+--connection node_2
+SELECT COUNT(*) = 5 FROM t1;
+
+--connection node_1
+DROP TABLE t1,t2;
+
+# Right side is a subquery
+
+--connection node_1
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+CREATE TABLE t1 AS SELECT MAX(f1) AS f1 FROM t2;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT f1 = 5 FROM t1;
+
+--connection node_1
+DROP TABLE t1,t2;
+
+# Inside a stored procedure
+
+--connection node_1
+DELIMITER |;
+CREATE PROCEDURE sp1 ()
+BEGIN
+       CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+       INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+       CREATE TABLE t1 AS SELECT * FROM t2;
+END|
+DELIMITER ;|
+CALL sp1();
+SELECT COUNT(*) = 5 FROM t1;
+
+--connection node_2
+SELECT COUNT(*) = 5 FROM t1;
+
+--connection node_1
+DROP TABLE t1, t2;
+DROP PROCEDURE sp1;
+
+# Inside a prepared statement
+
+--connection node_1
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+
+PREPARE stmt FROM 'CREATE TABLE t1 AS SELECT * FROM t2';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+
+#
+# Multi-master conflict
+#
+
+--connection node_1
+
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+LOCK TABLE t2 WRITE;
+
+--connection node_1
+--send CREATE TABLE t1 AS SELECT * FROM t2;
+
+--connection node_2
+SELECT COUNT(*) = 5 FROM t2;
+CREATE TABLE t1 AS SELECT * FROM t2;
+
+--connection node_1a
+UNLOCK TABLES;
+
+--connection node_1
+--error ER_TABLE_EXISTS_ERROR,ER_LOCK_DEADLOCK
+--reap
+
+DROP TABLE t1, t2;
+
+#
+# Temporary table
+#
+
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+
+CREATE TEMPORARY TABLE t1 AS SELECT * FROM t2;
+
+--connection node_2
+--error ER_NO_SUCH_TABLE
+SELECT * FROM t1;
+
+CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t1'' on query");
+
+--connection node_1
+DROP TABLE t1, t2;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ddl_multiline.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ddl_multiline.test
new file mode 100644 (file)
index 0000000..c7155d0
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Test that Galera works correctly with multiline statements, in particular involving DDLs
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection node_2
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t2;
+
+--connection node_1
+--send CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB; CREATE TABLE t4 (f1 INTEGER) ENGINE=InnoDB;
+--reap
+
+SHOW CREATE TABLE t3;
+SHOW CREATE TABLE t4;
+
+--connection node_2
+SHOW CREATE TABLE t3;
+SHOW CREATE TABLE t4;
+
+--connection node_1
+INSERT INTO t1 VALUES (1); CREATE TABLE t5 (f1 INTEGER) ENGINE=InnoDB;
+
+SELECT COUNT(*) = 1 FROM t1;
+SHOW CREATE TABLE t5;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SHOW CREATE TABLE t5;
+
+--connection node_1
+--send CREATE TABLE t6 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t2 VALUES (1);
+--reap
+
+SELECT COUNT(*) = 1 FROM t2;
+SHOW CREATE TABLE t6;
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t2;
+SHOW CREATE TABLE t6;
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+DROP TABLE t1, t2, t3, t4, t5, t6;
+
index de8310e52d2574045e5dc175aa882facd2df3a59..739255609ee78e11b0587e74a87e4d67b0a6c670 100644 (file)
@@ -29,12 +29,11 @@ SELECT * FROM t1;
 
 UNLOCK TABLES;
 
-SHOW TABLES;
-SELECT COUNT(*) = 1 FROM t1;
-
 --disable_query_log
 --eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig";
 --enable_query_log
 
-DROP TABLE t1;
+SHOW TABLES;
+SELECT COUNT(*) = 1 FROM t1;
 
+DROP TABLE t1;
index 721d84ecb0530a695a34c61ebee199a056b47598..cb788fd7e70eaa6b00bd3cd53d410f50828a2107 100644 (file)
@@ -21,8 +21,11 @@ LOCK TABLE t1 WRITE;
 --connection node_1
 
 INSERT INTO t1 VALUES (2);
+--sleep 2
 INSERT INTO t1 VALUES (3);
+--sleep 2
 INSERT INTO t1 VALUES (4);
+--sleep 2
 
 # This query will hang because flow control will kick in
 --send
index 48e46d7541d7b4d905f57b7ddaea8181766c1e1e..df23d9ab0d8a7981740af890557fa01c9c34ace4 100644 (file)
@@ -1 +1 @@
---gtid-mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency
+--gtid-mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency --loose-new-servers-for-galera_gtid-test
index 4b4b0a6e9fbc84b8ade01d180f8419f375e6e2eb..027f70e96d9dc7d69b455e6ec879cae1c5bc8aea 100644 (file)
@@ -2,10 +2,10 @@
 --source include/have_innodb.inc
 
 --let $wsrep_sync_wait_orig = (SELECT @@wsrep_sync_wait)
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
 
 --connection node_2
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
 
 
 #
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_progress.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_progress.cnf
new file mode 100644 (file)
index 0000000..0a26f6d
--- /dev/null
@@ -0,0 +1,5 @@
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
+
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_progress.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/galera_ist_progress.test
new file mode 100644 (file)
index 0000000..a4d331b
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# Test progress output during IST
+#
+
+--source include/galera_cluster.inc
+
+# Isolate node #2 
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+SET SESSION wsrep_on = ON;
+
+# Node #2 is now isolated. Run some transactions to accumulate writesets for IST
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+INSERT INTO t1 VALUES (5);
+INSERT INTO t1 VALUES (6);
+INSERT INTO t1 VALUES (7);
+INSERT INTO t1 VALUES (8);
+INSERT INTO t1 VALUES (9);
+INSERT INTO t1 VALUES (10);
+
+# Restore node #2, IST is performed
+
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+#
+# Grep for expected IST output in joiner log
+#
+
+--connection node_1
+
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = Need state transfer
+
+--let $assert_text = Receiving IST: 11 writesets, seqnos
+--let $assert_select = Receiving IST: 11 writesets, seqnos
+--source include/assert_grep.inc
+
+--let $assert_text = Receiving IST\.\.\.  0\.0% \( 0/11 events\) complete
+--let $assert_select = Receiving IST\.\.\.  0\.0% \( 0/11 events\) complete
+--source include/assert_grep.inc
+
+--let $assert_text = Receiving IST\.\.\.100\.0% \(11/11 events\) complete
+--let $assert_select = Receiving IST\.\.\.100\.0% \(11/11 events\) complete
+--source include/assert_grep.inc
+
+# Cleanup
+
+--connection node_1
+DROP TABLE t1;
index eae28bdbcd76741d0b194377408a44c37616bf9e..297f2379e1baf7bbb0fdab4f877a2d9f5560ab1a 100644 (file)
@@ -26,13 +26,6 @@ UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
 UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
 
 --connection node_2
-# Make sure IST will block ...
---let $galera_sync_point = recv_IST_after_apply_trx
---source include/galera_set_sync_point.inc
-
-SET SESSION wsrep_sync_wait = 0;
-
-
 # Write file to make mysql-test-run.pl expect the crash, but don't start it
 --let $_server_id= `SELECT @@server_id`
 --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
@@ -43,21 +36,23 @@ SET SESSION wsrep_sync_wait = 0;
 # ... and restart provider to force IST
 --echo Loading wsrep_provider ...
 --disable_query_log
+# base_port setting is lost for some reason when unloading provider, so we need to restore it
+--eval SET GLOBAL wsrep_provider_options= 'base_port=$NODE_GALERAPORT_2';
 --eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+# Make sure IST will block ...
+--let $galera_sync_point = recv_IST_after_apply_trx
+--source include/galera_set_sync_point.inc
 --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
 --enable_query_log
 
-# We can not use a wait_condition on SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS as such queries are blocked during IST
-# so we perform a simple sleep and SHOW instead
-
---sleep 5
-SHOW STATUS LIKE 'wsrep_debug_sync_waiters';
+SET SESSION wsrep_on=OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'recv_IST_after_apply_trx' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters';
+--source include/wait_condition.inc
+SET SESSION wsrep_on=ON;
 
 --connection node_1
-# Perform DML and DDL while IST is in progress
---connection node_1
+# Perform DML while IST is in progress
 UPDATE t1 SET f2 = 'd' WHERE f1 > 3;
-CREATE TABLE t2 (f1 INTEGER);
 
 # Kill node #2 while IST is in progress
 --connection node_2
@@ -80,9 +75,8 @@ EOF
 --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
 --source include/wait_condition.inc
 
-# Perform DML and DDL while node #2 is down
+# Perform DML while node #2 is down
 UPDATE t1 SET f2 = 'e' WHERE f1 > 4;
-CREATE TABLE t3 (f1 INTEGER);
 
 --connection node_2
 
@@ -101,8 +95,6 @@ SELECT * FROM t1;
 
 --connection node_2
 SELECT * FROM t1;
-SELECT COUNT(*) = 0 FROM t2;
-SELECT COUNT(*) = 0 FROM t3;
 
 --connection node_1
-DROP TABLE t1, t2, t3;
+DROP TABLE t1;
index 653dc2dd75aaabf6923923123868efa97582a220..58ba85e1b9e7dcc6d66d2ce3468de60514c724b6 100644 (file)
@@ -16,7 +16,7 @@ INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4
 --connection node_2
 SET SESSION wsrep_sync_wait = 0;
 --let $wsrep_provider_options_node2 = `SELECT @@wsrep_provider_options`
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 
 SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';
 
index dfaf4a651f81bb441f0dd13d7e2ba8569514f4eb..7d82f1fdc36421f3b6b8cdadf779a1725c2461dc 100644 (file)
@@ -13,7 +13,7 @@ log-bin=mysqld-bin
 
 wsrep_node_address=127.0.0.1
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 [mysqld.1]
 
index e078a342c167a545ebf21410cf2d30707b382d47..41cd0c8e6fae783fb84855a80659d05ae9a48b01 100644 (file)
@@ -45,7 +45,7 @@ SET SESSION wsrep_sync_wait = 0;
 
 UNLOCK TABLES;
 
-SET SESSION wsrep_sync_wait = 7;
+SET SESSION wsrep_sync_wait = 15;
 
 SELECT COUNT(*) = 10 FROM t1;
 SELECT COUNT(*) = 10 FROM t2;
index 0634eba3264815c451ad0c2a5286cee83106115b..391beb67092416cb31a1c1f8a7f891e442a79614 100644 (file)
@@ -10,7 +10,6 @@ INSERT INTO t1 VALUES (1);
 --let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
 SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
 SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
-SET SESSION wsrep_sync_wait = 7;
 SELECT MAX(id) FROM t1; # first lookup miss
 
 #
@@ -27,7 +26,6 @@ SET GLOBAL DEBUG = "";
 SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
 
 FLUSH QUERY CACHE;
-SET SESSION wsrep_sync_wait = 7;
 SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
 
 #
@@ -51,9 +49,7 @@ SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
 INSERT INTO t1 VALUES (4);
 
 --connection node_2
-SET SESSION wsrep_sync_wait = 7;
 SELECT MAX(id) FROM t1;
-SET SESSION wsrep_sync_wait = 7;
 
 #
 # Query cache hit
@@ -72,7 +68,6 @@ SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
 INSERT INTO t1 VALUES (5);
 
 --connection node_2
-SET SESSION wsrep_sync_wait = 7;
 --send SELECT MAX(id) FROM t1 
 
 --connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
index 59ea28653a2e9e2d5cdbb13ac2706d00f2d91228..25b10ea9b0051fb6e1c26249b1f6928f874629db 100644 (file)
@@ -10,7 +10,7 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.s
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
@@ -28,7 +28,7 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.s
 
 # enforce read-committed characteristics across the cluster
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 wsrep_node_address=127.0.0.1
 wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
index ecc551fbd11c6228a5492cda914770172ece89ca..be4a7e0b91dfd16714ba3de5b3b0a4c3480558fa 100644 (file)
@@ -20,7 +20,7 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
        my $pid_filename = $ENV{'NODE_2_PIDFILE'};
        my $mysqld_pid = `cat $pid_filename`;
         chomp($mysqld_pid);
-       system("kill -19 $mysqld_pid");
+       system("kill -SIGSTOP $mysqld_pid");
        exit(0);
 EOF
 
@@ -32,7 +32,7 @@ INSERT INTO t1 VALUES (1);
        my $pid_filename = $ENV{'NODE_2_PIDFILE'};
        my $mysqld_pid = `cat $pid_filename`;
         chomp($mysqld_pid);
-       system("kill -18 $mysqld_pid");
+       system("kill -SIGCONT $mysqld_pid");
        exit(0);
 EOF
 
index d025c8208bcf6f1beeb0d657cf7e5ca89f436981..65621c98fa4e154373ecc96688b6f6894627d7b7 100644 (file)
@@ -5,7 +5,8 @@
 --source include/galera_cluster.inc
 
 --connection node_2
-SET SESSION wsrep_sync_wait = 1;
+# MW-86 SHOW commands have now bitmap value 8
+SET SESSION wsrep_sync_wait = 8;
 
 
 --connection node_1
index 2f255e9a197e8674951c9414b4c4fd307407b812..6336bd0c794bbb2206adcb46c67b399247d14156 100644 (file)
@@ -6,10 +6,10 @@
 --source include/have_innodb.inc
 
 --let $wsrep_sync_wait_orig = (SELECT @@wsrep_sync_wait)
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
 
 --connection node_2
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
 
 --connection node_1
 
index b24ec5bbeb4dee3dacd64fee35739f56fef43181..a5ad5b7da5f38e9a1129a1cf5e8c127810fde279 100644 (file)
@@ -59,7 +59,7 @@ CALL mtr.add_suppression("Failed to initialize backend using 'foo");
 CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo");
 CALL mtr.add_suppression("gcs connect failed: Socket type not supported");
 CALL mtr.add_suppression("wsrep::connect\\(\\) failed: 7");
-CALL mtr.add_suppression("gcs_caused\\(\\) returned -103 \\(Software caused connection abort\\)");
+CALL mtr.add_suppression("gcs_caused\\(\\) returned -[0-9]+ \\(Software caused connection abort\\)");
 CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110");
 CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
 CALL mtr.add_suppression("gcs connect failed: Connection timed out");
index 935c271a4d6c4c510ed43529694de014814f8758..046724e16352ef8f32e9e603a210a8d308572f3f 100644 (file)
@@ -13,7 +13,10 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
 --connection node_2
 SET GLOBAL wsrep_sync_wait = 1;
 # Those statements should see the table
-SHOW TABLES LIKE '%t1';
+
+# MW-86 SHOW commands have now their own bitmask
+# SHOW TABLES LIKE '%t1';
+
 SELECT COUNT(*) = 0 FROM t1;
 
 --connection node_1
index be56ee5edc1a6788b37dec16656175d896296ab0..0c707d6d681d3e3c3f283f6f37e966e19ff8c43e 100644 (file)
@@ -45,7 +45,7 @@ SHOW CREATE TABLE t1;
 --connection node_2a
 --reap
 UNLOCK TABLES;
---sleep 1
+--sleep 2
 SHOW CREATE TABLE t1;
 SELECT * from t1;
 
index 3be61c024ae4ed2c30e60cbb637801ea20a20a17..0e4606f49549ccfbf4ea71b3a70b1706ef12bf8c 100644 (file)
@@ -6,6 +6,9 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
 CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
 
 --connection node_2
+# Ensure that the tables have been created on node #2
+SELECT 1 FROM DUAL;
+
 LOCK TABLE t2 WRITE;
 
 --connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
index e932754019586b97b8ba49173e49e5fb6117c98c..21cf05db008b8d64df24013e8eac38489980af4d 100644 (file)
@@ -8,7 +8,6 @@ INSERT INTO t1 VALUES (DEFAULT);
 --connection node_2
 --let $qcache_size_orig = `SELECT @@GLOBAL.query_cache_size`
 SET GLOBAL query_cache_size=1355776;
-SET SESSION wsrep_sync_wait = 7;
 
 --disable_query_log
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera/t/partition.test b/mysql-wsrep-5.6/mysql-test/suite/galera/t/partition.test
new file mode 100644 (file)
index 0000000..bb5a024
--- /dev/null
@@ -0,0 +1,207 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_partition.inc
+
+--echo #
+--echo # MDEV#4953 Galera: DELETE from a partitioned table is not replicated
+--echo #
+
+USE test;
+CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,100), (2,200);
+SELECT * FROM t1;
+
+DELETE FROM t1;
+SELECT * FROM t1;
+
+--echo
+--echo # On node_1
+--connection node_1
+SELECT * FROM t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM t1;
+
+# Cleanup
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV#7501 : alter table exchange partition is not replicated in
+--echo #             galera cluster
+--echo #
+
+--echo
+--echo # On node_1
+--connection node_1
+
+CREATE TABLE test.t1 (
+  i INT UNSIGNED NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (i)
+  ) ENGINE=INNODB
+  PARTITION BY RANGE (i)
+    (PARTITION p1 VALUES LESS THAN (10) ENGINE = INNODB,
+     PARTITION p2 VALUES LESS THAN (20) ENGINE = INNODB,
+     PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = INNODB);
+
+INSERT INTO test.t1 (i) VALUE (9),(19);
+CREATE TABLE test.p1 LIKE test.t1;
+ALTER TABLE test.p1 REMOVE PARTITIONING;
+
+ALTER TABLE test.t1 EXCHANGE PARTITION p1 WITH TABLE test.p1; 
+SELECT * FROM test.t1;
+SELECT * FROM test.p1;
+
+--echo
+--echo # On node_2
+--connection node_2
+
+SHOW CREATE TABLE t1;
+SHOW CREATE TABLE p1;
+
+SELECT * FROM test.t1;
+SELECT * FROM test.p1;
+
+--echo
+--echo # On node_1
+--connection node_1
+ALTER TABLE t1 TRUNCATE PARTITION p2;
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SELECT * FROM test.t1;
+
+--echo
+--echo # On node_1
+--connection node_1
+ALTER TABLE t1 DROP PARTITION p2;
+SHOW CREATE TABLE t1;
+
+--echo
+--echo # On node_2
+--connection node_2
+SHOW CREATE TABLE t1;
+
+
+# Cleanup
+DROP TABLE t1, p1;
+
+--echo #
+--echo # MDEV-5146: Bulk loads into partitioned table not working
+--echo #
+
+# Create 2 files with 20002 & 101 entries in each.
+--perl
+open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/mdev-5146-1.dat") or die;
+foreach  my $i (1..20002) {
+        print FILE "$i\n";
+}
+
+open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/mdev-5146-2.dat") or die;
+foreach  my $i (1..101) {
+        print FILE "$i\n";
+}
+EOF
+
+--connection node_1
+
+--let $wsrep_load_data_splitting_orig = `SELECT @@wsrep_load_data_splitting`
+
+--echo # Case 1: wsrep_load_data_splitting = ON & LOAD DATA with 20002
+--echo # entries.
+
+SET GLOBAL wsrep_load_data_splitting = ON;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+  ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+
+# Record wsrep_last_committed as it was before LOAD DATA
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--disable_query_log
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat' INTO TABLE t1;
+--enable_query_log
+
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_2
+SELECT COUNT(*) = 20002 FROM t1;
+
+# LOAD-ing 20002 rows causes 3 commits to be registered
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 3 AS wsrep_last_committed_diff;
+--enable_query_log
+
+DROP TABLE t1;
+
+--echo # Case 2: wsrep_load_data_splitting = ON & LOAD DATA with 101 entries.
+
+--connection node_1
+
+SET GLOBAL wsrep_load_data_splitting = ON;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+  ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+
+# Record wsrep_last_committed as it was before LOAD DATA
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--disable_query_log
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-5146-2.dat' INTO TABLE t1;
+--enable_query_log
+
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_2
+SELECT COUNT(*) = 101 FROM t1;
+
+# LOAD-ing 101 rows causes 1 commit to be registered
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+DROP TABLE t1;
+
+--echo # Case 3: wsrep_load_data_splitting = OFF & LOAD DATA with 20002
+--echo # entries.
+
+--connection node_1
+
+SET GLOBAL wsrep_load_data_splitting = OFF;
+
+CREATE TABLE t1 (pk INT PRIMARY KEY)
+  ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
+
+# Record wsrep_last_committed as it was before LOAD DATA
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--disable_query_log
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat' INTO TABLE t1;
+--enable_query_log
+
+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_2
+SELECT COUNT(*) = 20002 FROM t1;
+
+# LOAD-ing 20002 rows causes 1 commit to be registered
+--disable_query_log
+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
+--enable_query_log
+
+DROP TABLE t1;
+
+--connection node_1
+# Restore the original value
+--eval SET GLOBAL wsrep_load_data_splitting = $wsrep_load_data_splitting_orig;
+
+# Cleanup
+remove_file '$MYSQLTEST_VARDIR/tmp/mdev-5146-1.dat';
+remove_file '$MYSQLTEST_VARDIR/tmp/mdev-5146-2.dat';
+
+--source include/galera_end.inc
+--echo # End of test
index 56ac72ef7eecd170232eba137a7284f7dbff3b6d..60c4fad3db2604b508b3fbc2175196655e557d82 100644 (file)
@@ -9,7 +9,7 @@ wsrep_provider=@ENV.WSREP_PROVIDER
 # enforce read-committed characteristics across the cluster
 
 wsrep_causal_reads=ON
-wsrep_sync_wait = 7
+wsrep_sync_wait = 15
 
 # Required for Galera
 innodb_autoinc_lock_mode=2
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/GAL-501.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/GAL-501.result
new file mode 100644 (file)
index 0000000..a2bf5f4
--- /dev/null
@@ -0,0 +1,14 @@
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result
new file mode 100644 (file)
index 0000000..f519654
--- /dev/null
@@ -0,0 +1,26 @@
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+SET GLOBAL wsrep_sst_auth = 'sst:';
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+Unloading wsrep provider ...
+SET GLOBAL wsrep_provider = 'none';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+Loading wsrep provider ...
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+DROP USER sst;
+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
+CALL mtr.add_suppression("InnoDB: New log files created");
+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
+CALL mtr.add_suppression("Can't open and lock time zone table");
+CALL mtr.add_suppression("Can't open and lock privilege tables");
+CALL mtr.add_suppression("Info table is not ready to be used");
+CALL mtr.add_suppression("Native table .* has the wrong structure");
+CALL mtr.add_suppression("Unsupported protocol downgrade: incremental data collection disabled. Expect abort");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result
new file mode 100644 (file)
index 0000000..a2bf5f4
--- /dev/null
@@ -0,0 +1,14 @@
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result
new file mode 100644 (file)
index 0000000..53e3593
--- /dev/null
@@ -0,0 +1,18 @@
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+VARIABLE_VALUE LIKE '%[::1]%'
+1
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE = 3
+1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+DROP TABLE t1;
+include/assert_grep.inc [Streaming the backup to joiner at \[::1\]]
+include/assert_grep.inc [async IST sender starting to serve tcp://\[::1\]:]
+include/assert_grep.inc [IST receiver addr using tcp://\[::1\]]
+include/assert_grep.inc [Prepared IST receiver, listening at: tcp://\[::1\]]
index 6fb931638ef49af354323d9632e9642a9617beb8..0e854fa6c23050be87bd90f8c085312f8a27ebd4 100644 (file)
@@ -116,6 +116,9 @@ VARIABLE_VALUE = 'Synced'
 SET GLOBAL wsrep_provider_options = 'pc.weight=1';
 CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
 CALL mtr.add_suppression('overriding reported weight for');
+CALL mtr.add_suppression('SYNC message from member');
+CALL mtr.add_suppression('user message in state LEAVING');
+CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)');
 CALL mtr.add_suppression('WSREP: user message in state LEAVING');
-CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
+CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)');
 CALL mtr.add_suppression('overriding reported weight for');
index 462d50672c2b1457ad81cf78ac3b3d07f37c9e97..88780a2c87fa8df7765f2ae16204ed076a681e99 100644 (file)
@@ -24,7 +24,7 @@ PREPARE stmt_update FROM 'UPDATE t1 SET f1 = f1 + f1';
 SET GLOBAL wsrep_dirty_reads = 1;
 SET GLOBAL wsrep_sync_wait = 0;
 SET GLOBAL wsrep_dirty_reads = 0;
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
 SET SESSION wsrep_dirty_reads = 1;
 INSERT INTO t1 SELECT * FROM t1;
 ERROR 08S01: WSREP has not yet prepared node for application use
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/GAL-501.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/GAL-501.cnf
new file mode 100644 (file)
index 0000000..7002cb5
--- /dev/null
@@ -0,0 +1,26 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+
+[mysqld.1]
+wsrep-cluster-address=gcomm://
+wsrep_node_address=[::1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_node_address=[::1]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_node_address=[::1]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/GAL-501.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/GAL-501.test
new file mode 100644 (file)
index 0000000..60ed598
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Test GAL-501 Improved URI parsing for IPv6 addresses 
+# The .cnf file contains
+# wsrep_node_address=[::1]
+# ist.recv_addr=[::1]
+
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Force IST
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
index a68ba8ce15bb4408747fb569b89353b808dc91e2..519f992d1b48831365d0ffbcac90e96f60528b18 100644 (file)
@@ -32,7 +32,10 @@ INSERT INTO t1 VALUES (1);
 SELECT COUNT(*) = 1 FROM t1;
 
 --echo Killing garbd ...
---exec pkill --oldest --full garbd.*$NODE_GALERAPORT_3
+# FreeBSD's /bin/pkill only supports short versions of the options:
+# -o Select only the oldest (least recently started)
+# -f Match against full argument lists
+--exec pkill -o -f garbd.*$NODE_GALERAPORT_3
 
 --sleep 5
 
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf
new file mode 100644 (file)
index 0000000..3728e1c
--- /dev/null
@@ -0,0 +1,22 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test
new file mode 100644 (file)
index 0000000..5b06e61
--- /dev/null
@@ -0,0 +1,56 @@
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+
+--connection node_1
+GRANT ALL PRIVILEGES ON *.* TO 'sst';
+
+--let $wsrep_sst_auth_orig = `SELECT @@wsrep_sst_auth`
+SET GLOBAL wsrep_sst_auth = 'sst:';
+
+--connection node_2
+--source include/wait_until_connected_again.inc
+--let $wsrep_sst_method_orig = `SELECT @@wsrep_sst_method`
+--let $wsrep_sst_receive_address_orig = `SELECT @@wsrep_sst_receive_address`
+
+--disable_query_log
+--eval SET GLOBAL wsrep_sst_receive_address = '[::1]:$NODE_MYPORT_2';
+--enable_query_log
+SET GLOBAL wsrep_sst_method = 'mysqldump';
+
+
+#
+# Force mysqldump SST
+#
+
+--connection node_2
+--source suite/galera/include/galera_unload_provider.inc
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+
+--connection node_2
+--source suite/galera/include/galera_load_provider.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+
+--source suite/galera/include/galera_sst_restore.inc
+--connection node_2
+CALL mtr.add_suppression("Unsupported protocol downgrade: incremental data collection disabled. Expect abort");
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf
new file mode 100644 (file)
index 0000000..3728e1c
--- /dev/null
@@ -0,0 +1,22 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.test
new file mode 100644 (file)
index 0000000..7ee209d
--- /dev/null
@@ -0,0 +1,32 @@
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Force IST
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf
new file mode 100644 (file)
index 0000000..5cc8fb0
--- /dev/null
@@ -0,0 +1,30 @@
+!include ../galera_3nodes.cnf
+
+[mysqld]
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
+
+[mysqld.1]
+wsrep_node_name='node_1'
+wsrep-cluster-address=gcomm://
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.1.port'
+
+[mysqld.2]
+wsrep_node_name='node_2'
+wsrep_sst_donor='node_1'
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.2.port'
+
+[mysqld.3]
+wsrep_node_name='node_3'
+wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
+wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
+wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
+wsrep_node_incoming_address='[::1]:@mysqld.3.port'
+
+[SST]
+sockopt=",pf=ip6"
diff --git a/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test b/mysql-wsrep-5.6/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test
new file mode 100644 (file)
index 0000000..84eee01
--- /dev/null
@@ -0,0 +1,62 @@
+--source include/galera_cluster.inc
+--source include/have_ipv6.inc
+
+# Confirm that initial handshake happened over ipv6
+
+SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+# Force IST
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+# Confirm that key messages around SST and IST reference IPv6
+
+--connection node_1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = CURRENT_TEST
+
+--let $assert_count = 2
+--let $assert_text = Streaming the backup to joiner at \[::1\]
+--let $assert_select = Streaming the backup to joiner at \[::1\]
+--source include/assert_grep.inc
+
+--let $assert_count = 1
+--let $assert_text = async IST sender starting to serve tcp://\[::1\]:
+--let $assert_select = async IST sender starting to serve tcp://\[::1\]:
+--source include/assert_grep.inc
+
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+
+--let $assert_text = IST receiver addr using tcp://\[::1\]
+--let $assert_select = IST receiver addr using tcp://\[::1\]
+--source include/assert_grep.inc
+
+--let $assert_text = Prepared IST receiver, listening at: tcp://\[::1\]
+--let $assert_select = Prepared IST receiver, listening at: tcp://\[::1\]
+--source include/assert_grep.inc
+
+
+
+
index c118b7481bca2a3714afc6bf4dc29bd4ae3a9d83..5228a176963fb6782c10f9b5bb44d24501c1f75b 100644 (file)
@@ -9,16 +9,12 @@
 
 --connection node_1
 SET GLOBAL wsrep_provider_options = 'pc.weight=3';
-
---source include/wait_until_connected_again.inc
 --source include/galera_suspend.inc
 --sleep 10
 
 --connection node_2
 # Do not wait for causality as we are no longer in the primary component
 SET SESSION wsrep_sync_wait=0;
---source include/wait_until_connected_again.inc
-
 SET SESSION wsrep_on=OFF;
 --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
 --source include/wait_condition.inc
@@ -39,7 +35,6 @@ SHOW STATUS LIKE 'wsrep_local_state_comment';
 --source include/galera_connect.inc
 --connection node_3
 SET SESSION wsrep_sync_wait=0;
---source include/wait_until_connected_again.inc
 
 SHOW STATUS LIKE 'wsrep_cluster_size';
 SHOW STATUS LIKE 'wsrep_cluster_status';
@@ -121,8 +116,11 @@ CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
 
 --connection node_2
 CALL mtr.add_suppression('overriding reported weight for');
+CALL mtr.add_suppression('SYNC message from member');
+CALL mtr.add_suppression('user message in state LEAVING');
+CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)');
 
 --connection node_3
 CALL mtr.add_suppression('WSREP: user message in state LEAVING');
-CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
+CALL mtr.add_suppression('sending install message failed: (Transport endpoint is not connected|Socket is not connected)');
 CALL mtr.add_suppression('overriding reported weight for');
index e9729280f2cdebc8d59d5c1f024196facf7a5379..129ba2e1f38c24abe794afeee7784873e50c5085 100644 (file)
@@ -62,7 +62,7 @@ SET GLOBAL wsrep_sync_wait = 0;
 --error 0
 --exec $MYSQL_DUMP -u root -S $NODE_MYSOCK_2 test >/dev/null
 SET GLOBAL wsrep_dirty_reads = 0;
-SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 15;
 
 # Those statements should fail
 
index 284fcc8110e2950f4b16c8ea696e94c1bfe262ba..df85feb47bae3e8fb272b0f04e14e0f648b06173 100644 (file)
@@ -26,3 +26,4 @@ COUNT(*)
 call mtr.add_suppression("InnoDB: Error parsing");
 SET GLOBAL innodb_buffer_pool_load_now = ON;
 DROP TABLE ib_bp_test;
+SET GLOBAL innodb_buffer_pool_load_now = ON;
index 45eebdb54e436001c89e4ada8ac067716abd1722..35c94eb0aed5422cd92ed9c44eec58aa533d035b 100644 (file)
@@ -46,3 +46,5 @@ innodb-index-debug : Unsafe statement written to the binary log using statement
 flush-hang : Unsafe statement written to the binary log
 innodb_deadlock_with_autoinc : Test uses autoinc_lock_mode = 0
 innodb_stats_del_mark : Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.
+ibuf_not_empty : InnoDB: Failing assertion: !srv_read_only_mode with server restart
+innodb_force_recovery : InnoDB: Failing assertion: !srv_read_only_mode with server restart
\ No newline at end of file
index 9bd2c83067382a02bcdfaf7b1648191494a7728b..0c79c96bf1e932d64bc74940c2b3d198d961f47b 100644 (file)
@@ -113,3 +113,21 @@ let $wait_condition =
 -- source include/wait_condition.inc
 
 DROP TABLE ib_bp_test;
+
+
+# Write file to make mysql-test-run.pl wait for the server to stop
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+# Request shutdown
+-- send_shutdown
+# Call script that will poll the server waiting for it to disapear
+-- source include/wait_until_disconnected.inc
+
+# Write file to make mysql-test-run.pl start up the server with
+# read only mode.
+
+--exec echo "restart:--innodb-read-only=1" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+# Load
+SET GLOBAL innodb_buffer_pool_load_now = ON;
index adfcb703139e8d05f5f2dde0ccc69715e86233c4..cf35e55ef09603ebe59350ab67aefbc1880123af 100644 (file)
@@ -8,6 +8,10 @@
 --source include/have_log_bin.inc
 --source include/count_sessions.inc
 
+--disable_query_log
+CALL mtr.add_suppression("InnoDB: Warning: MySQL is trying to drop table *.*");
+--enable_query_log
+
 SET @old_log_output = @@global.log_output;
 SET @old_slow_query_log = @@global.slow_query_log;
 SET @old_general_log = @@global.general_log;
@@ -25,6 +29,7 @@ connect (con2,localhost,root,,);
 connection default;
 
 --echo # Case 1: Sync blocks DML(insert) on the same table.
+--sleep 2
 CREATE TABLE t1 (
         FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
         title VARCHAR(200),
index 33b0746b27e5d501ab79ef84c363d56ba847c6d3..61284575a3e2e65e7bdaccd3778a5e348370b8ed 100644 (file)
@@ -7894,15 +7894,15 @@ select * from t6 where d in (select f1() from t2 where s="c")   {
               "steps": [
                 {
                   "transformation": "equality_propagation",
-                  "resulting_condition": "(1 and multiple equal('c', `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal('c', `t2`.`s`))"
                 },
                 {
                   "transformation": "constant_propagation",
-                  "resulting_condition": "(1 and multiple equal('c', `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal('c', `t2`.`s`))"
                 },
                 {
                   "transformation": "trivial_condition_removal",
-                  "resulting_condition": "(multiple equal('c', `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "((`t6`.`d` = `f1`()) and multiple equal('c', `t2`.`s`))"
                 }
               ] /* steps */
             } /* condition_processing */
@@ -8030,7 +8030,7 @@ select * from t6 where d in (select f1() from t2 where s="c")     {
           },
           {
             "attaching_conditions_to_tables": {
-              "original_condition": "((`t6`.`d` = `f1`()) and (`t2`.`s` = 'c'))",
+              "original_condition": "((`t2`.`s` = 'c') and (`t6`.`d` = `f1`()))",
               "attached_conditions_computation": [
               ] /* attached_conditions_computation */,
               "attached_conditions_summary": [
@@ -8757,15 +8757,15 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)  {
               "steps": [
                 {
                   "transformation": "equality_propagation",
-                  "resulting_condition": "(1 and multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 },
                 {
                   "transformation": "constant_propagation",
-                  "resulting_condition": "(1 and multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 },
                 {
                   "transformation": "trivial_condition_removal",
-                  "resulting_condition": "(multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "((`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 }
               ] /* steps */
             } /* condition_processing */
@@ -8893,7 +8893,7 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)    {
           },
           {
             "attaching_conditions_to_tables": {
-              "original_condition": "((`t6`.`d` = `f1`()) and (`t2`.`s` = arg@0))",
+              "original_condition": "((`t2`.`s` = arg@0) and (`t6`.`d` = `f1`()))",
               "attached_conditions_computation": [
               ] /* attached_conditions_computation */,
               "attached_conditions_summary": [
@@ -10571,15 +10571,15 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)        {
               "steps": [
                 {
                   "transformation": "equality_propagation",
-                  "resulting_condition": "(1 and multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 },
                 {
                   "transformation": "constant_propagation",
-                  "resulting_condition": "(1 and multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 },
                 {
                   "transformation": "trivial_condition_removal",
-                  "resulting_condition": "(multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "((`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 }
               ] /* steps */
             } /* condition_processing */
@@ -10781,7 +10781,7 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)  {
           },
           {
             "attaching_conditions_to_tables": {
-              "original_condition": "((`t6`.`d` = `f1`()) and (`t2`.`s` = arg@0))",
+              "original_condition": "((`t2`.`s` = arg@0) and (`t6`.`d` = `<subquery2>`.`f1()`))",
               "attached_conditions_computation": [
               ] /* attached_conditions_computation */,
               "attached_conditions_summary": [
@@ -10791,7 +10791,7 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)  {
                 },
                 {
                   "table": "``.`<subquery2>`",
-                  "attached": "(`t6`.`d` = `f1`())"
+                  "attached": null
                 },
                 {
                   "table": "`t2`",
index 0ffb19779d7499985d293ca2d0fb6982efb14922..1b18572013d9caf2ebed2bed4c309e9f3445c877 100644 (file)
@@ -7850,15 +7850,15 @@ select * from t6 where d in (select f1() from t2 where s="c")   {
               "steps": [
                 {
                   "transformation": "equality_propagation",
-                  "resulting_condition": "(1 and multiple equal('c', `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal('c', `t2`.`s`))"
                 },
                 {
                   "transformation": "constant_propagation",
-                  "resulting_condition": "(1 and multiple equal('c', `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal('c', `t2`.`s`))"
                 },
                 {
                   "transformation": "trivial_condition_removal",
-                  "resulting_condition": "(multiple equal('c', `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "((`t6`.`d` = `f1`()) and multiple equal('c', `t2`.`s`))"
                 }
               ] /* steps */
             } /* condition_processing */
@@ -7986,7 +7986,7 @@ select * from t6 where d in (select f1() from t2 where s="c")     {
           },
           {
             "attaching_conditions_to_tables": {
-              "original_condition": "((`t6`.`d` = `f1`()) and (`t2`.`s` = 'c'))",
+              "original_condition": "((`t2`.`s` = 'c') and (`t6`.`d` = `f1`()))",
               "attached_conditions_computation": [
               ] /* attached_conditions_computation */,
               "attached_conditions_summary": [
@@ -8684,15 +8684,15 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)  {
               "steps": [
                 {
                   "transformation": "equality_propagation",
-                  "resulting_condition": "(1 and multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 },
                 {
                   "transformation": "constant_propagation",
-                  "resulting_condition": "(1 and multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 },
                 {
                   "transformation": "trivial_condition_removal",
-                  "resulting_condition": "(multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "((`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 }
               ] /* steps */
             } /* condition_processing */
@@ -8820,7 +8820,7 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)    {
           },
           {
             "attaching_conditions_to_tables": {
-              "original_condition": "((`t6`.`d` = `f1`()) and (`t2`.`s` = arg@0))",
+              "original_condition": "((`t2`.`s` = arg@0) and (`t6`.`d` = `f1`()))",
               "attached_conditions_computation": [
               ] /* attached_conditions_computation */,
               "attached_conditions_summary": [
@@ -10512,15 +10512,15 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)        {
               "steps": [
                 {
                   "transformation": "equality_propagation",
-                  "resulting_condition": "(1 and multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 },
                 {
                   "transformation": "constant_propagation",
-                  "resulting_condition": "(1 and multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "(1 and (`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 },
                 {
                   "transformation": "trivial_condition_removal",
-                  "resulting_condition": "(multiple equal(arg@0, `t2`.`s`) and multiple equal(`f1`(), `t6`.`d`))"
+                  "resulting_condition": "((`t6`.`d` = `f1`()) and multiple equal(arg@0, `t2`.`s`))"
                 }
               ] /* steps */
             } /* condition_processing */
@@ -10722,7 +10722,7 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)  {
           },
           {
             "attaching_conditions_to_tables": {
-              "original_condition": "((`t6`.`d` = `f1`()) and (`t2`.`s` = arg@0))",
+              "original_condition": "((`t2`.`s` = arg@0) and (`t6`.`d` = `<subquery2>`.`f1()`))",
               "attached_conditions_computation": [
               ] /* attached_conditions_computation */,
               "attached_conditions_summary": [
@@ -10732,7 +10732,7 @@ select d into res from t6 where d in (select f1() from t2 where s=arg)  {
                 },
                 {
                   "table": "``.`<subquery2>`",
-                  "attached": "(`t6`.`d` = `f1`())"
+                  "attached": null
                 },
                 {
                   "table": "`t2`",
index 5cfb8159011628baefe7dc71753f82e1c049f921..d66a776bb399f8877cbae309c73704b03ca4c3df 100644 (file)
@@ -19,22 +19,22 @@ Warning     1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a f
 START SLAVE;
 # ALTER TABLE on the master.
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
 f_time f_datetime      f_timestamp     HEX(WEIGHT_STRING(f_time))      HEX(WEIGHT_STRING(f_datetime))  HEX(WEIGHT_STRING(f_timestamp))
 10:10:10       2010-10-10 10:10:10     2031-11-21 17:11:01     818A92  0000124821911312        7468F975
 00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  00001230A2EA8AB5        3A6AFC05
 01:01:10       2020-01-01 01:01:01     1980-11-21 18:06:01     80277E  0000125F33D85AB5        147BF1D9
 NULL   2000-01-01 01:01:01     2015-11-21 17:11:01     NULL    00001230A2EA8AB5        56507B75
 00:00:00       NULL    2011-11-21 17:11:01     800000  NULL    4ECA5BF5
-ALTER TABLE t1 ADD COLUMN fld1 INT;
+ALTER TABLE t21 ADD COLUMN fld1 INT;
 Warnings:
 Note   1880    TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format.
-INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
+INSERT INTO t21 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
 # Since the global variable 'avoid_temporal_upgrade' is disabled on 
 # the master, the temporal columns of old format are upgraded to the
 # new format.
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
 f_time f_datetime      f_timestamp     HEX(WEIGHT_STRING(f_time))      HEX(WEIGHT_STRING(f_datetime))  HEX(WEIGHT_STRING(f_timestamp))
 10:10:10       2010-10-10 10:10:10     2031-11-21 17:11:01     80A28A  998714A28A      7468F975
 00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  9964421041      3A6AFC05
@@ -49,7 +49,7 @@ SET @saved_show_old_temporals= @@session.show_old_temporals;
 Warnings:
 Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
 f_time f_datetime      f_timestamp     HEX(WEIGHT_STRING(f_time))      HEX(WEIGHT_STRING(f_datetime))  HEX(WEIGHT_STRING(f_timestamp))
 10:10:10       2010-10-10 10:10:10     2031-11-21 17:11:01     818A92  0000124821911312        7468F975
 00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  00001230A2EA8AB5        3A6AFC05
@@ -60,15 +60,15 @@ NULL        2000-01-01 01:01:01     2015-11-21 17:11:01     NULL    00001230A2EA8AB5        56507B75
 SET SESSION show_old_temporals= ON;
 Warnings:
 Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
-SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t21;
 Table  Create Table
-t1     CREATE TABLE `t1` (
+t21    CREATE TABLE `t21` (
   `f_time` time /* 5.5 binary format */ DEFAULT NULL,
   `f_timestamp` timestamp /* 5.5 binary format */ NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   `f_datetime` datetime /* 5.5 binary format */ DEFAULT NULL,
   `fld1` int(11) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t21';
 COLUMN_TYPE
 time /* 5.5 binary format */
 timestamp /* 5.5 binary format */
@@ -78,7 +78,7 @@ SET @@session.show_old_temporals= @saved_show_old_temporals;
 Warnings:
 Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
 #Cleanup
-DROP TABLE t1;
+DROP TABLE t21;
 include/sync_slave_sql_with_master.inc
 # Testcase to ensure that the temporal columns of old format
 # are upgraded on the slave since 'avoid_temporal_column'
@@ -93,21 +93,21 @@ Warning     1287    '@@avoid_temporal_upgrade' is deprecated and will be removed in a f
 START SLAVE;
 # ALTER TABLE on the master.
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
 f_time f_datetime      f_timestamp     HEX(WEIGHT_STRING(f_time))      HEX(WEIGHT_STRING(f_datetime))  HEX(WEIGHT_STRING(f_timestamp))
 10:10:10       2010-10-10 10:10:10     2031-11-21 17:11:01     818A92  0000124821911312        7468F975
 00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  00001230A2EA8AB5        3A6AFC05
 01:01:10       2020-01-01 01:01:01     1980-11-21 18:06:01     80277E  0000125F33D85AB5        147BF1D9
 NULL   2000-01-01 01:01:01     2015-11-21 17:11:01     NULL    00001230A2EA8AB5        56507B75
 00:00:00       NULL    2011-11-21 17:11:01     800000  NULL    4ECA5BF5
-ALTER TABLE t1 ADD COLUMN fld1 INT;
+ALTER TABLE t31 ADD COLUMN fld1 INT;
 Warnings:
 Note   1880    TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format.
-INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
+INSERT INTO t31 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
 # Since the default value of 'avoid_temporal_upgrade' is FALSE,
 # the old temporal will be upgraded on the master.
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
 f_time f_datetime      f_timestamp     HEX(WEIGHT_STRING(f_time))      HEX(WEIGHT_STRING(f_datetime))  HEX(WEIGHT_STRING(f_timestamp))
 10:10:10       2010-10-10 10:10:10     2031-11-21 17:11:01     80A28A  998714A28A      7468F975
 00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  9964421041      3A6AFC05
@@ -115,15 +115,15 @@ f_time    f_datetime      f_timestamp     HEX(WEIGHT_STRING(f_time))      HEX(WEIGHT_STRING(f_dat
 NULL   2000-01-01 01:01:01     2015-11-21 17:11:01     NULL    9964421041      56507B75
 00:00:00       NULL    2011-11-21 17:11:01     800000  NULL    4ECA5BF5
 22:22:22       2011-11-21 22:22:22     2011-11-21 22:22:22     816596  998AAB6596      4ECAA4EE
-SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t31;
 Table  Create Table
-t1     CREATE TABLE `t1` (
+t31    CREATE TABLE `t31` (
   `f_time` time DEFAULT NULL,
   `f_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   `f_datetime` datetime DEFAULT NULL,
   `fld1` int(11) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t31';
 COLUMN_TYPE
 time
 timestamp
@@ -139,7 +139,7 @@ SET SESSION show_old_temporals= ON;
 Warnings:
 Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
 f_time f_datetime      f_timestamp     HEX(WEIGHT_STRING(f_time))      HEX(WEIGHT_STRING(f_datetime))  HEX(WEIGHT_STRING(f_timestamp))
 10:10:10       2010-10-10 10:10:10     2031-11-21 17:11:01     80A28A  998714A28A      7468F975
 00:00:00       2000-01-01 01:01:01     2001-01-21 18:11:01     800000  9964421041      3A6AFC05
@@ -147,15 +147,15 @@ f_time    f_datetime      f_timestamp     HEX(WEIGHT_STRING(f_time))      HEX(WEIGHT_STRING(f_dat
 NULL   2000-01-01 01:01:01     2015-11-21 17:11:01     NULL    9964421041      56507B75
 00:00:00       NULL    2011-11-21 17:11:01     800000  NULL    4ECA5BF5
 22:22:22       2011-11-21 22:22:22     2011-11-21 22:22:22     816596  998AAB6596      4ECAA4EE
-SHOW CREATE TABLE t1;
+SHOW CREATE TABLE t31;
 Table  Create Table
-t1     CREATE TABLE `t1` (
+t31    CREATE TABLE `t31` (
   `f_time` time DEFAULT NULL,
   `f_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
   `f_datetime` datetime DEFAULT NULL,
   `fld1` int(11) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t31';
 COLUMN_TYPE
 time
 timestamp
@@ -165,6 +165,6 @@ SET @@session.show_old_temporals= @saved_show_old_temporals;
 Warnings:
 Warning        1287    '@@show_old_temporals' is deprecated and will be removed in a future release.
 # cleanup
-DROP TABLE t1;
+DROP TABLE t31;
 include/sync_slave_sql_with_master.inc
 include/rpl_end.inc
index f707fb97e105a0251e8cfc26ed7303306738dfc2..7f303c9cf05d97649137188bc8d3f0427f6bdd1a 100644 (file)
@@ -3,6 +3,7 @@ Warnings:
 Note   ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
 Note   ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
 [connection master]
+include/stop_dump_threads.inc
 CREATE TABLE t1(i INT) engine=innodb;
 INSERT INTO t1 VALUES (1);
 FLUSH LOGS;
index a5fb90fa95cfe5d5a16f67c4ffa5e198526b1a30..59615ad721377ecbfef573efcc850ad47571cf94 100644 (file)
@@ -40,6 +40,7 @@ include/wait_for_slave_sql_error.inc [errno=1593]
 set @@global.slave_checkpoint_group= @save.slave_checkpoint_group;
 set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 set @@global.debug= @save.debug;
+include/assert.inc [Verified that their is no orphaned SQL worker thread]
 include/start_slave.inc
 include/rpl_reset.inc
 include/stop_slave.inc
index b436e5496ba778faa4faf8ed2c1825f810f579ed..38c25116c45222b0bbd9f05e92da0d9847ee1100 100644 (file)
@@ -64,6 +64,135 @@ INSERT INTO t5 VALUES (1,1,"ab"),(2,2,"cde"),(3,1,"12345"),(4,4,"random"),(5,NUL
 DELETE FROM t5 ORDER BY c1;
 DROP TABLE t5;
 include/sync_slave_sql_with_master.inc
+SET @@global.slave_rows_search_algorithms= 'INDEX_SCAN,HASH_SCAN';
+call mtr.add_suppression("Could not execute Delete_rows event on table test.t6");
+call mtr.add_suppression("Could not execute Update_rows event on table test.t6");
+call mtr.add_suppression("Can't find record in 't6'");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped");
+[connection master]
+CREATE TABLE t6(num INT, year INT, KEY year (year))
+PARTITION BY HASH(num) PARTITIONS 5;
+INSERT INTO t6 VALUES(6, 1977);
+INSERT INTO t6 VALUES(1, 1983);
+INSERT INTO t6 VALUES(9, 1977);
+DELETE FROM t6 WHERE num= 9;
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/diff_tables.inc [master:t6, slave:t6]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+[connection master]
+CREATE TABLE t6(num INT, year INT, KEY year (year))
+PARTITION BY HASH(num) PARTITIONS 5;
+INSERT INTO t6 VALUES(6, 1977);
+INSERT INTO t6 VALUES(1, 1983);
+INSERT INTO t6 VALUES(9, 1977);
+INSERT INTO t6 VALUES(9, 1977);
+INSERT INTO t6 VALUES(9, 1987);
+INSERT INTO t6 VALUES(9, 9);
+INSERT INTO t6 VALUES(9, 1555555500);
+DELETE FROM t6 WHERE num= 9;
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/diff_tables.inc [master:t6, slave:t6]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+[connection master]
+CREATE TABLE t6(num INT, year INT, num_2 INT, KEY year (year))
+PARTITION BY HASH(num_2-num) PARTITIONS 5;
+INSERT INTO t6 VALUES(6, 1977, 1);
+INSERT INTO t6 VALUES(1, 1983, 2);
+INSERT INTO t6 VALUES(9, 1977, 1);
+INSERT INTO t6 VALUES(9, 1983, 1);
+INSERT INTO t6 VALUES(9, 1977, 3);
+DELETE FROM t6 WHERE num_2= 1;
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/diff_tables.inc [master:t6, slave:t6]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+include/stop_slave_sql.inc
+[connection master]
+CREATE TABLE t6(num INT, year INT, KEY year (year))
+PARTITION BY HASH(num) PARTITIONS 5;
+INSERT INTO t6 VALUES(6, 1977);
+INSERT INTO t6 VALUES(1, 1983);
+INSERT INTO t6 VALUES(9, 1977);
+SET SQL_LOG_BIN= 0;
+INSERT INTO t6 VALUES(10, 1977);
+SET SQL_LOG_BIN= 1;
+DELETE FROM t6 WHERE num= 10;
+[connection slave]
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error.inc [errno=1032]
+include/stop_slave.inc
+INSERT INTO t6 VALUES(10, 1977);
+include/start_slave.inc
+[connection master]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+[connection master]
+CREATE TABLE t6(num INT, year INT, KEY year (year))
+PARTITION BY HASH(num) PARTITIONS 5;
+INSERT INTO t6 VALUES(6, 1977);
+INSERT INTO t6 VALUES(1, 1983);
+INSERT INTO t6 VALUES(9, 1977);
+UPDATE t6 SET num= 10 WHERE num= 9;
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/diff_tables.inc [master:t6, slave:t6]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+[connection master]
+CREATE TABLE t6(num INT, year INT, KEY year (year))
+PARTITION BY HASH(num) PARTITIONS 5;
+INSERT INTO t6 VALUES(6, 1977);
+INSERT INTO t6 VALUES(1, 1983);
+INSERT INTO t6 VALUES(9, 1977);
+INSERT INTO t6 VALUES(9, 1977);
+INSERT INTO t6 VALUES(9, 1987);
+INSERT INTO t6 VALUES(9, 9);
+INSERT INTO t6 VALUES(9, 1555555500);
+UPDATE t6 SET num= 10 WHERE num= 9;
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/diff_tables.inc [master:t6, slave:t6]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+[connection master]
+CREATE TABLE t6(num INT, year INT, num_2 INT, KEY year (year))
+PARTITION BY HASH(num_2-num) PARTITIONS 5;
+INSERT INTO t6 VALUES(6, 1977, 1);
+INSERT INTO t6 VALUES(1, 1983, 2);
+INSERT INTO t6 VALUES(9, 1977, 1);
+INSERT INTO t6 VALUES(9, 1983, 1);
+INSERT INTO t6 VALUES(9, 1977, 3);
+UPDATE t6 SET num= 10 WHERE num_2= 1;
+include/sync_slave_sql_with_master.inc
+[connection master]
+include/diff_tables.inc [master:t6, slave:t6]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
+include/stop_slave_sql.inc
+[connection master]
+CREATE TABLE t6(num INT, year INT, KEY year (year))
+PARTITION BY HASH(num) PARTITIONS 5;
+INSERT INTO t6 VALUES(6, 1977);
+INSERT INTO t6 VALUES(1, 1983);
+INSERT INTO t6 VALUES(9, 1977);
+SET SQL_LOG_BIN= 0;
+INSERT INTO t6 VALUES(10, 1977);
+SET SQL_LOG_BIN= 1;
+UPDATE t6 SET num= 9 WHERE num= 10;
+[connection slave]
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error.inc [errno=1032]
+include/stop_slave.inc
+INSERT INTO t6 VALUES(10, 1977);
+include/start_slave.inc
+[connection master]
+DROP TABLE t6;
+include/sync_slave_sql_with_master.inc
 SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms;
 DROP TABLE IF EXISTS t1, t2, t3, t4;
 include/sync_slave_sql_with_master.inc
index 1ae3e436a98e977add6cbb7e1ed2c7715529652b..d41d3004d27bdde5a2f40c657926f32d6540b17e 100644 (file)
 --echo # Copy the table containing the old Mysql-5.5 temporal format
 --echo # to the master and slave.
 
---copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t1.frm
---copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t1.MYD
---copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t1.MYI
+--copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t21.frm
+--copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t21.MYD
+--copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t21.MYI
 
---copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t1.frm
---copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t1.MYD
---copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t1.MYI
+--copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t21.frm
+--copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t21.MYD
+--copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t21.MYI
 
 --echo # Enable the 'avoid_temporal_column' global variable on slave.
 --connection slave
@@ -33,14 +33,14 @@ START SLAVE;
 --echo # ALTER TABLE on the master.
 --connection master
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
-ALTER TABLE t1 ADD COLUMN fld1 INT;
-INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
+ALTER TABLE t21 ADD COLUMN fld1 INT;
+INSERT INTO t21 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
 --echo # Since the global variable 'avoid_temporal_upgrade' is disabled on 
 --echo # the master, the temporal columns of old format are upgraded to the
 --echo # new format.
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
 --source include/sync_slave_sql_with_master.inc
 
 --echo # Since 'avoid_temporal_upgrade' is enabled on the slave,
@@ -48,15 +48,15 @@ HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
 --connection slave
 SET @saved_show_old_temporals= @@session.show_old_temporals;
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
 SET SESSION show_old_temporals= ON;
-SHOW CREATE TABLE t1;
-SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+SHOW CREATE TABLE t21;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t21';
 SET @@session.show_old_temporals= @saved_show_old_temporals;
 
 --echo #Cleanup
 --connection master
-DROP TABLE t1;
+DROP TABLE t21;
 --source include/sync_slave_sql_with_master.inc
 
 --echo # Testcase to ensure that the temporal columns of old format
@@ -66,13 +66,13 @@ DROP TABLE t1;
 --echo # Copy the table containing the old Mysql-5.5 temporal format
 --echo # to the master and slave.
 
---copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t1.frm
---copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t1.MYD
---copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t1.MYI
+--copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t31.frm
+--copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t31.MYD
+--copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t31.MYI
 
---copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t1.frm
---copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t1.MYD
---copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t1.MYI
+--copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t31.frm
+--copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t31.MYD
+--copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t31.MYI
 
 --echo # Disable the 'avoid_temporal_column' global variable on slave.
 --connection slave
@@ -83,16 +83,16 @@ START SLAVE;
 --echo # ALTER TABLE on the master.
 --connection master
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
-ALTER TABLE t1 ADD COLUMN fld1 INT;
-INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
+ALTER TABLE t31 ADD COLUMN fld1 INT;
+INSERT INTO t31 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
 
 --echo # Since the default value of 'avoid_temporal_upgrade' is FALSE,
 --echo # the old temporal will be upgraded on the master.
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-       HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
-SHOW CREATE TABLE t1;
-SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+       HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
+SHOW CREATE TABLE t31;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t31';
 
 --source include/sync_slave_sql_with_master.inc
 
@@ -102,14 +102,14 @@ SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
 SET @saved_show_old_temporals= @@session.show_old_temporals;
 SET SESSION show_old_temporals= ON;
 SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
-HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
-SHOW CREATE TABLE t1;
-SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
+HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
+SHOW CREATE TABLE t31;
+SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t31';
 SET @@session.show_old_temporals= @saved_show_old_temporals;
 
 --echo # cleanup
 --connection master
-DROP TABLE t1;
+DROP TABLE t31;
 --source include/sync_slave_sql_with_master.inc
 
 
index cb4f7f2aeb8fba4d45f00cf9316465fce379b174..99d9ca05764a9fd5389c02532fdc2185a4ddb9ed 100644 (file)
 --let $rpl_skip_start_slave=1
 --source include/master-slave.inc
 
+# When this test script is running in combination with other tests,
+# it is possible that dump threads from those tests are not killed.
+# (rpl_end.inc does not kill dump threads).
+# Hence doing the cleanup here as this test depends dump threads.
+--source include/stop_dump_threads.inc
+
 #  1) Create a binary log with some events
 CREATE TABLE t1(i INT) engine=innodb;
 INSERT INTO t1 VALUES (1);
index 36db5735fb664b2a9c59c05519bb033fd056261b..2b9287c523bee4fe4e940f751d77f541b10a11ee 100644 (file)
@@ -87,8 +87,17 @@ set @@global.slave_checkpoint_group= @save.slave_checkpoint_group;
 set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 set @@global.debug= @save.debug;
 
-source include/start_slave.inc;
+# Bug#24679056:MULTI-THREADED SLAVE LEAKS WORKER THREADS IN CASE
+#              OF THREAD CREATE FAILURE
+#
+# The current test verifies that there is no orphaned SQL worker thread
+# by setting the assert_count= 0, when we check the output of
+# SELECT *FROM PROCESSLIST table, this is same as SHOW PROCESSLIST.
 
+--let $assert_text= Verified that their is no orphaned SQL worker thread
+--let $assert_cond= `SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE='Waiting for an event from Coordinator'`
+--source include/assert.inc
+--source include/start_slave.inc
 #
 # BUG#13681205 : REPLICATION FAILS DURING SLAVE WORKERS INITIALIZATION, 
 #                CRASHES SLAVE 
@@ -201,5 +210,4 @@ set @@global.slave_parallel_workers= @save.slave_parallel_workers;
 
 --source include/start_slave.inc
 --source include/rpl_reset.inc
-
 --source include/rpl_end.inc
index 63b61788ba5245b4ad73bf99c41fd98858b20b3e..32f245667aa48bd08d466b02f8184ce33a84fd3f 100644 (file)
@@ -201,11 +201,137 @@ DROP TABLE t5;
 --source include/sync_slave_sql_with_master.inc
 # End of Test cases for Bug#18860225
 
--- connection slave
+# Test cases for BUG#26137159
+# Verify that update and delete operations can be safely replicated when the
+# partition function does not include the key used in the index
+
+SET @@global.slave_rows_search_algorithms= 'INDEX_SCAN,HASH_SCAN';
+
+call mtr.add_suppression("Could not execute Delete_rows event on table test.t6");
+call mtr.add_suppression("Could not execute Update_rows event on table test.t6");
+call mtr.add_suppression("Can't find record in 't6'");
+# when mts is enabled
+call mtr.add_suppression("The slave coordinator and worker threads are stopped");
+
+--let $i= 1
+
+while ($i<3)
+{
+  # Check that the slave can delete/update a value that is not the index key
+  --source include/rpl_connection_master.inc
+  CREATE TABLE t6(num INT, year INT, KEY year (year))
+    PARTITION BY HASH(num) PARTITIONS 5;
+  INSERT INTO t6 VALUES(6, 1977);
+  INSERT INTO t6 VALUES(1, 1983);
+  INSERT INTO t6 VALUES(9, 1977);
+  if ($i==1)
+  {
+    DELETE FROM t6 WHERE num= 9;
+  }
+  if ($i==2)
+  {
+    UPDATE t6 SET num= 10 WHERE num= 9;
+  }
+  --source include/sync_slave_sql_with_master.inc
+  --source include/rpl_connection_master.inc
+  --let $diff_tables= master:t6, slave:t6
+  --source include/diff_tables.inc
+  DROP TABLE t6;
+  --source include/sync_slave_sql_with_master.inc
+
+  # Check that the slave can delete/update a repeated value that is not the
+  # index key
+  --source include/rpl_connection_master.inc
+  CREATE TABLE t6(num INT, year INT, KEY year (year))
+    PARTITION BY HASH(num) PARTITIONS 5;
+  INSERT INTO t6 VALUES(6, 1977);
+  INSERT INTO t6 VALUES(1, 1983);
+  INSERT INTO t6 VALUES(9, 1977);
+  INSERT INTO t6 VALUES(9, 1977);
+  INSERT INTO t6 VALUES(9, 1987);
+  INSERT INTO t6 VALUES(9, 9);
+  INSERT INTO t6 VALUES(9, 1555555500);
+  if ($i==1)
+  {
+    DELETE FROM t6 WHERE num= 9;
+  }
+  if ($i==2)
+  {
+    UPDATE t6 SET num= 10 WHERE num= 9;
+  }
+  --source include/sync_slave_sql_with_master.inc
+  --source include/rpl_connection_master.inc
+  --let $diff_tables= master:t6, slave:t6
+  --source include/diff_tables.inc
+  DROP TABLE t6;
+  --source include/sync_slave_sql_with_master.inc
+
+  # Check that the slave can delete/update a repeated value that is not the
+  # index key when using another column for key and a more complex partition
+  # function
+  --source include/rpl_connection_master.inc
+  CREATE TABLE t6(num INT, year INT, num_2 INT, KEY year (year))
+    PARTITION BY HASH(num_2-num) PARTITIONS 5;
+  INSERT INTO t6 VALUES(6, 1977, 1);
+  INSERT INTO t6 VALUES(1, 1983, 2);
+  INSERT INTO t6 VALUES(9, 1977, 1);
+  INSERT INTO t6 VALUES(9, 1983, 1);
+  INSERT INTO t6 VALUES(9, 1977, 3);
+  if ($i==1)
+  {
+    DELETE FROM t6 WHERE num_2= 1;
+  }
+  if ($i==2)
+  {
+    UPDATE t6 SET num= 10 WHERE num_2= 1;
+  }
+  --source include/sync_slave_sql_with_master.inc
+  --source include/rpl_connection_master.inc
+  --let $diff_tables= master:t6, slave:t6
+  --source include/diff_tables.inc
+  DROP TABLE t6;
+  --source include/sync_slave_sql_with_master.inc
+
+  # Check that the slave will error if trying to delete a non-existing value
+  --source include/stop_slave_sql.inc
+  --source include/rpl_connection_master.inc
+  CREATE TABLE t6(num INT, year INT, KEY year (year))
+   PARTITION BY HASH(num) PARTITIONS 5;
+  INSERT INTO t6 VALUES(6, 1977);
+  INSERT INTO t6 VALUES(1, 1983);
+  INSERT INTO t6 VALUES(9, 1977);
+  SET SQL_LOG_BIN= 0;
+  INSERT INTO t6 VALUES(10, 1977);
+  SET SQL_LOG_BIN= 1;
+  if ($i==1)
+  {
+    DELETE FROM t6 WHERE num= 10;
+  }
+  if ($i==2)
+  {
+    UPDATE t6 SET num= 9 WHERE num= 10;
+  }
+
+  --source include/rpl_connection_slave.inc
+  START SLAVE SQL_THREAD;
+  --let $slave_sql_errno= convert_error(ER_KEY_NOT_FOUND)
+  --source include/wait_for_slave_sql_error.inc
+
+  # update the slave to clear the error
+  --source include/stop_slave.inc
+  INSERT INTO t6 VALUES(10, 1977);
+  -- source include/start_slave.inc
+
+  --source include/rpl_connection_master.inc
+  DROP TABLE t6;
+  --source include/sync_slave_sql_with_master.inc
+
+  --inc $i
+}
 
-SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms;
 
 #clean Up
+SET @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms;
 --connection master
 DROP TABLE IF EXISTS t1, t2, t3, t4;
 --source include/sync_slave_sql_with_master.inc
index cc14b4c85d2c13bee1d3250cfd4c4b69d514480c..f2b3d212a2556f0f356380e591aed6717ce099d8 100644 (file)
@@ -182,3 +182,15 @@ drop table t1, t2;
 CREATE TABLE t1(a YEAR);
 SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
 DROP TABLE t1;
+
+--echo #
+--echo # Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
+--echo #              (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
+--echo #
+
+set @@sql_mode='';
+CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2) engine=innodb;
+INSERT INTO t1 VALUES(990101.102);
+SELECT COALESCE(c1)FROM t1 ORDER BY 1;
+DROP TABLE t1;
+set @@sql_mode=default;
index 2b0bfcab657a22b701844948fbbb051e8856d2e5..794d8c8b1a22c86954e1552b012efcf30fb805e6 100644 (file)
@@ -16,7 +16,7 @@ archive-big              : Bug#11817185 2011-03-10 Anitha Disabled since this le
 ds_mrr-big @solaris      : Bug#14168107 2012-04-03 Hemant disabled new test added by Olav Sandstå,since this leads to timeout on Solaris on slow sparc servers
 mysql_embedded_client_test      : Bug#13964673 2012-04-16 amitbha since most of the test cases are failing
 mysql_client_test_embedded : Bug#16084066 2013-01-08 Disabled since this test is failing
-mysqlhotcopy_archive @solaris : DBD-mysql perl module not available on Solaris
-mysqlhotcopy_myisam @solaris  : DBD-mysql perl module not available on Solaris
 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 
+mysqlhotcopy_archive @solaris : DBD-mysql perl module not available on Solaris
+mysqlhotcopy_myisam @solaris  : DBD-mysql perl module not available on Solaris
index db7d9fd2d089f9639ac3ae372dfa62c77bbbe4ee..33f3b287679b92b2bdbc7a3e3f11a3990dc9b4a4 100644 (file)
@@ -632,3 +632,17 @@ DEALLOCATE PREPARE stmt;
 DROP TABLE t1;
 
 --echo End of 5.1 tests
+
+
+--echo # Bug#21140111: Explain ... match against: Assertion failed: ret ...
+
+CREATE TABLE z(a INTEGER) engine=innodb;
+CREATE TABLE q(b TEXT CHARSET latin1, fulltext(b)) engine=innodb;
+
+let $query=
+SELECT 1 FROM q WHERE (SELECT MATCH(b) AGAINST ('*') FROM z);
+
+--error ER_WRONG_ARGUMENTS
+eval explain format=json $query;
+
+DROP TABLE z, q;
index 381be3f47b5a93a4e76b0dae22b76679fd9cd65e..ee5b4039e94ba058b35db670e78726766787f50e 100644 (file)
    fun:malloc
    fun:CRYPTO_malloc
    fun:sk_new
-   fun:load_builtin_compressions
+   ...
    fun:SSL_COMP_get_compression_methods
    fun:SSL_library_init
 }
index 44849323e8acd68e6bda949ba36ec032e1a30f28..7b3cffb5a38ec6d6b123f6ae056767f00085d491 100644 (file)
@@ -79,8 +79,9 @@
       <?if "@Platform@"="x64"?>\r
         <Property Id="VS10REDISTX64">\r
           <RegistrySearch Id="FindRedistVS10"\r
+              Win64="no"\r
               Root="HKLM"\r
-              Key="SOFTWARE\WOW6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x64"\r
+              Key="SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64"\r
               Name="Version"\r
               Type="raw" />\r
         </Property>\r
@@ -90,8 +91,9 @@
       <?elseif "@Platform@"="x86" ?>\r
         <Property Id="VS10REDISTX86">\r
           <RegistrySearch Id="FindRedistVS10"\r
+              Win64="no"\r
               Root="HKLM"\r
-              Key="SOFTWARE\WOW6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x86"\r
+              Key="SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86"\r
               Name="Version"\r
               Type="raw" />\r
         </Property>\r
index d3348684dc6e499239134629d5a07f62584d5048..aa14eb424251caf684bffabafb906680a94c40f5 100644 (file)
@@ -16,7 +16,6 @@
 IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
   RETURN()
 ENDIF()
-
 IF (NOT DEFINED DEB_CODENAME)
   execute_process(
     COMMAND lsb_release -cs
@@ -25,20 +24,36 @@ IF (NOT DEFINED DEB_CODENAME)
   )
   SET (DEB_CODENAME ${DEB_CODENAME} CACHE STRING "")
 ENDIF()
+IF (DEFINED WITH_NDBCLUSTER_STORAGE_ENGINE)
+  SET (DEB_BASE_PRODUCT "cluster-")
+  SET (DEB_BASE_PRODUCTC "Cluster ")
+  SET (DEB_BASE_VERSION ${NDBVERSION})
+  SET (DEB_CONTROL_SERVER_CONFLICT_NDB "mysql-community-server, mysql-commercial-server")
+  SET (DEB_CONTROL_CLIENT_CONFLICT_NDB "mysql-community-client, mysql-commercial-client")
+ELSE()
+  SET (DEB_BASE_PRODUCT "")
+  SET (DEB_BASE_PRODUCTC "")
+  SET (DEB_BASE_VERSION ${VERSION})
+  SET (DEB_CONTROL_SERVER_CONFLICT_NDB "mysql-cluster-community-server, mysql-cluster-commercial-server")
+  SET (DEB_CONTROL_CLIENT_CONFLICT_NDB "mysql-cluster-community-client, mysql-cluster-commercial-client")
+ENDIF()
+
+SET (DEB_BASE_VERSION "${DEB_BASE_VERSION}-${WSREP_VERSION}")
+
 # Commercial or community
 IF (DEB_PRODUCT STREQUAL "commercial")
+  message (FATAL_ERROR "mysql-wsrep is GPL only, no commercial builds")
   SET (DEB_COPYRIGHT_UPSTREAMNAME "MySQL Commercial Server ${MYSQL_BASE_VERSION}")
-  SET (DEB_PRODUCTNAME "commercial")
-  SET (DEB_PRODUCTNAMEC "Commercial")
-  SET (DEB_NOTPRODUCTNAME "community")
+  SET (DEB_PRODUCTNAME "${DEB_BASE_PRODUCT}commercial")
+  SET (DEB_PRODUCTNAMEC "${DEB_BASE_PRODUCTC}Commercial")
+  SET (DEB_NOTPRODUCTNAME "${DEB_BASE_PRODUCT}community")
   SET (DEB_LICENSENAME "Advanced")
   SET (DEB_INSTALL_LICENSEFILE "LICENSE.mysql")
-  SET (DEB_SERVERVERSION "${VERSION}+commercial-1")
+  SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}+commercial.1")
   SET (DEB_PLUGIN_SETPERMISSION "")
   SET (DEB_MAN_SETPERMISSION "")
   # List of plugins that are only in commercial packages
   # Plugins that are in both community and commercial should NOT be added here
-
   SET (DEB_INCLUDE_BINARIES_EXTRA
 "
 debian/extra/audit_log-plugin
@@ -56,29 +71,49 @@ usr/lib/mysql/plugin/thread_pool.so
 usr/lib/mysql/plugin/firewall.so
 usr/lib/mysql/plugin/debug/audit_log.so
 usr/lib/mysql/plugin/debug/authentication_pam.so
+usr/lib/mysql/plugin/debug/keyring_okv.so
 usr/lib/mysql/plugin/debug/openssl_udf.so
 usr/lib/mysql/plugin/debug/thread_pool.so
 usr/lib/mysql/plugin/debug/firewall.so
 ")
   SET (DEB_REMOVEPATTERN "gpl.in")
 ELSE()
-  SET (DEB_PRODUCT "community")
+  SET (DEB_PRODUCT "${DEB_BASE_PRODUCT}community")
   SET (DEB_COPYRIGHT_UPSTREAMNAME "MySQL Server ${MYSQL_BASE_VERSION}")
-  SET (DEB_PRODUCTNAME "community")
-  SET (DEB_PRODUCTNAMEC "Community")
-  SET (DEB_NOTPRODUCTNAME "commercial")
+  SET (DEB_PRODUCTNAME "${DEB_BASE_PRODUCT}community")
+  SET (DEB_PRODUCTNAMEC "${DEB_BASE_PRODUCTC}Community")
+  SET (DEB_NOTPRODUCTNAME "${DEB_BASE_PRODUCT}commercial")
   SET (DEB_LICENSENAME "GPL")
   SET (DEB_INSTALL_LICENSEFILE "COPYING")
-  SET (DEB_SERVERVERSION "${VERSION}-1")
+  SET (DEB_SERVERVERSION "${DEB_BASE_VERSION}+1")
   SET (DEB_REMOVEPATTERN "com.in")
   SET (DEB_PLUGIN_SETPERMISSION "usr/bin/mysql_setpermission")
   SET (DEB_MAN_SETPERMISSION "usr/share/man/man1/mysql_setpermission.1")
 ENDIF()
 
+# mysql-wsrep !
+SET (DEB_PRODUCTNAME "wsrep")
+SET (DEB_PRODUCTNAMEC "Wsrep")
+SET (DEB_PRODUCTSERIES "-5.6")
+SET (DEB_WSREP_README "README-wsrep")
+
+
+SET (FILES_STARTUP_SYSV
+"
+etc/init.d/mysql
+usr/bin/mysqld_safe
+")
+SET (FILES_STARTUP_UPSTART
+"
+Not Yet Implememted: Upstart File List
+")
+
 # Platform specifics. The differences are generally only distro version
-# and whether or not systemd and/or apparmor are available
+# and whether or not Systemd and/or apparmor are available
 IF (DEB_CODENAME STREQUAL "wheezy")
   SET (DEB_PLATFORMRELEASE "debian7")
+  # Following the Oracle example, we package for Debian 7
+  # using only SysV init and no Apparmor.
   SET (DEB_CONTROL_BDEPS "")
   SET (DEB_INSTALL_SOURCE_XZ "")
   SET (DEB_RULES_INSTALL_SYSTEMD "")
@@ -89,37 +124,44 @@ IF (DEB_CODENAME STREQUAL "wheezy")
   SET (DEB_INSTALL_SERVER_SYSTEMD "")
   SET (DEB_INSTALL_SERVER_APPARMOR "")
   SET (DEB_SERVICE_SERVER_EXECPRE "")
+  SET (DEB_SERVICE_SERVER_EXECPOST "")
   SET (DEB_INIT_APPARMOR "")
+  SET (DEB_STARTUP "SYSV")
 ELSEIF(DEB_CODENAME STREQUAL "jessie")
   SET (DEB_PLATFORMRELEASE "debian8")
-  SET (DEB_CONTROL_BDEPS "dh-systemd")
+  # Improving on Oracle, we would prefer to package for Debian 8
+  # using both SysV init and Systemd, but still no Apparmor.
+  SET (DEB_CONTROL_BDEPS "")
   SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/")
-  SET (DEB_RULES_INSTALL_SYSTEMD
-    "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/")
+  SET (DEB_RULES_INSTALL_SYSTEMD  "")
   SET (DEB_RULES_INSTALL_APPARMOR "")
   SET (DEB_RULES_APPARMOR_LOAD "")
-  SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql")
-  SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade")
-  SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start")
+  SET (DEB_SYSTEMD_SERVICE_NAME "")
+  SET (DEB_RULES_SYSTEMD_ENABLE "")
+  SET (DEB_RULES_SYSTEMD_START "")
+  SET (DEB_INSTALL_SERVER_SYSTEMD "")
   SET (DEB_INSTALL_SERVER_APPARMOR "")
-  SET (DEB_SERVICE_SERVER_EXECPRE
-    "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
+  SET (DEB_SERVICE_SERVER_EXECPRE "")
+  SET (DEB_SERVICE_SERVER_EXECPOST "")
   SET (DEB_INIT_APPARMOR "")
+  # Debian 8 comes with both SysV init and Systemd,
+  # but "scripts/CMakeLists.txt" enforces an either-or.
+  SET (DEB_STARTUP "SYSV")
+  # For now, we go with Systemd only.
 ELSEIF(DEB_CODENAME STREQUAL "stretch")
   SET (DEB_PLATFORMRELEASE "debian9")
-  SET (DEB_CONTROL_BDEPS "dh-systemd")
+  SET (DEB_CONTROL_BDEPS "")
   SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/")
-  SET (DEB_RULES_INSTALL_SYSTEMD
-    "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/")
+  SET (DEB_RULES_INSTALL_SYSTEMD "")
   SET (DEB_RULES_INSTALL_APPARMOR "")
   SET (DEB_RULES_APPARMOR_LOAD "")
-  SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql")
-  SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade")
-  SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start")
+  SET (DEB_RULES_SYSTEMD_ENABLE "")
+  SET (DEB_RULES_SYSTEMD_START "")
+  SET (DEB_INSTALL_SERVER_SYSTEMD "")
   SET (DEB_INSTALL_SERVER_APPARMOR "")
-  SET (DEB_SERVICE_SERVER_EXECPRE
-    "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
+  SET (DEB_SERVICE_SERVER_EXECPRE "")
   SET (DEB_INIT_APPARMOR "")
+  SET (DEB_STARTUP "SYSV")
 ELSEIF(DEB_CODENAME STREQUAL "precise")
   SET (DEB_PLATFORMRELEASE "ubuntu12.04")
   SET (DEB_CONTROL_BDEPS "dh-apparmor")
@@ -134,7 +176,9 @@ ELSEIF(DEB_CODENAME STREQUAL "precise")
   SET (DEB_INSTALL_SERVER_SYSTEMD "")
   SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld")
   SET (DEB_SERVICE_SERVER_EXECPRE "")
+  SET (DEB_SERVICE_SERVER_EXECPOST "")
   SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld")
+  SET (DEB_STARTUP "SYSV")
 ELSEIF(DEB_CODENAME STREQUAL "trusty")
   SET (DEB_PLATFORMRELEASE "ubuntu14.04")
   SET (DEB_CONTROL_BDEPS "dh-apparmor")
@@ -149,7 +193,9 @@ ELSEIF(DEB_CODENAME STREQUAL "trusty")
   SET (DEB_INSTALL_SERVER_SYSTEMD "")
   SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld")
   SET (DEB_SERVICE_SERVER_EXECPRE "")
+  SET (DEB_SERVICE_SERVER_EXECPOST "")
   SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld")
+  SET (DEB_STARTUP "SYSV")
 ELSEIF(DEB_CODENAME STREQUAL "wily")
   SET (DEB_PLATFORMRELEASE "ubuntu15.10")
   SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
@@ -160,30 +206,35 @@ ELSEIF(DEB_CODENAME STREQUAL "wily")
     "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld")
   SET (DEB_RULES_APPARMOR_LOAD
     "dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld")
-  SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql")
+  SET (DEB_SYSTEMD_SERVICE_NAME "mysql")
+  SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --no-enable --name=mysql")
   SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade")
   SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start")
   SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld")
   SET (DEB_SERVICE_SERVER_EXECPRE
     "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
+  SET (DEB_SERVICE_SERVER_EXECPOST
+    "ExecStartPost=/usr/share/mysql/mysql-systemd-start post")
   SET (DEB_INIT_APPARMOR "/lib/init/apparmor-profile-load usr.sbin.mysqld")
+  SET (DEB_STARTUP "SYSTEMD")
 ELSEIF(DEB_CODENAME STREQUAL "xenial")
   SET (DEB_PLATFORMRELEASE "ubuntu16.04")
-  SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
+  SET (DEB_CONTROL_BDEPS "dh-apparmor")
   SET (DEB_INSTALL_SOURCE_XZ "../*.tar.xz usr/src/mysql/")
-  SET (DEB_RULES_INSTALL_SYSTEMD
-    "install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/")
+  SET (DEB_RULES_INSTALL_SYSTEMD "")
   SET (DEB_RULES_INSTALL_APPARMOR
     "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld")
   SET (DEB_RULES_APPARMOR_LOAD
     "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld")
-  SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql")
-  SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade")
-  SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start")
+  SET (DEB_SYSTEMD_SERVICE_NAME "")
+  SET (DEB_RULES_SYSTEMD_ENABLE "")
+  SET (DEB_RULES_SYSTEMD_START "")
+  SET (DEB_INSTALL_SERVER_SYSTEMD "")
   SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld")
-  SET (DEB_SERVICE_SERVER_EXECPRE
-    "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
+  SET (DEB_SERVICE_SERVER_EXECPRE  "")
+  SET (DEB_SERVICE_SERVER_EXECPOST "")
   SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld")
+  SET (DEB_STARTUP "SYSV")
 ELSEIF(DEB_CODENAME STREQUAL "yakkety")
   SET (DEB_PLATFORMRELEASE "ubuntu16.10")
   SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
@@ -194,13 +245,17 @@ ELSEIF(DEB_CODENAME STREQUAL "yakkety")
     "install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld")
   SET (DEB_RULES_APPARMOR_LOAD
     "dh_apparmor -pmysql-${DEB_PRODUCTNAME}-server --profile-name=usr.sbin.mysqld")
-  SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --name=mysql")
+  SET (DEB_SYSTEMD_SERVICE_NAME "mysql")
+  SET (DEB_RULES_SYSTEMD_ENABLE "dh_systemd_enable --no-enable --name=mysql")
   SET (DEB_RULES_SYSTEMD_START "dh_systemd_start --restart-after-upgrade")
   SET (DEB_INSTALL_SERVER_SYSTEMD "usr/share/mysql/mysql-systemd-start")
   SET (DEB_INSTALL_SERVER_APPARMOR "etc/apparmor.d/usr.sbin.mysqld")
   SET (DEB_SERVICE_SERVER_EXECPRE
     "ExecStartPre=/usr/share/mysql/mysql-systemd-start pre")
+  SET (DEB_SERVICE_SERVER_EXECPOST
+    "ExecStartPost=/usr/share/mysql/mysql-systemd-start post")
   SET (DEB_INIT_APPARMOR "/lib/apparmor/profile-load usr.sbin.mysqld")
+  SET (DEB_STARTUP "SYSTEMD")
 ELSEIF(DEB_CODENAME STREQUAL "zesty")
   SET (DEB_PLATFORMRELEASE "ubuntu17.04")
   SET (DEB_CONTROL_BDEPS "dh-apparmor, dh-systemd (>=1.5)")
@@ -224,29 +279,79 @@ ELSE()
   RETURN()
 ENDIF()
 
-# All files are configured and copied to the debian/ directory, which is used 
+# All files are configured and copied to the debian/ directory, which is used
 # by debuild to make the packages
+# 5.7.11 builds out-of-source. Hack: have duplicate debian/
 SET (DEB_ROOT ${CMAKE_SOURCE_DIR}/packaging/deb-in)
 FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/debian)
+FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/debian)
 FILE(GLOB_RECURSE SOURCEFILES RELATIVE "${DEB_ROOT}" "${DEB_ROOT}/*")
 # Skip the copyright file from the "other" product type
 LIST(REMOVE_ITEM SOURCEFILES "copyright.${DEB_REMOVEPATTERN}")
 LIST(REMOVE_ITEM SOURCEFILES "CMakeLists.txt")
+# Combine the list of all startup files to be included,
+# skip Debian magical init files unless needed
+IF(DEB_PRODUCTNAME STREQUAL "wsrep")
+    SET(COMMON_WSREP_CONFLICTS "mysql-common (>= 5.7)")
+    LIST(REMOVE_ITEM SOURCEFILES "mysql-common.install.in")
+    LIST(REMOVE_ITEM SOURCEFILES "mysql-common.dirs.in")
+    LIST(REMOVE_ITEM SOURCEFILES "mysql-common.postinst.in")
+    LIST(REMOVE_ITEM SOURCEFILES "mysql-common.postrm.in")
+ENDIF()
+IF(DEB_STARTUP MATCHES ".*SYSV.*")
+  SET (DEB_FILES_STARTUP ${FILES_STARTUP_SYSV})
+ELSE()
+  LIST(REMOVE_ITEM SOURCEFILES
+  "mysql-packagesource-server-SERIES.mysql.init.in")
+ENDIF()
+IF(DEB_STARTUP MATCHES ".*SYSTEMD.*")
+  SET (DEB_FILES_STARTUP
+    ${DEB_FILES_STARTUP}
+    ${FILES_STARTUP_SYSTEMD})
+ELSE()
+  LIST(REMOVE_ITEM SOURCEFILES
+  "mysql-packagesource-server-SERIES.mysql.service.in")
+ENDIF()
 # Don't install systemd file on systems without systemd
 IF(DEB_INSTALL_SERVER_SYSTEMD STREQUAL "")
        LIST(REMOVE_ITEM SOURCEFILES "mysql-packagesource-server.mysql.service.in")
 ENDIF()
+
 FOREACH (SOURCEFILE ${SOURCEFILES})
   STRING(REGEX REPLACE "-packagesource-" "-${DEB_PRODUCTNAME}-"
     TMPFILE ${SOURCEFILE})
+  STRING(REGEX REPLACE "-SERIES" "${DEB_PRODUCTSERIES}" TMPFILE ${TMPFILE})
   # Strip away the input file endings from the destination filenames
   STRING(REGEX REPLACE ".in$" "" TMPFILE ${TMPFILE})
   STRING(REGEX REPLACE ".gpl$" "" TMPFILE ${TMPFILE})
   STRING(REGEX REPLACE ".com$" "" DESTFILE ${TMPFILE})
   CONFIGURE_FILE("${DEB_ROOT}/${SOURCEFILE}"
     "${CMAKE_BINARY_DIR}/debian/${DESTFILE}" @ONLY)
+  CONFIGURE_FILE("${DEB_ROOT}/${SOURCEFILE}"
+    "${CMAKE_SOURCE_DIR}/debian/${DESTFILE}" @ONLY)
 ENDFOREACH()
 EXECUTE_PROCESS(
   COMMAND chmod +x ${CMAKE_BINARY_DIR}/debian/rules
 )
-
+IF(DEB_PRODUCTNAME STREQUAL "wsrep")
+FILE(APPEND "${CMAKE_BINARY_DIR}/debian/control" "
+Package: mysql-common
+Architecture: any
+Pre-depends: debconf (>= 0.2.17),
+             \${misc:Pre-Depends}
+Multi-Arch: foreign
+Depends: \${misc:Depends},
+         \${shlibs:Depends},
+         mysql-wsrep-common
+Description: MySQL Common
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains common files needed by MySQL client
+ library and the MySQL database server.
+ This package is a dummy replacement for the case when using mysql WSREP
+ implementation to satisfy dependencies of other packages
+ like libmysqlclient18. It depends on any mysql-wsrep-common
+")
+ENDIF()
index 4b91c8e3f7040e696707b99df29da5492b15a151..843b3f7a1dc2021924463cd688f57a15c5fb4ec0 100644 (file)
 
 TODO: Why /bin/bash for some files and /bin/sh for others (this is also the case in native packaging, so might be a reason)
 TODO: Related to above: Should be POSIX compliant
-TODO: Build with -DWITH_SYSTEMD and related to use inbuilt systemd support (Deb8 and Ubuntu15+)
 TODO: Maybe refactor CMakeLists.txt to remove redundancy
 TODO: Clean up install exception list so --list-missing can be changed to --fail-missing
+
+###  WSREP stuff
+TODO: Find a more efficient way to configure just "packaging/deb-in/"
+TODO: Can we unite systemd files (service definition, pre- and post-scriptlets, maybe more) across platforms?
+      In RedHat etc, we have "scripts/systemd/mysqld.service.in" which is working.
+      Can we use that to replace "packaging/deb-in/mysql-packagesource-server-SERIES.mysql.service.in" ?
+TODO: Check whether it was safe to drop "debian/additions/debian-start*", recover from old sources if not.
+TODO: Check everything, especially the pre/post-install/rm scripts,
+      and decide whether to follow Debian or Oracle or to create a mix.
+TODO: Clean "packaging/deb-in/CMakeLists.txt" for systemd, SysV init, Upstart, and the mix (Debian!).
+TODO: Introduce "WITH_SYSV" as a build option, so that we can build packages with both SysV and Systemd
+      startup support, as fits Debian (which delivers both).
+TODO: Decide about Upstart, either implement support for it or remove the references.
+TODO; Check package naming on Debian/Ubuntu:
+      We now have platform as part of version in the file name (separator '~')
+      because a dash '-' would start a revision which Debian tools don't affect in a "native" package.
+
+###  Other stuff
+Package cut: Comments in RPM spec files say "lz4_decompress" and "zlib_decompress" were added to client RPMs.
+      That's wrong, they are in the server RPMs. Similar for DEB. They are meant for "mysqlpump" result files
+      (if compressed), and that tool is in the client packages (both RPM and DEB).
+      Also, placement differs: RPMs have them in "/usr/bin/", DEBs in "/usr/lib/mysql/" and a patch for MTR
+      so that they will be found.
+      Proposal 1: Make comments come true, move them into client packages.
+      Proposal 2: Put them in "/usr/bin/", delete the patch.
index ca8858916984d6a4fd03a0e73ea4856c720f2793..a22d9da5657b4ee716c542ecf1c954416da969e6 100644 (file)
@@ -1,3 +1,16 @@
+mysql-@DEB_PRODUCTNAME@@DEB_PRODUCTSERIES@ (@DEB_SERVERVERSION@@DEB_PLATFORMRELEASE@) @DEB_CODENAME@; urgency=low
+
+  * (backport from 5.7 branch for packaging)
+    Integrate the provisional 5.7.11 changes for Ubuntu 16.04 "Xenial Xerus"
+    ("packaging/deb-in/" from Oracle's 5.7.14,
+    adapted to Codership's "mysql-wsrep" needs,
+    SysV init files replaced by systemd files)
+    with 5.7.15, to support both 16.04 LTS "Xenial Xerus" and 14.04 LTS
+    "Trusty Tahr".
+  * Update to 5.6.36 upstream release
+
+ -- Jörg Brühe <joerg.bruehe@fromdual.com>  Tue, 01 Nov 2016 09:45:42 +0100
+
 mysql-@DEB_PRODUCTNAME@ (@DEB_SERVERVERSION@@DEB_PLATFORMRELEASE@) @DEB_CODENAME@; urgency=low
 
   [ Akhil Mohan ]
index b32b6439dfe178c3f3f55ed7b2350a82bdfaeb7f..8dd58090fa763e34692799cc5e5edb2ece7053c5 100644 (file)
@@ -1,15 +1,30 @@
-Source: mysql-@DEB_PRODUCTNAME@
-Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Source: mysql-@DEB_PRODUCTNAME@@DEB_PRODUCTSERIES@
+Maintainer: Codership Oy <info@codership.com>
 Section: database
 Priority: optional
 Standards-Version: 3.9.6
-Homepage: http://www.mysql.com/
-Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, lsb-release, cmake, fakeroot, libnuma-dev, @DEB_CONTROL_BDEPS@
+Homepage: http://galeracluster.com/
+Build-Depends: bison,
+               cmake,
+               debhelper (>= 9.0.0),
+               fakeroot,
+               libaio-dev[linux-any],
+               libmecab-dev,
+               libncurses5-dev (>= 5.0-6),
+               libnuma-dev,
+               lsb-release,
+               perl,
+               po-debconf,
+               psmisc,
+               quilt,
+               zlib1g-dev (>= 1:1.1.3-5),
+               @DEB_CONTROL_BDEPS@
 
 
 Package: mysql-server
 Architecture: any
-Depends: mysql-@DEB_PRODUCTNAME@-server (= ${binary:Version}), ${misc:Depends}
+Depends: mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         ${misc:Depends}
 Description: MySQL Server meta package depending on latest version
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -18,12 +33,18 @@ Description: MySQL Server meta package depending on latest version
  Oracle. This is a meta package that depends on the latest mysql server
  package available in the repository.
 
-Package: mysql-@DEB_PRODUCTNAME@-server
+Package: mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@
 Architecture: any
 Pre-depends: debconf (>= 0.2.17), adduser
-Depends: mysql-common (>= ${binary:Version}), mysql-client (= ${binary:Version}), perl, psmisc,
- ${shlibs:Depends}, ${misc:Depends}
-Breaks: mysql-common (<< 5.6.36)
+Depends: mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         perl,
+         psmisc,
+         rsync,
+         socat,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Breaks: mysql-common (<< 5.6.35), mysql-@DEB_PRODUCTNAME@-client (<< 5.6)
 Conflicts: mysql,
  mysql-client-5.0, mysql-client-core-5.0,
  mysql-client-5.1, mysql-client-core-5.1,
@@ -34,12 +55,8 @@ Conflicts: mysql,
  mysql-server-5.1, mysql-server-core-5.1,
  mysql-server-5.5, mysql-server-core-5.5,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-server-5.7, mysql-server-core-5.7,
  mysql-@DEB_NOTPRODUCTNAME@-server,
- mariadb-client-5.5, mariadb-client-core-5.5,
- mariadb-client-10.0, mariadb-client-core-10.0,
- mariadb-client-10.1, mariadb-client-core-10.1,
- mariadb-client-10.2, mariadb-client-core-10.2,
+ @DEB_CONTROL_SERVER_CONFLICT_NDB@,
  mariadb-server-5.5, mariadb-server-core-5.5,
  mariadb-server-10.0, mariadb-server-core-10.0,
  mariadb-server-10.1, mariadb-server-core-10.1,
@@ -49,9 +66,10 @@ Replaces: mysql,
  mysql-server-5.1, mysql-server-core-5.1,
  mysql-server-5.5, mysql-server-core-5.5,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-server-5.7, mysql-server-core-5.7,
+ mysql-@DEB_PRODUCTNAME@-client (<< 5.6),
  mysql-@DEB_NOTPRODUCTNAME@-server,
- mysql-common (<< 5.6.36)
+ @DEB_CONTROL_SERVER_CONFLICT_NDB@,
+ mysql-common (<< 5.6.35)
 Provides: virtual-mysql-server, virtual-mysql-server-core
 Description: MySQL Server
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
@@ -63,7 +81,8 @@ Description: MySQL Server
 
 Package: mysql-client
 Architecture: any
-Depends: mysql-@DEB_PRODUCTNAME@-client (= ${binary:Version}), ${misc:Depends}
+Depends: mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         ${misc:Depends}
 Description: MySQL Client meta package depending on latest version
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -72,23 +91,20 @@ Description: MySQL Client meta package depending on latest version
  Oracle. This is a meta package that depends on the latest mysql client
  package available in the repository.
 
-Package: mysql-@DEB_PRODUCTNAME@-client
+Package: mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@
 Architecture: any
-Depends: mysql-common (>= ${binary:Version}),
- ${shlibs:Depends}, ${misc:Depends}
-Breaks: mysql-common (<< 5.6.36), libmysqlclient-dev (<< 5.6.36)
+Depends: mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         ${misc:Depends},
+         ${shlibs:Depends}
+Breaks: libmysqlclient-dev (<< 5.6.35),
+        mysql-common (<< 5.6.35)
 Conflicts: mysql,
  mysql-client-5.0, mysql-client-core-5.0,
  mysql-client-5.1, mysql-client-core-5.1,
  mysql-client-5.5, mysql-client-core-5.5,
  mysql-client-5.6, mysql-client-core-5.6,
- mysql-client-5.7, mysql-client-core-5.7,
- mysql-server-5.0, mysql-server-core-5.0,
- mysql-server-5.1, mysql-server-core-5.1,
- mysql-server-5.5, mysql-server-core-5.5,
- mysql-server-5.6, mysql-server-core-5.6,
- mysql-server-5.7, mysql-server-core-5.7,
  mysql-@DEB_NOTPRODUCTNAME@-client,
+ @DEB_CONTROL_CLIENT_CONFLICT_NDB@,
  mariadb-client-5.5, mariadb-client-core-5.5,
  mariadb-client-10.0, mariadb-client-core-10.0,
  mariadb-client-10.1, mariadb-client-core-10.1,
@@ -102,11 +118,12 @@ Replaces: mysql,
  mysql-client-5.1, mysql-client-core-5.1,
  mysql-client-5.5, mysql-client-core-5.5,
  mysql-client-5.6, mysql-client-core-5.6,
- mysql-client-5.7, mysql-client-core-5.7,
  mysql-@DEB_NOTPRODUCTNAME@-client,
- mysql-common (<< 5.6.36),
- libmysqlclient-dev (<< 5.6.36)
-Provides: virtual-mysql-client, virtual-mysql-client-core
+ @DEB_CONTROL_CLIENT_CONFLICT_NDB@,
+ mysql-common (<< 5.6.35),
+ libmysqlclient-dev (<< 5.6.35)
+Provides: virtual-mysql-client,
+          virtual-mysql-client-core
 Description: MySQL Client
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -120,8 +137,9 @@ Architecture: any
 Section: libs
 Pre-Depends: ${misc:Pre-Depends}
 Multi-Arch: same
-Depends: mysql-common (>= ${binary:Version}),
- ${shlibs:Depends}, ${misc:Depends}
+Depends: mysql-@DEB_PRODUCTNAME@-common,
+         ${misc:Depends},
+         ${shlibs:Depends}
 Description: MySQL shared client libraries
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -130,38 +148,43 @@ Description: MySQL shared client libraries
  Oracle. This package contains the shared libraries for MySQL client
  applications.
 
-Package: mysql-common
+Package: mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@
 Architecture: any
-Pre-depends: debconf (>= 0.2.17), ${misc:Pre-Depends}
+Pre-depends: debconf (>= 0.2.17),
+             ${misc:Pre-Depends}
 Multi-Arch: foreign
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Conflicts: mysql, mysql-server-5.6, mysql-server-core-5.6,
+Depends: ${misc:Depends},
+         ${shlibs:Depends},
+         mysql-common (= ${binary:Version})
+Conflicts: mysql,
+           mysql-server-5.6, mysql-server-core-5.6,
  mysql-client-5.6, mysql-client-core-5.6,
  mysql-server-5.7, mysql-server-core-5.7,
  mysql-client-5.7, mysql-client-core-5.7,
  mariadb-server-5.5, percona-xtradb-cluster-common-5.5,
- mysql-common (<< 5.6.36)
-Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev,
+ mysql-@DEB_PRODUCTNAME@-common (<< 5.6.35),
+ mysql-@DEB_PRODUCTNAME@-common-5.6, mysql-@DEB_PRODUCTNAME@-common-5.5,
+ @COMMON_WSREP_CONFLICTS@
+Replaces: mysql,
+          mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev,
  mysql-server-5.6, mysql-server-core-5.6,
- mysql-server-5.7, mysql-server-core-5.7,
  mariadb-server-5.5, percona-xtradb-cluster-common-5.5,
- mysql-common (<< 5.6.36)
-Provides: mysql-common
+ @COMMON_WSREP_CONFLICTS@, mysql-common
+Provides: mysql-common, mysql-@DEB_PRODUCTNAME@-common
 Description: MySQL Common
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
  is intended for mission-critical, heavy-load production systems as well
  as for embedding into mass-deployed software. MySQL is a trademark of
  Oracle. This package contains common files needed by MySQL client
- library, MySQL database server, and MySQL embedded server.
+ library and the MySQL database server.
 
 Package: libmysqlclient-dev
 Architecture: any
 Section: libdevel
 Depends: libmysqlclient18 (= ${binary:Version}),
- ${shlibs:Depends}, ${misc:Depends}
-Replaces: mysql-client-5.6, mysql-client-core-5.6,
- mysql-client-5.7, mysql-client-core-5.7
+         ${misc:Depends},
+         ${shlibs:Depends}
 Description: MySQL development headers
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -170,21 +193,17 @@ Description: MySQL development headers
  Oracle. This package contains the development header files necessary
  to develop MySQL client applications.
 
-Package: libmysqld-dev
+Package: mysql-@DEB_PRODUCTNAME@@DEB_PRODUCTSERIES@
 Architecture: any
-Section: libdevel
-Depends: libmysqlclient-dev (= ${binary:Version}),
- ${shlibs:Depends}, ${misc:Depends}
-Description: MySQL embedded server library
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- Oracle. This package contains the MySQL server as an embedded library.
+Depends: mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         ${misc:Depends}
+Description: Metapackage that installs mysql-wsrep client and server packages.
 
 Package: mysql-testsuite
 Architecture: any
-Depends: mysql-@DEB_PRODUCTNAME@-test (= ${binary:Version}), ${misc:Depends}
+Depends: mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         ${misc:Depends}
 Description: MySQL Testsuite meta package depending on latest version
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
@@ -193,16 +212,19 @@ Description: MySQL Testsuite meta package depending on latest version
  Oracle. This is a meta package that depends on the latest mysql test
  package available in the repository.
 
-Package: mysql-@DEB_PRODUCTNAME@-test
+Package: mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@
 Architecture: any
-Depends: mysql-@DEB_PRODUCTNAME@-server (= ${binary:Version}),
- mysql-@DEB_PRODUCTNAME@-client (= ${binary:Version}), python,
- libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
-Breaks: mysql-@DEB_PRODUCTNAME@-server (<< 5.6.36),
- mysql-@DEB_PRODUCTNAME@-client (<< 5.6.36)
+Depends: mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ (= ${binary:Version}),
+         libmysqlclient-dev,
+         python,
+         ${misc:Depends},
+         ${shlibs:Depends}
+Breaks: mysql-@DEB_PRODUCTNAME@-server (<< 5.6.35),
+        mysql-@DEB_PRODUCTNAME@-client (<< 5.6.35)
 Conflicts: mysql,
  mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
- mysql-testsuite-5.6, mysql-testsuite-5.7, mysql-@DEB_NOTPRODUCTNAME@-test,
+ mysql-testsuite-5.6, mysql-@DEB_NOTPRODUCTNAME@-test,
  mariadb-test, mariadb-test-data
 Description: MySQL Test Run MTR - The MySQL testsuite
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
@@ -212,24 +234,15 @@ Description: MySQL Test Run MTR - The MySQL testsuite
  Oracle. This package contains the MySQL regression test suite for MySQL
  database server.
 
-Package: mysql-@DEB_PRODUCTNAME@-bench
-Architecture: any
-Depends: mysql-@DEB_PRODUCTNAME@-server (= ${binary:Version}),
- ${shlibs:Depends}, ${misc:Depends}
-Conflicts: mysql, mysql-@DEB_NOTPRODUCTNAME@-bench
-Description: MySQL Bench
- The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
- and robust SQL (Structured Query Language) database server. MySQL Server
- is intended for mission-critical, heavy-load production systems as well
- as for embedding into mass-deployed software. MySQL is a trademark of
- Oracle.
-
-Package: mysql-@DEB_PRODUCTNAME@-source
+Package: mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@
 Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}
+Depends: ${misc:Depends},
+         ${shlibs:Depends}
 Description: MySQL source
  The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
  and robust SQL (Structured Query Language) database server. MySQL Server
  is intended for mission-critical, heavy-load production systems as well
  as for embedding into mass-deployed software. MySQL is a trademark of
  Oracle.
+
+@DEB_NDB_CONTROL_EXTRAS@
diff --git a/mysql-wsrep-5.6/packaging/deb-in/deb_debug.cmake b/mysql-wsrep-5.6/packaging/deb-in/deb_debug.cmake
new file mode 100644 (file)
index 0000000..59f4158
--- /dev/null
@@ -0,0 +1,90 @@
+# Copyright (c) 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+SET (DEB_RULES_DEBUG_CMAKE
+"
+       mkdir debug && cd debug && \\
+       cmake .. \\
+               -DBUILD_CONFIG=mysql_release \\
+               -DCMAKE_INSTALL_PREFIX=/usr \\
+               -DCMAKE_BUILD_TYPE=Debug \\
+               -DINSTALL_DOCDIR=share/mysql/docs \\
+               -DINSTALL_DOCREADMEDIR=share/mysql \\
+               -DINSTALL_INCLUDEDIR=include/mysql \\
+               -DINSTALL_INFODIR=share/mysql/docs \\
+               -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \\
+               -DINSTALL_MANDIR=share/man \\
+               -DINSTALL_MYSQLSHAREDIR=share/mysql \\
+               -DINSTALL_MYSQLTESTDIR=lib/mysql-test \\
+               -DINSTALL_PLUGINDIR=lib/mysql/plugin \\
+               -DINSTALL_SBINDIR=sbin \\
+               -DINSTALL_SUPPORTFILESDIR=share/mysql \\
+               -DSYSCONFDIR=/etc/mysql \\
+               -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \\
+               -DWITH_SSL=bundled \\
+               -DWITH_INNODB_MEMCACHED=1 \\
+               -DWITH_MECAB=system \\
+               -DWITH_NUMA=ON \\
+               -DCOMPILATION_COMMENT=\"MySQL ${DEB_PRODUCTNAMEC} Server (${DEB_LICENSENAME})\" \\
+               -DINSTALL_LAYOUT=DEB \\
+               -DDEB_PRODUCT=${DEB_PRODUCT} \\
+               ${DEB_CMAKE_EXTRAS}
+")
+
+SET (DEB_RULES_DEBUG_MAKE
+"
+       cd debug && \\
+       $(MAKE) -j8 VERBOSE=1
+")
+
+SET (DEB_RULES_DEBUG_EXTRA
+"
+       # The ini file isn't built for debug, so copy over from the standard build
+       install -g root -o root -m 0755 debian/tmp/usr/lib/mysql/plugin/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
+")
+
+SET (DEB_INSTALL_DEBUG_SERVER
+"
+# debug binary
+usr/sbin/mysqld-debug
+")
+
+SET (DEB_INSTALL_DEBUG_SERVER_PLUGINS
+"
+# debug plugins
+usr/lib/mysql/plugin/debug/adt_null.so
+usr/lib/mysql/plugin/debug/auth_socket.so
+usr/lib/mysql/plugin/debug/connection_control.so
+usr/lib/mysql/plugin/debug/innodb_engine.so
+usr/lib/mysql/plugin/debug/libmemcached.so
+usr/lib/mysql/plugin/debug/mypluglib.so
+usr/lib/mysql/plugin/debug/mysql_no_login.so
+usr/lib/mysql/plugin/debug/semisync_master.so
+usr/lib/mysql/plugin/debug/semisync_slave.so
+usr/lib/mysql/plugin/debug/validate_password.so
+")
+
+SET (DEB_INSTALL_DEBUG_TEST_PLUGINS
+"
+# debug plugins
+usr/lib/mysql/plugin/debug/auth.so
+usr/lib/mysql/plugin/debug/auth_test_plugin.so
+usr/lib/mysql/plugin/debug/daemon_example.ini
+usr/lib/mysql/plugin/debug/libdaemon_example.so
+usr/lib/mysql/plugin/debug/qa_auth_client.so
+usr/lib/mysql/plugin/debug/qa_auth_interface.so
+usr/lib/mysql/plugin/debug/qa_auth_server.so
+usr/lib/mysql/plugin/debug/test_udf_services.so
+")
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/Docs__Images__Makefile.in b/mysql-wsrep-5.6/packaging/deb-in/extra/Docs__Images__Makefile.in
new file mode 100644 (file)
index 0000000..f7316d4
--- /dev/null
@@ -0,0 +1,6 @@
+all:
+
+distclean:
+       -rm -f Makefile
+
+.PHONY: all distclean clean install check
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/Docs__Makefile.in b/mysql-wsrep-5.6/packaging/deb-in/extra/Docs__Makefile.in
new file mode 100644 (file)
index 0000000..f7316d4
--- /dev/null
@@ -0,0 +1,6 @@
+all:
+
+distclean:
+       -rm -f Makefile
+
+.PHONY: all distclean clean install check
index 8004069fc1dcd006842e7dbf19b5eda871da0ed8..f95003d49113ef6bbf9791de24926a0e26088d4d 100644 (file)
@@ -65,3 +65,4 @@
   # Site-specific additions and overrides. See local/README for details.
   #include <local/usr.sbin.mysqld>
 }
+# The above is taken from Oracle's 5.7.14, parts may be premature.
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/configure-symlinks b/mysql-wsrep-5.6/packaging/deb-in/extra/configure-symlinks
new file mode 100755 (executable)
index 0000000..6c1a6a5
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+  install)
+    variant="$2"
+    my_cnf_path="$3"
+    update-alternatives --install /etc/mysql/my.cnf my.cnf "$my_cnf_path" 200
+  ;;
+  remove)
+    variant="$2"
+    my_cnf_path="$3"
+    update-alternatives --remove my.cnf "$my_cnf_path"
+  ;;
+esac
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/debian-start b/mysql-wsrep-5.6/packaging/deb-in/extra/debian-start
new file mode 100644 (file)
index 0000000..1ea1207
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# This script is executed by "/etc/init.d/mysql" on every (re)start.
+# 
+# Changes to this file will be preserved when updating the Debian package.
+#
+
+source /usr/share/mysql/debian-start.inc.sh
+
+MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
+MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
+MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
+MYCHECK_PARAMS="--all-databases --fast --silent"
+MYCHECK_RCPT="root"
+
+# The following commands should be run when the server is up but in background
+# where they do not block the server start and in one shell instance so that
+# they run sequentially. They are supposed not to echo anything to stdout.
+# If you want to disable the check for crashed tables comment
+# "check_for_crashed_tables" out.  
+# (There may be no output to stdout inside the background process!)
+echo "Checking for tables which need an upgrade, are corrupt or were "
+echo "not closed cleanly."
+(
+  upgrade_system_tables_if_necessary;
+  check_root_accounts;
+  check_for_crashed_tables;
+) >&2 &
+
+exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/debian-start.inc.sh b/mysql-wsrep-5.6/packaging/deb-in/extra/debian-start.inc.sh
new file mode 100644 (file)
index 0000000..f507128
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/bash
+#
+# This file is included by /etc/mysql/debian-start
+#
+
+## Check all unclosed tables.
+# - Requires the server to be up.
+# - Is supposed to run silently in background. 
+function check_for_crashed_tables() {
+  set -e
+  set -u
+
+  # But do it in the background to not stall the boot process.
+  logger -p daemon.info -i -t$0 "Triggering myisam-recover for all MyISAM tables"
+
+  # Checking for $? is unreliable so the size of the output is checked.
+  # Some table handlers like HEAP do not support CHECK TABLE.
+  tempfile=`tempfile`
+  # We have to use xargs in this case, because a for loop barfs on the 
+  # spaces in the thing to be looped over. 
+  LC_ALL=C $MYSQL --skip-column-names --batch -e  '
+      select concat('\''select count(*) into @discard from `'\'',
+                    TABLE_SCHEMA, '\''`.`'\'', TABLE_NAME, '\''`'\'') 
+      from information_schema.TABLES where ENGINE='\''MyISAM'\' | \
+    xargs -i $MYSQL --skip-column-names --silent --batch \
+                    --force -e "{}" >$tempfile 
+  if [ -s $tempfile ]; then
+    (
+      /bin/echo -e "\n" \
+        "Improperly closed tables are also reported if clients are accessing\n" \
+       "the tables *now*. A list of current connections is below.\n";
+       $MYADMIN processlist status
+    ) >> $tempfile
+    # Check for presence as a dependency on mailx would require an MTA.
+    if [ -x /usr/bin/mailx ]; then 
+      mailx -e -s"$MYCHECK_SUBJECT" $MYCHECK_RCPT < $tempfile 
+    fi
+    (echo "$MYCHECK_SUBJECT"; cat $tempfile) | logger -p daemon.warn -i -t$0
+  fi
+  rm $tempfile
+}
+
+## Check for tables needing an upgrade.
+# - Requires the server to be up.
+# - Is supposed to run silently in background. 
+function upgrade_system_tables_if_necessary() {
+  set -e
+  set -u
+
+  logger -p daemon.info -i -t$0 "Upgrading MySQL tables if necessary."
+
+  # Filter all "duplicate column", "duplicate key" and "unknown column"
+  # errors as the script is designed to be idempotent.
+  LC_ALL=C $MYUPGRADE \
+    2>&1 \
+    | egrep -v '^(1|@had|ERROR (1054|1060|1061))' \
+    | logger -p daemon.warn -i -t$0
+}
+
+## Check for the presence of both, root accounts with and without password.
+# This might have been caused by a bug related to mysql_install_db (#418672).
+function check_root_accounts() {
+  set -e
+  set -u
+  
+  logger -p daemon.info -i -t$0 "Checking for insecure root accounts."
+
+  ret=$( echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='';" | $MYSQL --skip-column-names )
+  if [ "$ret" -ne "0" ]; then
+    logger -p daemon.warn -i -t$0 "WARNING: mysql.user contains $ret root accounts without password!"
+  fi
+}
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/debian_create_root_user.sql b/mysql-wsrep-5.6/packaging/deb-in/extra/debian_create_root_user.sql
new file mode 100644 (file)
index 0000000..fd45cec
--- /dev/null
@@ -0,0 +1,23 @@
+-- Get the hostname, if the hostname has any wildcard character like "_" or "%"
+-- add escape character in front of wildcard character to convert "_" or "%" to
+-- a plain character
+SET @get_hostname= @@hostname;
+SELECT REPLACE((SELECT REPLACE(@get_hostname,'_','\_')),'%','\%') INTO @current_hostname;
+
+-- Fill "user" table with default users allowing root access
+-- from local machine if "user" table didn't exist before
+CREATE TEMPORARY TABLE tmp_user LIKE user;
+INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N');
+REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N' FROM dual WHERE LOWER( @current_hostname) != 'localhost';
+REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N');
+REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N');
+INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
+DROP TABLE tmp_user;
+
+CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv;
+INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now());
+REPLACE INTO tmp_proxies_priv SELECT @current_hostname, 'root', '', '', TRUE, '', now() FROM DUAL WHERE LOWER (@current_hostname) != 'localhost';
+INSERT INTO  proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0;
+DROP TABLE tmp_proxies_priv;
+FLUSH PRIVILEGES;
+
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/echo_stderr b/mysql-wsrep-5.6/packaging/deb-in/extra/echo_stderr
new file mode 100644 (file)
index 0000000..67b3ed7
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+echo "$*" 1>&2
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/innotop/changelog.innotop b/mysql-wsrep-5.6/packaging/deb-in/extra/innotop/changelog.innotop
new file mode 100644 (file)
index 0000000..ab4c154
--- /dev/null
@@ -0,0 +1,357 @@
+Changelog for innotop:
+
+2009-03-09: version 1.7.1
+
+   Changes:
+   * Don't display the CXN column if only one connection is active in 
+     the current view
+
+   Bugs fixed:
+   * fixed bug where trying to aggregate the time column would result 
+     in a crash if the time column had an undef value in it, which is 
+     the case when a thread is in the 'Connect' state
+   * updated innotop.spec file to reflect current version
+
+2009-02-23: version 1.7.0
+
+   Changes:
+   * supports a central config (/etc/innotop/innotop.conf)
+   * changed the default home directory config to ~/.innotop/innotop.conf
+     (away from .ini)
+   * embedded InnoDBParser.pm into innotop so it can be run with no 
+     installation
+   * no longer writes a new config file by default
+   * added --skipcentral (skip reading central config) and --write (write
+     a config if none were loaded at start-up)
+   * if no config file is loaded, connect to a MySQL database on
+     localhost using mysql_read_default_group=client
+   * embedded maatkit's DSNParser.pm and added support for --user,
+     --password, --host, --port
+   * changed default mode from T (InnoDB Transactions) to Q (Query List)
+   * in addition to connected threads, now displays running and cached
+     threads in statusbar
+   * don't load connections from a config file if any DSN information or
+     a username or password is specified on the command-line
+   
+   Bugs fixed:
+   * fixed bug preventing utilization of command-line options that
+     override default config settings if no config file was loaded
+   * fixed a bug where migrating from an old version of the config will
+     delete ~/innotop.ini, if it exists.  Now uses File::Temp::tempfile().
+
+2007-11-09: version 1.6.0
+
+   * S mode crashed on non-numeric values.
+   * New user-defined columns crashed upon restart.
+   * Added --color option to control terminal coloring.
+
+2007-09-18: version 1.5.2
+
+   * Added the ability to monitor InnoDB status from a file.
+   * Changed W mode to L mode; it monitors all locks, not just lock waits.
+
+2007-09-16: version 1.5.1
+
+   * Added C (Command Summary) mode.
+   * Fixed a bug in the 'avg' aggregate function.
+
+2007-09-10: version 1.5.0
+
+   Changes:
+   * Added plugin functionality.
+   * Added group-by functionality.
+   * Moved the configuration file to a directory.
+   * Enhanced filtering and sorting on pivoted tables.
+   * Many small bug fixes.
+
+2007-07-16: version 1.4.3
+
+   Changes:
+   * Added standard --version command-line option
+   * Changed colors to cyan instead of blue; more visible on dark terminals.
+   * Added information to the filter-choosing dialog.
+   * Added column auto-completion when entering a filter expression.
+   * Changed Term::ReadKey from optional to mandatory.
+   * Clarified username in password prompting.
+   * Ten thousand words of documentation!
+
+   Bugs fixed:
+   * innotop crashed in W mode when InnoDB status data was truncated.
+   * innotop didn't display errors in tables if debug was enabled.
+   * The colored() subroutine wasn't being created in non-interactive mode.
+   * Don't prompt to save password except the first time.
+
+2007-05-03: version 1.4.2
+
+   This version contains all changes to the trunk until revision 239; some
+   changes in revisions 240:250 are included.
+
+   MAJOR CHANGES:
+
+   * Quick-filters to easily filter any column in any display
+   * Compatibility with MySQL 3.23 through 6.0
+   * Improved error handling when a server is down, permissions denied, etc
+   * Use additional SHOW INNODB STATUS information in 5.1.x
+   * Make all modes use tables consistently, so they can all be edited,
+     filtered, colored and sorted consistently
+   * Combine V, G and S modes into S mode, with v, g, and s hot-keys
+   * Let DBD driver read MySQL option files; permit connections without
+     user/pass/etc
+   * Compile SQL-like expressions into Perl subroutines; eliminate need to
+     know Perl
+   * Do not save all config data to config file, only save user's customizations
+   * Rewritten and improved command-line option handling
+   * Added --count, --delay, and other command-line options to support
+     run-and-exit operation
+   * Improve built-in variable sets
+   * Improve help screen with three-part balanced-column layout
+   * Simplify table-editor and improve hotkey support
+   * Require Perl to have high-resolution time support (Time::HiRes)
+   * Help the user choose a query to analyze or kill
+   * Enable EXPLAIN, show-full-query in T mode just like Q mode
+   * Let data-extraction access current, previous and incremental data sets
+     all at once
+
+   MINOR CHANGES:
+
+   * Column stabilizing for Q mode
+   * New color rules for T, Q, W modes
+   * Apply slave I/O filter to Q mode
+   * Improve detection of server version and other meta-data
+   * Make connection timeout a config variable
+   * Improve cross-version-compatible SQL syntax
+   * Get some information from the DBD driver instead of asking MySQL for it
+   * Improved error messages
+   * Improve server group creation/editing
+   * Improve connection/thread killing
+   * Fix broken key bindings and restore previously mapped hot-keys for
+     choosing columns
+   * Some documentation updates (but not nearly enough)
+   * Allow the user to specify graphing char in S mode (formerly G mode)
+   * Allow easy switching between variable sets in S mode
+   * Bind 'n' key globally to choose the 'next' server connection
+   * Bind '%' key globally to filter displayed tables
+   * Allow aligning columns on the decimal place for easy readability
+   * Add hide_hdr config variable to hide column headers in tables
+   * Add a feature to smartly run PURGE MASTER LOGS in Replication mode
+   * Enable debug mode as a globally configurable variable
+   * Improve error messages when an expression or filter doesn't compile or has
+     a run-time error; die on error when debug is enabled
+   * Allow user-configurable delays after executing SQL (to let the server
+     settle down before taking another measurement)
+   * Add an expression to show how long until a transaction is finished
+   * Add skip_innodb as a global config variable
+   * Add '%' after percentages to help disambiguate (user-configurable)
+   * Add column to M mode to help see how fast slave is catching up to master
+
+   BUG FIXES:
+
+   * T and W modes had wrong value for wait_status column
+   * Error tracking on connections didn't reset when the connection recovered
+   * wait_timeout on connections couldn't be set before MySQL 4.0.3
+   * There was a crash on 3.23 when wiping deadlocks
+   * Lettercase changes in some result sets (SHOW MASTER/SLAVE STATUS) between
+     MySQL versions crashed innotop
+   * Inactive connections crashed innotop upon access to DBD driver
+   * set_precision did not respect user defaults for number of digits
+   * --inc command-line option could not be negated
+   * InnoDB status parsing was not always parsing all needed information
+   * S mode (formerly G mode) could crash trying to divide non-numeric data
+   * M table didn't show Slave_open_temp_tables variable; incorrect lettercase
+   * DBD drivers with broken AutoCommit would crash innotop
+   * Some key bindings had incorrect labels
+   * Some config-file loading routines could load data for things that didn't
+     exist
+   * Headers printed too often in S mode
+   * High-resolution time was not used even when the user had it
+   * Non-interactive mode printed blank lines sometimes
+   * Q-mode header and statusbar showed different QPS numbers
+   * Formulas for key-cache and query-cache hit ratios were wrong
+   * Mac OS "Darwin" machines were mis-identified as Microsoft Windows
+   * Some multiplications crashed when given undefined input
+   * The commify transformation did not check its input and could crash
+   * Specifying an invalid mode on the command line or config file could crash
+     innotop
+
+2007-03-29: version 1.4.1
+
+   * More tweaks to display of connection errors.
+   * Fixed a problem with skip-innodb in MySQL 5.1.
+   * Fix a bug with dead connections in single-connection mode.
+   * Fix a regex to allow parsing more data from truncated deadlocks.
+   * Don't load active cxns from the config file if the cxn isn't defined.
+
+2007-03-03: version 1.4.0
+
+   * Further tweak error handling and display of connection errors
+   * More centralization of querying
+   * Fix forking so it doesn't kill all database connections
+   * Allow user to run innotop without permissions for GLOBAL variables and status
+
+2007-02-11: version 1.3.6
+
+   * Handle some connection failures so innotop doesn't crash because of one server.
+   * Enable incremental display in more modes.
+   * Tweaks to colorizing, color editor, and default color rules.
+   * Tweaks to default sorting rules.
+   * Use prepared statements for efficiency.
+   * Bug fixes and code cleanups.
+   * Data storage is keyed on clock ticks now.
+
+2007-02-03: version 1.3.5
+
+   * Bug fixes.
+   * More tools for editing configuration from within innotop.
+   * Filters and transformations are constrained to valid values.
+   * Support for colorizing rows.
+   * Sorting by multiple columns.
+   * Compress headers when display is very wide.
+   * Stabilize and limit column widths.
+   * Check config file formats when upgrading so upgrades go smoothly.
+   * Make D mode handle many connections at once.
+   * Extract simple expressions from data sets in column src property.
+     This makes innotop more awk-ish.
+
+2007-01-16: version 1.3
+
+   * Readline support.
+   * Can be used unattended, or in a pipe-and-filter mode
+     where it outputs tab-separated data to standard output.
+   * You can specify a config file on the command line.
+     Config files can be marked read-only.
+   * Monitor multiple servers simultaneously.
+   * Server groups to help manage many servers conveniently.
+   * Monitor master/slave status, and control slaves.
+   * Columns can have user-defined expressions as their data sources.
+   * Better configuration tools.
+   * InnoDB status information is merged into SHOW VARIABLES and
+     SHOW STATUS information, so you can access it all together.
+   * High-precision time support in more places.
+   * Lots of tweaks to make things display more readably and compactly.
+   * Column transformations and filters.
+
+2007-01-16: version 1.0.1
+   * NOTE: innotop is now hosted at Sourceforge, in Subversion not CVS.
+     The new project homepage is http://sourceforge.net/projects/innotop/
+   * Tweak default T/Q mode sort columns to match what people expect.
+   * Fix broken InnoDBParser.pm documentation (and hence man page).
+
+2007-01-06: version 1.0
+   * NOTE: innotop is now hosted at Sourceforge, in Subversion not CVS.
+     The new project homepage is http://sourceforge.net/projects/innotop/
+   * Prevent control characters from freaking terminal out.
+   * Set timeout to keep busy servers from closing connection.
+   * There is only one InnoDB insert buffer.
+   * Make licenses clear and consistent.
+
+2006-11-14: innotop 0.1.160, InnoDBParser version 1.69
+   * Support for ANSI color on Microsoft Windows (more readable, compact
+     display; thanks Gisbert W. Selke).
+   * Better handling of $ENV{HOME} on Windows.
+   * Added a LICENSE file to the package as per Gentoo bug:
+     http://bugs.gentoo.org/show_bug.cgi?id=147600
+
+2006-11-11: innotop 0.1.157, InnoDBParser version 1.69
+   * Add Microsoft Windows support.
+
+2006-10-19: innotop 0.1.154, InnoDBParser version 1.69
+   * Add O (Open Tables) mode
+   * Add some more checks to handle incomplete InnoDB status information
+
+2006-09-30: innotop 0.1.152, InnoDBParser version 1.69
+   * Figured out what was wrong with package $VERSION variable: it wasn't
+     after the package declaration!
+
+2006-09-28: innotop 0.1.152, InnoDBParser version 1.67
+   * Make more efforts towards crash-resistance and tolerance of completely
+     messed-up inputs.  If innotop itself is broken, it is now much harder to
+     tell, because it just keeps on running without complaining.
+   * Fix a small bug parsing out some information and displaying it.
+
+2006-09-05: innotop 0.1.149, InnoDBParser version 1.64
+   * Try to find and eliminate any parsing code that assumes pattern matches
+     will succeed.
+
+2006-09-05: innotop 0.1.149, InnoDBParser version 1.62
+   * Make innotop crash-resistant, so I can declare it STABLE finally.
+   * Instead of using SQL conditional comments, detect MySQL version.
+
+2006-08-22: innotop 0.1.147, InnoDBParser version 1.60
+   * Fix some innotop bugs with undefined values, bad formatting etc.
+
+2006-08-19: innotop 0.1.146, InnoDBParser version 1.60
+   * Make innotop handle some unexpected NULL values in Q mode.
+   * Add OS wait information to W mode, so it is now "everything that waits."
+   * Center section captions better.
+   * Make R mode more readable and compact.
+   * Make InnoDBParser parse lock waits even when they've been waiting 0 secs.
+
+2006-08-12: innotop 0.1.139, InnoDBParser version 1.59
+   * Add more documentation
+   * Tweak V mode to show more info in less space.
+   * Fix a bug in G mode.
+
+2006-08-10: innotop 0.1.132, InnoDBParser version 1.58
+   * Handle yet more types of FK error... it will never end!
+   * Handle some special cases when DEADLOCK info truncated
+   * Add a bit more FK info to F mode in innotop
+   * More tests added to the test suite
+
+2006-08-07: innotop 0.1.131, InnoDBParser version 1.55
+   * Fix another issue with configuration
+   * Handle another type of FK error
+
+2006-08-03: innotop 0.1.130, InnoDBParser version 1.54
+   * Fix an issue loading config file
+   * Add heap_no to 'D' (InnoDB Deadlock) mode to ease deadlock debugging.
+
+2006-08-02: innotop 0.1.128, InnoDBParser version 1.54
+   * Parse lock wait information from the TRANSACTION section.
+   * Even more OS-specific parsing... pain in the butt...
+   * Add 'W' (InnoDB Lock Wait) mode.
+   * Fix some minor display issues with statusbar.
+
+2006-08-02: innotop 0.1.125, InnoDBParser version 1.50
+   * Don't try to get references to Perl built-in functions like time()
+   * Handle more OS-specific variations of InnoDB status text
+   * Add some more information to various places in innotop
+
+2006-08-01: innotop 0.1.123, InnoDBParser version 1.47
+
+   * Enhance S and G modes: clear screen and re-print headers
+   * Don't crash when deadlock data is truncated
+   * Make Analyze mode say how to get back to whatever you came from
+   * Display 'nothing to display' when there is nothing
+   * Add ability to read InnoDB status text from a file (mostly helps test)
+   * Add table of Wait Array Information in Row Op/Semaphore mode
+   * Add table of lock information in InnoDB deadlock mode
+   * Ensure new features in upgrades don't get masked by existing config files
+   * Tweak default column choices for T mode
+   * Enhance foreign key parsing
+   * Enhance physical record and data tuple parsing
+   * Enhance lock parsing (handle old-style and new-style formats)
+
+2006-07-24: innotop 0.1.112, InnoDBParser version 1.36
+
+   * InnoDBParser enhancements for FK error messages.
+   * A fix to innotop to prevent it from crashing while trying to display a FK
+     error message.
+   * Some minor cosmetic changes to number formatting in innotop.
+
+2006-07-22: innotop 0.1.106, InnoDBParser version 1.35
+
+   * InnoDBParser is much more complete and accurate.
+   * Tons of bug fixes.
+   * Add partitions to EXPLAIN mode.
+   * Enhance Q mode header, add T mode header.
+   * Share some configuration variables across modes.
+   * Add formatted time columns to Q, T modes.
+   * Add command-line argument parsing.
+   * Turn off echo when asking for password.
+   * Add option to specify port when connecting.
+   * Let display-optimized-query display multiple notes.
+   * Lots of small improvements, such as showing more info in statusbar.
+
+2006-07-02: innotop 0.1.74, InnoDBParser version 1.24
+
+   * Initial release for public consumption.
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/innotop/innotop b/mysql-wsrep-5.6/packaging/deb-in/extra/innotop/innotop
new file mode 100644 (file)
index 0000000..646f0d7
--- /dev/null
@@ -0,0 +1,10946 @@
+#!/usr/bin/perl
+
+# vim: tw=160:nowrap:expandtab:tabstop=3:shiftwidth=3:softtabstop=3
+
+# This program is copyright (c) 2006 Baron Schwartz, baron at xaprb dot com.
+# Feedback and improvements are gratefully received.
+#
+# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, version 2; OR the Perl Artistic License.  On UNIX and similar
+# systems, you can issue `man perlgpl' or `man perlartistic' to read these
+
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA  02111-1307  USA
+
+use strict;
+use warnings FATAL => 'all';
+
+our $VERSION = '1.7.1';
+
+# Find the home directory; it's different on different OSes.
+our $homepath = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
+
+# Configuration files
+our $default_home_conf = "$homepath/.innotop/innotop.conf";
+our $default_central_conf = "/etc/innotop/innotop.conf";
+our $conf_file = "";
+
+## Begin packages ##
+
+package DSNParser;
+
+use DBI;
+use Data::Dumper;
+$Data::Dumper::Indent    = 0;
+$Data::Dumper::Quotekeys = 0;
+use English qw(-no_match_vars);
+
+use constant MKDEBUG => $ENV{MKDEBUG};
+
+# Defaults are built-in, but you can add/replace items by passing them as
+# hashrefs of {key, desc, copy, dsn}.  The desc and dsn items are optional.
+# You can set properties with the prop() sub.  Don't set the 'opts' property.
+sub new {
+   my ( $class, @opts ) = @_;
+   my $self = {
+      opts => {
+         A => {
+            desc => 'Default character set',
+            dsn  => 'charset',
+            copy => 1,
+         },
+         D => {
+            desc => 'Database to use',
+            dsn  => 'database',
+            copy => 1,
+         },
+         F => {
+            desc => 'Only read default options from the given file',
+            dsn  => 'mysql_read_default_file',
+            copy => 1,
+         },
+         h => {
+            desc => 'Connect to host',
+            dsn  => 'host',
+            copy => 1,
+         },
+         p => {
+            desc => 'Password to use when connecting',
+            dsn  => 'password',
+            copy => 1,
+         },
+         P => {
+            desc => 'Port number to use for connection',
+            dsn  => 'port',
+            copy => 1,
+         },
+         S => {
+            desc => 'Socket file to use for connection',
+            dsn  => 'mysql_socket',
+            copy => 1,
+         },
+         u => {
+            desc => 'User for login if not current user',
+            dsn  => 'user',
+            copy => 1,
+         },
+      },
+   };
+   foreach my $opt ( @opts ) {
+      MKDEBUG && _d('Adding extra property ' . $opt->{key});
+      $self->{opts}->{$opt->{key}} = { desc => $opt->{desc}, copy => $opt->{copy} };
+   }
+   return bless $self, $class;
+}
+
+# Recognized properties:
+# * autokey:   which key to treat a bareword as (typically h=host).
+# * dbidriver: which DBI driver to use; assumes mysql, supports Pg.
+# * required:  which parts are required (hashref).
+# * setvars:   a list of variables to set after connecting
+sub prop {
+   my ( $self, $prop, $value ) = @_;
+   if ( @_ > 2 ) {
+      MKDEBUG && _d("Setting $prop property");
+      $self->{$prop} = $value;
+   }
+   return $self->{$prop};
+}
+
+sub parse {
+   my ( $self, $dsn, $prev, $defaults ) = @_;
+   if ( !$dsn ) {
+      MKDEBUG && _d('No DSN to parse');
+      return;
+   }
+   MKDEBUG && _d("Parsing $dsn");
+   $prev     ||= {};
+   $defaults ||= {};
+   my %given_props;
+   my %final_props;
+   my %opts = %{$self->{opts}};
+   my $prop_autokey = $self->prop('autokey');
+
+   # Parse given props
+   foreach my $dsn_part ( split(/,/, $dsn) ) {
+      if ( my ($prop_key, $prop_val) = $dsn_part =~  m/^(.)=(.*)$/ ) {
+         # Handle the typical DSN parts like h=host, P=3306, etc.
+         $given_props{$prop_key} = $prop_val;
+      }
+      elsif ( $prop_autokey ) {
+         # Handle barewords
+         MKDEBUG && _d("Interpreting $dsn_part as $prop_autokey=$dsn_part");
+         $given_props{$prop_autokey} = $dsn_part;
+      }
+      else {
+         MKDEBUG && _d("Bad DSN part: $dsn_part");
+      }
+   }
+
+   # Fill in final props from given, previous, and/or default props
+   foreach my $key ( keys %opts ) {
+      MKDEBUG && _d("Finding value for $key");
+      $final_props{$key} = $given_props{$key};
+      if (   !defined $final_props{$key}
+           && defined $prev->{$key} && $opts{$key}->{copy} )
+      {
+         $final_props{$key} = $prev->{$key};
+         MKDEBUG && _d("Copying value for $key from previous DSN");
+      }
+      if ( !defined $final_props{$key} ) {
+         $final_props{$key} = $defaults->{$key};
+         MKDEBUG && _d("Copying value for $key from defaults");
+      }
+   }
+
+   # Sanity check props
+   foreach my $key ( keys %given_props ) {
+      die "Unrecognized DSN part '$key' in '$dsn'\n"
+         unless exists $opts{$key};
+   }
+   if ( (my $required = $self->prop('required')) ) {
+      foreach my $key ( keys %$required ) {
+         die "Missing DSN part '$key' in '$dsn'\n" unless $final_props{$key};
+      }
+   }
+
+   return \%final_props;
+}
+
+sub as_string {
+   my ( $self, $dsn ) = @_;
+   return $dsn unless ref $dsn;
+   return join(',',
+      map  { "$_=" . ($_ eq 'p' ? '...' : $dsn->{$_}) }
+      grep { defined $dsn->{$_} && $self->{opts}->{$_} }
+      sort keys %$dsn );
+}
+
+sub usage {
+   my ( $self ) = @_;
+   my $usage
+      = "DSN syntax is key=value[,key=value...]  Allowable DSN keys:\n"
+      . "  KEY  COPY  MEANING\n"
+      . "  ===  ====  =============================================\n";
+   my %opts = %{$self->{opts}};
+   foreach my $key ( sort keys %opts ) {
+      $usage .= "  $key    "
+             .  ($opts{$key}->{copy} ? 'yes   ' : 'no    ')
+             .  ($opts{$key}->{desc} || '[No description]')
+             . "\n";
+   }
+   if ( (my $key = $self->prop('autokey')) ) {
+      $usage .= "  If the DSN is a bareword, the word is treated as the '$key' key.\n";
+   }
+   return $usage;
+}
+
+# Supports PostgreSQL via the dbidriver element of $info, but assumes MySQL by
+# default.
+sub get_cxn_params {
+   my ( $self, $info ) = @_;
+   my $dsn;
+   my %opts = %{$self->{opts}};
+   my $driver = $self->prop('dbidriver') || '';
+   if ( $driver eq 'Pg' ) {
+      $dsn = 'DBI:Pg:dbname=' . ( $info->{D} || '' ) . ';'
+         . join(';', map  { "$opts{$_}->{dsn}=$info->{$_}" }
+                     grep { defined $info->{$_} }
+                     qw(h P));
+   }
+   else {
+      $dsn = 'DBI:mysql:' . ( $info->{D} || '' ) . ';'
+         . join(';', map  { "$opts{$_}->{dsn}=$info->{$_}" }
+                     grep { defined $info->{$_} }
+                     qw(F h P S A))
+         . ';mysql_read_default_group=client';
+   }
+   MKDEBUG && _d($dsn);
+   return ($dsn, $info->{u}, $info->{p});
+}
+
+
+# Fills in missing info from a DSN after successfully connecting to the server.
+sub fill_in_dsn {
+   my ( $self, $dbh, $dsn ) = @_;
+   my $vars = $dbh->selectall_hashref('SHOW VARIABLES', 'Variable_name');
+   my ($user, $db) = $dbh->selectrow_array('SELECT USER(), DATABASE()');
+   $user =~ s/@.*//;
+   $dsn->{h} ||= $vars->{hostname}->{Value};
+   $dsn->{S} ||= $vars->{'socket'}->{Value};
+   $dsn->{P} ||= $vars->{port}->{Value};
+   $dsn->{u} ||= $user;
+   $dsn->{D} ||= $db;
+}
+
+sub get_dbh {
+   my ( $self, $cxn_string, $user, $pass, $opts ) = @_;
+   $opts ||= {};
+   my $defaults = {
+      AutoCommit        => 0,
+      RaiseError        => 1,
+      PrintError        => 0,
+      mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/ ? 1 : 0),
+   };
+   @{$defaults}{ keys %$opts } = values %$opts;
+   my $dbh;
+   my $tries = 2;
+   while ( !$dbh && $tries-- ) {
+      eval {
+         MKDEBUG && _d($cxn_string, ' ', $user, ' ', $pass, ' {',
+            join(', ', map { "$_=>$defaults->{$_}" } keys %$defaults ), '}');
+         $dbh = DBI->connect($cxn_string, $user, $pass, $defaults);
+         # Immediately set character set and binmode on STDOUT.
+         if ( my ($charset) = $cxn_string =~ m/charset=(\w+)/ ) {
+            my $sql = "/*!40101 SET NAMES $charset*/";
+            MKDEBUG && _d("$dbh: $sql");
+            $dbh->do($sql);
+            MKDEBUG && _d('Enabling charset for STDOUT');
+            if ( $charset eq 'utf8' ) {
+               binmode(STDOUT, ':utf8')
+                  or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR";
+            }
+            else {
+               binmode(STDOUT) or die "Can't binmode(STDOUT): $OS_ERROR";
+            }
+         }
+      };
+      if ( !$dbh && $EVAL_ERROR ) {
+         MKDEBUG && _d($EVAL_ERROR);
+         if ( $EVAL_ERROR =~ m/not a compiled character set|character set utf8/ ) {
+            MKDEBUG && _d("Going to try again without utf8 support");
+            delete $defaults->{mysql_enable_utf8};
+         }
+         if ( !$tries ) {
+            die $EVAL_ERROR;
+         }
+      }
+   }
+   # If setvars exists and it's MySQL connection, set them
+   my $setvars = $self->prop('setvars');
+   if ( $cxn_string =~ m/mysql/i && $setvars ) {
+      my $sql = "SET $setvars";
+      MKDEBUG && _d("$dbh: $sql");
+      eval {
+         $dbh->do($sql);
+      };
+      if ( $EVAL_ERROR ) {
+         MKDEBUG && _d($EVAL_ERROR);
+      }
+   }
+   MKDEBUG && _d('DBH info: ',
+      $dbh,
+      Dumper($dbh->selectrow_hashref(
+         'SELECT DATABASE(), CONNECTION_ID(), VERSION()/*!50038 , @@hostname*/')),
+      ' Connection info: ', ($dbh->{mysql_hostinfo} || 'undef'),
+      ' Character set info: ',
+      Dumper($dbh->selectall_arrayref(
+         'SHOW VARIABLES LIKE "character_set%"', { Slice => {}})),
+      ' $DBD::mysql::VERSION: ', $DBD::mysql::VERSION,
+      ' $DBI::VERSION: ', $DBI::VERSION,
+   );
+   return $dbh;
+}
+
+# Tries to figure out a hostname for the connection.
+sub get_hostname {
+   my ( $self, $dbh ) = @_;
+   if ( my ($host) = ($dbh->{mysql_hostinfo} || '') =~ m/^(\w+) via/ ) {
+      return $host;
+   }
+   my ( $hostname, $one ) = $dbh->selectrow_array(
+      'SELECT /*!50038 @@hostname, */ 1');
+   return $hostname;
+}
+
+# Disconnects a database handle, but complains verbosely if there are any active
+# children.  These are usually $sth handles that haven't been finish()ed.
+sub disconnect {
+   my ( $self, $dbh ) = @_;
+   MKDEBUG && $self->print_active_handles($dbh);
+   $dbh->disconnect;
+}
+
+sub print_active_handles {
+   my ( $self, $thing, $level ) = @_;
+   $level ||= 0;
+   printf("# Active %sh: %s %s %s\n", ($thing->{Type} || 'undef'), "\t" x $level,
+      $thing, (($thing->{Type} || '') eq 'st' ? $thing->{Statement} || '' : ''))
+      or die "Cannot print: $OS_ERROR";
+   foreach my $handle ( grep {defined} @{ $thing->{ChildHandles} } ) {
+      $self->print_active_handles( $handle, $level + 1 );
+   }
+}
+
+sub _d {
+   my ($package, undef, $line) = caller 0;
+   @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
+        map { defined $_ ? $_ : 'undef' }
+        @_;
+   # Use $$ instead of $PID in case the package
+   # does not use English.
+   print "# $package:$line $$ ", @_, "\n";
+}
+
+1;
+
+package InnoDBParser;
+
+use Data::Dumper;
+$Data::Dumper::Sortkeys = 1;
+use English qw(-no_match_vars);
+use List::Util qw(max);
+
+# Some common patterns
+my $d  = qr/(\d+)/;                    # Digit
+my $f  = qr/(\d+\.\d+)/;               # Float
+my $t  = qr/(\d+ \d+)/;                # Transaction ID
+my $i  = qr/((?:\d{1,3}\.){3}\d+)/;    # IP address
+my $n  = qr/([^`\s]+)/;                # MySQL object name
+my $w  = qr/(\w+)/;                    # Words
+my $fl = qr/([\w\.\/]+) line $d/;      # Filename and line number
+my $h  = qr/((?:0x)?[0-9a-f]*)/;       # Hex
+my $s  = qr/(\d{6} .\d:\d\d:\d\d)/;    # InnoDB timestamp
+
+# If you update this variable, also update the SYNOPSIS in the pod.
+my %innodb_section_headers = (
+   "TRANSACTIONS"                          => "tx",
+   "BUFFER POOL AND MEMORY"                => "bp",
+   "SEMAPHORES"                            => "sm",
+   "LOG"                                   => "lg",
+   "ROW OPERATIONS"                        => "ro",
+   "INSERT BUFFER AND ADAPTIVE HASH INDEX" => "ib",
+   "FILE I/O"                              => "io",
+   "LATEST DETECTED DEADLOCK"              => "dl",
+   "LATEST FOREIGN KEY ERROR"              => "fk",
+);
+
+my %parser_for = (
+   tx => \&parse_tx_section,
+   bp => \&parse_bp_section,
+   sm => \&parse_sm_section,
+   lg => \&parse_lg_section,
+   ro => \&parse_ro_section,
+   ib => \&parse_ib_section,
+   io => \&parse_io_section,
+   dl => \&parse_dl_section,
+   fk => \&parse_fk_section,
+);
+
+my %fk_parser_for = (
+   Transaction => \&parse_fk_transaction_error,
+   Error       => \&parse_fk_bad_constraint_error,
+   Cannot      => \&parse_fk_cant_drop_parent_error,
+);
+
+# A thread's proc_info can be at least 98 different things I've found in the
+# source.  Fortunately, most of them begin with a gerunded verb.  These are
+# the ones that don't.
+my %is_proc_info = (
+   'After create'                 => 1,
+   'Execution of init_command'    => 1,
+   'FULLTEXT initialization'      => 1,
+   'Reopen tables'                => 1,
+   'Repair done'                  => 1,
+   'Repair with keycache'         => 1,
+   'System lock'                  => 1,
+   'Table lock'                   => 1,
+   'Thread initialized'           => 1,
+   'User lock'                    => 1,
+   'copy to tmp table'            => 1,
+   'discard_or_import_tablespace' => 1,
+   'end'                          => 1,
+   'got handler lock'             => 1,
+   'got old table'                => 1,
+   'init'                         => 1,
+   'key cache'                    => 1,
+   'locks'                        => 1,
+   'malloc'                       => 1,
+   'query end'                    => 1,
+   'rename result table'          => 1,
+   'rename'                       => 1,
+   'setup'                        => 1,
+   'statistics'                   => 1,
+   'status'                       => 1,
+   'table cache'                  => 1,
+   'update'                       => 1,
+);
+
+sub new {
+   bless {}, shift;
+}
+
+# Parse the status and return it.
+# See srv_printf_innodb_monitor in innobase/srv/srv0srv.c
+# Pass in the text to parse, whether to be in debugging mode, which sections
+# to parse (hashref; if empty, parse all), and whether to parse full info from
+# locks and such (probably shouldn't unless you need to).
+sub parse_status_text {
+   my ( $self, $fulltext, $debug, $sections, $full ) = @_;
+
+   die "I can't parse undef" unless defined $fulltext;
+   $fulltext =~ s/[\r\n]+/\n/g;
+
+   $sections ||= {};
+   die '$sections must be a hashref' unless ref($sections) eq 'HASH';
+
+   my %innodb_data = (
+      got_all   => 0,         # Whether I was able to get the whole thing
+      ts        => '',        # Timestamp the server put on it
+      last_secs => 0,         # Num seconds the averages are over
+      sections  => {},        # Parsed values from each section
+   );
+
+   if ( $debug ) {
+      $innodb_data{'fulltext'} = $fulltext;
+   }
+
+   # Get the most basic info about the status: beginning and end, and whether
+   # I got the whole thing (if there has been a big deadlock and there are
+   # too many locks to print, the output might be truncated)
+   my ( $time_text ) = $fulltext =~ m/^$s INNODB MONITOR OUTPUT$/m;
+   $innodb_data{'ts'} = [ parse_innodb_timestamp( $time_text ) ];
+   $innodb_data{'timestring'} = ts_to_string($innodb_data{'ts'});
+   ( $innodb_data{'last_secs'} ) = $fulltext
+      =~ m/Per second averages calculated from the last $d seconds/;
+
+   ( my $got_all ) = $fulltext =~ m/END OF INNODB MONITOR OUTPUT/;
+   $innodb_data{'got_all'} = $got_all || 0;
+
+   # Split it into sections.  Each section begins with
+   # -----
+   # LABEL
+   # -----
+   my %innodb_sections;
+   my @matches = $fulltext
+      =~ m#\n(---+)\n([A-Z /]+)\n\1\n(.*?)(?=\n(---+)\n[A-Z /]+\n\4\n|$)#gs;
+   while ( my ( $start, $name, $text, $end ) = splice(@matches, 0, 4) ) {
+      $innodb_sections{$name} = [ $text, $end ? 1 : 0 ];
+   }
+   # The Row Operations section is a special case, because instead of ending
+   # with the beginning of another section, it ends with the end of the file.
+   # So this section is complete if the entire file is complete.
+   $innodb_sections{'ROW OPERATIONS'}->[1] ||= $innodb_data{'got_all'};
+
+   # Just for sanity's sake, make sure I understand what to do with each
+   # section
+   eval {
+      foreach my $section ( keys %innodb_sections ) {
+         my $header = $innodb_section_headers{$section};
+         die "Unknown section $section in $fulltext\n"
+            unless $header;
+         $innodb_data{'sections'}->{ $header }
+            ->{'fulltext'} = $innodb_sections{$section}->[0];
+         $innodb_data{'sections'}->{ $header }
+            ->{'complete'} = $innodb_sections{$section}->[1];
+      }
+   };
+   if ( $EVAL_ERROR ) {
+      _debug( $debug, $EVAL_ERROR);
+   }
+
+   # ################################################################
+   # Parse the detailed data out of the sections.
+   # ################################################################
+   eval {
+      foreach my $section ( keys %parser_for ) {
+         if ( defined $innodb_data{'sections'}->{$section}
+               && (!%$sections || (defined($sections->{$section} && $sections->{$section})) )) {
+            $parser_for{$section}->(
+                  $innodb_data{'sections'}->{$section},
+                  $innodb_data{'sections'}->{$section}->{'complete'},
+                  $debug,
+                  $full )
+               or delete $innodb_data{'sections'}->{$section};
+         }
+         else {
+            delete $innodb_data{'sections'}->{$section};
+         }
+      }
+   };
+   if ( $EVAL_ERROR ) {
+      _debug( $debug, $EVAL_ERROR);
+   }
+
+   return \%innodb_data;
+}
+
+# Parses the status text and returns it flattened out as a single hash.
+sub get_status_hash {
+   my ( $self, $fulltext, $debug, $sections, $full ) = @_;
+
+   # Parse the status text...
+   my $innodb_status
+      = $self->parse_status_text($fulltext, $debug, $sections, $full );
+
+   # Flatten the hierarchical structure into a single list by grabbing desired
+   # sections from it.
+   return
+      (map { 'IB_' . $_ => $innodb_status->{$_} } qw(timestring last_secs got_all)),
+      (map { 'IB_bp_' . $_ => $innodb_status->{'sections'}->{'bp'}->{$_} }
+         qw( writes_pending buf_pool_hit_rate total_mem_alloc buf_pool_reads
+            awe_mem_alloc pages_modified writes_pending_lru page_creates_sec
+            reads_pending pages_total buf_pool_hits writes_pending_single_page
+            page_writes_sec pages_read pages_written page_reads_sec
+            writes_pending_flush_list buf_pool_size add_pool_alloc
+            dict_mem_alloc pages_created buf_free complete )),
+      (map { 'IB_tx_' . $_ => $innodb_status->{'sections'}->{'tx'}->{$_} }
+         qw( num_lock_structs history_list_len purge_done_for transactions
+            purge_undo_for is_truncated trx_id_counter complete )),
+      (map { 'IB_ib_' . $_ => $innodb_status->{'sections'}->{'ib'}->{$_} }
+         qw( hash_table_size hash_searches_s non_hash_searches_s
+            bufs_in_node_heap used_cells size free_list_len seg_size inserts
+            merged_recs merges complete )),
+      (map { 'IB_lg_' . $_ => $innodb_status->{'sections'}->{'lg'}->{$_} }
+         qw( log_ios_done pending_chkp_writes last_chkp log_ios_s
+            log_flushed_to log_seq_no pending_log_writes complete )),
+      (map { 'IB_sm_' . $_ => $innodb_status->{'sections'}->{'sm'}->{$_} }
+         qw( wait_array_size rw_shared_spins rw_excl_os_waits mutex_os_waits
+            mutex_spin_rounds mutex_spin_waits rw_excl_spins rw_shared_os_waits
+            waits signal_count reservation_count complete )),
+      (map { 'IB_ro_' . $_ => $innodb_status->{'sections'}->{'ro'}->{$_} }
+         qw( queries_in_queue n_reserved_extents main_thread_state
+         main_thread_proc_no main_thread_id read_sec del_sec upd_sec ins_sec
+         read_views_open num_rows_upd num_rows_ins num_rows_read
+         queries_inside num_rows_del complete )),
+      (map { 'IB_fk_' . $_ => $innodb_status->{'sections'}->{'fk'}->{$_} }
+         qw( trigger parent_table child_index parent_index attempted_op
+         child_db timestring fk_name records col_name reason txn parent_db
+         type child_table parent_col complete )),
+      (map { 'IB_io_' . $_ => $innodb_status->{'sections'}->{'io'}->{$_} }
+         qw( pending_buffer_pool_flushes pending_pwrites pending_preads
+         pending_normal_aio_reads fsyncs_s os_file_writes pending_sync_ios
+         reads_s flush_type avg_bytes_s pending_ibuf_aio_reads writes_s
+         threads os_file_reads pending_aio_writes pending_log_ios os_fsyncs
+         pending_log_flushes complete )),
+      (map { 'IB_dl_' . $_ => $innodb_status->{'sections'}->{'dl'}->{$_} }
+         qw( timestring rolled_back txns complete ));
+
+}
+
+sub ts_to_string {
+   my $parts = shift;
+   return sprintf('%02d-%02d-%02d %02d:%02d:%02d', @$parts);
+}
+
+sub parse_innodb_timestamp {
+   my $text = shift;
+   my ( $y, $m, $d, $h, $i, $s )
+      = $text =~ m/^(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)$/;
+   die("Can't get timestamp from $text\n") unless $y;
+   $y += 2000;
+   return ( $y, $m, $d, $h, $i, $s );
+}
+
+sub parse_fk_section {
+   my ( $section, $complete, $debug, $full ) = @_;
+   my $fulltext = $section->{'fulltext'};
+
+   return 0 unless $fulltext;
+
+   my ( $ts, $type ) = $fulltext =~ m/^$s\s+(\w+)/m;
+   $section->{'ts'} = [ parse_innodb_timestamp( $ts ) ];
+   $section->{'timestring'} = ts_to_string($section->{'ts'});
+   $section->{'type'} = $type;
+
+   # Decide which type of FK error happened, and dispatch to the right parser.
+   if ( $type && $fk_parser_for{$type} ) {
+      $fk_parser_for{$type}->( $section, $complete, $debug, $fulltext, $full );
+   }
+
+   delete $section->{'fulltext'} unless $debug;
+
+   return 1;
+}
+
+sub parse_fk_cant_drop_parent_error {
+   my ( $section, $complete, $debug, $fulltext, $full ) = @_;
+
+   # Parse the parent/child table info out
+   @{$section}{ qw(attempted_op parent_db parent_table) } = $fulltext
+      =~ m{Cannot $w table `(.*)/(.*)`}m;
+   @{$section}{ qw(child_db child_table) } = $fulltext
+      =~ m{because it is referenced by `(.*)/(.*)`}m;
+
+   ( $section->{'reason'} ) = $fulltext =~ m/(Cannot .*)/s;
+   $section->{'reason'} =~ s/\n(?:InnoDB: )?/ /gm
+      if $section->{'reason'};
+
+   # Certain data may not be present.  Make them '' if not present.
+   map { $section->{$_} ||= "" }
+      qw(child_index fk_name col_name parent_col);
+}
+
+# See dict/dict0dict.c, function dict_foreign_error_report
+# I don't care much about these.  There are lots of different messages, and
+# they come from someone trying to create a foreign key, or similar
+# statements.  They aren't indicative of some transaction trying to insert,
+# delete or update data.  Sometimes it is possible to parse out a lot of
+# information about the tables and indexes involved, but often the message
+# contains the DDL string the user entered, which is way too much for this
+# module to try to handle.
+sub parse_fk_bad_constraint_error {
+   my ( $section, $complete, $debug, $fulltext, $full ) = @_;
+
+   # Parse the parent/child table and index info out
+   @{$section}{ qw(child_db child_table) } = $fulltext
+      =~ m{Error in foreign key constraint of table (.*)/(.*):$}m;
+   $section->{'attempted_op'} = 'DDL';
+
+   # FK name, parent info... if possible.
+   @{$section}{ qw(fk_name col_name parent_db parent_table parent_col) }
+      = $fulltext
+      =~ m/CONSTRAINT `?$n`? FOREIGN KEY \(`?$n`?\) REFERENCES (?:`?$n`?\.)?`?$n`? \(`?$n`?\)/;
+
+   if ( !defined($section->{'fk_name'}) ) {
+      # Try to parse SQL a user might have typed in a CREATE statement or such
+      @{$section}{ qw(col_name parent_db parent_table parent_col) }
+         = $fulltext
+         =~ m/FOREIGN\s+KEY\s*\(`?$n`?\)\s+REFERENCES\s+(?:`?$n`?\.)?`?$n`?\s*\(`?$n`?\)/i;
+   }
+   $section->{'parent_db'} ||= $section->{'child_db'};
+
+   # Name of the child index (index in the same table where the FK is, see
+   # definition of dict_foreign_struct in include/dict0mem.h, where it is
+   # called foreign_index, as opposed to referenced_index which is in the
+   # parent table.  This may not be possible to find.
+   @{$section}{ qw(child_index) } = $fulltext
+      =~ m/^The index in the foreign key in table is $n$/m;
+
+   @{$section}{ qw(reason) } = $fulltext =~ m/:\s*([^:]+)(?= Constraint:|$)/ms;
+   $section->{'reason'} =~ s/\s+/ /g
+      if $section->{'reason'};
+   
+   # Certain data may not be present.  Make them '' if not present.
+   map { $section->{$_} ||= "" }
+      qw(child_index fk_name col_name parent_table parent_col);
+}
+
+# see source file row/row0ins.c
+sub parse_fk_transaction_error {
+   my ( $section, $complete, $debug, $fulltext, $full ) = @_;
+
+   # Parse the txn info out
+   my ( $txn ) = $fulltext
+      =~ m/Transaction:\n(TRANSACTION.*)\nForeign key constraint fails/s;
+   if ( $txn ) {
+      $section->{'txn'} = parse_tx_text( $txn, $complete, $debug, $full );
+   }
+
+   # Parse the parent/child table and index info out.  There are two types: an
+   # update or a delete of a parent record leaves a child orphaned
+   # (row_ins_foreign_report_err), and an insert or update of a child record has
+   # no matching parent record (row_ins_foreign_report_add_err).
+
+   @{$section}{ qw(reason child_db child_table) }
+      = $fulltext =~ m{^(Foreign key constraint fails for table `(.*)/(.*)`:)$}m;
+
+   @{$section}{ qw(fk_name col_name parent_db parent_table parent_col) }
+      = $fulltext
+      =~ m/CONSTRAINT `$n` FOREIGN KEY \(`$n`\) REFERENCES (?:`$n`\.)?`$n` \(`$n`\)/;
+   $section->{'parent_db'} ||= $section->{'child_db'};
+
+   # Special case, which I don't know how to trigger, but see
+   # innobase/row/row0ins.c row_ins_check_foreign_constraint
+   if ( $fulltext =~ m/ibd file does not currently exist!/ ) {
+      my ( $attempted_op, $index, $records )
+         = $fulltext =~ m/^Trying to (add to index) `$n` tuple:\n(.*))?/sm;
+      $section->{'child_index'} = $index;
+      $section->{'attempted_op'} = $attempted_op || '';
+      if ( $records && $full ) {
+         ( $section->{'records'} )
+            = parse_innodb_record_dump( $records, $complete, $debug );
+      }
+      @{$section}{qw(parent_db parent_table)}
+         =~ m/^But the parent table `$n`\.`$n`$/m;
+   }
+   else {
+      my ( $attempted_op, $which, $index )
+         = $fulltext =~ m/^Trying to ([\w ]*) in (child|parent) table, in index `$n` tuple:$/m;
+      if ( $which ) {
+         $section->{$which . '_index'} = $index;
+         $section->{'attempted_op'} = $attempted_op || '';
+
+         # Parse out the related records in the other table.
+         my ( $search_index, $records );
+         if ( $which eq 'child' ) {
+            ( $search_index, $records ) = $fulltext
+               =~ m/^But in parent table [^,]*, in index `$n`,\nthe closest match we can find is record:\n(.*)/ms;
+            $section->{'parent_index'} = $search_index;
+         }
+         else {
+            ( $search_index, $records ) = $fulltext
+               =~ m/^But in child table [^,]*, in index `$n`, (?:the record is not available|there is a record:\n(.*))?/ms;
+            $section->{'child_index'} = $search_index;
+         }
+         if ( $records && $full ) {
+            $section->{'records'}
+               = parse_innodb_record_dump( $records, $complete, $debug );
+         }
+         else {
+            $section->{'records'} = '';
+         }
+      }
+   }
+
+   # Parse out the tuple trying to be updated, deleted or inserted.
+   my ( $trigger ) = $fulltext =~ m/^(DATA TUPLE: \d+ fields;\n.*)$/m;
+   if ( $trigger ) {
+      $section->{'trigger'} = parse_innodb_record_dump( $trigger, $complete, $debug );
+   }
+
+   # Certain data may not be present.  Make them '' if not present.
+   map { $section->{$_} ||= "" }
+      qw(child_index fk_name col_name parent_table parent_col);
+}
+
+# There are new-style and old-style record formats.  See rem/rem0rec.c
+# TODO: write some tests for this
+sub parse_innodb_record_dump {
+   my ( $dump, $complete, $debug ) = @_;
+   return undef unless $dump;
+
+   my $result = {};
+
+   if ( $dump =~ m/PHYSICAL RECORD/ ) {
+      my $style = $dump =~ m/compact format/ ? 'new' : 'old';
+      $result->{'style'} = $style;
+
+      # This is a new-style record.
+      if ( $style eq 'new' ) {
+         @{$result}{qw( heap_no type num_fields info_bits )}
+            = $dump
+            =~ m/^(?:Record lock, heap no $d )?([A-Z ]+): n_fields $d; compact format; info bits $d$/m;
+      }
+
+      # OK, it's old-style.  Unfortunately there are variations here too.
+      elsif ( $dump =~ m/-byte offs / ) {
+         # Older-old style.
+         @{$result}{qw( heap_no type num_fields byte_offset info_bits )}
+            = $dump
+            =~ m/^(?:Record lock, heap no $d )?([A-Z ]+): n_fields $d; $d-byte offs [A-Z]+; info bits $d$/m;
+            if ( $dump !~ m/-byte offs TRUE/ ) {
+               $result->{'byte_offset'} = 0;
+            }
+      }
+      else {
+         # Newer-old style.
+         @{$result}{qw( heap_no type num_fields byte_offset info_bits )}
+            = $dump
+            =~ m/^(?:Record lock, heap no $d )?([A-Z ]+): n_fields $d; $d-byte offsets; info bits $d$/m;
+      }
+
+   }
+   else {
+      $result->{'style'} = 'tuple';
+      @{$result}{qw( type num_fields )}
+         = $dump =~ m/^(DATA TUPLE): $d fields;$/m;
+   }
+
+   # Fill in default values for things that couldn't be parsed.
+   map { $result->{$_} ||= 0 }
+      qw(heap_no num_fields byte_offset info_bits);
+   map { $result->{$_} ||= '' }
+      qw(style type );
+
+   my @fields = $dump =~ m/ (\d+:.*?;?);(?=$| \d+:)/gm;
+   $result->{'fields'} = [ map { parse_field($_, $complete, $debug ) } @fields ];
+
+   return $result;
+}
+
+# New/old-style applies here.  See rem/rem0rec.c
+# $text should not include the leading space or the second trailing semicolon.
+sub parse_field {
+   my ( $text, $complete, $debug ) = @_;
+
+   # Sample fields:
+   # '4: SQL NULL, size 4 '
+   # '1: len 6; hex 000000005601; asc     V ;'
+   # '6: SQL NULL'
+   # '5: len 30; hex 687474703a2f2f7777772e737765657477617465722e636f6d2f73746f72; asc http://www.sweetwater.com/stor;...(truncated)'
+   my ( $id, $nullsize, $len, $hex, $asc, $truncated );
+   ( $id, $nullsize ) = $text =~ m/^$d: SQL NULL, size $d $/;
+   if ( !defined($id) ) {
+      ( $id ) = $text =~ m/^$d: SQL NULL$/;
+   }
+   if ( !defined($id) ) {
+      ( $id, $len, $hex, $asc, $truncated )
+         = $text =~ m/^$d: len $d; hex $h; asc (.*);(\.\.\.\(truncated\))?$/;
+   }
+
+   die "Could not parse this field: '$text'" unless defined $id;
+   return {
+      id    => $id,
+      len   => defined($len) ? $len : defined($nullsize) ? $nullsize : 0,
+      'hex' => defined($hex) ? $hex : '',
+      asc   => defined($asc) ? $asc : '',
+      trunc => $truncated ? 1 : 0,
+   };
+
+}
+
+sub parse_dl_section {
+   my ( $dl, $complete, $debug, $full ) = @_;
+   return unless $dl;
+   my $fulltext = $dl->{'fulltext'};
+   return 0 unless $fulltext;
+
+   my ( $ts ) = $fulltext =~ m/^$s$/m;
+   return 0 unless $ts;
+
+   $dl->{'ts'} = [ parse_innodb_timestamp( $ts ) ];
+   $dl->{'timestring'} = ts_to_string($dl->{'ts'});
+   $dl->{'txns'} = {};
+
+   my @sections
+      = $fulltext
+      =~ m{
+         ^\*{3}\s([^\n]*)  # *** (1) WAITING FOR THIS...
+         (.*?)             # Followed by anything, non-greedy
+         (?=(?:^\*{3})|\z) # Followed by another three stars or EOF
+      }gmsx;
+
+
+   # Loop through each section.  There are no assumptions about how many
+   # there are, who holds and wants what locks, and who gets rolled back.
+   while ( my ($header, $body) = splice(@sections, 0, 2) ) {
+      my ( $txn_id, $what ) = $header =~ m/^\($d\) (.*):$/;
+      next unless $txn_id;
+      $dl->{'txns'}->{$txn_id} ||= {};
+      my $txn = $dl->{'txns'}->{$txn_id};
+
+      if ( $what eq 'TRANSACTION' ) {
+         $txn->{'tx'} = parse_tx_text( $body, $complete, $debug, $full );
+      }
+      else {
+         push @{$txn->{'locks'}}, parse_innodb_record_locks( $body, $complete, $debug, $full );
+      }
+   }
+
+   @{ $dl }{ qw(rolled_back) }
+      = $fulltext =~ m/^\*\*\* WE ROLL BACK TRANSACTION \($d\)$/m;
+
+   # Make sure certain values aren't undef
+   map { $dl->{$_} ||= '' } qw(rolled_back);
+
+   delete $dl->{'fulltext'} unless $debug;
+   return 1;
+}
+
+sub parse_innodb_record_locks {
+   my ( $text, $complete, $debug, $full ) = @_;
+   my @result;
+
+   foreach my $lock ( $text =~ m/(^(?:RECORD|TABLE) LOCKS?.*$)/gm ) {
+      my $hash = {};
+      @{$hash}{ qw(lock_type space_id page_no n_bits index db table txn_id lock_mode) }
+         = $lock
+         =~ m{^(RECORD|TABLE) LOCKS? (?:space id $d page no $d n bits $d index `?$n`? of )?table `$n(?:/|`\.`)$n` trx id $t lock.mode (\S+)}m;
+      ( $hash->{'special'} )
+         = $lock =~ m/^(?:RECORD|TABLE) .*? locks (rec but not gap|gap before rec)/m;
+      $hash->{'insert_intention'}
+         = $lock =~ m/^(?:RECORD|TABLE) .*? insert intention/m ? 1 : 0;
+      $hash->{'waiting'}
+         = $lock =~ m/^(?:RECORD|TABLE) .*? waiting/m ? 1 : 0;
+
+      # Some things may not be in the text, so make sure they are not
+      # undef.
+      map { $hash->{$_} ||= 0 } qw(n_bits page_no space_id);
+      map { $hash->{$_} ||= "" } qw(index special);
+      push @result, $hash;
+   }
+
+   return @result;
+}
+
+sub parse_tx_text {
+   my ( $txn, $complete, $debug, $full ) = @_;
+
+   my ( $txn_id, $txn_status, $active_secs, $proc_no, $os_thread_id )
+      = $txn
+      =~ m/^(?:---)?TRANSACTION $t, (\D*?)(?: $d sec)?, (?:process no $d, )?OS thread id $d/m;
+   my ( $thread_status, $thread_decl_inside )
+      = $txn
+      =~ m/OS thread id \d+(?: ([^,]+?))?(?:, thread declared inside InnoDB $d)?$/m;
+
+   # Parsing the line that begins 'MySQL thread id' is complicated.  The only
+   # thing always in the line is the thread and query id.  See function
+   # innobase_mysql_print_thd in InnoDB source file sql/ha_innodb.cc.
+   my ( $thread_line ) = $txn =~ m/^(MySQL thread id .*)$/m;
+   my ( $mysql_thread_id, $query_id, $hostname, $ip, $user, $query_status );
+
+   if ( $thread_line ) {
+      # These parts can always be gotten.
+      ( $mysql_thread_id, $query_id ) = $thread_line =~ m/^MySQL thread id $d, query id $d/m;
+
+      # If it's a master/slave thread, "Has (read|sent) all" may be the thread's
+      # proc_info.  In these cases, there won't be any host/ip/user info
+      ( $query_status ) = $thread_line =~ m/(Has (?:read|sent) all .*$)/m;
+      if ( defined($query_status) ) {
+         $user = 'system user';
+      }
+
+      # It may be the case that the query id is the last thing in the line.
+      elsif ( $thread_line =~ m/query id \d+ / ) {
+         # The IP address is the only non-word thing left, so it's the most
+         # useful marker for where I have to start guessing.
+         ( $hostname, $ip ) = $thread_line =~ m/query id \d+(?: ([A-Za-z]\S+))? $i/m;
+         if ( defined $ip ) {
+            ( $user, $query_status ) = $thread_line =~ m/$ip $w(?: (.*))?$/;
+         }
+         else { # OK, there wasn't an IP address.
+            # There might not be ANYTHING except the query status.
+            ( $query_status ) = $thread_line =~ m/query id \d+ (.*)$/;
+            if ( $query_status !~ m/^\w+ing/ && !exists($is_proc_info{$query_status}) ) {
+               # The remaining tokens are, in order: hostname, user, query_status.
+               # It's basically impossible to know which is which.
+               ( $hostname, $user, $query_status ) = $thread_line
+                  =~ m/query id \d+(?: ([A-Za-z]\S+))?(?: $w(?: (.*))?)?$/m;
+            }
+            else {
+               $user = 'system user';
+            }
+         }
+      }
+   }
+
+   my ( $lock_wait_status, $lock_structs, $heap_size, $row_locks, $undo_log_entries )
+      = $txn
+      =~ m/^(?:(\D*) )?$d lock struct\(s\), heap size $d(?:, $d row lock\(s\))?(?:, undo log entries $d)?$/m;
+   my ( $lock_wait_time )
+      = $txn
+      =~ m/^------- TRX HAS BEEN WAITING $d SEC/m;
+
+   my $locks;
+   # If the transaction has locks, grab the locks.
+   if ( $txn =~ m/^TABLE LOCK|RECORD LOCKS/ ) {
+      $locks = [parse_innodb_record_locks($txn, $complete, $debug, $full)];
+   }
+   
+   my ( $tables_in_use, $tables_locked )
+      = $txn
+      =~ m/^mysql tables in use $d, locked $d$/m;
+   my ( $txn_doesnt_see_ge, $txn_sees_lt )
+      = $txn
+      =~ m/^Trx read view will not see trx with id >= $t, sees < $t$/m;
+   my $has_read_view = defined($txn_doesnt_see_ge);
+   # Only a certain number of bytes of the query text are included here, at least
+   # under some circumstances.  Some versions include 300, some 600.
+   my ( $query_text )
+      = $txn
+      =~ m{
+         ^MySQL\sthread\sid\s[^\n]+\n           # This comes before the query text
+         (.*?)                                  # The query text
+         (?=                                    # Followed by any of...
+            ^Trx\sread\sview
+            |^-------\sTRX\sHAS\sBEEN\sWAITING
+            |^TABLE\sLOCK
+            |^RECORD\sLOCKS\sspace\sid
+            |^(?:---)?TRANSACTION
+            |^\*\*\*\s\(\d\)
+            |\Z
+         )
+      }xms;
+   if ( $query_text ) {
+      $query_text =~ s/\s+$//;
+   }
+   else {
+      $query_text = '';
+   }
+
+   my %stuff = (
+      active_secs        => $active_secs,
+      has_read_view      => $has_read_view,
+      heap_size          => $heap_size,
+      hostname           => $hostname,
+      ip                 => $ip,
+      lock_structs       => $lock_structs,
+      lock_wait_status   => $lock_wait_status,
+      lock_wait_time     => $lock_wait_time,
+      mysql_thread_id    => $mysql_thread_id,
+      os_thread_id       => $os_thread_id,
+      proc_no            => $proc_no,
+      query_id           => $query_id,
+      query_status       => $query_status,
+      query_text         => $query_text,
+      row_locks          => $row_locks,
+      tables_in_use      => $tables_in_use,
+      tables_locked      => $tables_locked,
+      thread_decl_inside => $thread_decl_inside,
+      thread_status      => $thread_status,
+      txn_doesnt_see_ge  => $txn_doesnt_see_ge,
+      txn_id             => $txn_id,
+      txn_sees_lt        => $txn_sees_lt,
+      txn_status         => $txn_status,
+      undo_log_entries   => $undo_log_entries,
+      user               => $user,
+   );
+   $stuff{'fulltext'} = $txn if $debug;
+   $stuff{'locks'} = $locks if $locks;
+
+   # Some things may not be in the txn text, so make sure they are not
+   # undef.
+   map { $stuff{$_} ||= 0 } qw(active_secs heap_size lock_structs
+         tables_in_use undo_log_entries tables_locked has_read_view
+         thread_decl_inside lock_wait_time proc_no row_locks);
+   map { $stuff{$_} ||= "" } qw(thread_status txn_doesnt_see_ge
+         txn_sees_lt query_status ip query_text lock_wait_status user);
+   $stuff{'hostname'} ||= $stuff{'ip'};
+
+   return \%stuff;
+}
+
+sub parse_tx_section {
+   my ( $section, $complete, $debug, $full ) = @_;
+   return unless $section && $section->{'fulltext'};
+   my $fulltext = $section->{'fulltext'};
+   $section->{'transactions'} = [];
+
+   # Handle the individual transactions
+   my @transactions = $fulltext =~ m/(---TRANSACTION \d.*?)(?=\n---TRANSACTION|$)/gs;
+   foreach my $txn ( @transactions ) {
+      my $stuff = parse_tx_text( $txn, $complete, $debug, $full );
+      delete $stuff->{'fulltext'} unless $debug;
+      push @{$section->{'transactions'}}, $stuff;
+   }
+
+   # Handle the general info
+   @{$section}{ 'trx_id_counter' }
+      = $fulltext =~ m/^Trx id counter $t$/m;
+   @{$section}{ 'purge_done_for', 'purge_undo_for' }
+      = $fulltext =~ m/^Purge done for trx's n:o < $t undo n:o < $t$/m;
+   @{$section}{ 'history_list_len' } # This isn't present in some 4.x versions
+      = $fulltext =~ m/^History list length $d$/m;
+   @{$section}{ 'num_lock_structs' }
+      = $fulltext =~ m/^Total number of lock structs in row lock hash table $d$/m;
+   @{$section}{ 'is_truncated' }
+      = $fulltext =~ m/^\.\.\. truncated\.\.\.$/m ? 1 : 0;
+
+   # Fill in things that might not be present
+   foreach ( qw(history_list_len) ) {
+      $section->{$_} ||= 0;
+   }
+
+   delete $section->{'fulltext'} unless $debug;
+   return 1;
+}
+
+# I've read the source for this section.
+sub parse_ro_section {
+   my ( $section, $complete, $debug, $full ) = @_;
+   return unless $section && $section->{'fulltext'};
+   my $fulltext = $section->{'fulltext'};
+
+   # Grab the info
+   @{$section}{ 'queries_inside', 'queries_in_queue' }
+      = $fulltext =~ m/^$d queries inside InnoDB, $d queries in queue$/m;
+   ( $section->{ 'read_views_open' } )
+      = $fulltext =~ m/^$d read views open inside InnoDB$/m;
+   ( $section->{ 'n_reserved_extents' } )
+      = $fulltext =~ m/^$d tablespace extents now reserved for B-tree/m;
+   @{$section}{ 'main_thread_proc_no', 'main_thread_id', 'main_thread_state' }
+      = $fulltext =~ m/^Main thread (?:process no. $d, )?id $d, state: (.*)$/m;
+   @{$section}{ 'num_rows_ins', 'num_rows_upd', 'num_rows_del', 'num_rows_read' }
+      = $fulltext =~ m/^Number of rows inserted $d, updated $d, deleted $d, read $d$/m;
+   @{$section}{ 'ins_sec', 'upd_sec', 'del_sec', 'read_sec' }
+      = $fulltext =~ m#^$f inserts/s, $f updates/s, $f deletes/s, $f reads/s$#m;
+   $section->{'main_thread_proc_no'} ||= 0;
+
+   map { $section->{$_} ||= 0 } qw(read_views_open n_reserved_extents);
+   delete $section->{'fulltext'} unless $debug;
+   return 1;
+}
+
+sub parse_lg_section {
+   my ( $section, $complete, $debug, $full ) = @_;
+   return unless $section;
+   my $fulltext = $section->{'fulltext'};
+
+   # Grab the info
+   ( $section->{ 'log_seq_no' } )
+      = $fulltext =~ m/Log sequence number \s*(\d.*)$/m;
+   ( $section->{ 'log_flushed_to' } )
+      = $fulltext =~ m/Log flushed up to \s*(\d.*)$/m;
+   ( $section->{ 'last_chkp' } )
+      = $fulltext =~ m/Last checkpoint at \s*(\d.*)$/m;
+   @{$section}{ 'pending_log_writes', 'pending_chkp_writes' }
+      = $fulltext =~ m/$d pending log writes, $d pending chkp writes/;
+   @{$section}{ 'log_ios_done', 'log_ios_s' }
+      = $fulltext =~ m#$d log i/o's done, $f log i/o's/second#;
+
+   delete $section->{'fulltext'} unless $debug;
+   return 1;
+}
+
+sub parse_ib_section {
+   my ( $section, $complete, $debug, $full ) = @_;
+   return unless $section && $section->{'fulltext'};
+   my $fulltext = $section->{'fulltext'};
+
+   # Some servers will output ibuf information for tablespace 0, as though there
+   # might be many tablespaces with insert buffers.  (In practice I believe
+   # the source code shows there will only ever be one).  I have to parse both
+   # cases here, but I assume there will only be one.
+   @{$section}{ 'size', 'free_list_len', 'seg_size' }
+      = $fulltext =~ m/^Ibuf(?: for space 0)?: size $d, free list len $d, seg size $d,$/m;
+   @{$section}{ 'inserts', 'merged_recs', 'merges' }
+      = $fulltext =~ m/^$d inserts, $d merged recs, $d merges$/m;
+
+   @{$section}{ 'hash_table_size', 'used_cells', 'bufs_in_node_heap' }
+      = $fulltext =~ m/^Hash table size $d, used cells $d, node heap has $d buffer\(s\)$/m;
+   @{$section}{ 'hash_searches_s', 'non_hash_searches_s' }
+      = $fulltext =~ m{^$f hash searches/s, $f non-hash searches/s$}m;
+
+   delete $section->{'fulltext'} unless $debug;
+   return 1;
+}
+
+sub parse_wait_array {
+   my ( $text, $complete, $debug, $full ) = @_;
+   my %result;
+
+   @result{ qw(thread waited_at_filename waited_at_line waited_secs) }
+      = $text =~ m/^--Thread $d has waited at $fl for $f seconds/m;
+
+   # Depending on whether it's a SYNC_MUTEX,RW_LOCK_EX,RW_LOCK_SHARED,
+   # there will be different text output
+   if ( $text =~ m/^Mutex at/m ) {
+      $result{'request_type'} = 'M';
+      @result{ qw( lock_mem_addr lock_cfile_name lock_cline lock_var) }
+         = $text =~ m/^Mutex at $h created file $fl, lock var $d$/m;
+      @result{ qw( waiters_flag )}
+         = $text =~ m/^waiters flag $d$/m;
+   }
+   else {
+      @result{ qw( request_type lock_mem_addr lock_cfile_name lock_cline) }
+         = $text =~ m/^(.)-lock on RW-latch at $h created in file $fl$/m;
+      @result{ qw( writer_thread writer_lock_mode ) }
+         = $text =~ m/^a writer \(thread id $d\) has reserved it in mode  (.*)$/m;
+      @result{ qw( num_readers waiters_flag )}
+         = $text =~ m/^number of readers $d, waiters flag $d$/m;
+      @result{ qw(last_s_file_name last_s_line ) }
+         = $text =~ m/Last time read locked in file $fl$/m;
+      @result{ qw(last_x_file_name last_x_line ) }
+         = $text =~ m/Last time write locked in file $fl$/m;
+   }
+
+   $result{'cell_waiting'} = $text =~ m/^wait has ended$/m ? 0 : 1;
+   $result{'cell_event_set'} = $text =~ m/^wait is ending$/m ? 1 : 0;
+
+   # Because there are two code paths, some things won't get set.
+   map { $result{$_} ||= '' }
+      qw(last_s_file_name last_x_file_name writer_lock_mode);
+   map { $result{$_} ||= 0 }
+      qw(num_readers lock_var last_s_line last_x_line writer_thread);
+
+   return \%result;
+}
+
+sub parse_sm_section {
+   my ( $section, $complete, $debug, $full ) = @_;
+   return 0 unless $section && $section->{'fulltext'};
+   my $fulltext = $section->{'fulltext'};
+
+   # Grab the info
+   @{$section}{ 'reservation_count', 'signal_count' }
+      = $fulltext =~ m/^OS WAIT ARRAY INFO: reservation count $d, signal count $d$/m;
+   @{$section}{ 'mutex_spin_waits', 'mutex_spin_rounds', 'mutex_os_waits' }
+      = $fulltext =~ m/^Mutex spin waits $d, rounds $d, OS waits $d$/m;
+   @{$section}{ 'rw_shared_spins', 'rw_shared_os_waits', 'rw_excl_spins', 'rw_excl_os_waits' }
+      = $fulltext =~ m/^RW-shared spins $d, OS waits $d; RW-excl spins $d, OS waits $d$/m;
+
+   # Look for info on waits.
+   my @waits = $fulltext =~ m/^(--Thread.*?)^(?=Mutex spin|--Thread)/gms;
+   $section->{'waits'} = [ map { parse_wait_array($_, $complete, $debug) } @waits ];
+   $section->{'wait_array_size'} = scalar(@waits);
+
+   delete $section->{'fulltext'} unless $debug;
+   return 1;
+}
+
+# I've read the source for this section.
+sub parse_bp_section {
+   my ( $section, $complete, $debug, $full ) = @_;
+   return unless $section && $section->{'fulltext'};
+   my $fulltext = $section->{'fulltext'};
+
+   # Grab the info
+   @{$section}{ 'total_mem_alloc', 'add_pool_alloc' }
+      = $fulltext =~ m/^Total memory allocated $d; in additional pool allocated $d$/m;
+   @{$section}{'dict_mem_alloc'}     = $fulltext =~ m/Dictionary memory allocated $d/;
+   @{$section}{'awe_mem_alloc'}      = $fulltext =~ m/$d MB of AWE memory/;
+   @{$section}{'buf_pool_size'}      = $fulltext =~ m/^Buffer pool size\s*$d$/m;
+   @{$section}{'buf_free'}           = $fulltext =~ m/^Free buffers\s*$d$/m;
+   @{$section}{'pages_total'}        = $fulltext =~ m/^Database pages\s*$d$/m;
+   @{$section}{'pages_modified'}     = $fulltext =~ m/^Modified db pages\s*$d$/m;
+   @{$section}{'pages_read', 'pages_created', 'pages_written'}
+      = $fulltext =~ m/^Pages read $d, created $d, written $d$/m;
+   @{$section}{'page_reads_sec', 'page_creates_sec', 'page_writes_sec'}
+      = $fulltext =~ m{^$f reads/s, $f creates/s, $f writes/s$}m;
+   @{$section}{'buf_pool_hits', 'buf_pool_reads'}
+      = $fulltext =~ m{Buffer pool hit rate $d / $d$}m;
+   if ($fulltext =~ m/^No buffer pool page gets since the last printout$/m) {
+      @{$section}{'buf_pool_hits', 'buf_pool_reads'} = (0, 0);
+      @{$section}{'buf_pool_hit_rate'} = '--';
+   }
+   else {
+      @{$section}{'buf_pool_hit_rate'}
+         = $fulltext =~ m{Buffer pool hit rate (\d+ / \d+)$}m;
+   }
+   @{$section}{'reads_pending'} = $fulltext =~ m/^Pending reads $d/m;
+   @{$section}{'writes_pending_lru', 'writes_pending_flush_list', 'writes_pending_single_page' }
+      = $fulltext =~ m/^Pending writes: LRU $d, flush list $d, single page $d$/m;
+
+   map { $section->{$_} ||= 0 }
+      qw(writes_pending_lru writes_pending_flush_list writes_pending_single_page
+      awe_mem_alloc dict_mem_alloc);
+   @{$section}{'writes_pending'} = List::Util::sum(
+      @{$section}{ qw(writes_pending_lru writes_pending_flush_list writes_pending_single_page) });
+
+   delete $section->{'fulltext'} unless $debug;
+   return 1;
+}
+
+# I've read the source for this.
+sub parse_io_section {
+   my ( $section, $complete, $debug, $full ) = @_;
+   return unless $section && $section->{'fulltext'};
+   my $fulltext = $section->{'fulltext'};
+   $section->{'threads'} = {};
+
+   # Grab the I/O thread info
+   my @threads = $fulltext =~ m<^(I/O thread \d+ .*)$>gm;
+   foreach my $thread (@threads) {
+      my ( $tid, $state, $purpose, $event_set )
+         = $thread =~ m{I/O thread $d state: (.+?) \((.*)\)(?: ev set)?$}m;
+      if ( defined $tid ) {
+         $section->{'threads'}->{$tid} = {
+            thread    => $tid,
+            state     => $state,
+            purpose   => $purpose,
+            event_set => $event_set ? 1 : 0,
+         };
+      }
+   }
+
+   # Grab the reads/writes/flushes info
+   @{$section}{ 'pending_normal_aio_reads', 'pending_aio_writes' }
+      = $fulltext =~ m/^Pending normal aio reads: $d, aio writes: $d,$/m;
+   @{$section}{ 'pending_ibuf_aio_reads', 'pending_log_ios', 'pending_sync_ios' }
+      = $fulltext =~ m{^ ibuf aio reads: $d, log i/o's: $d, sync i/o's: $d$}m;
+   @{$section}{ 'flush_type', 'pending_log_flushes', 'pending_buffer_pool_flushes' }
+      = $fulltext =~ m/^Pending flushes \($w\) log: $d; buffer pool: $d$/m;
+   @{$section}{ 'os_file_reads', 'os_file_writes', 'os_fsyncs' }
+      = $fulltext =~ m/^$d OS file reads, $d OS file writes, $d OS fsyncs$/m;
+   @{$section}{ 'reads_s', 'avg_bytes_s', 'writes_s', 'fsyncs_s' }
+      = $fulltext =~ m{^$f reads/s, $d avg bytes/read, $f writes/s, $f fsyncs/s$}m;
+   @{$section}{ 'pending_preads', 'pending_pwrites' }
+      = $fulltext =~ m/$d pending preads, $d pending pwrites$/m;
+   @{$section}{ 'pending_preads', 'pending_pwrites' } = (0, 0)
+      unless defined($section->{'pending_preads'});
+
+   delete $section->{'fulltext'} unless $debug;
+   return 1;
+}
+
+sub _debug {
+   my ( $debug, $msg ) = @_;
+   if ( $debug ) {
+      die $msg;
+   }
+   else {
+      warn $msg;
+   }
+   return 1;
+}
+
+1;
+
+# end_of_package InnoDBParser
+
+package main;
+
+use sigtrap qw(handler finish untrapped normal-signals);
+
+use Data::Dumper;
+use DBI;
+use English qw(-no_match_vars);
+use File::Basename qw(dirname);
+use File::Temp;
+use Getopt::Long;
+use List::Util qw(max min maxstr sum);
+use POSIX qw(ceil);
+use Time::HiRes qw(time sleep);
+use Term::ReadKey qw(ReadMode ReadKey);
+
+# License and warranty information. {{{1
+# ###########################################################################
+
+my $innotop_license = <<"LICENSE";
+
+This is innotop version $VERSION, a MySQL and InnoDB monitor.
+
+This program is copyright (c) 2006 Baron Schwartz.
+Feedback and improvements are welcome.
+
+THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation, version 2; OR the Perl Artistic License.  On UNIX and similar
+systems, you can issue `man perlgpl' or `man perlartistic' to read these
+licenses.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA  02111-1307  USA.
+LICENSE
+
+# Configuration information and global setup {{{1
+# ###########################################################################
+
+# Really, really, super-global variables.
+my @config_versions = (
+   "000-000-000", "001-003-000", # config file was one big name-value hash.
+   "001-003-000", "001-004-002", # config file contained non-user-defined stuff.
+);
+
+my $clear_screen_sub;
+my $dsn_parser = new DSNParser();
+
+# This defines expected properties and defaults for the column definitions that
+# eventually end up in tbl_meta.
+my %col_props = (
+   hdr     => '',
+   just    => '-',
+   dec     => 0,     # Whether to align the column on the decimal point
+   num     => 0,
+   label   => '',
+   user    => 0,
+   src     => '',
+   tbl     => '',    # Helps when writing/reading custom columns in config files
+   minw    => 0,
+   maxw    => 0,
+   trans   => [],
+   agg     => 'first',  # Aggregate function
+   aggonly => 0,        # Whether to show only when tbl_meta->{aggregate} is true
+);
+
+# Actual DBI connections to MySQL servers.
+my %dbhs;
+
+# Command-line parameters {{{2
+# ###########################################################################
+
+my @opt_spec = (
+   { s => 'help',       d => 'Show this help message' },
+   { s => 'color|C!',   d => 'Use terminal coloring (default)',   c => 'color' },
+   { s => 'config|c=s', d => 'Config file to read' },
+   { s => 'nonint|n',   d => 'Non-interactive, output tab-separated fields' },
+   { s => 'count=i',    d => 'Number of updates before exiting' },
+   { s => 'delay|d=f',  d => 'Delay between updates in seconds',  c => 'interval' },
+   { s => 'mode|m=s',   d => 'Operating mode to start in',        c => 'mode' },
+   { s => 'inc|i!',     d => 'Measure incremental differences',   c => 'status_inc' },
+   { s => 'write|w',    d => 'Write running configuration into home directory if no config files were loaded' },
+   { s => 'skipcentral|s',     d => 'Skip reading the central configuration file' },
+   { s => 'version',    d => 'Output version information and exit' },
+   { s => 'user|u=s',   d => 'User for login if not current user' },
+   { s => 'password|p=s',   d => 'Password to use for connection' },
+   { s => 'host|h=s',   d => 'Connect to host' },
+   { s => 'port|P=i',   d => 'Port number to use for connection' },
+);
+
+# This is the container for the command-line options' values to be stored in
+# after processing.  Initial values are defaults.
+my %opts = (
+   n => !( -t STDIN && -t STDOUT ), # If in/out aren't to terminals, we're interactive
+);
+# Post-process...
+my %opt_seen;
+foreach my $spec ( @opt_spec ) {
+   my ( $long, $short ) = $spec->{s} =~ m/^(\w+)(?:\|([^!+=]*))?/;
+   $spec->{k} = $short || $long;
+   $spec->{l} = $long;
+   $spec->{t} = $short;
+   $spec->{n} = $spec->{s} =~ m/!/;
+   $opts{$spec->{k}} = undef unless defined $opts{$spec->{k}};
+   die "Duplicate option $spec->{k}" if $opt_seen{$spec->{k}}++;
+}
+
+Getopt::Long::Configure('no_ignore_case', 'bundling');
+GetOptions( map { $_->{s} => \$opts{$_->{k}} } @opt_spec) or $opts{help} = 1;
+
+if ( $opts{version} ) {
+   print "innotop  Ver $VERSION\n";
+   exit(0);
+}
+
+if ( $opts{c} and ! -f $opts{c} ) {
+   print $opts{c} . " doesn't exist.  Exiting.\n";
+   exit(1);
+}
+if ( $opts{'help'} ) {
+   print "Usage: innotop <options> <innodb-status-file>\n\n";
+   my $maxw = max(map { length($_->{l}) + ($_->{n} ? 4 : 0)} @opt_spec);
+   foreach my $spec ( sort { $a->{l} cmp $b->{l} } @opt_spec ) {
+      my $long  = $spec->{n} ? "[no]$spec->{l}" : $spec->{l};
+      my $short = $spec->{t} ? "-$spec->{t}" : '';
+      printf("  --%-${maxw}s %-4s %s\n", $long, $short, $spec->{d});
+   }
+   print <<USAGE;
+
+innotop is a MySQL and InnoDB transaction/status monitor, like 'top' for
+MySQL.  It displays queries, InnoDB transactions, lock waits, deadlocks,
+foreign key errors, open tables, replication status, buffer information,
+row operations, logs, I/O operations, load graph, and more.  You can
+monitor many servers at once with innotop. 
+
+USAGE
+   exit(1);
+}
+
+# Meta-data (table definitions etc) {{{2
+# ###########################################################################
+
+# Expressions {{{3
+# Convenience so I can copy/paste these in several places...
+# ###########################################################################
+my %exprs = (
+   Host              => q{my $host = host || hostname || ''; ($host) = $host =~ m/^((?:[\d.]+(?=:))|(?:[a-zA-Z]\w+))/; return $host || ''},
+   Port              => q{my ($p) = host =~ m/:(.*)$/; return $p || 0},
+   OldVersions       => q{dulint_to_int(IB_tx_trx_id_counter) - dulint_to_int(IB_tx_purge_done_for)},
+   MaxTxnTime        => q/max(map{ $_->{active_secs} } @{ IB_tx_transactions }) || 0/,
+   NumTxns           => q{scalar @{ IB_tx_transactions } },
+   DirtyBufs         => q{ $cur->{IB_bp_pages_modified} / ($cur->{IB_bp_buf_pool_size} || 1) },
+   BufPoolFill       => q{ $cur->{IB_bp_pages_total} / ($cur->{IB_bp_buf_pool_size} || 1) },
+   ServerLoad        => q{ $cur->{Threads_connected}/(Questions||1)/Uptime_hires },
+   TxnTimeRemain     => q{ defined undo_log_entries && defined $pre->{undo_log_entries} && undo_log_entries < $pre->{undo_log_entries} ? undo_log_entries / (($pre->{undo_log_entries} - undo_log_entries)/((active_secs-$pre->{active_secs})||1))||1 : 0},
+   SlaveCatchupRate  => ' defined $cur->{seconds_behind_master} && defined $pre->{seconds_behind_master} && $cur->{seconds_behind_master} < $pre->{seconds_behind_master} ? ($pre->{seconds_behind_master}-$cur->{seconds_behind_master})/($cur->{Uptime_hires}-$pre->{Uptime_hires}) : 0',
+   QcacheHitRatio    => q{(Qcache_hits||0)/(((Com_select||0)+(Qcache_hits||0))||1)},
+);
+
+# ###########################################################################
+# Column definitions {{{3
+# Defines every column in every table. A named column has the following
+# properties:
+#    * hdr    Column header/title
+#    * label  Documentation for humans.
+#    * num    Whether it's numeric (for sorting).
+#    * just   Alignment; generated from num, user-overridable in tbl_meta
+#    * minw, maxw Auto-generated, user-overridable.
+# Values from this hash are just copied to tbl_meta, which is where everything
+# else in the program should read from.
+# ###########################################################################
+
+my %columns = (
+   active_secs                 => { hdr => 'SecsActive',          num => 1, label => 'Seconds transaction has been active', },
+   add_pool_alloc              => { hdr => 'Add\'l Pool',         num => 1, label => 'Additonal pool allocated' },
+   attempted_op                => { hdr => 'Action',              num => 0, label => 'The action that caused the error' },
+   awe_mem_alloc               => { hdr => 'AWE Memory',          num => 1, label => '[Windows] AWE memory allocated' },
+   binlog_cache_overflow       => { hdr => 'Binlog Cache',        num => 1, label => 'Transactions too big for binlog cache that went to disk' },
+   binlog_do_db                => { hdr => 'Binlog Do DB',        num => 0, label => 'binlog-do-db setting' },
+   binlog_ignore_db            => { hdr => 'Binlog Ignore DB',    num => 0, label => 'binlog-ignore-db setting' },
+   bps_in                      => { hdr => 'BpsIn',               num => 1, label => 'Bytes per second received by the server', },
+   bps_out                     => { hdr => 'BpsOut',              num => 1, label => 'Bytes per second sent by the server', },
+   buf_free                    => { hdr => 'Free Bufs',           num => 1, label => 'Buffers free in the buffer pool' },
+   buf_pool_hit_rate           => { hdr => 'Hit Rate',            num => 0, label => 'Buffer pool hit rate' },
+   buf_pool_hits               => { hdr => 'Hits',                num => 1, label => 'Buffer pool hits' },
+   buf_pool_reads              => { hdr => 'Reads',               num => 1, label => 'Buffer pool reads' },
+   buf_pool_size               => { hdr => 'Size',                num => 1, label => 'Buffer pool size' },
+   bufs_in_node_heap           => { hdr => 'Node Heap Bufs',      num => 1, label => 'Buffers in buffer pool node heap' },
+   bytes_behind_master         => { hdr => 'ByteLag',             num => 1, label => 'Bytes the slave lags the master in binlog' },
+   cell_event_set              => { hdr => 'Ending?',             num => 1, label => 'Whether the cell event is set' },
+   cell_waiting                => { hdr => 'Waiting?',            num => 1, label => 'Whether the cell is waiting' },
+   child_db                    => { hdr => 'Child DB',            num => 0, label => 'The database of the child table' },
+   child_index                 => { hdr => 'Child Index',         num => 0, label => 'The index in the child table' },
+   child_table                 => { hdr => 'Child Table',         num => 0, label => 'The child table' },
+   cmd                         => { hdr => 'Cmd',                 num => 0, label => 'Type of command being executed', },
+   cnt                         => { hdr => 'Cnt',                 num => 0, label => 'Count', agg => 'count', aggonly => 1 },
+   connect_retry               => { hdr => 'Connect Retry',       num => 1, label => 'Slave connect-retry timeout' },
+   cxn                         => { hdr => 'CXN',                 num => 0, label => 'Connection from which the data came', },
+   db                          => { hdr => 'DB',                  num => 0, label => 'Current database', },
+   dict_mem_alloc              => { hdr => 'Dict Mem',            num => 1, label => 'Dictionary memory allocated' },
+   dirty_bufs                  => { hdr => 'Dirty Buf',           num => 1, label => 'Dirty buffer pool pages' },
+   dl_txn_num                  => { hdr => 'Num',                 num => 0, label => 'Deadlocked transaction number', },
+   event_set                   => { hdr => 'Evt Set?',            num => 1, label => '[Win32] if a wait event is set', },
+   exec_master_log_pos         => { hdr => 'Exec Master Log Pos', num => 1, label => 'Exec Master Log Position' },
+   fk_name                     => { hdr => 'Constraint',          num => 0, label => 'The name of the FK constraint' },
+   free_list_len               => { hdr => 'Free List Len',       num => 1, label => 'Length of the free list' },
+   has_read_view               => { hdr => 'Rd View',             num => 1, label => 'Whether the transaction has a read view' },
+   hash_searches_s             => { hdr => 'Hash/Sec',            num => 1, label => 'Number of hash searches/sec' },
+   hash_table_size             => { hdr => 'Size',                num => 1, label => 'Number of non-hash searches/sec' },
+   heap_no                     => { hdr => 'Heap',                num => 1, label => 'Heap number' },
+   heap_size                   => { hdr => 'Heap',                num => 1, label => 'Heap size' },
+   history_list_len            => { hdr => 'History',             num => 1, label => 'History list length' },
+   host_and_domain             => { hdr => 'Host',                num => 0, label => 'Hostname/IP and domain' },
+   host_and_port               => { hdr => 'Host/IP',             num => 0, label => 'Hostname or IP address, and port number', },
+   hostname                    => { hdr => 'Host',                num => 0, label => 'Hostname' },
+   index                       => { hdr => 'Index',               num => 0, label => 'The index involved' },
+   index_ref                   => { hdr => 'Index Ref',           num => 0, label => 'Index referenced' },
+   info                        => { hdr => 'Query',               num => 0, label => 'Info or the current query', },
+   insert_intention            => { hdr => 'Ins Intent',          num => 1, label => 'Whether the thread was trying to insert' },
+   inserts                     => { hdr => 'Inserts',             num => 1, label => 'Inserts' },
+   io_bytes_s                  => { hdr => 'Bytes/Sec',           num => 1, label => 'Average I/O bytes/sec' },
+   io_flush_type               => { hdr => 'Flush Type',          num => 0, label => 'I/O Flush Type' },
+   io_fsyncs_s                 => { hdr => 'fsyncs/sec',          num => 1, label => 'I/O fsyncs/sec' },
+   io_reads_s                  => { hdr => 'Reads/Sec',           num => 1, label => 'Average I/O reads/sec' },
+   io_writes_s                 => { hdr => 'Writes/Sec',          num => 1, label => 'Average I/O writes/sec' },
+   ip                          => { hdr => 'IP',                  num => 0, label => 'IP address' },
+   is_name_locked              => { hdr => 'Locked',              num => 1, label => 'Whether table is name locked', },
+   key_buffer_hit              => { hdr => 'KCacheHit',           num => 1, label => 'Key cache hit ratio', },
+   key_len                     => { hdr => 'Key Length',          num => 1, label => 'Number of bytes used in the key' },
+   last_chkp                   => { hdr => 'Last Checkpoint',     num => 0, label => 'Last log checkpoint' },
+   last_errno                  => { hdr => 'Last Errno',          num => 1, label => 'Last error number' },
+   last_error                  => { hdr => 'Last Error',          num => 0, label => 'Last error' },
+   last_s_file_name            => { hdr => 'S-File',              num => 0, label => 'Filename where last read locked' },
+   last_s_line                 => { hdr => 'S-Line',              num => 1, label => 'Line where last read locked' },
+   last_x_file_name            => { hdr => 'X-File',              num => 0, label => 'Filename where last write locked' },
+   last_x_line                 => { hdr => 'X-Line',              num => 1, label => 'Line where last write locked' },
+   last_pct                    => { hdr => 'Pct',                 num => 1, label => 'Last Percentage' },
+   last_total                  => { hdr => 'Last Total',          num => 1, label => 'Last Total' },
+   last_value                  => { hdr => 'Last Incr',           num => 1, label => 'Last Value' },
+   load                        => { hdr => 'Load',                num => 1, label => 'Server load' },
+   lock_cfile_name             => { hdr => 'Crtd File',           num => 0, label => 'Filename where lock created' },
+   lock_cline                  => { hdr => 'Crtd Line',           num => 1, label => 'Line where lock created' },
+   lock_mem_addr               => { hdr => 'Addr',                num => 0, label => 'The lock memory address' },
+   lock_mode                   => { hdr => 'Mode',                num => 0, label => 'The lock mode' },
+   lock_structs                => { hdr => 'LStrcts',             num => 1, label => 'Number of lock structs' },
+   lock_type                   => { hdr => 'Type',                num => 0, label => 'The lock type' },
+   lock_var                    => { hdr => 'Lck Var',             num => 1, label => 'The lock variable' },
+   lock_wait_time              => { hdr => 'Wait',                num => 1, label => 'How long txn has waited for a lock' },
+   log_flushed_to              => { hdr => 'Flushed To',          num => 0, label => 'Log position flushed to' },
+   log_ios_done                => { hdr => 'IO Done',             num => 1, label => 'Log I/Os done' },
+   log_ios_s                   => { hdr => 'IO/Sec',              num => 1, label => 'Average log I/Os per sec' },
+   log_seq_no                  => { hdr => 'Sequence No.',        num => 0, label => 'Log sequence number' },
+   main_thread_id              => { hdr => 'Main Thread ID',      num => 1, label => 'Main thread ID' },
+   main_thread_proc_no         => { hdr => 'Main Thread Proc',    num => 1, label => 'Main thread process number' },
+   main_thread_state           => { hdr => 'Main Thread State',   num => 0, label => 'Main thread state' },
+   master_file                 => { hdr => 'File',                num => 0, label => 'Master file' },
+   master_host                 => { hdr => 'Master',              num => 0, label => 'Master server hostname' },
+   master_log_file             => { hdr => 'Master Log File',     num => 0, label => 'Master log file' },
+   master_port                 => { hdr => 'Master Port',         num => 1, label => 'Master port' },
+   master_pos                  => { hdr => 'Position',            num => 1, label => 'Master position' },
+   master_ssl_allowed          => { hdr => 'Master SSL Allowed',  num => 0, label => 'Master SSL Allowed' },
+   master_ssl_ca_file          => { hdr => 'Master SSL CA File',  num => 0, label => 'Master SSL Cert Auth File' },
+   master_ssl_ca_path          => { hdr => 'Master SSL CA Path',  num => 0, label => 'Master SSL Cert Auth Path' },
+   master_ssl_cert             => { hdr => 'Master SSL Cert',     num => 0, label => 'Master SSL Cert' },
+   master_ssl_cipher           => { hdr => 'Master SSL Cipher',   num => 0, label => 'Master SSL Cipher' },
+   master_ssl_key              => { hdr => 'Master SSL Key',      num => 0, label => 'Master SSL Key' },
+   master_user                 => { hdr => 'Master User',         num => 0, label => 'Master username' },
+   max_txn                     => { hdr => 'MaxTxnTime',          num => 1, label => 'MaxTxn' },
+   merged_recs                 => { hdr => 'Merged Recs',         num => 1, label => 'Merged records' },
+   merges                      => { hdr => 'Merges',              num => 1, label => 'Merges' },
+   mutex_os_waits              => { hdr => 'Waits',               num => 1, label => 'Mutex OS Waits' },
+   mutex_spin_rounds           => { hdr => 'Rounds',              num => 1, label => 'Mutex Spin Rounds' },
+   mutex_spin_waits            => { hdr => 'Spins',               num => 1, label => 'Mutex Spin Waits' },
+   mysql_thread_id             => { hdr => 'ID',                  num => 1, label => 'MySQL connection (thread) ID', },
+   name                        => { hdr => 'Name',                num => 0, label => 'Variable Name' },
+   n_bits                      => { hdr => '# Bits',              num => 1, label => 'Number of bits' },
+   non_hash_searches_s         => { hdr => 'Non-Hash/Sec',        num => 1, label => 'Non-hash searches/sec' },
+   num_deletes                 => { hdr => 'Del',                 num => 1, label => 'Number of deletes' },
+   num_deletes_sec             => { hdr => 'Del/Sec',             num => 1, label => 'Number of deletes' },
+   num_inserts                 => { hdr => 'Ins',                 num => 1, label => 'Number of inserts' },
+   num_inserts_sec             => { hdr => 'Ins/Sec',             num => 1, label => 'Number of inserts' },
+   num_readers                 => { hdr => 'Readers',             num => 1, label => 'Number of readers' },
+   num_reads                   => { hdr => 'Read',                num => 1, label => 'Number of reads' },
+   num_reads_sec               => { hdr => 'Read/Sec',            num => 1, label => 'Number of reads' },
+   num_res_ext                 => { hdr => 'BTree Extents',       num => 1, label => 'Number of extents reserved for B-Tree' },
+   num_rows                    => { hdr => 'Row Count',           num => 1, label => 'Number of rows estimated to examine' },
+   num_times_open              => { hdr => 'In Use',              num => 1, label => '# times table is opened', },
+   num_txns                    => { hdr => 'Txns',                num => 1, label => 'Number of transactions' },
+   num_updates                 => { hdr => 'Upd',                 num => 1, label => 'Number of updates' },
+   num_updates_sec             => { hdr => 'Upd/Sec',             num => 1, label => 'Number of updates' },
+   os_file_reads               => { hdr => 'OS Reads',            num => 1, label => 'OS file reads' },
+   os_file_writes              => { hdr => 'OS Writes',           num => 1, label => 'OS file writes' },
+   os_fsyncs                   => { hdr => 'OS fsyncs',           num => 1, label => 'OS fsyncs' },
+   os_thread_id                => { hdr => 'OS Thread',           num => 1, label => 'The operating system thread ID' },
+   p_aio_writes                => { hdr => 'Async Wrt',           num => 1, label => 'Pending asynchronous I/O writes' },
+   p_buf_pool_flushes          => { hdr => 'Buffer Pool Flushes', num => 1, label => 'Pending buffer pool flushes' },
+   p_ibuf_aio_reads            => { hdr => 'IBuf Async Rds',      num => 1, label => 'Pending insert buffer asynch I/O reads' },
+   p_log_flushes               => { hdr => 'Log Flushes',         num => 1, label => 'Pending log flushes' },
+   p_log_ios                   => { hdr => 'Log I/Os',            num => 1, label => 'Pending log I/O operations' },
+   p_normal_aio_reads          => { hdr => 'Async Rds',           num => 1, label => 'Pending asynchronous I/O reads' },
+   p_preads                    => { hdr => 'preads',              num => 1, label => 'Pending p-reads' },
+   p_pwrites                   => { hdr => 'pwrites',             num => 1, label => 'Pending p-writes' },
+   p_sync_ios                  => { hdr => 'Sync I/Os',           num => 1, label => 'Pending synchronous I/O operations' },
+   page_creates_sec            => { hdr => 'Creates/Sec',         num => 1, label => 'Page creates/sec' },
+   page_no                     => { hdr => 'Page',                num => 1, label => 'Page number' },
+   page_reads_sec              => { hdr => 'Reads/Sec',           num => 1, label => 'Page reads per second' },
+   page_writes_sec             => { hdr => 'Writes/Sec',          num => 1, label => 'Page writes per second' },
+   pages_created               => { hdr => 'Created',             num => 1, label => 'Pages created' },
+   pages_modified              => { hdr => 'Dirty Pages',         num => 1, label => 'Pages modified (dirty)' },
+   pages_read                  => { hdr => 'Reads',               num => 1, label => 'Pages read' },
+   pages_total                 => { hdr => 'Pages',               num => 1, label => 'Pages total' },
+   pages_written               => { hdr => 'Writes',              num => 1, label => 'Pages written' },
+   parent_col                  => { hdr => 'Parent Column',       num => 0, label => 'The referred column in the parent table', },
+   parent_db                   => { hdr => 'Parent DB',           num => 0, label => 'The database of the parent table' },
+   parent_index                => { hdr => 'Parent Index',        num => 0, label => 'The referred index in the parent table' },
+   parent_table                => { hdr => 'Parent Table',        num => 0, label => 'The parent table' },
+   part_id                     => { hdr => 'Part ID',             num => 1, label => 'Sub-part ID of the query' },
+   partitions                  => { hdr => 'Partitions',          num => 0, label => 'Query partitions used' },
+   pct                         => { hdr => 'Pct',                 num => 1, label => 'Percentage' },
+   pending_chkp_writes         => { hdr => 'Chkpt Writes',        num => 1, label => 'Pending log checkpoint writes' },
+   pending_log_writes          => { hdr => 'Log Writes',          num => 1, label => 'Pending log writes' },
+   port                        => { hdr => 'Port',                num => 1, label => 'Client port number', },
+   possible_keys               => { hdr => 'Poss. Keys',          num => 0, label => 'Possible keys' },
+   proc_no                     => { hdr => 'Proc',                num => 1, label => 'Process number' },
+   q_cache_hit                 => { hdr => 'QCacheHit',           num => 1, label => 'Query cache hit ratio', },
+   qps                         => { hdr => 'QPS',                 num => 1, label => 'How many queries/sec', },
+   queries_in_queue            => { hdr => 'Queries Queued',      num => 1, label => 'Queries in queue' },
+   queries_inside              => { hdr => 'Queries Inside',      num => 1, label => 'Queries inside InnoDB' },
+   query_id                    => { hdr => 'Query ID',            num => 1, label => 'Query ID' },
+   query_status                => { hdr => 'Query Status',        num => 0, label => 'The query status' },
+   query_text                  => { hdr => 'Query Text',          num => 0, label => 'The query text' },
+   questions                   => { hdr => 'Questions',           num => 1, label => 'How many queries the server has gotten', },
+   read_master_log_pos         => { hdr => 'Read Master Pos',     num => 1, label => 'Read master log position' },
+   read_views_open             => { hdr => 'Rd Views',            num => 1, label => 'Number of read views open' },
+   reads_pending               => { hdr => 'Pending Reads',       num => 1, label => 'Reads pending' },
+   relay_log_file              => { hdr => 'Relay File',          num => 0, label => 'Relay log file' },
+   relay_log_pos               => { hdr => 'Relay Pos',           num => 1, label => 'Relay log position' },
+   relay_log_size              => { hdr => 'Relay Size',          num => 1, label => 'Relay log size' },
+   relay_master_log_file       => { hdr => 'Relay Master File',   num => 0, label => 'Relay master log file' },
+   replicate_do_db             => { hdr => 'Do DB',               num => 0, label => 'Replicate-do-db setting' },
+   replicate_do_table          => { hdr => 'Do Table',            num => 0, label => 'Replicate-do-table setting' },
+   replicate_ignore_db         => { hdr => 'Ignore DB',           num => 0, label => 'Replicate-ignore-db setting' },
+   replicate_ignore_table      => { hdr => 'Ignore Table',        num => 0, label => 'Replicate-do-table setting' },
+   replicate_wild_do_table     => { hdr => 'Wild Do Table',       num => 0, label => 'Replicate-wild-do-table setting' },
+   replicate_wild_ignore_table => { hdr => 'Wild Ignore Table',   num => 0, label => 'Replicate-wild-ignore-table setting' },
+   request_type                => { hdr => 'Type',                num => 0, label => 'Type of lock the thread waits for' },
+   reservation_count           => { hdr => 'ResCnt',              num => 1, label => 'Reservation Count' },
+   row_locks                   => { hdr => 'RLocks',              num => 1, label => 'Number of row locks' },
+   rw_excl_os_waits            => { hdr => 'RW Waits',            num => 1, label => 'R/W Excl. OS Waits' },
+   rw_excl_spins               => { hdr => 'RW Spins',            num => 1, label => 'R/W Excl. Spins' },
+   rw_shared_os_waits          => { hdr => 'Sh Waits',            num => 1, label => 'R/W Shared OS Waits' },
+   rw_shared_spins             => { hdr => 'Sh Spins',            num => 1, label => 'R/W Shared Spins' },
+   scan_type                   => { hdr => 'Type',                num => 0, label => 'Scan type in chosen' },
+   seg_size                    => { hdr => 'Seg. Size',           num => 1, label => 'Segment size' },
+   select_type                 => { hdr => 'Select Type',         num => 0, label => 'Type of select used' },
+   signal_count                => { hdr => 'Signals',             num => 1, label => 'Signal Count' },
+   size                        => { hdr => 'Size',                num => 1, label => 'Size of the tablespace' },
+   skip_counter                => { hdr => 'Skip Counter',        num => 1, label => 'Skip counter' },
+   slave_catchup_rate          => { hdr => 'Catchup',             num => 1, label => 'How fast the slave is catching up in the binlog' },
+   slave_io_running            => { hdr => 'Slave-IO',            num => 0, label => 'Whether the slave I/O thread is running' },
+   slave_io_state              => { hdr => 'Slave IO State',      num => 0, label => 'Slave I/O thread state' },
+   slave_open_temp_tables      => { hdr => 'Temp',                num => 1, label => 'Slave open temp tables' },
+   slave_sql_running           => { hdr => 'Slave-SQL',           num => 0, label => 'Whether the slave SQL thread is running' },
+   slow                        => { hdr => 'Slow',                num => 1, label => 'How many slow queries', },
+   space_id                    => { hdr => 'Space',               num => 1, label => 'Tablespace ID' },
+   special                     => { hdr => 'Special',             num => 0, label => 'Special/Other info' },
+   state                       => { hdr => 'State',               num => 0, label => 'Connection state', maxw => 18, },
+   tables_in_use               => { hdr => 'Tbl Used',            num => 1, label => 'Number of tables in use' },
+   tables_locked               => { hdr => 'Tbl Lck',             num => 1, label => 'Number of tables locked' },
+   tbl                         => { hdr => 'Table',               num => 0, label => 'Table', },
+   thread                      => { hdr => 'Thread',              num => 1, label => 'Thread number' },
+   thread_decl_inside          => { hdr => 'Thread Inside',       num => 0, label => 'What the thread is declared inside' },
+   thread_purpose              => { hdr => 'Purpose',             num => 0, label => "The thread's purpose" },
+   thread_status               => { hdr => 'Thread Status',       num => 0, label => 'The thread status' },
+   time                        => { hdr => 'Time',                num => 1, label => 'Time since the last event', },
+   time_behind_master          => { hdr => 'TimeLag',             num => 1, label => 'Time slave lags master' },
+   timestring                  => { hdr => 'Timestring',          num => 0, label => 'Time the event occurred' },
+   total                       => { hdr => 'Total',               num => 1, label => 'Total' },
+   total_mem_alloc             => { hdr => 'Memory',              num => 1, label => 'Total memory allocated' },
+   truncates                   => { hdr => 'Trunc',               num => 0, label => 'Whether the deadlock is truncating InnoDB status' },
+   txn_doesnt_see_ge           => { hdr => "Txn Won't See",       num => 0, label => 'Where txn read view is limited' },
+   txn_id                      => { hdr => 'ID',                  num => 0, label => 'Transaction ID' },
+   txn_sees_lt                 => { hdr => 'Txn Sees',            num => 1, label => 'Where txn read view is limited' },
+   txn_status                  => { hdr => 'Txn Status',          num => 0, label => 'Transaction status' },
+   txn_time_remain             => { hdr => 'Remaining',           num => 1, label => 'Time until txn rollback/commit completes' },
+   undo_log_entries            => { hdr => 'Undo',                num => 1, label => 'Number of undo log entries' },
+   undo_for                    => { hdr => 'Undo',                num => 0, label => 'Undo for' },
+   until_condition             => { hdr => 'Until Condition',     num => 0, label => 'Slave until condition' },
+   until_log_file              => { hdr => 'Until Log File',      num => 0, label => 'Slave until log file' },
+   until_log_pos               => { hdr => 'Until Log Pos',       num => 1, label => 'Slave until log position' },
+   used_cells                  => { hdr => 'Cells Used',          num => 1, label => 'Number of cells used' },
+   used_bufs                   => { hdr => 'Used Bufs',           num => 1, label => 'Number of buffer pool pages used' },
+   user                        => { hdr => 'User',                num => 0, label => 'Database username', },
+   value                       => { hdr => 'Value',               num => 1, label => 'Value' },
+   versions                    => { hdr => 'Versions',            num => 1, label => 'Number of InnoDB MVCC versions unpurged' },
+   victim                      => { hdr => 'Victim',              num => 0, label => 'Whether this txn was the deadlock victim' },
+   wait_array_size             => { hdr => 'Wait Array Size',     num => 1, label => 'Wait Array Size' },
+   wait_status                 => { hdr => 'Lock Status',         num => 0, label => 'Status of txn locks' },
+   waited_at_filename          => { hdr => 'File',                num => 0, label => 'Filename at which thread waits' },
+   waited_at_line              => { hdr => 'Line',                num => 1, label => 'Line at which thread waits' },
+   waiters_flag                => { hdr => 'Waiters',             num => 1, label => 'Waiters Flag' },
+   waiting                     => { hdr => 'Waiting',             num => 1, label => 'Whether lock is being waited for' },
+   when                        => { hdr => 'When',                num => 0, label => 'Time scale' },
+   writer_lock_mode            => { hdr => 'Wrtr Lck Mode',       num => 0, label => 'Writer lock mode' },
+   writer_thread               => { hdr => 'Wrtr Thread',         num => 1, label => 'Writer thread ID' },
+   writes_pending              => { hdr => 'Writes',              num => 1, label => 'Number of writes pending' },
+   writes_pending_flush_list   => { hdr => 'Flush List Writes',   num => 1, label => 'Number of flush list writes pending' },
+   writes_pending_lru          => { hdr => 'LRU Writes',          num => 1, label => 'Number of LRU writes pending' },
+   writes_pending_single_page  => { hdr => '1-Page Writes',       num => 1, label => 'Number of 1-page writes pending' },
+);
+
+# Apply a default property or three.  By default, columns are not width-constrained,
+# aligned left, and sorted alphabetically, not numerically.
+foreach my $col ( values %columns ) {
+   map { $col->{$_} ||= 0 } qw(num minw maxw);
+   $col->{just} = $col->{num} ? '' : '-';
+}
+
+# Filters {{{3
+# This hash defines every filter that can be applied to a table.  These
+# become part of tbl_meta as well.  Each filter is just an expression that
+# returns true or false.
+# Properties of each entry:
+#  * func:   the subroutine
+#  * name:   the name, repeated
+#  * user:   whether it's a user-defined filter (saved in config)
+#  * text:   text of the subroutine
+#  * note:   explanation
+my %filters = ();
+
+# These are pre-processed to live in %filters above, by compiling them.
+my %builtin_filters = (
+   hide_self => {
+      text => <<'      END',
+         return ( !$set->{info} || $set->{info} ne 'SHOW FULL PROCESSLIST' )
+             && ( !$set->{query_text}    || $set->{query_text} !~ m/INNODB STATUS$/ );
+      END
+      note => 'Removes the innotop processes from the list',
+      tbls => [qw(innodb_transactions processlist)],
+   },
+   hide_inactive => {
+      text => <<'      END',
+         return ( !defined($set->{txn_status}) || $set->{txn_status} ne 'not started' )
+             && ( !defined($set->{cmd})        || $set->{cmd} !~ m/Sleep|Binlog Dump/ )
+             && ( !defined($set->{info})       || $set->{info} =~ m/\S/               );
+      END
+      note => 'Removes processes which are not doing anything',
+      tbls => [qw(innodb_transactions processlist)],
+   },
+   hide_slave_io => {
+      text => <<'      END',
+         return !$set->{state} || $set->{state} !~ m/^(?:Waiting for master|Has read all relay)/;
+      END
+      note => 'Removes slave I/O threads from the list',
+      tbls => [qw(processlist slave_io_status)],
+   },
+   table_is_open => {
+      text => <<'      END',
+         return $set->{num_times_open} + $set->{is_name_locked};
+      END
+      note => 'Removes tables that are not in use or locked',
+      tbls => [qw(open_tables)],
+   },
+   cxn_is_master => {
+      text => <<'      END',
+         return $set->{master_file} ? 1 : 0;
+      END
+      note => 'Removes servers that are not masters',
+      tbls => [qw(master_status)],
+   },
+   cxn_is_slave => {
+      text => <<'      END',
+         return $set->{master_host} ? 1 : 0;
+      END
+      note => 'Removes servers that are not slaves',
+      tbls => [qw(slave_io_status slave_sql_status)],
+   },
+   thd_is_not_waiting => {
+      text => <<'      END',
+         return $set->{thread_status} !~ m#waiting for i/o request#;
+      END
+      note => 'Removes idle I/O threads',
+      tbls => [qw(io_threads)],
+   },
+);
+foreach my $key ( keys %builtin_filters ) {
+   my ( $sub, $err ) = compile_filter($builtin_filters{$key}->{text});
+   $filters{$key} = {
+      func => $sub,
+      text => $builtin_filters{$key}->{text},
+      user => 0,
+      name => $key, # useful for later
+      note => $builtin_filters{$key}->{note},
+      tbls => $builtin_filters{$key}->{tbls},
+   }
+}
+
+# Variable sets {{{3
+# Sets (arrayrefs) of variables that are used in S mode.  They are read/written to
+# the config file.
+my %var_sets = (
+   general => {
+      text => join(
+         ', ',
+         'set_precision(Questions/Uptime_hires) as QPS',
+         'set_precision(Com_commit/Uptime_hires) as Commit_PS',
+         'set_precision((Com_rollback||0)/(Com_commit||1)) as Rollback_Commit',
+         'set_precision(('
+            . join('+', map { "($_||0)" }
+               qw(Com_delete Com_delete_multi Com_insert Com_insert_select Com_replace
+                  Com_replace_select Com_select Com_update Com_update_multi))
+            . ')/(Com_commit||1)) as Write_Commit',
+         'set_precision((Com_select+(Qcache_hits||0))/(('
+            . join('+', map { "($_||0)" }
+               qw(Com_delete Com_delete_multi Com_insert Com_insert_select Com_replace
+                  Com_replace_select Com_select Com_update Com_update_multi))
+            . ')||1)) as R_W_Ratio',
+         'set_precision(Opened_tables/Uptime_hires) as Opens_PS',
+         'percent($cur->{Open_tables}/($cur->{table_cache})) as Table_Cache_Used',
+         'set_precision(Threads_created/Uptime_hires) as Threads_PS',
+         'percent($cur->{Threads_cached}/($cur->{thread_cache_size}||1)) as Thread_Cache_Used',
+         'percent($cur->{Max_used_connections}/($cur->{max_connections}||1)) as CXN_Used_Ever',
+         'percent($cur->{Threads_connected}/($cur->{max_connections}||1)) as CXN_Used_Now',
+      ),
+   },
+   commands => {
+      text => join(
+         ', ',
+         qw(Uptime Questions Com_delete Com_delete_multi Com_insert
+         Com_insert_select Com_replace Com_replace_select Com_select Com_update
+         Com_update_multi)
+      ),
+   },
+   query_status => {
+      text => join(
+         ',',
+         qw( Uptime Select_full_join Select_full_range_join Select_range
+         Select_range_check Select_scan Slow_queries Sort_merge_passes
+         Sort_range Sort_rows Sort_scan)
+      ),
+   },
+   innodb => {
+      text => join(
+         ',',
+         qw( Uptime Innodb_row_lock_current_waits Innodb_row_lock_time
+         Innodb_row_lock_time_avg Innodb_row_lock_time_max Innodb_row_lock_waits
+         Innodb_rows_deleted Innodb_rows_inserted Innodb_rows_read
+         Innodb_rows_updated)
+      ),
+   },
+   txn => {
+      text => join(
+         ',',
+         qw( Uptime Com_begin Com_commit Com_rollback Com_savepoint
+         Com_xa_commit Com_xa_end Com_xa_prepare Com_xa_recover Com_xa_rollback
+         Com_xa_start)
+      ),
+   },
+   key_cache => {
+      text => join(
+         ',',
+         qw( Uptime Key_blocks_not_flushed Key_blocks_unused Key_blocks_used
+         Key_read_requests Key_reads Key_write_requests Key_writes )
+      ),
+   },
+   query_cache => {
+      text => join(
+         ',',
+         "percent($exprs{QcacheHitRatio}) as Hit_Pct",
+         'set_precision((Qcache_hits||0)/(Qcache_inserts||1)) as Hit_Ins',
+         'set_precision((Qcache_lowmem_prunes||0)/Uptime_hires) as Lowmem_Prunes_sec',
+         'percent(1-((Qcache_free_blocks||0)/(Qcache_total_blocks||1))) as Blocks_used',
+         qw( Qcache_free_blocks Qcache_free_memory Qcache_not_cached Qcache_queries_in_cache)
+      ),
+   },
+   handler => {
+      text => join(
+         ',',
+         qw( Uptime Handler_read_key Handler_read_first Handler_read_next
+         Handler_read_prev Handler_read_rnd Handler_read_rnd_next Handler_delete
+         Handler_update Handler_write)
+      ),
+   },
+   cxns_files_threads => {
+      text => join(
+         ',',
+         qw( Uptime Aborted_clients Aborted_connects Bytes_received Bytes_sent
+         Compression Connections Created_tmp_disk_tables Created_tmp_files
+         Created_tmp_tables Max_used_connections Open_files Open_streams
+         Open_tables Opened_tables Table_locks_immediate Table_locks_waited
+         Threads_cached Threads_connected Threads_created Threads_running)
+      ),
+   },
+   prep_stmt => {
+      text => join(
+         ',',
+         qw( Uptime Com_dealloc_sql Com_execute_sql Com_prepare_sql Com_reset
+         Com_stmt_close Com_stmt_execute Com_stmt_fetch Com_stmt_prepare
+         Com_stmt_reset Com_stmt_send_long_data )
+      ),
+   },
+   innodb_health => {
+      text => join(
+         ',',
+         "$exprs{OldVersions} as OldVersions",
+         qw(IB_sm_mutex_spin_waits IB_sm_mutex_spin_rounds IB_sm_mutex_os_waits),
+         "$exprs{NumTxns} as NumTxns",
+         "$exprs{MaxTxnTime} as MaxTxnTime",
+         qw(IB_ro_queries_inside IB_ro_queries_in_queue),
+         "set_precision($exprs{DirtyBufs} * 100) as dirty_bufs",
+         "set_precision($exprs{BufPoolFill} * 100) as buf_fill",
+         qw(IB_bp_pages_total IB_bp_pages_read IB_bp_pages_written IB_bp_pages_created)
+      ),
+   },
+   innodb_health2 => {
+      text => join(
+         ', ',
+         'percent(1-((Innodb_buffer_pool_pages_free||0)/($cur->{Innodb_buffer_pool_pages_total}||1))) as BP_page_cache_usage',
+         'percent(1-((Innodb_buffer_pool_reads||0)/(Innodb_buffer_pool_read_requests||1))) as BP_cache_hit_ratio',
+         'Innodb_buffer_pool_wait_free',
+         'Innodb_log_waits',
+      ),
+   },
+   slow_queries => {
+      text => join(
+         ', ',
+         'set_precision(Slow_queries/Uptime_hires) as Slow_PS',
+         'set_precision(Select_full_join/Uptime_hires) as Full_Join_PS',
+         'percent(Select_full_join/(Com_select||1)) as Full_Join_Ratio',
+      ),
+   },
+);
+
+# Server sets {{{3
+# Defines sets of servers between which the user can quickly switch.
+my %server_groups;
+
+# Connections {{{3
+# This hash defines server connections.  Each connection is a string that can be passed to
+# the DBI connection.  These are saved in the connections section in the config file.
+my %connections;
+# Defines the parts of connections.
+my @conn_parts = qw(user have_user pass have_pass dsn savepass dl_table);
+
+# Graph widths {{{3
+# This hash defines the max values seen for various status/variable values, for graphing.
+# These are stored in their own section in the config file.  These are just initial values:
+my %mvs = (
+   Com_select   => 50,
+   Com_insert   => 50,
+   Com_update   => 50,
+   Com_delete   => 50,
+   Questions    => 100,
+);
+
+# ###########################################################################
+# Valid Term::ANSIColor color strings.
+# ###########################################################################
+my %ansicolors = map { $_ => 1 }
+   qw( black blink blue bold clear concealed cyan dark green magenta on_black
+       on_blue on_cyan on_green on_magenta on_red on_white on_yellow red reset
+       reverse underline underscore white yellow);
+
+# ###########################################################################
+# Valid comparison operators for color rules
+# ###########################################################################
+my %comp_ops = (
+   '==' => 'Numeric equality',
+   '>'  => 'Numeric greater-than',
+   '<'  => 'Numeric less-than',
+   '>=' => 'Numeric greater-than/equal',
+   '<=' => 'Numeric less-than/equal',
+   '!=' => 'Numeric not-equal',
+   'eq' => 'String equality',
+   'gt' => 'String greater-than',
+   'lt' => 'String less-than',
+   'ge' => 'String greater-than/equal',
+   'le' => 'String less-than/equal',
+   'ne' => 'String not-equal',
+   '=~' => 'Pattern match',
+   '!~' => 'Negated pattern match',
+);
+
+# ###########################################################################
+# Valid aggregate functions.
+# ###########################################################################
+my %agg_funcs = (
+   first => sub {
+      return $_[0]
+   },
+   count => sub {
+      return 0 + @_;
+   },
+   avg   => sub {
+      my @args = grep { defined $_ } @_;
+      return (sum(map { m/([\d\.-]+)/g } @args) || 0) / (scalar(@args) || 1);
+   },
+   sum   => sub {
+      my @args = grep { defined $_ } @_;
+      return sum(@args);
+   }
+);
+
+# ###########################################################################
+# Valid functions for transformations.
+# ###########################################################################
+my %trans_funcs = (
+   shorten      => \&shorten,
+   secs_to_time => \&secs_to_time,
+   no_ctrl_char => \&no_ctrl_char,
+   percent      => \&percent,
+   commify      => \&commify,
+   dulint_to_int => \&dulint_to_int,
+   set_precision => \&set_precision,
+);
+
+# Table definitions {{{3
+# This hash defines every table that can get displayed in every mode.  Each
+# table specifies columns and column data sources.  The column is
+# defined by the %columns hash.
+#
+# Example: foo => { src => 'bar' } means the foo column (look at
+# $columns{foo} for its definition) gets its data from the 'bar' element of
+# the current data set, whatever that is.
+#
+# These columns are post-processed after being defined, because they get stuff
+# from %columns.  After all the config is loaded for columns, there's more
+# post-processing too; the subroutines compiled from src get added to
+# the hash elements for extract_values to use.
+# ###########################################################################
+
+my %tbl_meta = (
+   adaptive_hash_index => {
+      capt => 'Adaptive Hash Index',
+      cust => {},
+      cols => {
+         cxn                 => { src => 'cxn' },
+         hash_table_size     => { src => 'IB_ib_hash_table_size', trans => [qw(shorten)], },
+         used_cells          => { src => 'IB_ib_used_cells' },
+         bufs_in_node_heap   => { src => 'IB_ib_bufs_in_node_heap' },
+         hash_searches_s     => { src => 'IB_ib_hash_searches_s' },
+         non_hash_searches_s => { src => 'IB_ib_non_hash_searches_s' },
+      },
+      visible => [ qw(cxn hash_table_size used_cells bufs_in_node_heap hash_searches_s non_hash_searches_s) ],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'ib',
+      group_by => [],
+      aggregate => 0,
+   },
+   buffer_pool => {
+      capt => 'Buffer Pool',
+      cust => {},
+      cols => {
+         cxn                        => { src => 'cxn' },
+         total_mem_alloc            => { src => 'IB_bp_total_mem_alloc', trans => [qw(shorten)], },
+         awe_mem_alloc              => { src => 'IB_bp_awe_mem_alloc', trans => [qw(shorten)], },
+         add_pool_alloc             => { src => 'IB_bp_add_pool_alloc', trans => [qw(shorten)], },
+         buf_pool_size              => { src => 'IB_bp_buf_pool_size', trans => [qw(shorten)], },
+         buf_free                   => { src => 'IB_bp_buf_free' },
+         buf_pool_hit_rate          => { src => 'IB_bp_buf_pool_hit_rate' },
+         buf_pool_reads             => { src => 'IB_bp_buf_pool_reads' },
+         buf_pool_hits              => { src => 'IB_bp_buf_pool_hits' },
+         dict_mem_alloc             => { src => 'IB_bp_dict_mem_alloc' },
+         pages_total                => { src => 'IB_bp_pages_total' },
+         pages_modified             => { src => 'IB_bp_pages_modified' },
+         reads_pending              => { src => 'IB_bp_reads_pending' },
+         writes_pending             => { src => 'IB_bp_writes_pending' },
+         writes_pending_lru         => { src => 'IB_bp_writes_pending_lru' },
+         writes_pending_flush_list  => { src => 'IB_bp_writes_pending_flush_list' },
+         writes_pending_single_page => { src => 'IB_bp_writes_pending_single_page' },
+         page_creates_sec           => { src => 'IB_bp_page_creates_sec' },
+         page_reads_sec             => { src => 'IB_bp_page_reads_sec' },
+         page_writes_sec            => { src => 'IB_bp_page_writes_sec' },
+         pages_created              => { src => 'IB_bp_pages_created' },
+         pages_read                 => { src => 'IB_bp_pages_read' },
+         pages_written              => { src => 'IB_bp_pages_written' },
+      },
+      visible => [ qw(cxn buf_pool_size buf_free pages_total pages_modified buf_pool_hit_rate total_mem_alloc add_pool_alloc)],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'bp',
+      group_by => [],
+      aggregate => 0,
+   },
+   # TODO: a new step in set_to_tbl: join result to itself, grouped?
+   # TODO: this would also enable pulling Q and T data together.
+   # TODO: using a SQL-ish language would also allow pivots to be easier -- treat the pivoted data as a view and SELECT from it.
+   cmd_summary => {
+      capt => 'Command Summary',
+      cust => {},
+      cols => {
+         name       => { src => 'name' },
+         total      => { src => 'total' },
+         value      => { src => 'value',                     agg   => 'sum'},
+         pct        => { src => 'value/total',               trans => [qw(percent)] },
+         last_total => { src => 'last_total' },
+         last_value => { src => 'last_value',                agg   => 'sum'},
+         last_pct   => { src => 'last_value/last_total',     trans => [qw(percent)] },
+      },
+      visible   => [qw(name value pct last_value last_pct)],
+      filters   => [qw()],
+      sort_cols => '-value',
+      sort_dir  => '1',
+      innodb    => '',
+      group_by  => [qw(name)],
+      aggregate => 1,
+   },
+   deadlock_locks => {
+      capt => 'Deadlock Locks',
+      cust => {},
+      cols => {
+         cxn              => { src => 'cxn' },
+         mysql_thread_id  => { src => 'mysql_thread_id' },
+         dl_txn_num       => { src => 'dl_txn_num' },
+         lock_type        => { src => 'lock_type' },
+         space_id         => { src => 'space_id' },
+         page_no          => { src => 'page_no' },
+         heap_no          => { src => 'heap_no' },
+         n_bits           => { src => 'n_bits' },
+         index            => { src => 'index' },
+         db               => { src => 'db' },
+         tbl              => { src => 'table' },
+         lock_mode        => { src => 'lock_mode' },
+         special          => { src => 'special' },
+         insert_intention => { src => 'insert_intention' },
+         waiting          => { src => 'waiting' },
+      },
+      visible => [ qw(cxn mysql_thread_id waiting lock_mode db tbl index special insert_intention)],
+      filters => [],
+      sort_cols => 'cxn mysql_thread_id',
+      sort_dir => '1',
+      innodb   => 'dl',
+      group_by => [],
+      aggregate => 0,
+   },
+   deadlock_transactions => {
+      capt => 'Deadlock Transactions',
+      cust => {},
+      cols => {
+         cxn                => { src => 'cxn' },
+         active_secs        => { src => 'active_secs' },
+         dl_txn_num         => { src => 'dl_txn_num' },
+         has_read_view      => { src => 'has_read_view' },
+         heap_size          => { src => 'heap_size' },
+         host_and_domain    => { src => 'hostname' },
+         hostname           => { src => $exprs{Host} },
+         ip                 => { src => 'ip' },
+         lock_structs       => { src => 'lock_structs' },
+         lock_wait_time     => { src => 'lock_wait_time', trans => [ qw(secs_to_time) ] },
+         mysql_thread_id    => { src => 'mysql_thread_id' },
+         os_thread_id       => { src => 'os_thread_id' },
+         proc_no            => { src => 'proc_no' },
+         query_id           => { src => 'query_id' },
+         query_status       => { src => 'query_status' },
+         query_text         => { src => 'query_text', trans => [ qw(no_ctrl_char) ] },
+         row_locks          => { src => 'row_locks' },
+         tables_in_use      => { src => 'tables_in_use' },
+         tables_locked      => { src => 'tables_locked' },
+         thread_decl_inside => { src => 'thread_decl_inside' },
+         thread_status      => { src => 'thread_status' },
+         'time'             => { src => 'active_secs', trans => [ qw(secs_to_time) ] },
+         timestring         => { src => 'timestring' },
+         txn_doesnt_see_ge  => { src => 'txn_doesnt_see_ge' },
+         txn_id             => { src => 'txn_id' },
+         txn_sees_lt        => { src => 'txn_sees_lt' },
+         txn_status         => { src => 'txn_status' },
+         truncates          => { src => 'truncates' },
+         undo_log_entries   => { src => 'undo_log_entries' },
+         user               => { src => 'user' },
+         victim             => { src => 'victim' },
+         wait_status        => { src => 'lock_wait_status' },
+      },
+      visible => [ qw(cxn mysql_thread_id timestring user hostname victim time undo_log_entries lock_structs query_text)],
+      filters => [],
+      sort_cols => 'cxn mysql_thread_id',
+      sort_dir => '1',
+      innodb   => 'dl',
+      group_by => [],
+      aggregate => 0,
+   },
+   explain => {
+      capt => 'EXPLAIN Results',
+      cust => {},
+      cols => {
+         part_id       => { src => 'id' },
+         select_type   => { src => 'select_type' },
+         tbl           => { src => 'table' },
+         partitions    => { src => 'partitions' },
+         scan_type     => { src => 'type' },
+         possible_keys => { src => 'possible_keys' },
+         index         => { src => 'key' },
+         key_len       => { src => 'key_len' },
+         index_ref     => { src => 'ref' },
+         num_rows      => { src => 'rows' },
+         special       => { src => 'extra' },
+      },
+      visible => [ qw(select_type tbl partitions scan_type possible_keys index key_len index_ref num_rows special)],
+      filters => [],
+      sort_cols => '',
+      sort_dir => '1',
+      innodb   => '',
+      group_by => [],
+      aggregate => 0,
+   },
+   file_io_misc => {
+      capt => 'File I/O Misc',
+      cust => {},
+      cols => {
+         cxn            => { src => 'cxn' },
+         io_bytes_s     => { src => 'IB_io_avg_bytes_s' },
+         io_flush_type  => { src => 'IB_io_flush_type' },
+         io_fsyncs_s    => { src => 'IB_io_fsyncs_s' },
+         io_reads_s     => { src => 'IB_io_reads_s' },
+         io_writes_s    => { src => 'IB_io_writes_s' },
+         os_file_reads  => { src => 'IB_io_os_file_reads' },
+         os_file_writes => { src => 'IB_io_os_file_writes' },
+         os_fsyncs      => { src => 'IB_io_os_fsyncs' },
+      },
+      visible => [ qw(cxn os_file_reads os_file_writes os_fsyncs io_reads_s io_writes_s io_bytes_s)],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'io',
+      group_by => [],
+      aggregate => 0,
+   },
+   fk_error => {
+      capt => 'Foreign Key Error Info',
+      cust => {},
+      cols => {
+         timestring   => { src => 'IB_fk_timestring' },
+         child_db     => { src => 'IB_fk_child_db' },
+         child_table  => { src => 'IB_fk_child_table' },
+         child_index  => { src => 'IB_fk_child_index' },
+         fk_name      => { src => 'IB_fk_fk_name' },
+         parent_db    => { src => 'IB_fk_parent_db' },
+         parent_table => { src => 'IB_fk_parent_table' },
+         parent_col   => { src => 'IB_fk_parent_col' },
+         parent_index => { src => 'IB_fk_parent_index' },
+         attempted_op => { src => 'IB_fk_attempted_op' },
+      },
+      visible => [ qw(timestring child_db child_table child_index parent_db parent_table parent_col parent_index fk_name attempted_op)],
+      filters => [],
+      sort_cols => '',
+      sort_dir => '1',
+      innodb   => 'fk',
+      group_by => [],
+      aggregate => 0,
+   },
+   insert_buffers => {
+      capt => 'Insert Buffers',
+      cust => {},
+      cols => {
+         cxn           => { src => 'cxn' },
+         inserts       => { src => 'IB_ib_inserts' },
+         merged_recs   => { src => 'IB_ib_merged_recs' },
+         merges        => { src => 'IB_ib_merges' },
+         size          => { src => 'IB_ib_size' },
+         free_list_len => { src => 'IB_ib_free_list_len' },
+         seg_size      => { src => 'IB_ib_seg_size' },
+      },
+      visible => [ qw(cxn inserts merged_recs merges size free_list_len seg_size)],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'ib',
+      group_by => [],
+      aggregate => 0,
+   },
+   innodb_locks  => {
+      capt => 'InnoDB Locks',
+      cust => {},
+      cols => {
+         cxn              => { src => 'cxn' },
+         db               => { src => 'db' },
+         index            => { src => 'index' },
+         insert_intention => { src => 'insert_intention' },
+         lock_mode        => { src => 'lock_mode' },
+         lock_type        => { src => 'lock_type' },
+         lock_wait_time   => { src => 'lock_wait_time', trans => [ qw(secs_to_time) ] },
+         mysql_thread_id  => { src => 'mysql_thread_id' },
+         n_bits           => { src => 'n_bits' },
+         page_no          => { src => 'page_no' },
+         space_id         => { src => 'space_id' },
+         special          => { src => 'special' },
+         tbl              => { src => 'table' },
+         'time'           => { src => 'active_secs', hdr => 'Active', trans => [ qw(secs_to_time) ] },
+         txn_id           => { src => 'txn_id' },
+         waiting          => { src => 'waiting' },
+      },
+      visible => [ qw(cxn mysql_thread_id lock_type waiting lock_wait_time time lock_mode db tbl index insert_intention special)],
+      filters => [],
+      sort_cols => 'cxn -lock_wait_time',
+      sort_dir => '1',
+      innodb   => 'tx',
+      colors   => [
+         { col => 'lock_wait_time', op => '>',  arg => 60, color => 'red' },
+         { col => 'lock_wait_time', op => '>',  arg => 30, color => 'yellow' },
+         { col => 'lock_wait_time', op => '>',  arg => 10, color => 'green' },
+      ],
+      group_by => [],
+      aggregate => 0,
+   },
+   innodb_transactions => {
+      capt => 'InnoDB Transactions',
+      cust => {},
+      cols => {
+         cxn                => { src => 'cxn' },
+         active_secs        => { src => 'active_secs' },
+         has_read_view      => { src => 'has_read_view' },
+         heap_size          => { src => 'heap_size' },
+         hostname           => { src => $exprs{Host} },
+         ip                 => { src => 'ip' },
+         wait_status        => { src => 'lock_wait_status' },
+         lock_wait_time     => { src => 'lock_wait_time',      trans => [ qw(secs_to_time) ] },
+         lock_structs       => { src => 'lock_structs' },
+         mysql_thread_id    => { src => 'mysql_thread_id' },
+         os_thread_id       => { src => 'os_thread_id' },
+         proc_no            => { src => 'proc_no' },
+         query_id           => { src => 'query_id' },
+         query_status       => { src => 'query_status' },
+         query_text         => { src => 'query_text',          trans => [ qw(no_ctrl_char) ] },
+         txn_time_remain    => { src => $exprs{TxnTimeRemain}, trans => [ qw(secs_to_time) ] },
+         row_locks          => { src => 'row_locks' },
+         tables_in_use      => { src => 'tables_in_use' },
+         tables_locked      => { src => 'tables_locked' },
+         thread_decl_inside => { src => 'thread_decl_inside' },
+         thread_status      => { src => 'thread_status' },
+         'time'             => { src => 'active_secs',         trans => [ qw(secs_to_time) ], agg => 'sum' },
+         txn_doesnt_see_ge  => { src => 'txn_doesnt_see_ge' },
+         txn_id             => { src => 'txn_id' },
+         txn_sees_lt        => { src => 'txn_sees_lt' },
+         txn_status         => { src => 'txn_status',          minw => 10, maxw => 10 },
+         undo_log_entries   => { src => 'undo_log_entries' },
+         user               => { src => 'user',                maxw => 10 },
+         cnt                => { src => 'mysql_thread_id',     minw => 0 },
+      },
+      visible => [ qw(cxn cnt mysql_thread_id user hostname txn_status time undo_log_entries query_text)],
+      filters => [ qw( hide_self hide_inactive ) ],
+      sort_cols => '-active_secs txn_status cxn mysql_thread_id',
+      sort_dir => '1',
+      innodb   => 'tx',
+      hide_caption => 1,
+      colors   => [
+         { col => 'wait_status', op => 'eq', arg => 'LOCK WAIT',   color => 'black on_red' },
+         { col => 'time',        op => '>',  arg => 600,           color => 'red' },
+         { col => 'time',        op => '>',  arg => 300,           color => 'yellow' },
+         { col => 'time',        op => '>',  arg => 60,            color => 'green' },
+         { col => 'time',        op => '>',  arg => 30,            color => 'cyan' },
+         { col => 'txn_status',  op => 'eq', arg => 'not started', color => 'white' },
+      ],
+      group_by => [ qw(cxn txn_status) ],
+      aggregate => 0,
+   },
+   io_threads => {
+      capt => 'I/O Threads',
+      cust => {},
+      cols => {
+         cxn            => { src => 'cxn' },
+         thread         => { src => 'thread' },
+         thread_purpose => { src => 'purpose' },
+         event_set      => { src => 'event_set' },
+         thread_status  => { src => 'state' },
+      },
+      visible => [ qw(cxn thread thread_purpose thread_status)],
+      filters => [ qw() ],
+      sort_cols => 'cxn thread',
+      sort_dir => '1',
+      innodb   => 'io',
+      group_by => [],
+      aggregate => 0,
+   },
+   log_statistics => {
+      capt => 'Log Statistics',
+      cust => {},
+      cols => {
+         cxn                 => { src => 'cxn' },
+         last_chkp           => { src => 'IB_lg_last_chkp' },
+         log_flushed_to      => { src => 'IB_lg_log_flushed_to' },
+         log_ios_done        => { src => 'IB_lg_log_ios_done' },
+         log_ios_s           => { src => 'IB_lg_log_ios_s' },
+         log_seq_no          => { src => 'IB_lg_log_seq_no' },
+         pending_chkp_writes => { src => 'IB_lg_pending_chkp_writes' },
+         pending_log_writes  => { src => 'IB_lg_pending_log_writes' },
+      },
+      visible => [ qw(cxn log_seq_no log_flushed_to last_chkp log_ios_done log_ios_s)],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'lg',
+      group_by => [],
+      aggregate => 0,
+   },
+   master_status => {
+      capt => 'Master Status',
+      cust => {},
+      cols => {
+         cxn                         => { src => 'cxn' },
+         binlog_do_db                => { src => 'binlog_do_db' },
+         binlog_ignore_db            => { src => 'binlog_ignore_db' },
+         master_file                 => { src => 'file' },
+         master_pos                  => { src => 'position' },
+         binlog_cache_overflow       => { src => '(Binlog_cache_disk_use||0)/(Binlog_cache_use||1)', trans => [ qw(percent) ] },
+      },
+      visible => [ qw(cxn master_file master_pos binlog_cache_overflow)],
+      filters => [ qw(cxn_is_master) ],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => '',
+      group_by => [],
+      aggregate => 0,
+   },
+   pending_io => {
+      capt => 'Pending I/O',
+      cust => {},
+      cols => {
+         cxn                => { src => 'cxn' },
+         p_normal_aio_reads => { src => 'IB_io_pending_normal_aio_reads' },
+         p_aio_writes       => { src => 'IB_io_pending_aio_writes' },
+         p_ibuf_aio_reads   => { src => 'IB_io_pending_ibuf_aio_reads' },
+         p_sync_ios         => { src => 'IB_io_pending_sync_ios' },
+         p_buf_pool_flushes => { src => 'IB_io_pending_buffer_pool_flushes' },
+         p_log_flushes      => { src => 'IB_io_pending_log_flushes' },
+         p_log_ios          => { src => 'IB_io_pending_log_ios' },
+         p_preads           => { src => 'IB_io_pending_preads' },
+         p_pwrites          => { src => 'IB_io_pending_pwrites' },
+      },
+      visible => [ qw(cxn p_normal_aio_reads p_aio_writes p_ibuf_aio_reads p_sync_ios p_log_flushes p_log_ios)],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'io',
+      group_by => [],
+      aggregate => 0,
+   },
+   open_tables => {
+      capt => 'Open Tables',
+      cust => {},
+      cols => {
+         cxn            => { src => 'cxn' },
+         db             => { src => 'database' },
+         tbl            => { src => 'table' },
+         num_times_open => { src => 'in_use' },
+         is_name_locked => { src => 'name_locked' },
+      },
+      visible => [ qw(cxn db tbl num_times_open is_name_locked)],
+      filters => [ qw(table_is_open) ],
+      sort_cols => '-num_times_open cxn db tbl',
+      sort_dir => '1',
+      innodb   => '',
+      group_by => [],
+      aggregate => 0,
+   },
+   page_statistics => {
+      capt => 'Page Statistics',
+      cust => {},
+      cols => {
+         cxn              => { src => 'cxn' },
+         pages_read       => { src => 'IB_bp_pages_read' },
+         pages_written    => { src => 'IB_bp_pages_written' },
+         pages_created    => { src => 'IB_bp_pages_created' },
+         page_reads_sec   => { src => 'IB_bp_page_reads_sec' },
+         page_writes_sec  => { src => 'IB_bp_page_writes_sec' },
+         page_creates_sec => { src => 'IB_bp_page_creates_sec' },
+      },
+      visible => [ qw(cxn pages_read pages_written pages_created page_reads_sec page_writes_sec page_creates_sec)],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'bp',
+      group_by => [],
+      aggregate => 0,
+   },
+   processlist => {
+      capt => 'MySQL Process List',
+      cust => {},
+      cols => {
+         cxn             => { src => 'cxn',        minw => 6,  maxw => 10 },
+         mysql_thread_id => { src => 'id',         minw => 6,  maxw => 0 },
+         user            => { src => 'user',       minw => 5,  maxw => 8 },
+         hostname        => { src => $exprs{Host}, minw => 13, maxw => 8, },
+         port            => { src => $exprs{Port}, minw => 0,  maxw => 0, },
+         host_and_port   => { src => 'host',       minw => 0,  maxw => 0 },
+         db              => { src => 'db',         minw => 6,  maxw => 12 },
+         cmd             => { src => 'command',    minw => 5,  maxw => 0 },
+         time            => { src => 'time',       minw => 5,  maxw => 0, trans => [ qw(secs_to_time) ], agg => 'sum' },
+         state           => { src => 'state',      minw => 0,  maxw => 0 },
+         info            => { src => 'info',       minw => 0,  maxw => 0, trans => [ qw(no_ctrl_char) ] },
+         cnt             => { src => 'id',         minw => 0,  maxw => 0 },
+      },
+      visible => [ qw(cxn cmd cnt mysql_thread_id state user hostname db time info)],
+      filters => [ qw(hide_self hide_inactive hide_slave_io) ],
+      sort_cols => '-time cxn hostname mysql_thread_id',
+      sort_dir => '1',
+      innodb   => '',
+      hide_caption => 1,
+      colors   => [
+         { col => 'state',       op => 'eq', arg => 'Locked',      color => 'black on_red' },
+         { col => 'cmd',         op => 'eq', arg => 'Sleep',       color => 'white' },
+         { col => 'user',        op => 'eq', arg => 'system user', color => 'white' },
+         { col => 'cmd',         op => 'eq', arg => 'Connect',     color => 'white' },
+         { col => 'cmd',         op => 'eq', arg => 'Binlog Dump', color => 'white' },
+         { col => 'time',        op => '>',  arg => 600,           color => 'red' },
+         { col => 'time',        op => '>',  arg => 120,           color => 'yellow' },
+         { col => 'time',        op => '>',  arg => 60,            color => 'green' },
+         { col => 'time',        op => '>',  arg => 30,            color => 'cyan' },
+      ],
+      group_by => [qw(cxn cmd)],
+      aggregate => 0,
+   },
+
+   # TODO: some more columns:
+   # kb_used=hdr='BufUsed' minw='0' num='0' src='percent(1 - ((Key_blocks_unused * key_cache_block_size) / (key_buffer_size||1)))' dec='0' trans='' tbl='q_header' just='-' user='1' maxw='0' label='User-defined'
+   # retries=hdr='Retries' minw='0' num='0' src='Slave_retried_transactions' dec='0' trans='' tbl='slave_sql_status' just='-' user='1' maxw='0' label='User-defined'
+   # thd=hdr='Thd' minw='0' num='0' src='Threads_connected' dec='0' trans='' tbl='slave_sql_status' just='-' user='1' maxw='0' label='User-defined'
+
+   q_header => {
+      capt => 'Q-mode Header',
+      cust => {},
+      cols => {
+         cxn            => { src => 'cxn' },
+         questions      => { src => 'Questions' },
+         qps            => { src => 'Questions/Uptime_hires',               dec => 1, trans => [qw(shorten)] },
+         load           => { src => $exprs{ServerLoad},                     dec => 1, trans => [qw(shorten)] },
+         slow           => { src => 'Slow_queries',                         dec => 1, trans => [qw(shorten)] },
+         q_cache_hit    => { src => $exprs{QcacheHitRatio},                 dec => 1, trans => [qw(percent)] },
+         key_buffer_hit => { src => '1-(Key_reads/(Key_read_requests||1))', dec => 1, trans => [qw(percent)] },
+         bps_in         => { src => 'Bytes_received/Uptime_hires',          dec => 1, trans => [qw(shorten)] },
+         bps_out        => { src => 'Bytes_sent/Uptime_hires',              dec => 1, trans => [qw(shorten)] },
+         when           => { src => 'when' },
+      },
+      visible => [ qw(cxn when load qps slow q_cache_hit key_buffer_hit bps_in bps_out)],
+      filters => [],
+      sort_cols => 'when cxn',
+      sort_dir => '1',
+      innodb   => '',
+      hide_caption => 1,
+      group_by => [],
+      aggregate => 0,
+   },
+   row_operations => {
+      capt => 'InnoDB Row Operations',
+      cust => {},
+      cols => {
+         cxn         => { src => 'cxn' },
+         num_inserts => { src => 'IB_ro_num_rows_ins' },
+         num_updates => { src => 'IB_ro_num_rows_upd' },
+         num_reads   => { src => 'IB_ro_num_rows_read' },
+         num_deletes => { src => 'IB_ro_num_rows_del' },
+         num_inserts_sec => { src => 'IB_ro_ins_sec' },
+         num_updates_sec => { src => 'IB_ro_upd_sec' },
+         num_reads_sec   => { src => 'IB_ro_read_sec' },
+         num_deletes_sec => { src => 'IB_ro_del_sec' },
+      },
+      visible => [ qw(cxn num_inserts num_updates num_reads num_deletes num_inserts_sec
+                       num_updates_sec num_reads_sec num_deletes_sec)],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'ro',
+      group_by => [],
+      aggregate => 0,
+   },
+   row_operation_misc => {
+      capt => 'Row Operation Misc',
+      cust => {},
+      cols => {
+         cxn                 => { src => 'cxn' },
+         queries_in_queue    => { src => 'IB_ro_queries_in_queue' },
+         queries_inside      => { src => 'IB_ro_queries_inside' },
+         read_views_open     => { src => 'IB_ro_read_views_open' },
+         main_thread_id      => { src => 'IB_ro_main_thread_id' },
+         main_thread_proc_no => { src => 'IB_ro_main_thread_proc_no' },
+         main_thread_state   => { src => 'IB_ro_main_thread_state' },
+         num_res_ext         => { src => 'IB_ro_n_reserved_extents' },
+      },
+      visible => [ qw(cxn queries_in_queue queries_inside read_views_open main_thread_state)],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'ro',
+      group_by => [],
+      aggregate => 0,
+   },
+   semaphores => {
+      capt => 'InnoDB Semaphores',
+      cust => {},
+      cols => {
+         cxn                => { src => 'cxn' },
+         mutex_os_waits     => { src => 'IB_sm_mutex_os_waits' },
+         mutex_spin_rounds  => { src => 'IB_sm_mutex_spin_rounds' },
+         mutex_spin_waits   => { src => 'IB_sm_mutex_spin_waits' },
+         reservation_count  => { src => 'IB_sm_reservation_count' },
+         rw_excl_os_waits   => { src => 'IB_sm_rw_excl_os_waits' },
+         rw_excl_spins      => { src => 'IB_sm_rw_excl_spins' },
+         rw_shared_os_waits => { src => 'IB_sm_rw_shared_os_waits' },
+         rw_shared_spins    => { src => 'IB_sm_rw_shared_spins' },
+         signal_count       => { src => 'IB_sm_signal_count' },
+         wait_array_size    => { src => 'IB_sm_wait_array_size' },
+      },
+      visible => [ qw(cxn mutex_os_waits mutex_spin_waits mutex_spin_rounds
+         rw_excl_os_waits rw_excl_spins rw_shared_os_waits rw_shared_spins
+         signal_count reservation_count )],
+      filters => [],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => 'sm',
+      group_by => [],
+      aggregate => 0,
+   },
+   slave_io_status => {
+      capt => 'Slave I/O Status',
+      cust => {},
+      cols => {
+         cxn                         => { src => 'cxn' },
+         connect_retry               => { src => 'connect_retry' },
+         master_host                 => { src => 'master_host', hdr => 'Master'},
+         master_log_file             => { src => 'master_log_file', hdr => 'File' },
+         master_port                 => { src => 'master_port' },
+         master_ssl_allowed          => { src => 'master_ssl_allowed' },
+         master_ssl_ca_file          => { src => 'master_ssl_ca_file' },
+         master_ssl_ca_path          => { src => 'master_ssl_ca_path' },
+         master_ssl_cert             => { src => 'master_ssl_cert' },
+         master_ssl_cipher           => { src => 'master_ssl_cipher' },
+         master_ssl_key              => { src => 'master_ssl_key' },
+         master_user                 => { src => 'master_user' },
+         read_master_log_pos         => { src => 'read_master_log_pos', hdr => 'Pos' },
+         relay_log_size              => { src => 'relay_log_space', trans => [qw(shorten)] },
+         slave_io_running            => { src => 'slave_io_running', hdr => 'On?' },
+         slave_io_state              => { src => 'slave_io_state', hdr => 'State' },
+      },
+      visible => [ qw(cxn master_host slave_io_running master_log_file relay_log_size read_master_log_pos slave_io_state)],
+      filters => [ qw( cxn_is_slave ) ],
+      sort_cols => 'slave_io_running cxn',
+      colors   => [
+         { col => 'slave_io_running',  op => 'ne', arg => 'Yes', color => 'black on_red' },
+      ],
+      sort_dir => '1',
+      innodb   => '',
+      group_by => [],
+      aggregate => 0,
+   },
+   slave_sql_status => {
+      capt => 'Slave SQL Status',
+      cust => {},
+      cols => {
+         cxn                         => { src => 'cxn' },
+         exec_master_log_pos         => { src => 'exec_master_log_pos', hdr => 'Master Pos' },
+         last_errno                  => { src => 'last_errno' },
+         last_error                  => { src => 'last_error' },
+         master_host                 => { src => 'master_host', hdr => 'Master' },
+         relay_log_file              => { src => 'relay_log_file' },
+         relay_log_pos               => { src => 'relay_log_pos' },
+         relay_log_size              => { src => 'relay_log_space', trans => [qw(shorten)] },
+         relay_master_log_file       => { src => 'relay_master_log_file', hdr => 'Master File' },
+         replicate_do_db             => { src => 'replicate_do_db' },
+         replicate_do_table          => { src => 'replicate_do_table' },
+         replicate_ignore_db         => { src => 'replicate_ignore_db' },
+         replicate_ignore_table      => { src => 'replicate_ignore_table' },
+         replicate_wild_do_table     => { src => 'replicate_wild_do_table' },
+         replicate_wild_ignore_table => { src => 'replicate_wild_ignore_table' },
+         skip_counter                => { src => 'skip_counter' },
+         slave_sql_running           => { src => 'slave_sql_running', hdr => 'On?' },
+         until_condition             => { src => 'until_condition' },
+         until_log_file              => { src => 'until_log_file' },
+         until_log_pos               => { src => 'until_log_pos' },
+         time_behind_master          => { src => 'seconds_behind_master', trans => [ qw(secs_to_time) ] },
+         bytes_behind_master         => { src => 'master_log_file && master_log_file eq relay_master_log_file ? read_master_log_pos - exec_master_log_pos : 0', trans => [qw(shorten)] },
+         slave_catchup_rate          => { src => $exprs{SlaveCatchupRate}, trans => [ qw(set_precision) ] },
+         slave_open_temp_tables      => { src => 'Slave_open_temp_tables' },
+      },
+      visible => [ qw(cxn master_host slave_sql_running time_behind_master slave_catchup_rate slave_open_temp_tables relay_log_pos last_error)],
+      filters => [ qw( cxn_is_slave ) ],
+      sort_cols => 'slave_sql_running cxn',
+      sort_dir => '1',
+      innodb   => '',
+      colors   => [
+         { col => 'slave_sql_running',  op => 'ne', arg => 'Yes', color => 'black on_red' },
+         { col => 'time_behind_master', op => '>',  arg => 600,   color => 'red' },
+         { col => 'time_behind_master', op => '>',  arg => 60,    color => 'yellow' },
+         { col => 'time_behind_master', op => '==', arg => 0,     color => 'white' },
+      ],
+      group_by => [],
+      aggregate => 0,
+   },
+   t_header => {
+      capt => 'T-Mode Header',
+      cust => {},
+      cols => {
+         cxn                         => { src => 'cxn' },
+         dirty_bufs                  => { src => $exprs{DirtyBufs},           trans => [qw(percent)] },
+         history_list_len            => { src => 'IB_tx_history_list_len' },
+         lock_structs                => { src => 'IB_tx_num_lock_structs' },
+         num_txns                    => { src => $exprs{NumTxns} },
+         max_txn                     => { src => $exprs{MaxTxnTime},          trans => [qw(secs_to_time)] },
+         undo_for                    => { src => 'IB_tx_purge_undo_for' },
+         used_bufs                   => { src => $exprs{BufPoolFill},         trans => [qw(percent)]},
+         versions                    => { src => $exprs{OldVersions} },
+      },
+      visible => [ qw(cxn history_list_len versions undo_for dirty_bufs used_bufs num_txns max_txn lock_structs)],
+      filters => [ ],
+      sort_cols => 'cxn',
+      sort_dir => '1',
+      innodb   => '',
+      colors   => [],
+      hide_caption => 1,
+      group_by => [],
+      aggregate => 0,
+   },
+   var_status => {
+      capt      => 'Variables & Status',
+      cust      => {},
+      cols      => {}, # Generated from current varset
+      visible   => [], # Generated from current varset
+      filters   => [],
+      sort_cols => '',
+      sort_dir  => 1,
+      innodb    => '',
+      temp      => 1, # Do not persist to config file.
+      hide_caption  => 1,
+      pivot     => 0,
+      group_by => [],
+      aggregate => 0,
+   },
+   wait_array => {
+      capt => 'InnoDB Wait Array',
+      cust => {},
+      cols => {
+         cxn                => { src => 'cxn' },
+         thread             => { src => 'thread' },
+         waited_at_filename => { src => 'waited_at_filename' },
+         waited_at_line     => { src => 'waited_at_line' },
+         'time'             => { src => 'waited_secs', trans => [ qw(secs_to_time) ] },
+         request_type       => { src => 'request_type' },
+         lock_mem_addr      => { src => 'lock_mem_addr' },
+         lock_cfile_name    => { src => 'lock_cfile_name' },
+         lock_cline         => { src => 'lock_cline' },
+         writer_thread      => { src => 'writer_thread' },
+         writer_lock_mode   => { src => 'writer_lock_mode' },
+         num_readers        => { src => 'num_readers' },
+         lock_var           => { src => 'lock_var' },
+         waiters_flag       => { src => 'waiters_flag' },
+         last_s_file_name   => { src => 'last_s_file_name' },
+         last_s_line        => { src => 'last_s_line' },
+         last_x_file_name   => { src => 'last_x_file_name' },
+         last_x_line        => { src => 'last_x_line' },
+         cell_waiting       => { src => 'cell_waiting' },
+         cell_event_set     => { src => 'cell_event_set' },
+      },
+      visible => [ qw(cxn thread time waited_at_filename waited_at_line request_type num_readers lock_var waiters_flag cell_waiting cell_event_set)],
+      filters => [],
+      sort_cols => 'cxn -time',
+      sort_dir => '1',
+      innodb   => 'sm',
+      group_by => [],
+      aggregate => 0,
+   },
+);
+
+# Initialize %tbl_meta from %columns and do some checks.
+foreach my $table_name ( keys %tbl_meta ) {
+   my $table = $tbl_meta{$table_name};
+   my $cols  = $table->{cols};
+
+   foreach my $col_name ( keys %$cols ) {
+      my $col_def = $table->{cols}->{$col_name};
+      die "I can't find a column named '$col_name' for '$table_name'" unless $columns{$col_name};
+      $columns{$col_name}->{referenced} = 1;
+
+      foreach my $prop ( keys %col_props ) {
+         # Each column gets non-existing values set from %columns or defaults from %col_props.
+         if ( !$col_def->{$prop} ) {
+            $col_def->{$prop}
+               = defined($columns{$col_name}->{$prop})
+               ? $columns{$col_name}->{$prop}
+               : $col_props{$prop};
+         }
+      }
+
+      # Ensure transformations and aggregate functions are valid
+      die "Unknown aggregate function '$col_def->{agg}' "
+         . "for column '$col_name' in table '$table_name'"
+         unless exists $agg_funcs{$col_def->{agg}};
+      foreach my $trans ( @{$col_def->{trans}} ) {
+         die "Unknown transformation '$trans' "
+            . "for column '$col_name' in table '$table_name'"
+            unless exists $trans_funcs{$trans};
+      }
+   }
+
+   # Ensure each column in visible and group_by exists in cols
+   foreach my $place ( qw(visible group_by) ) {
+      foreach my $col_name ( @{$table->{$place}} ) {
+         if ( !exists $cols->{$col_name} ) {
+            die "Column '$col_name' is listed in '$place' for '$table_name', but doesn't exist";
+         }
+      }
+   }
+
+   # Compile sort and color subroutines
+   $table->{sort_func}  = make_sort_func($table);
+   $table->{color_func} = make_color_func($table);
+}
+
+# This is for code cleanup:
+{
+   my @unused_cols = grep { !$columns{$_}->{referenced} } sort keys %columns;
+   if ( @unused_cols ) {
+      die "The following columns are not used: "
+         . join(' ', @unused_cols);
+   }
+}
+
+# ###########################################################################
+# Operating modes {{{3
+# ###########################################################################
+my %modes = (
+   B => {
+      hdr               => 'InnoDB Buffers',
+      cust              => {},
+      note              => 'Shows buffer info from InnoDB',
+      action_for        => {
+         i => {
+            action => sub { toggle_config('status_inc') },
+            label  => 'Toggle incremental status display',
+         },
+      },
+      display_sub       => \&display_B,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(buffer_pool page_statistics insert_buffers adaptive_hash_index)],
+      visible_tables    => [qw(buffer_pool page_statistics insert_buffers adaptive_hash_index)],
+   },
+   C => {
+      hdr               => 'Command Summary',
+      cust              => {},
+      note              => 'Shows relative magnitude of variables',
+      action_for        => {
+         s => {
+            action => sub { get_config_interactive('cmd_filter') },
+            label  => 'Choose variable prefix',
+         },
+      },
+      display_sub       => \&display_C,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(cmd_summary)],
+      visible_tables    => [qw(cmd_summary)],
+   },
+   D => {
+      hdr               => 'InnoDB Deadlocks',
+      cust              => {},
+      note              => 'View InnoDB deadlock information',
+      action_for        => {
+         c => {
+            action => sub { edit_table('deadlock_transactions') },
+            label  => 'Choose visible columns',
+         },
+         w => {
+            action => \&create_deadlock,
+            label  => 'Wipe deadlock status info by creating a deadlock',
+         },
+      },
+      display_sub       => \&display_D,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(deadlock_transactions deadlock_locks)],
+      visible_tables    => [qw(deadlock_transactions deadlock_locks)],
+   },
+   F => {
+      hdr               => 'InnoDB FK Err',
+      cust              => {},
+      note              => 'View the latest InnoDB foreign key error',
+      action_for        => {},
+      display_sub       => \&display_F,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 1,
+      tables            => [qw(fk_error)],
+      visible_tables    => [qw(fk_error)],
+   },
+   I => {
+      hdr               => 'InnoDB I/O Info',
+      cust              => {},
+      note              => 'Shows I/O info (i/o, log...) from InnoDB',
+      action_for        => {
+         i => {
+            action => sub { toggle_config('status_inc') },
+            label  => 'Toggle incremental status display',
+         },
+      },
+      display_sub       => \&display_I,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(io_threads pending_io file_io_misc log_statistics)],
+      visible_tables    => [qw(io_threads pending_io file_io_misc log_statistics)],
+   },
+   L => {
+      hdr             => 'Locks',
+      cust            => {},
+      note            => 'Shows transaction locks',
+      action_for      => {
+         a => {
+            action => sub { send_cmd_to_servers('CREATE TABLE IF NOT EXISTS test.innodb_lock_monitor(a int) ENGINE=InnoDB', 0, '', []); },
+            label  => 'Start the InnoDB Lock Monitor',
+         },
+         o => {
+            action => sub { send_cmd_to_servers('DROP TABLE IF EXISTS test.innodb_lock_monitor', 0, '', []); },
+            label  => 'Stop the InnoDB Lock Monitor',
+         },
+      },
+      display_sub     => \&display_L,
+      connections     => [],
+      server_group    => '',
+      one_connection  => 0,
+      tables            => [qw(innodb_locks)],
+      visible_tables    => [qw(innodb_locks)],
+   },
+   M => {
+      hdr               => 'Replication Status',
+      cust              => {},
+      note              => 'Shows replication (master and slave) status',
+      action_for        => {
+         a => {
+            action => sub { send_cmd_to_servers('START SLAVE', 0, 'START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE = ?, MASTER_LOG_POS = ?', []); },
+            label  => 'Start slave(s)',
+         },
+         i => {
+            action => sub { toggle_config('status_inc') },
+            label  => 'Toggle incremental status display',
+         },
+         o => {
+            action => sub { send_cmd_to_servers('STOP SLAVE', 0, '', []); },
+            label  => 'Stop slave(s)',
+         },
+         b => {
+            action => sub { purge_master_logs() },
+            label  => 'Purge unused master logs',
+         },
+      },
+      display_sub       => \&display_M,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(slave_sql_status slave_io_status master_status)],
+      visible_tables    => [qw(slave_sql_status slave_io_status master_status)],
+   },
+   O => {
+      hdr               => 'Open Tables',
+      cust              => {},
+      note              => 'Shows open tables in MySQL',
+      action_for        => {
+         r => {
+            action => sub { reverse_sort('open_tables'); },
+            label  => 'Reverse sort order',
+         },
+         s => {
+            action => sub { choose_sort_cols('open_tables'); },
+            label => "Choose sort column",
+         },
+      },
+      display_sub       => \&display_O,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(open_tables)],
+      visible_tables    => [qw(open_tables)],
+   },
+   Q => {
+      hdr        => 'Query List',
+      cust       => {},
+      note       => 'Shows queries from SHOW FULL PROCESSLIST',
+      action_for => {
+         a => {
+            action => sub { toggle_filter('processlist', 'hide_self') },
+            label  => 'Toggle the innotop process',
+         },
+         c => {
+            action => sub { edit_table('processlist') },
+            label  => 'Choose visible columns',
+         },
+         e => {
+            action => sub { analyze_query('e'); },
+            label  => "Explain a thread's query",
+         },
+         f => {
+            action => sub { analyze_query('f'); },
+            label  => "Show a thread's full query",
+         },
+         h => {
+            action => sub { toggle_visible_table('Q', 'q_header') },
+            label  => 'Toggle the header on and off',
+         },
+         i => {
+            action => sub { toggle_filter('processlist', 'hide_inactive') },
+            label  => 'Toggle idle processes',
+         },
+         k => {
+            action => sub { kill_query('CONNECTION') },
+            label => "Kill a query's connection",
+         },
+         r => {
+            action => sub { reverse_sort('processlist'); },
+            label  => 'Reverse sort order',
+         },
+         s => {
+            action => sub { choose_sort_cols('processlist'); },
+            label => "Change the display's sort column",
+         },
+         x => {
+            action => sub { kill_query('QUERY') },
+            label => "Kill a query",
+         },
+      },
+      display_sub       => \&display_Q,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(q_header processlist)],
+      visible_tables    => [qw(q_header processlist)],
+   },
+   R => {
+      hdr               => 'InnoDB Row Ops',
+      cust              => {},
+      note              => 'Shows InnoDB row operation and semaphore info',
+      action_for        => {
+         i => {
+            action => sub { toggle_config('status_inc') },
+            label  => 'Toggle incremental status display',
+         },
+      },
+      display_sub       => \&display_R,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(row_operations row_operation_misc semaphores wait_array)],
+      visible_tables    => [qw(row_operations row_operation_misc semaphores wait_array)],
+   },
+   S => {
+      hdr               => 'Variables & Status',
+      cust              => {},
+      note              => 'Shows query load statistics a la vmstat',
+      action_for        => {
+         '>' => {
+            action => sub { switch_var_set('S_set', 1) },
+            label  => 'Switch to next variable set',
+         },
+         '<' => {
+            action => sub { switch_var_set('S_set', -1) },
+            label  => 'Switch to prev variable set',
+         },
+         c => {
+            action => sub {
+               choose_var_set('S_set');
+               start_S_mode();
+            },
+            label => "Choose which set to display",
+         },
+         e => {
+            action => \&edit_current_var_set,
+            label  => 'Edit the current set of variables',
+         },
+         i => {
+            action => sub { $clear_screen_sub->(); toggle_config('status_inc') },
+            label  => 'Toggle incremental status display',
+         },
+         '-' => {
+            action => sub { set_display_precision(-1) },
+            label  => 'Decrease fractional display precision',
+         },
+         '+' => {
+            action => sub { set_display_precision(1) },
+            label  => 'Increase fractional display precision',
+         },
+         g => {
+            action => sub { set_s_mode('g') },
+            label  => 'Switch to graph (tload) view',
+         },
+         s => {
+            action => sub { set_s_mode('s') },
+            label  => 'Switch to standard (vmstat) view',
+         },
+         v => {
+            action => sub { set_s_mode('v') },
+            label  => 'Switch to pivoted view',
+         },
+      },
+      display_sub       => \&display_S,
+      no_clear_screen   => 1,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(var_status)],
+      visible_tables    => [qw(var_status)],
+   },
+   T => {
+      hdr        => 'InnoDB Txns',
+      cust       => {},
+      note       => 'Shows InnoDB transactions in top-like format',
+      action_for => {
+         a => {
+            action => sub { toggle_filter('innodb_transactions', 'hide_self') },
+            label  => 'Toggle the innotop process',
+         },
+         c => {
+            action => sub { edit_table('innodb_transactions') },
+            label  => 'Choose visible columns',
+         },
+         e => {
+            action => sub { analyze_query('e'); },
+            label  => "Explain a thread's query",
+         },
+         f => {
+            action => sub { analyze_query('f'); },
+            label  => "Show a thread's full query",
+         },
+         h => {
+            action => sub { toggle_visible_table('T', 't_header') },
+            label  => 'Toggle the header on and off',
+         },
+         i => {
+            action => sub { toggle_filter('innodb_transactions', 'hide_inactive') },
+            label  => 'Toggle inactive transactions',
+         },
+         k => {
+            action => sub { kill_query('CONNECTION') },
+            label  => "Kill a transaction's connection",
+         },
+         r => {
+            action => sub { reverse_sort('innodb_transactions'); },
+            label  => 'Reverse sort order',
+         },
+         s => {
+            action => sub { choose_sort_cols('innodb_transactions'); },
+            label  => "Change the display's sort column",
+         },
+         x => {
+            action => sub { kill_query('QUERY') },
+            label  => "Kill a query",
+         },
+      },
+      display_sub       => \&display_T,
+      connections       => [],
+      server_group      => '',
+      one_connection    => 0,
+      tables            => [qw(t_header innodb_transactions)],
+      visible_tables    => [qw(t_header innodb_transactions)],
+   },
+);
+
+# ###########################################################################
+# Global key mappings {{{3
+# Keyed on a single character, which is read from the keyboard.  Uppercase
+# letters switch modes.  Lowercase letters access commands when in a mode.
+# These can be overridden by action_for in %modes.
+# ###########################################################################
+my %action_for = (
+   '$' => {
+      action => \&edit_configuration,
+      label  => 'Edit configuration settings',
+   },
+   '?' => {
+      action => \&display_help,
+      label  => 'Show help',
+   },
+   '!' => {
+      action => \&display_license,
+      label  => 'Show license and warranty',
+   },
+   '^' => {
+      action => \&edit_table,
+      label  => "Edit the displayed table(s)",
+   },
+   '#' => {
+      action => \&choose_server_groups,
+      label  => 'Select/create server groups',
+   },
+   '@' => {
+      action => \&choose_servers,
+      label  => 'Select/create server connections',
+   },
+   '/' => {
+      action => \&add_quick_filter,
+      label  => 'Quickly filter what you see',
+   },
+   '\\' => {
+      action => \&clear_quick_filters,
+      label  => 'Clear quick-filters',
+   },
+   '%' => {
+      action => \&choose_filters,
+      label  => 'Choose and edit table filters',
+   },
+   "\t" => {
+      action => \&next_server_group,
+      label  => 'Switch to the next server group',
+      key    => 'TAB',
+   },
+   '=' => {
+      action => \&toggle_aggregate,
+      label  => 'Toggle aggregation',
+   },
+   # TODO: can these be auto-generated from %modes?
+   B => {
+      action => sub { switch_mode('B') },
+      label  => '',
+   },
+   C => {
+      action => sub { switch_mode('C') },
+      label  => '',
+   },
+   D => {
+      action => sub { switch_mode('D') },
+      label  => '',
+   },
+   F => {
+      action => sub { switch_mode('F') },
+      label  => '',
+   },
+   I => {
+      action => sub { switch_mode('I') },
+      label  => '',
+   },
+   L => {
+      action => sub { switch_mode('L') },
+      label  => '',
+   },
+   M => {
+      action => sub { switch_mode('M') },
+      label  => '',
+   },
+   O => {
+      action => sub { switch_mode('O') },
+      label  => '',
+   },
+   Q => {
+      action => sub { switch_mode('Q') },
+      label  => '',
+   },
+   R => {
+      action => sub { switch_mode('R') },
+      label  => '',
+   },
+   S => {
+      action => \&start_S_mode,
+      label  => '',
+   },
+   T => {
+      action => sub { switch_mode('T') },
+      label  => '',
+   },
+   d => {
+      action => sub { get_config_interactive('interval') },
+      label  => 'Change refresh interval',
+   },
+   n => { action => \&next_server,       label => 'Switch to the next connection' },
+   p => { action => \&pause,             label => 'Pause innotop', },
+   q => { action => \&finish,            label => 'Quit innotop', },
+);
+
+# ###########################################################################
+# Sleep times after certain statements {{{3
+# ###########################################################################
+my %stmt_sleep_time_for = ();
+
+# ###########################################################################
+# Config editor key mappings {{{3
+# ###########################################################################
+my %cfg_editor_action = (
+   c => {
+      note => 'Edit columns, etc in the displayed table(s)',
+      func => \&edit_table,
+   },
+   g => {
+      note => 'Edit general configuration',
+      func => \&edit_configuration_variables,
+   },
+   k => {
+      note => 'Edit row-coloring rules',
+      func => \&edit_color_rules,
+   },
+   p => {
+      note => 'Manage plugins',
+      func => \&edit_plugins,
+   },
+   s => {
+      note => 'Edit server groups',
+      func => \&edit_server_groups,
+   },
+   S => {
+      note => 'Edit SQL statement sleep delays',
+      func => \&edit_stmt_sleep_times,
+   },
+   t => {
+      note => 'Choose which table(s) to display in this mode',
+      func => \&choose_mode_tables,
+   },
+);
+
+# ###########################################################################
+# Color editor key mappings {{{3
+# ###########################################################################
+my %color_editor_action = (
+   n => {
+      note => 'Create a new color rule',
+      func => sub {
+         my ( $tbl, $idx ) = @_;
+         my $meta = $tbl_meta{$tbl};
+
+         $clear_screen_sub->();
+         my $col;
+         do {
+            $col = prompt_list(
+               'Choose the target column for the rule',
+               '',
+               sub { return keys %{$meta->{cols}} },
+               { map { $_ => $meta->{cols}->{$_}->{label} } keys %{$meta->{cols}} });
+         } while ( !$col );
+         ( $col ) = grep { $_ } split(/\W+/, $col);
+         return $idx unless $col && exists $meta->{cols}->{$col};
+
+         $clear_screen_sub->();
+         my $op;
+         do {
+            $op = prompt_list(
+               'Choose the comparison operator for the rule',
+               '',
+               sub { return keys %comp_ops },
+               { map { $_ => $comp_ops{$_} } keys %comp_ops } );
+         } until ( $op );
+         $op =~ s/\s+//g;
+         return $idx unless $op && exists $comp_ops{$op};
+
+         my $arg;
+         do {
+            $arg = prompt('Specify an argument for the comparison');
+         } until defined $arg;
+
+         my $color;
+         do {
+            $color = prompt_list(
+               'Choose the color(s) the row should be when the rule matches',
+               '',
+               sub { return keys %ansicolors },
+               { map { $_ => $_ } keys %ansicolors } );
+         } until defined $color;
+         $color = join(' ', unique(grep { exists $ansicolors{$_} } split(/\W+/, $color)));
+         return $idx unless $color;
+
+         push @{$tbl_meta{$tbl}->{colors}}, {
+            col   => $col,
+            op    => $op,
+            arg   => $arg,
+            color => $color
+         };
+         $tbl_meta{$tbl}->{cust}->{colors} = 1;
+
+         return $idx;
+      },
+   },
+   d => {
+      note => 'Remove the selected rule',
+      func => sub {
+         my ( $tbl, $idx ) = @_;
+         my @rules = @{ $tbl_meta{$tbl}->{colors} };
+         return 0 unless @rules > 0 && $idx < @rules && $idx >= 0;
+         splice(@{$tbl_meta{$tbl}->{colors}}, $idx, 1);
+         $tbl_meta{$tbl}->{cust}->{colors} = 1;
+         return $idx == @rules ? $#rules : $idx;
+      },
+   },
+   j => {
+      note => 'Move highlight down one',
+      func => sub {
+         my ( $tbl, $idx ) = @_;
+         my $num_rules = scalar @{$tbl_meta{$tbl}->{colors}};
+         return ($idx + 1) % $num_rules;
+      },
+   },
+   k => {
+      note => 'Move highlight up one',
+      func => sub {
+         my ( $tbl, $idx ) = @_;
+         my $num_rules = scalar @{$tbl_meta{$tbl}->{colors}};
+         return ($idx - 1) % $num_rules;
+      },
+   },
+   '+' => {
+      note => 'Move selected rule up one',
+      func => sub {
+         my ( $tbl, $idx ) = @_;
+         my $meta = $tbl_meta{$tbl};
+         my $dest = $idx == 0 ? scalar(@{$meta->{colors}} - 1) : $idx - 1;
+         my $temp = $meta->{colors}->[$idx];
+         $meta->{colors}->[$idx]  = $meta->{colors}->[$dest];
+         $meta->{colors}->[$dest] = $temp;
+         $meta->{cust}->{colors} = 1;
+         return $dest;
+      },
+   },
+   '-' => {
+      note => 'Move selected rule down one',
+      func => sub {
+         my ( $tbl, $idx ) = @_;
+         my $meta = $tbl_meta{$tbl};
+         my $dest = $idx == scalar(@{$meta->{colors}} - 1) ? 0 : $idx + 1;
+         my $temp = $meta->{colors}->[$idx];
+         $meta->{colors}->[$idx]  = $meta->{colors}->[$dest];
+         $meta->{colors}->[$dest] = $temp;
+         $meta->{cust}->{colors} = 1;
+         return $dest;
+      },
+   },
+);
+
+# ###########################################################################
+# Plugin editor key mappings {{{3
+# ###########################################################################
+my %plugin_editor_action = (
+   '*' => {
+      note => 'Toggle selected plugin active/inactive',
+      func => sub {
+         my ( $plugins, $idx ) = @_;
+         my $plugin = $plugins->[$idx];
+         $plugin->{active} = $plugin->{active} ? 0 : 1;
+         return $idx;
+      },
+   },
+   j => {
+      note => 'Move highlight down one',
+      func => sub {
+         my ( $plugins, $idx ) = @_;
+         return ($idx + 1) % scalar(@$plugins);
+      },
+   },
+   k => {
+      note => 'Move highlight up one',
+      func => sub {
+         my ( $plugins, $idx ) = @_;
+         return $idx == 0 ? @$plugins - 1 : $idx - 1;
+      },
+   },
+);
+
+# ###########################################################################
+# Table editor key mappings {{{3
+# ###########################################################################
+my %tbl_editor_action = (
+   a => {
+      note => 'Add a column to the table',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         my @visible_cols = @{ $tbl_meta{$tbl}->{visible} };
+         my %all_cols     = %{ $tbl_meta{$tbl}->{cols} };
+         delete @all_cols{@visible_cols};
+         my $choice = prompt_list(
+            'Choose a column',
+            '',
+            sub { return keys %all_cols; },
+            { map { $_ => $all_cols{$_}->{label} || $all_cols{$_}->{hdr} } keys %all_cols });
+         if ( $all_cols{$choice} ) {
+            push @{$tbl_meta{$tbl}->{visible}}, $choice;
+            $tbl_meta{$tbl}->{cust}->{visible} = 1;
+            return $choice;
+         }
+         return $col;
+      },
+   },
+   n => {
+      note => 'Create a new column and add it to the table',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+
+         $clear_screen_sub->();
+         print word_wrap("Choose a name for the column.  This name is not displayed, and is used only "
+               . "for internal reference.  It can contain only lowercase letters, numbers, "
+               . "and underscores.");
+         print "\n\n";
+         do {
+            $col = prompt("Enter column name");
+            $col = '' if $col =~ m/[^a-z0-9_]/;
+         } while ( !$col );
+
+         $clear_screen_sub->();
+         my $hdr;
+         do {
+            $hdr = prompt("Enter column header");
+         } while ( !$hdr );
+
+         $clear_screen_sub->();
+         print "Choose a source for the column's data\n\n";
+         my ( $src, $sub, $err );
+         do {
+            if ( $err ) {
+               print "Error: $err\n\n";
+            }
+            $src = prompt("Enter column source");
+            if ( $src ) {
+               ( $sub, $err ) = compile_expr($src);
+            }
+         } until ( !$err);
+
+         # TODO: this duplicates %col_props.
+         $tbl_meta{$tbl}->{cols}->{$col} = {
+            hdr   => $hdr,
+            src   => $src,
+            just  => '-',
+            num   => 0,
+            label => 'User-defined',
+            user  => 1,
+            tbl   => $tbl,
+            minw  => 0,
+            maxw  => 0,
+            trans => [],
+            func  => $sub,
+            dec   => 0,
+            agg   => 0,
+            aggonly => 0,
+         };
+
+         $tbl_meta{$tbl}->{visible} = [ unique(@{$tbl_meta{$tbl}->{visible}}, $col) ];
+         $tbl_meta{$tbl}->{cust}->{visible} = 1;
+         return $col;
+      },
+   },
+   d => {
+      note => 'Remove selected column',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         my @visible_cols = @{ $tbl_meta{$tbl}->{visible} };
+         my $idx          = 0;
+         return $col unless @visible_cols > 1;
+         while ( $visible_cols[$idx] ne $col ) {
+            $idx++;
+         }
+         $tbl_meta{$tbl}->{visible} = [ grep { $_ ne $col } @visible_cols ];
+         $tbl_meta{$tbl}->{cust}->{visible} = 1;
+         return $idx == $#visible_cols ? $visible_cols[$idx - 1] : $visible_cols[$idx + 1];
+      },
+   },
+   e => {
+      note => 'Edit selected column',
+      func => sub {
+         # TODO: make this editor hotkey-driven and give readline support.
+         my ( $tbl, $col ) = @_;
+         $clear_screen_sub->();
+         my $meta = $tbl_meta{$tbl}->{cols}->{$col};
+         my @prop = qw(hdr label src just num minw maxw trans agg); # TODO redundant
+
+         my $answer;
+         do {
+            # Do what the user asked...
+            if ( $answer && grep { $_ eq $answer } @prop ) {
+               # Some properties are arrays, others scalars.
+               my $ini = ref $col_props{$answer} ? join(' ', @{$meta->{$answer}}) : $meta->{$answer};
+               my $val = prompt("New value for $answer", undef, $ini);
+               $val = [ split(' ', $val) ] if ref($col_props{$answer});
+               if ( $answer eq 'trans' ) {
+                  $val = [ unique(grep{ exists $trans_funcs{$_} } @$val) ];
+               }
+               @{$meta}{$answer, 'user', 'tbl' } = ( $val, 1, $tbl );
+            }
+
+            my @display_lines = (
+               '',
+               "You are editing column $tbl.$col.\n",
+            );
+
+            push @display_lines, create_table2(
+               \@prop,
+               { map { $_ => $_ } @prop },
+               { map { $_ => ref $meta->{$_} eq 'ARRAY' ? join(' ', @{$meta->{$_}})
+                           : ref $meta->{$_}            ? '[expression code]'
+                           :                              $meta->{$_}
+                     } @prop
+               },
+               { sep => '  ' });
+            draw_screen(\@display_lines, { raw => 1 });
+            print "\n\n"; # One to add space, one to clear readline artifacts
+            $answer = prompt('Edit what? (q to quit)');
+         } while ( $answer ne 'q' );
+
+         return $col;
+      },
+   },
+   j => {
+      note => 'Move highlight down one',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         my @visible_cols = @{ $tbl_meta{$tbl}->{visible} };
+         my $idx          = 0;
+         while ( $visible_cols[$idx] ne $col ) {
+            $idx++;
+         }
+         return $visible_cols[ ($idx + 1) % @visible_cols ];
+      },
+   },
+   k => {
+      note => 'Move highlight up one',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         my @visible_cols = @{ $tbl_meta{$tbl}->{visible} };
+         my $idx          = 0;
+         while ( $visible_cols[$idx] ne $col ) {
+            $idx++;
+         }
+         return $visible_cols[ $idx - 1 ];
+      },
+   },
+   '+' => {
+      note => 'Move selected column up one',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         my $meta         = $tbl_meta{$tbl};
+         my @visible_cols = @{$meta->{visible}};
+         my $idx          = 0;
+         while ( $visible_cols[$idx] ne $col ) {
+            $idx++;
+         }
+         if ( $idx ) {
+            $visible_cols[$idx]     = $visible_cols[$idx - 1];
+            $visible_cols[$idx - 1] = $col;
+            $meta->{visible}        = \@visible_cols;
+         }
+         else {
+            shift @{$meta->{visible}};
+            push @{$meta->{visible}}, $col;
+         }
+         $meta->{cust}->{visible} = 1;
+         return $col;
+      },
+   },
+   '-' => {
+      note => 'Move selected column down one',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         my $meta         = $tbl_meta{$tbl};
+         my @visible_cols = @{$meta->{visible}};
+         my $idx          = 0;
+         while ( $visible_cols[$idx] ne $col ) {
+            $idx++;
+         }
+         if ( $idx == $#visible_cols ) {
+            unshift @{$meta->{visible}}, $col;
+            pop @{$meta->{visible}};
+         }
+         else {
+            $visible_cols[$idx]     = $visible_cols[$idx + 1];
+            $visible_cols[$idx + 1] = $col;
+            $meta->{visible}        = \@visible_cols;
+         }
+         $meta->{cust}->{visible} = 1;
+         return $col;
+      },
+   },
+   f => {
+      note => 'Choose filters',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         choose_filters($tbl);
+         return $col;
+      },
+   },
+   o => {
+      note => 'Edit color rules',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         edit_color_rules($tbl);
+         return $col;
+      },
+   },
+   s => {
+      note => 'Choose sort columns',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         choose_sort_cols($tbl);
+         return $col;
+      },
+   },
+   g => {
+      note => 'Choose group-by (aggregate) columns',
+      func => sub {
+         my ( $tbl, $col ) = @_;
+         choose_group_cols($tbl);
+         return $col;
+      },
+   },
+);
+
+# ###########################################################################
+# Global variables and environment {{{2
+# ###########################################################################
+
+my @this_term_size; # w_chars, h_chars, w_pix, h_pix
+my @last_term_size; # w_chars, h_chars, w_pix, h_pix
+my $char;
+my $windows       = $OSNAME =~ m/MSWin/;
+my $have_color    = 0;
+my $MAX_ULONG     = 4294967295; # 2^32-1
+my $num_regex     = qr/^[+-]?(?=\d|\.)\d*(?:\.\d+)?(?:E[+-]?\d+|)$/i;
+my $int_regex     = qr/^\d+$/;
+my $bool_regex    = qr/^[01]$/;
+my $term          = undef;
+my $file          = undef; # File to watch for InnoDB monitor output
+my $file_mtime    = undef; # Status of watched file
+my $file_data     = undef; # Last chunk of text read from file
+my $innodb_parser = InnoDBParser->new;
+
+my $nonfatal_errs = join('|',
+   'Access denied for user',
+   'Unknown MySQL server host',
+   'Unknown database',
+   'Can\'t connect to local MySQL server through socket',
+   'Can\'t connect to MySQL server on',
+   'MySQL server has gone away',
+   'Cannot call SHOW INNODB STATUS',
+   'Access denied',
+   'AutoCommit',
+);
+
+if ( !$opts{n} ) {
+   require Term::ReadLine;
+   $term = Term::ReadLine->new('innotop');
+}
+
+# Stores status, variables, innodb status, master/slave status etc.
+# Keyed on connection name.  Each entry is a hashref of current and past data sets,
+# keyed on clock tick.
+my %vars;
+my %info_gotten = (); # Which things have been retrieved for the current clock tick.
+
+# Stores info on currently displayed queries: cxn, connection ID, query text.
+my @current_queries;
+
+my $lines_printed       = 0;
+my $clock               = 0;   # Incremented with every wake-sleep cycle
+my $clearing_deadlocks  = 0;
+
+# If terminal coloring is available, use it.  The only function I want from
+# the module is the colored() function.
+eval {
+   if ( !$opts{n} ) {
+      if ( $windows ) {
+         require Win32::Console::ANSI;
+      }
+      require Term::ANSIColor;
+      import Term::ANSIColor qw(colored);
+      $have_color = 1;
+   }
+};
+if ( $EVAL_ERROR || $opts{n} ) {
+   # If there was an error, manufacture my own colored() function that does no
+   # coloring.
+   *colored = sub { pop @_; @_; };
+}
+
+if ( $opts{n} ) {
+   $clear_screen_sub = sub {};
+}
+elsif ( $windows ) {
+   $clear_screen_sub = sub { $lines_printed = 0; system("cls") };
+}
+else {
+   my $clear = `clear`;
+   $clear_screen_sub = sub { $lines_printed = 0; print $clear };
+}
+
+# ###########################################################################
+# Config storage. {{{2
+# ###########################################################################
+my %config = (
+   color => {
+      val  => $have_color,
+      note => 'Whether to use terminal coloring',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   cmd_filter => {
+      val  => 'Com_',
+      note => 'Prefix for values in C mode',
+      conf => [qw(C)],
+   },
+   plugin_dir => {
+      val  => "$homepath/.innotop/plugins",
+      note => 'Directory where plugins can be found',
+      conf => 'ALL',
+   },
+   show_percent => {
+      val  => 1,
+      note => 'Show the % symbol after percentages',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   skip_innodb => {
+      val  => 0,
+      note => 'Disable SHOW INNODB STATUS',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   S_func => {
+      val  => 's',
+      note => 'What to display in S mode: graph, status, pivoted status',
+      conf => [qw(S)],
+      pat  => qr/^[gsv]$/,
+   },
+   cxn_timeout => {
+      val  => 28800,
+      note => 'Connection timeout for keeping unused connections alive',
+      conf => 'ALL',
+      pat  => $int_regex,
+   },
+   graph_char => {
+      val  => '*',
+      note => 'Character for drawing graphs',
+      conf => [ qw(S) ],
+      pat  => qr/^.$/,
+   },
+   show_cxn_errors_in_tbl => {
+      val  => 1,
+      note => 'Whether to display connection errors as rows in the table',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   hide_hdr => {
+      val  => 0,
+      note => 'Whether to show column headers',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   show_cxn_errors => {
+      val  => 1,
+      note => 'Whether to print connection errors to STDOUT',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   readonly => {
+      val  => 1,
+      note => 'Whether the config file is read-only',
+      conf => [ qw() ],
+      pat  => $bool_regex,
+   },
+   global => {
+      val  => 1,
+      note => 'Whether to show GLOBAL variables and status',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   header_highlight => {
+      val  => 'bold',
+      note => 'How to highlight table column headers',
+      conf => 'ALL',
+      pat  => qr/^(?:bold|underline)$/,
+   },
+   display_table_captions => {
+      val  => 1,
+      note => 'Whether to put captions on tables',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   charset => {
+      val  => 'ascii',
+      note => 'What type of characters should be displayed in queries (ascii, unicode, none)',
+      conf => 'ALL',
+      pat  => qr/^(?:ascii|unicode|none)$/,
+   },
+   auto_wipe_dl => {
+      val  => 0,
+      note => 'Whether to auto-wipe InnoDB deadlocks',
+      conf => 'ALL',
+      pat  => $bool_regex,
+   },
+   max_height => {
+      val  => 30,
+      note => '[Win32] Max window height',
+      conf => 'ALL',
+   },
+   debug => {
+      val  => 0,
+      pat  => $bool_regex,
+      note => 'Debug mode (more verbose errors, uses more memory)',
+      conf => 'ALL',
+   },
+   num_digits => {
+      val  => 2,
+      pat  => $int_regex,
+      note => 'How many digits to show in fractional numbers and percents',
+      conf => 'ALL',
+   },
+   debugfile => {
+      val  => "$homepath/.innotop/core_dump",
+      note => 'A debug file in case you are interested in error output',
+   },
+   show_statusbar => {
+      val  => 1,
+      pat  => $bool_regex,
+      note => 'Whether to show the status bar in the display',
+      conf => 'ALL',
+   },
+   mode => {
+      val  => "Q",
+      note => "Which mode to start in",
+      cmdline => 1,
+   },
+   status_inc => {
+      val  => 0,
+      note => 'Whether to show raw or incremental values for status variables',
+      pat  => $bool_regex,
+   },
+   interval => {
+      val  => 10,
+      pat  => qr/^(?:(?:\d*?[1-9]\d*(?:\.\d*)?)|(?:\d*\.\d*?[1-9]\d*))$/,
+      note => "The interval at which the display will be refreshed.  Fractional values allowed.",
+   },
+   num_status_sets => {
+      val  => 9,
+      pat  => $int_regex,
+      note => 'How many sets of STATUS and VARIABLES values to show',
+      conf => [ qw(S) ],
+   },
+   S_set => {
+      val  => 'general',
+      pat  => qr/^\w+$/,
+      note => 'Which set of variables to display in S (Variables & Status) mode',
+      conf => [ qw(S) ],
+   },
+);
+
+# ###########################################################################
+# Config file sections {{{2
+# The configuration file is broken up into sections like a .ini file.  This
+# variable defines those sections and the subroutines responsible for reading
+# and writing them.
+# ###########################################################################
+my %config_file_sections = (
+   plugins => {
+      reader => \&load_config_plugins,
+      writer => \&save_config_plugins,
+   },
+   group_by => {
+      reader => \&load_config_group_by,
+      writer => \&save_config_group_by,
+   },
+   filters => {
+      reader => \&load_config_filters,
+      writer => \&save_config_filters,
+   },
+   active_filters => {
+      reader => \&load_config_active_filters,
+      writer => \&save_config_active_filters,
+   },
+   visible_tables => {
+      reader => \&load_config_visible_tables,
+      writer => \&save_config_visible_tables,
+   },
+   sort_cols => {
+      reader => \&load_config_sort_cols,
+      writer => \&save_config_sort_cols,
+   },
+   active_columns => {
+      reader => \&load_config_active_columns,
+      writer => \&save_config_active_columns,
+   },
+   tbl_meta => {
+      reader => \&load_config_tbl_meta,
+      writer => \&save_config_tbl_meta,
+   },
+   general => {
+      reader => \&load_config_config,
+      writer => \&save_config_config,
+   },
+   connections => {
+      reader => \&load_config_connections,
+      writer => \&save_config_connections,
+   },
+   active_connections => {
+      reader => \&load_config_active_connections,
+      writer => \&save_config_active_connections,
+   },
+   server_groups => {
+      reader => \&load_config_server_groups,
+      writer => \&save_config_server_groups,
+   },
+   active_server_groups => {
+      reader => \&load_config_active_server_groups,
+      writer => \&save_config_active_server_groups,
+   },
+   max_values_seen => {
+      reader => \&load_config_mvs,
+      writer => \&save_config_mvs,
+   },
+   varsets => {
+      reader => \&load_config_varsets,
+      writer => \&save_config_varsets,
+   },
+   colors => {
+      reader => \&load_config_colors,
+      writer => \&save_config_colors,
+   },
+   stmt_sleep_times => {
+      reader => \&load_config_stmt_sleep_times,
+      writer => \&save_config_stmt_sleep_times,
+   },
+);
+
+# Config file sections have some dependencies, so they have to be read/written in order.
+my @ordered_config_file_sections = qw(general plugins filters active_filters tbl_meta
+   connections active_connections server_groups active_server_groups max_values_seen
+   active_columns sort_cols visible_tables varsets colors stmt_sleep_times
+   group_by);
+
+# All events for which plugins may register themselves.  Entries are arrayrefs.
+my %event_listener_for = map { $_ => [] }
+   qw(
+      extract_values
+      set_to_tbl_pre_filter set_to_tbl_pre_sort set_to_tbl_pre_group
+      set_to_tbl_pre_colorize set_to_tbl_pre_transform set_to_tbl_pre_pivot
+      set_to_tbl_pre_create set_to_tbl_post_create
+      draw_screen
+   );
+
+# All variables to which plugins have access.
+my %pluggable_vars = (
+   action_for    => \%action_for,
+   agg_funcs     => \%agg_funcs,
+   config        => \%config,
+   connections   => \%connections,
+   dbhs          => \%dbhs,
+   filters       => \%filters,
+   modes         => \%modes,
+   server_groups => \%server_groups,
+   tbl_meta      => \%tbl_meta,
+   trans_funcs   => \%trans_funcs,
+   var_sets      => \%var_sets,
+);
+
+# ###########################################################################
+# Contains logic to generate prepared statements for a given function for a
+# given DB connection.  Returns a $sth.
+# ###########################################################################
+my %stmt_maker_for = (
+   INNODB_STATUS => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare(version_ge( $dbh, '5.0.0' )
+             ? 'SHOW ENGINE INNODB STATUS'
+             : 'SHOW INNODB STATUS');
+   },
+   SHOW_VARIABLES => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare($config{global}->{val} && version_ge( $dbh, '4.0.3' )
+             ? 'SHOW GLOBAL VARIABLES'
+             : 'SHOW VARIABLES');
+   },
+   SHOW_STATUS => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare($config{global}->{val} && version_ge( $dbh, '5.0.2' )
+             ? 'SHOW GLOBAL STATUS'
+             : 'SHOW STATUS');
+   },
+   KILL_QUERY => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare(version_ge( $dbh, '5.0.0' )
+             ? 'KILL QUERY ?'
+             : 'KILL ?');
+   },
+   SHOW_MASTER_LOGS => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare('SHOW MASTER LOGS');
+   },
+   SHOW_MASTER_STATUS => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare('SHOW MASTER STATUS');
+   },
+   SHOW_SLAVE_STATUS => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare('SHOW SLAVE STATUS');
+   },
+   KILL_CONNECTION => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare(version_ge( $dbh, '5.0.0' )
+             ? 'KILL CONNECTION ?'
+             : 'KILL ?');
+   },
+   OPEN_TABLES => sub {
+      my ( $dbh ) = @_;
+      return version_ge($dbh, '4.0.0')
+         ? $dbh->prepare('SHOW OPEN TABLES')
+         : undef;
+   },
+   PROCESSLIST => sub {
+      my ( $dbh ) = @_;
+      return $dbh->prepare('SHOW FULL PROCESSLIST');
+   },
+);
+
+# Plugins!
+my %plugins = (
+);
+
+# ###########################################################################
+# Run the program {{{1
+# ###########################################################################
+
+# This config variable is only useful for MS Windows because its terminal
+# can't tell how tall it is.
+if ( !$windows ) {
+   delete $config{max_height};
+}
+
+# Try to lower my priority.
+eval { setpriority(0, 0, getpriority(0, 0) + 10); };
+
+# Print stuff to the screen immediately, don't wait for a newline.
+$OUTPUT_AUTOFLUSH = 1;
+
+# Clear the screen and load the configuration.
+$clear_screen_sub->();
+load_config();
+
+# Override config variables with command-line options
+my %cmdline =
+   map  { $_->{c} => $opts{$_->{k}} }
+   grep { exists $_->{c} && exists $opts{$_->{k}} }
+   @opt_spec;
+
+foreach my $name (keys %cmdline) {
+   next if not defined $cmdline{$name};
+   my $val = $cmdline{$name};
+   if ( exists($config{$name}) and (!$config{$name}->{pat} or $val =~ m/$config{$name}->{pat}/ )) {
+      $config{$name}->{val} = $val;
+   }
+}
+
+post_process_tbl_meta();
+
+# Make sure no changes are written to config file in non-interactive mode.
+if ( $opts{n} ) {
+   $config{readonly}->{val} = 1;
+}
+
+eval {
+
+   # Open the file for InnoDB status
+   if ( @ARGV ) {
+      my $filename = shift @ARGV;
+      open $file, "<", $filename
+         or die "Cannot open '$filename': $OS_ERROR";
+   }
+
+   # In certain modes we might have to collect data for two cycles
+   # before printing anything out, so we need to bump up the count one.
+   if ( $opts{n} && $opts{count} && $config{status_inc}->{val}
+      && $config{mode}->{val} =~ m/[S]/ )
+   {
+      $opts{count}++;
+   }
+
+   while (++$clock) {
+
+      my $mode = $config{mode}->{val} || 'Q';
+      if ( !$modes{$mode} ) {
+         die "Mode '$mode' doesn't exist; try one of these:\n"
+            . join("\n", map { "  $_ $modes{$_}->{hdr}" }  sort keys %modes)
+            . "\n";
+      }
+
+      if ( !$opts{n} ) {
+         @last_term_size = @this_term_size;
+         @this_term_size = Term::ReadKey::GetTerminalSize(\*STDOUT);
+         if ( $windows ) {
+            $this_term_size[0]--;
+            $this_term_size[1]
+               = min($this_term_size[1], $config{max_height}->{val});
+         }
+         die("Can't read terminal size") unless @this_term_size;
+      }
+
+      # If there's no connection to a database server, we need to fix that...
+      if ( !%connections ) {
+         print "You have not defined any database connections.\n\n";
+         add_new_dsn();
+      }
+
+      # See whether there are any connections defined for this mode.  If there's only one
+      # connection total, assume the user wants to just use innotop for a single server
+      # and don't ask which server to connect to.  Also, if we're monitoring from a file,
+      # we just use the first connection.
+      if ( !get_connections() ) {
+         if ( $file || 1 == scalar keys %connections ) {
+            $modes{$config{mode}->{val}}->{connections} = [ keys %connections ];
+         }
+         else {
+            choose_connections();
+         }
+      }
+
+      # Term::ReadLine might have re-set $OUTPUT_AUTOFLUSH.
+      $OUTPUT_AUTOFLUSH = 1;
+
+      # Prune old data
+      my $sets = $config{num_status_sets}->{val};
+      foreach my $store ( values %vars ) {
+         delete @{$store}{ grep { $_ < $clock - $sets } keys %$store };
+      }
+      %info_gotten = ();
+
+      # Call the subroutine to display this mode.
+      $modes{$mode}->{display_sub}->();
+
+      # It may be time to quit now.
+      if ( $opts{count} && $clock >= $opts{count} ) {
+         finish();
+      }
+
+      # Wait for a bit.
+      if ( $opts{n} ) {
+         sleep($config{interval}->{val});
+      }
+      else {
+         ReadMode('cbreak');
+         $char = ReadKey($config{interval}->{val});
+         ReadMode('normal');
+      }
+
+      # Handle whatever action the key indicates.
+      do_key_action();
+
+   }
+};
+if ( $EVAL_ERROR ) {
+   core_dump( $EVAL_ERROR );
+}
+finish();
+
+# Subroutines {{{1
+# Mode functions{{{2
+# switch_mode {{{3
+sub switch_mode {
+   my $mode = shift;
+   $config{mode}->{val} = $mode;
+}
+
+# Prompting functions {{{2
+# prompt_list {{{3
+# Prompts the user for a value, given a question, initial value,
+# a completion function and a hashref of hints.
+sub prompt_list {
+   die "Can't call in non-interactive mode" if $opts{n};
+   my ( $question, $init, $completion, $hints ) = @_;
+   if ( $hints ) {
+      # Figure out how wide the table will be
+      my $max_name = max(map { length($_) } keys %$hints );
+      $max_name ||= 0;
+      $max_name +=  3;
+      my @meta_rows = create_table2(
+               [ sort keys %$hints ],
+               { map { $_ => $_ } keys %$hints },
+               { map { $_ => trunc($hints->{$_}, $this_term_size[0] - $max_name) } keys %$hints },
+               { sep => '  ' });
+      if (@meta_rows > 10) {
+         # Try to split and stack the meta rows next to each other
+         my $split = int(@meta_rows / 2);
+         @meta_rows = stack_next(
+            [@meta_rows[0..$split - 1]],
+            [@meta_rows[$split..$#meta_rows]],
+            { pad => ' | '},
+         );
+      }
+      print join( "\n",
+         '',
+         map { ref $_ ? colored(@$_) : $_ } create_caption('Choose from', @meta_rows), ''),
+         "\n";
+   }
+   $term->Attribs->{completion_function} = $completion;
+   my $answer = $term->readline("$question: ", $init);
+   $OUTPUT_AUTOFLUSH = 1;
+   $answer = '' if !defined($answer);
+   $answer =~ s/\s+$//;
+   return $answer;
+}
+
+# prompt {{{3
+# Prints out a prompt and reads from the keyboard, then validates with the
+# validation regex until the input is correct.
+sub prompt {
+   die "Can't call in non-interactive mode" if $opts{n};
+   my ( $prompt, $regex, $init, $completion ) = @_;
+   my $response;
+   my $success = 0;
+   do {
+      if ( $completion ) {
+         $term->Attribs->{completion_function} = $completion;
+      }
+      $response = $term->readline("$prompt: ", $init);
+      if ( $regex && $response !~ m/$regex/ ) {
+         print "Invalid response.\n\n";
+      }
+      else {
+         $success = 1;
+      }
+   } while ( !$success );
+   $OUTPUT_AUTOFLUSH = 1;
+   $response =~ s/\s+$//;
+   return $response;
+}
+
+# prompt_noecho {{{3
+# Unfortunately, suppressing echo with Term::ReadLine isn't reliable; the user might not
+# have that library, or it might not support that feature.
+sub prompt_noecho {
+   my ( $prompt ) = @_;
+   print colored("$prompt: ", 'underline');
+   my $response;
+   ReadMode('noecho');
+   $response = <STDIN>;
+   chomp($response);
+   ReadMode('normal');
+   return $response;
+}
+
+# do_key_action {{{3
+# Depending on whether a key was read, do something.  Keys have certain
+# actions defined in lookup tables.  Each mode may have its own lookup table,
+# which trumps the global table -- so keys can be context-sensitive.  The key
+# may be read and written in a subroutine, so it's a global.
+sub do_key_action {
+   if ( defined $char ) {
+      my $mode = $config{mode}->{val};
+      my $action
+         = defined($modes{$mode}->{action_for}->{$char})
+         ? $modes{$mode}->{action_for}->{$char}->{action}
+         : defined($action_for{$char})
+         ? $action_for{$char}->{action}
+         : sub{};
+      $action->();
+   }
+}
+
+# pause {{{3
+sub pause {
+   die "Can't call in non-interactive mode" if $opts{n};
+   my $msg = shift;
+   print defined($msg) ? "\n$msg" : "\nPress any key to continue";
+   ReadMode('cbreak');
+   my $char = ReadKey(0);
+   ReadMode('normal');
+   return $char;
+}
+
+# reverse_sort {{{3
+sub reverse_sort {
+   my $tbl = shift;
+   $tbl_meta{$tbl}->{sort_dir} *= -1;
+}
+
+# select_cxn {{{3
+# Selects connection(s).  If the mode (or argument list) has only one, returns
+# it without prompt.
+sub select_cxn {
+   my ( $prompt, @cxns ) = @_;
+   if ( !@cxns ) {
+      @cxns = get_connections();
+   }
+   if ( @cxns == 1 ) {
+      return $cxns[0];
+   }
+   my $choices = prompt_list(
+         $prompt,
+         $cxns[0],
+         sub{ return @cxns },
+         { map { $_ => $connections{$_}->{dsn} } @cxns });
+   my @result = unique(grep { my $a = $_; grep { $_ eq $a } @cxns } split(/\s+/, $choices));
+   return @result;
+}
+
+# kill_query {{{3
+# Kills a connection, or on new versions, optionally a query but not connection.
+sub kill_query {
+   my ( $q_or_c ) = @_;
+
+   my $info = choose_thread(
+      sub { 1 },
+      'Select a thread to kill the ' . $q_or_c,
+   );
+   return unless $info;
+   return unless pause("Kill $info->{id}?") =~ m/y/i;
+
+   eval {
+      do_stmt($info->{cxn}, $q_or_c eq 'QUERY' ? 'KILL_QUERY' : 'KILL_CONNECTION', $info->{id} );
+   };
+
+   if ( $EVAL_ERROR ) {
+      print "\nError: $EVAL_ERROR";
+      pause();
+   }
+}
+
+# set_display_precision {{{3
+sub set_display_precision {
+   my $dir = shift;
+   $config{num_digits}->{val} = min(9, max(0, $config{num_digits}->{val} + $dir));
+}
+
+sub toggle_visible_table {
+   my ( $mode, $table ) = @_;
+   my $visible = $modes{$mode}->{visible_tables};
+   if ( grep { $_ eq $table } @$visible ) {
+      $modes{$mode}->{visible_tables} = [ grep { $_ ne $table } @$visible ];
+   }
+   else {
+      unshift @$visible, $table;
+   }
+   $modes{$mode}->{cust}->{visible_tables} = 1;
+}
+
+# toggle_filter{{{3
+sub toggle_filter {
+   my ( $tbl, $filter ) = @_;
+   my $filters = $tbl_meta{$tbl}->{filters};
+   if ( grep { $_ eq $filter } @$filters ) {
+      $tbl_meta{$tbl}->{filters} = [ grep { $_ ne $filter } @$filters ];
+   }
+   else {
+      push @$filters, $filter;
+   }
+   $tbl_meta{$tbl}->{cust}->{filters} = 1;
+}
+
+# toggle_config {{{3
+sub toggle_config {
+   my ( $key ) = @_;
+   $config{$key}->{val} ^= 1;
+}
+
+# create_deadlock {{{3
+sub create_deadlock {
+   $clear_screen_sub->();
+
+   print "This function will deliberately cause a small deadlock, "
+      . "clearing deadlock information from the InnoDB monitor.\n\n";
+
+   my $answer = prompt("Are you sure you want to proceed?  Say 'y' if you do");
+   return 0 unless $answer eq 'y';
+
+   my ( $cxn ) = select_cxn('Clear on which server? ');
+   return unless $cxn && exists($connections{$cxn});
+
+   clear_deadlock($cxn);
+}
+
+# deadlock_thread {{{3
+sub deadlock_thread {
+   my ( $id, $tbl, $cxn ) = @_;
+
+   eval {
+      my $dbh = get_new_db_connection($cxn, 1);
+      my @stmts = (
+         "set transaction isolation level serializable",
+         (version_ge($dbh, '4.0.11') ? "start transaction" : 'begin'),
+         "select * from $tbl where a = $id",
+         "update $tbl set a = $id where a <> $id",
+      );
+
+      foreach my $stmt (@stmts[0..2]) {
+         $dbh->do($stmt);
+      }
+      sleep(1 + $id);
+      $dbh->do($stmts[-1]);
+   };
+   if ( $EVAL_ERROR ) {
+      if ( $EVAL_ERROR !~ m/Deadlock found/ ) {
+         die $EVAL_ERROR;
+      }
+   }
+   exit(0);
+}
+
+# Purges unused binlogs on the master, up to but not including the latest log.
+# TODO: guess which connections are slaves of a given master.
+sub purge_master_logs {
+   my @cxns = get_connections();
+
+   get_master_slave_status(@cxns);
+
+   # Toss out the rows that don't have master/slave status...
+   my @vars =
+      grep { $_ && ($_->{file} || $_->{master_host}) }
+      map  { $vars{$_}->{$clock} } @cxns;
+   @cxns = map { $_->{cxn} } @vars;
+
+   # Figure out which master to purge ons.
+   my @masters = map { $_->{cxn} } grep { $_->{file} } @vars;
+   my ( $master ) = select_cxn('Which master?', @masters );
+   return unless $master;
+   my ($master_status) = grep { $_->{cxn} eq $master } @vars;
+
+   # Figure out the result order (not lexical order) of master logs.
+   my @master_logs = get_master_logs($master);
+   my $i = 0;
+   my %master_logs = map { $_->{log_name} => $i++ } @master_logs;
+
+   # Ask which slave(s) are reading from this master.
+   my @slave_status = grep { $_->{master_host} } @vars;
+   my @slaves = map { $_->{cxn} } @slave_status;
+   @slaves = select_cxn("Which slaves are reading from $master?", @slaves);
+   @slave_status = grep { my $item = $_; grep { $item->{cxn} eq $_ } @slaves } @slave_status;
+   return unless @slave_status;
+
+   # Find the minimum binary log in use.
+   my $min_log = min(map { $master_logs{$_->{master_log_file}} } @slave_status);
+   my $log_name = $master_logs[$min_log]->{log_name};
+
+   my $stmt = "PURGE MASTER LOGS TO '$log_name'";
+   send_cmd_to_servers($stmt, 0, 'PURGE {MASTER | BINARY} LOGS {TO "log_name" | BEFORE "date"}', [$master]);
+}
+
+sub send_cmd_to_servers {
+   my ( $cmd, $all, $hint, $cxns ) = @_;
+   if ( $all ) {
+      @$cxns = get_connections();
+   }
+   elsif ( !@$cxns ) {
+      @$cxns = select_cxn('Which servers?', @$cxns);
+   }
+   if ( $hint ) {
+      print "\nHint: $hint\n";
+   }
+   $cmd = prompt('Command to send', undef, $cmd);
+   foreach my $cxn ( @$cxns ) {
+      eval {
+         my $sth = do_query($cxn, $cmd);
+      };
+      if ( $EVAL_ERROR ) {
+         print "Error from $cxn: $EVAL_ERROR\n";
+      }
+      else {
+         print "Success on $cxn\n";
+      }
+   }
+   pause();
+}
+
+# Display functions {{{2
+
+sub set_s_mode {
+   my ( $func ) = @_;
+   $clear_screen_sub->();
+   $config{S_func}->{val} = $func;
+}
+
+# start_S_mode {{{3
+sub start_S_mode {
+   $clear_screen_sub->();
+   switch_mode('S');
+}
+
+# display_B {{{3
+sub display_B {
+   my @display_lines;
+   my @cxns = get_connections();
+   get_innodb_status(\@cxns);
+
+   my @buffer_pool;
+   my @page_statistics;
+   my @insert_buffers;
+   my @adaptive_hash_index;
+   my %rows_for = (
+      buffer_pool         => \@buffer_pool,
+      page_statistics     => \@page_statistics,
+      insert_buffers      => \@insert_buffers,
+      adaptive_hash_index => \@adaptive_hash_index,
+   );
+
+   my @visible = get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+
+   foreach my $cxn ( @cxns ) {
+      my $set = $vars{$cxn}->{$clock};
+      my $pre = $vars{$cxn}->{$clock-1} || $set;
+
+      if ( $set->{IB_bp_complete} ) {
+         if ( $wanted{buffer_pool} ) {
+            push @buffer_pool, extract_values($set, $set, $pre, 'buffer_pool');
+         }
+         if ( $wanted{page_statistics} ) {
+            push @page_statistics, extract_values($set, $set, $pre, 'page_statistics');
+         }
+      }
+      if ( $set->{IB_ib_complete} ) {
+         if ( $wanted{insert_buffers} ) {
+            push @insert_buffers, extract_values(
+               $config{status_inc}->{val} ? inc(0, $cxn) : $set, $set, $pre,
+               'insert_buffers');
+         }
+         if ( $wanted{adaptive_hash_index} ) {
+            push @adaptive_hash_index, extract_values($set, $set, $pre, 'adaptive_hash_index');
+         }
+      }
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   draw_screen(\@display_lines);
+}
+
+# display_C {{{3
+sub display_C {
+   my @display_lines;
+   my @cxns = get_connections();
+   get_status_info(@cxns);
+
+   my @cmd_summary;
+   my %rows_for = (
+      cmd_summary => \@cmd_summary,
+   );
+
+   my @visible = get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+
+   # For now, I'm manually pulling these variables out and pivoting.  Eventually a SQL-ish
+   # dialect should let me join a table to a grouped and pivoted table and do this more easily.
+   # TODO: make it so.
+   my $prefix = qr/^$config{cmd_filter}->{val}/; # TODO: this is a total hack
+   my @values;
+   my ($total, $last_total) = (0, 0);
+   foreach my $cxn ( @cxns ) {
+      my $set = $vars{$cxn}->{$clock};
+      my $pre = $vars{$cxn}->{$clock-1} || $set;
+      foreach my $key ( keys %$set ) {
+         next unless $key =~ m/$prefix/i;
+         my $val = $set->{$key};
+         next unless defined $val && $val =~ m/^\d+$/;
+         my $last_val = $val - ($pre->{$key} || 0);
+         $total      += $val;
+         $last_total += $last_val;
+         push @values, {
+            name       => $key,
+            value      => $val,
+            last_value => $last_val,
+         };
+      }
+   }
+
+   # Add aggregation and turn into a real set TODO: total hack
+   if ( $wanted{cmd_summary} ) {
+      foreach my $value ( @values ) {
+         @{$value}{qw(total last_total)} = ($total, $last_total);
+         push @cmd_summary, extract_values($value, $value, $value, 'cmd_summary');
+      }
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   draw_screen(\@display_lines);
+}
+
+# display_D {{{3
+sub display_D {
+   my @display_lines;
+   my @cxns = get_connections();
+   get_innodb_status(\@cxns);
+
+   my @deadlock_transactions;
+   my @deadlock_locks;
+   my %rows_for = (
+      deadlock_transactions => \@deadlock_transactions,
+      deadlock_locks        => \@deadlock_locks,
+   );
+
+   my @visible = get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+
+   foreach my $cxn ( @cxns ) {
+      my $innodb_status = $vars{$cxn}->{$clock};
+      my $prev_status   = $vars{$cxn}->{$clock-1} || $innodb_status;
+
+      if ( $innodb_status->{IB_dl_timestring} ) {
+
+         my $victim = $innodb_status->{IB_dl_rolled_back} || 0;
+
+         if ( %wanted ) {
+            foreach my $txn_id ( keys %{$innodb_status->{IB_dl_txns}} ) {
+               my $txn = $innodb_status->{IB_dl_txns}->{$txn_id};
+               my $pre = $prev_status->{IB_dl_txns}->{$txn_id} || $txn;
+
+               if ( $wanted{deadlock_transactions} ) {
+                  my $hash = extract_values($txn->{tx}, $txn->{tx}, $pre->{tx}, 'deadlock_transactions');
+                  $hash->{cxn}        = $cxn;
+                  $hash->{dl_txn_num} = $txn_id;
+                  $hash->{victim}     = $txn_id == $victim ? 'Yes' : 'No';
+                  $hash->{timestring} = $innodb_status->{IB_dl_timestring};
+                  $hash->{truncates}  = $innodb_status->{IB_dl_complete} ? 'No' : 'Yes';
+                  push @deadlock_transactions, $hash;
+               }
+
+               if ( $wanted{deadlock_locks} ) {
+                  foreach my $lock ( @{$txn->{locks}} ) {
+                     my $hash = extract_values($lock, $lock, $lock, 'deadlock_locks');
+                     $hash->{dl_txn_num}      = $txn_id;
+                     $hash->{cxn}             = $cxn;
+                     $hash->{mysql_thread_id} = $txn->{tx}->{mysql_thread_id};
+                     push @deadlock_locks, $hash;
+                  }
+               }
+
+            }
+         }
+      }
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   draw_screen(\@display_lines);
+}
+
+# display_F {{{3
+sub display_F {
+   my @display_lines;
+   my ( $cxn ) = get_connections();
+   get_innodb_status([$cxn]);
+   my $innodb_status = $vars{$cxn}->{$clock};
+
+   if ( $innodb_status->{IB_fk_timestring} ) {
+
+      push @display_lines, 'Reason: ' . $innodb_status->{IB_fk_reason};
+
+      # Display FK errors caused by invalid DML.
+      if ( $innodb_status->{IB_fk_txn} ) {
+         my $txn = $innodb_status->{IB_fk_txn};
+         push @display_lines,
+            '',
+            "User $txn->{user} from $txn->{hostname}, thread $txn->{mysql_thread_id} was executing:",
+            '', no_ctrl_char($txn->{query_text});
+      }
+
+      my @fk_table = create_table2(
+         $tbl_meta{fk_error}->{visible},
+         meta_to_hdr('fk_error'),
+         extract_values($innodb_status, $innodb_status, $innodb_status, 'fk_error'),
+         { just => '-', sep => '  '});
+      push @display_lines, '', @fk_table;
+
+   }
+   else {
+      push @display_lines, '', 'No foreign key error data.';
+   }
+   draw_screen(\@display_lines, { raw => 1 } );
+}
+
+# display_I {{{3
+sub display_I {
+   my @display_lines;
+   my @cxns = get_connections();
+   get_innodb_status(\@cxns);
+
+   my @io_threads;
+   my @pending_io;
+   my @file_io_misc;
+   my @log_statistics;
+   my %rows_for = (
+      io_threads     => \@io_threads,
+      pending_io     => \@pending_io,
+      file_io_misc   => \@file_io_misc,
+      log_statistics => \@log_statistics,
+   );
+
+   my @visible = get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+
+   foreach my $cxn ( @cxns ) {
+      my $set = $vars{$cxn}->{$clock};
+      my $pre = $vars{$cxn}->{$clock-1} || $set;
+
+      if ( $set->{IB_io_complete} ) {
+         if ( $wanted{io_threads} ) {
+            my $cur_threads = $set->{IB_io_threads};
+            my $pre_threads = $pre->{IB_io_threads} || $cur_threads;
+            foreach my $key ( sort keys %$cur_threads ) {
+               my $cur_thd = $cur_threads->{$key};
+               my $pre_thd = $pre_threads->{$key} || $cur_thd;
+               my $hash = extract_values($cur_thd, $cur_thd, $pre_thd, 'io_threads');
+               $hash->{cxn} = $cxn;
+               push @io_threads, $hash;
+            }
+         }
+         if ( $wanted{pending_io} ) {
+            push @pending_io, extract_values($set, $set, $pre, 'pending_io');
+         }
+         if ( $wanted{file_io_misc} ) {
+            push @file_io_misc, extract_values(
+               $config{status_inc}->{val} ? inc(0, $cxn) : $set,
+               $set, $pre, 'file_io_misc');
+         }
+      }
+      if ( $set->{IB_lg_complete} && $wanted{log_statistics} ) {
+         push @log_statistics, extract_values($set, $set, $pre, 'log_statistics');
+      }
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   draw_screen(\@display_lines);
+}
+
+# display_L {{{3
+sub display_L {
+   my @display_lines;
+   my @cxns = get_connections();
+   get_innodb_status(\@cxns);
+
+   my @innodb_locks;
+   my %rows_for = (
+      innodb_locks => \@innodb_locks,
+   );
+
+   my @visible = get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+
+   # Get info on locks
+   foreach my $cxn ( @cxns ) {
+      my $set = $vars{$cxn}->{$clock} or next;
+      my $pre = $vars{$cxn}->{$clock-1} || $set;
+
+      if ( $wanted{innodb_locks} && defined $set->{IB_tx_transactions} && @{$set->{IB_tx_transactions}} ) {
+
+         my $cur_txns = $set->{IB_tx_transactions};
+         my $pre_txns = $pre->{IB_tx_transactions} || $cur_txns;
+         my %cur_txns = map { $_->{mysql_thread_id} => $_ } @$cur_txns;
+         my %pre_txns = map { $_->{mysql_thread_id} => $_ } @$pre_txns;
+         foreach my $txn ( @$cur_txns ) {
+            foreach my $lock ( @{$txn->{locks}} ) {
+               my %hash = map { $_ => $txn->{$_} } qw(txn_id mysql_thread_id lock_wait_time active_secs);
+               map { $hash{$_} = $lock->{$_} } qw(lock_type space_id page_no n_bits index db table txn_id lock_mode special insert_intention waiting);
+               $hash{cxn} = $cxn;
+               push @innodb_locks, extract_values(\%hash, \%hash, \%hash, 'innodb_locks');
+            }
+         }
+      }
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   draw_screen(\@display_lines);
+}
+
+# display_M {{{3
+sub display_M {
+   my @display_lines;
+   my @cxns = get_connections();
+   get_master_slave_status(@cxns);
+   get_status_info(@cxns);
+
+   my @slave_sql_status;
+   my @slave_io_status;
+   my @master_status;
+   my %rows_for = (
+      slave_sql_status => \@slave_sql_status,
+      slave_io_status  => \@slave_io_status,
+      master_status    => \@master_status,
+   );
+
+   my @visible = get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+
+   foreach my $cxn ( @cxns ) {
+      my $set  = $config{status_inc}->{val} ? inc(0, $cxn) : $vars{$cxn}->{$clock};
+      my $pre  = $vars{$cxn}->{$clock - 1} || $set;
+      if ( $wanted{slave_sql_status} ) {
+         push @slave_sql_status, extract_values($set, $set, $pre, 'slave_sql_status');
+      }
+      if ( $wanted{slave_io_status} ) {
+         push @slave_io_status, extract_values($set, $set, $pre, 'slave_io_status');
+      }
+      if ( $wanted{master_status} ) {
+         push @master_status, extract_values($set, $set, $pre, 'master_status');
+      }
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   draw_screen(\@display_lines);
+}
+
+# display_O {{{3
+sub display_O {
+   my @display_lines = ('');
+   my @cxns          = get_connections();
+   my @open_tables   = get_open_tables(@cxns);
+   my @tables = map { extract_values($_, $_, $_, 'open_tables') } @open_tables;
+   push @display_lines, set_to_tbl(\@tables, 'open_tables'), get_cxn_errors(@cxns);
+   draw_screen(\@display_lines);
+}
+
+# display_Q {{{3
+sub display_Q {
+   my @display_lines;
+
+   my @q_header;
+   my @processlist;
+   my %rows_for = (
+      q_header    => \@q_header,
+      processlist => \@processlist,
+   );
+
+   my @visible = $opts{n} ? 'processlist' : get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+
+   # Get the data
+   my @cxns             = get_connections();
+   my @full_processlist = get_full_processlist(@cxns);
+
+   # Create header
+   if ( $wanted{q_header} ) {
+      get_status_info(@cxns);
+      foreach my $cxn ( @cxns ) {
+         my $set = $vars{$cxn}->{$clock};
+         my $pre = $vars{$cxn}->{$clock-1} || $set;
+         my $hash = extract_values($set, $set, $pre, 'q_header');
+         $hash->{cxn} = $cxn;
+         $hash->{when} = 'Total';
+         push @q_header, $hash;
+
+         if ( exists $vars{$cxn}->{$clock - 1} ) {
+            my $inc = inc(0, $cxn);
+            my $hash = extract_values($inc, $set, $pre, 'q_header');
+            $hash->{cxn} = $cxn;
+            $hash->{when} = 'Now';
+            push @q_header, $hash;
+         }
+      }
+   }
+
+   if ( $wanted{processlist} ) {
+      # TODO: save prev values
+      push @processlist, map { extract_values($_, $_, $_, 'processlist') } @full_processlist;
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      next unless $wanted{$tbl};
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   # Save queries in global variable for analysis.  The rows in %rows_for have been
+   # filtered, etc as a side effect of set_to_tbl(), so they are the same as the rows
+   # that get pushed to the screen.
+   @current_queries = map {
+      my %hash;
+      @hash{ qw(cxn id db query secs) } = @{$_}{ qw(cxn mysql_thread_id db info secs) };
+      \%hash;
+   } @{$rows_for{processlist}};
+
+   draw_screen(\@display_lines);
+}
+
+# display_R {{{3
+sub display_R {
+   my @display_lines;
+   my @cxns = get_connections();
+   get_innodb_status(\@cxns);
+
+   my @row_operations;
+   my @row_operation_misc;
+   my @semaphores;
+   my @wait_array;
+   my %rows_for = (
+      row_operations     => \@row_operations,
+      row_operation_misc => \@row_operation_misc,
+      semaphores         => \@semaphores,
+      wait_array         => \@wait_array,
+   );
+
+   my @visible = get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+   my $incvar  = $config{status_inc}->{val};
+
+   foreach my $cxn ( @cxns ) {
+      my $set = $vars{$cxn}->{$clock};
+      my $pre = $vars{$cxn}->{$clock-1} || $set;
+      my $inc; # Only assigned to if wanted
+
+      if ( $set->{IB_ro_complete} ) {
+         if ( $wanted{row_operations} ) {
+            $inc ||= $incvar ? inc(0, $cxn) : $set;
+            push @row_operations, extract_values($inc, $set, $pre, 'row_operations');
+         }
+         if ( $wanted{row_operation_misc} ) {
+            push @row_operation_misc, extract_values($set, $set, $pre, 'row_operation_misc'),
+         }
+      }
+
+      if ( $set->{IB_sm_complete} && $wanted{semaphores} ) {
+         $inc ||= $incvar ? inc(0, $cxn) : $set;
+         push @semaphores, extract_values($inc, $set, $pre, 'semaphores');
+      }
+
+      if ( $set->{IB_sm_wait_array_size} && $wanted{wait_array} ) {
+         foreach my $wait ( @{$set->{IB_sm_waits}} ) {
+            my $hash = extract_values($wait, $wait, $wait, 'wait_array');
+            $hash->{cxn} = $cxn;
+            push @wait_array, $hash;
+         }
+      }
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   draw_screen(\@display_lines);
+}
+
+# display_T {{{3
+sub display_T {
+   my @display_lines;
+
+   my @t_header;
+   my @innodb_transactions;
+   my %rows_for = (
+      t_header            => \@t_header,
+      innodb_transactions => \@innodb_transactions,
+   );
+
+   my @visible = $opts{n} ? 'innodb_transactions' : get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+
+   my @cxns = get_connections();
+
+   # If the header is to be shown, buffer pool data is required.
+   get_innodb_status( \@cxns, [ $wanted{t_header} ? qw(bp) : () ] );
+
+   foreach my $cxn ( get_connections() ) {
+      my $set = $vars{$cxn}->{$clock};
+      my $pre = $vars{$cxn}->{$clock-1} || $set;
+
+      next unless $set->{IB_tx_transactions};
+
+      if ( $wanted{t_header} ) {
+         my $hash = extract_values($set, $set, $pre, 't_header');
+         push @t_header, $hash;
+      }
+
+      if ( $wanted{innodb_transactions} ) {
+         my $cur_txns = $set->{IB_tx_transactions};
+         my $pre_txns = $pre->{IB_tx_transactions} || $cur_txns;
+         my %cur_txns = map { $_->{mysql_thread_id} => $_ } @$cur_txns;
+         my %pre_txns = map { $_->{mysql_thread_id} => $_ } @$pre_txns;
+         foreach my $thd_id ( sort keys %cur_txns ) {
+            my $cur_txn = $cur_txns{$thd_id};
+            my $pre_txn = $pre_txns{$thd_id} || $cur_txn;
+            my $hash    = extract_values($cur_txn, $cur_txn, $pre_txn, 'innodb_transactions');
+            $hash->{cxn} = $cxn;
+            push @innodb_transactions, $hash;
+         }
+      }
+
+   }
+
+   my $first_table = 0;
+   foreach my $tbl ( @visible ) {
+      push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+      push @display_lines, get_cxn_errors(@cxns)
+         if ( $config{debug}->{val} || !$first_table++ );
+   }
+
+   # Save queries in global variable for analysis.  The rows in %rows_for have been
+   # filtered, etc as a side effect of set_to_tbl(), so they are the same as the rows
+   # that get pushed to the screen.
+   @current_queries = map {
+      my %hash;
+      @hash{ qw(cxn id db query secs) } = @{$_}{ qw(cxn mysql_thread_id db query_text active_secs) };
+      \%hash;
+   } @{$rows_for{innodb_transactions}};
+
+   draw_screen(\@display_lines);
+}
+
+# display_S {{{3
+sub display_S {
+   my $fmt  = get_var_set('S_set');
+   my $func = $config{S_func}->{val};
+   my $inc  = $func eq 'g' || $config{status_inc}->{val};
+
+   # The table's meta-data is generated from the compiled var_set.
+   my ( $cols, $visible );
+   if ( $tbl_meta{var_status}->{fmt} && $fmt eq $tbl_meta{var_status}->{fmt} ) {
+      ( $cols, $visible ) = @{$tbl_meta{var_status}}{qw(cols visible)};
+   }
+   else {
+      ( $cols, $visible ) = compile_select_stmt($fmt);
+
+      # Apply missing values to columns.  Always apply averages across all connections.
+      map {
+         $_->{agg}   = 'avg';
+         $_->{label} = $_->{hdr};
+      } values %$cols;
+
+      $tbl_meta{var_status}->{cols}    = $cols;
+      $tbl_meta{var_status}->{visible} = $visible;
+      $tbl_meta{var_status}->{fmt}     = $fmt;
+      map { $tbl_meta{var_status}->{cols}->{$_}->{just} = ''} @$visible;
+   }
+
+   my @var_status;
+   my %rows_for = (
+      var_status => \@var_status,
+   );
+
+   my @visible = get_visible_tables();
+   my %wanted  = map { $_ => 1 } @visible;
+   my @cxns    = get_connections();
+
+   get_status_info(@cxns);
+   get_innodb_status(\@cxns);
+
+   # Set up whether to pivot and how many sets to extract.
+   $tbl_meta{var_status}->{pivot} = $func eq 'v';
+
+   my $num_sets
+      = $func eq 'v'
+      ? $config{num_status_sets}->{val}
+      : 0;
+   foreach my $set ( 0 .. $num_sets ) {
+      my @rows;
+      foreach my $cxn ( @cxns ) {
+         my $vars = $inc ? inc($set, $cxn) : $vars{$cxn}->{$clock - $set};
+         my $cur  = $vars{$cxn}->{$clock-$set};
+         my $pre  = $vars{$cxn}->{$clock-$set-1} || $cur;
+         next unless $vars && %$vars;
+         my $hash = extract_values($vars, $cur, $pre, 'var_status');
+         push @rows, $hash;
+      }
+      @rows = apply_group_by('var_status', [], @rows);
+      push @var_status, @rows;
+   }
+
+   # Recompile the sort func. TODO: avoid recompiling at every refresh.
+   # Figure out whether the data is all numeric and decide on a sort type.
+   # my $cmp
+   #   = scalar(
+   #      grep { !defined $_ || $_ !~ m/^\d+$/ }
+   #      map  { my $col = $_; map { $_->{$col} } @var_status }
+   #           $tbl_meta{var_status}->{sort_cols} =~ m/(\w+)/g)
+   #   ? 'cmp'
+   #   : '<=>';
+   $tbl_meta{var_status}->{sort_func} = make_sort_func($tbl_meta{var_status});
+
+   # ################################################################
+   # Now there is specific display code based on $config{S_func}
+   # ################################################################
+   if ( $func =~ m/s|g/ ) {
+      my $min_width = 4;
+
+      # Clear the screen if the display width changed.
+      if ( @last_term_size && $this_term_size[0] != $last_term_size[0] ) {
+         $lines_printed = 0;
+         $clear_screen_sub->();
+      }
+
+      if ( $func eq 's' ) {
+         # Decide how wide columns should be.
+         my $num_cols = scalar(@$visible);
+         my $width    = $opts{n} ? 0 : max($min_width, int(($this_term_size[0] - $num_cols + 1) / $num_cols));
+         my $g_format = $opts{n} ? ( "%s\t" x $num_cols ) : ( "%-${width}s " x $num_cols );
+
+         # Print headers every now and then.  Headers can get really long, so compact them.
+         my @hdr = @$visible;
+         if ( $opts{n} ) {
+            if ( $lines_printed == 0 ) {
+               print join("\t", @hdr), "\n";
+               $lines_printed++;
+            }
+         }
+         elsif ( $lines_printed == 0 || $lines_printed > $this_term_size[1] - 2 ) {
+            @hdr = map { donut(crunch($_, $width), $width) } @hdr;
+            print join(' ', map { sprintf( "%${width}s", donut($_, $width)) } @hdr) . "\n";
+            $lines_printed = 1;
+         }
+
+         # Design a column format for the values.
+         my $format
+            = $opts{n}
+            ? join("\t", map { '%s' } @$visible) . "\n"
+            : join(' ',  map { "%${width}s" } @hdr) . "\n";
+
+         foreach my $row ( @var_status ) {
+            printf($format, map { defined $_ ? $_ : '' } @{$row}{ @$visible });
+            $lines_printed++;
+         }
+      }
+      else { # 'g' mode
+         # Design a column format for the values.
+         my $num_cols = scalar(@$visible);
+         my $width    = $opts{n} ? 0 : int(($this_term_size[0] - $num_cols + 1) / $num_cols);
+         my $format   = $opts{n} ? ( "%s\t" x $num_cols ) : ( "%-${width}s " x $num_cols );
+         $format      =~ s/\s$/\n/;
+
+         # Print headers every now and then.
+         if ( $opts{n} ) {
+            if ( $lines_printed == 0 ) {
+               print join("\t", @$visible), "\n";
+               print join("\t", map { shorten($mvs{$_}) } @$visible), "\n";
+            }
+         }
+         elsif ( $lines_printed == 0 || $lines_printed > $this_term_size[1] - 2 ) {
+            printf($format, map { donut(crunch($_, $width), $width) } @$visible);
+            printf($format, map { shorten($mvs{$_} || 0) } @$visible);
+            $lines_printed = 2;
+         }
+
+         # Update the max ever seen, and scale by the max ever seen.
+         my $set = $var_status[0];
+         foreach my $col ( @$visible ) {
+            $set->{$col}  = 1 unless defined $set->{$col} && $set->{$col} =~ m/$num_regex/;
+            $set->{$col}  = ($set->{$col} || 1) / ($set->{Uptime_hires} || 1);
+            $mvs{$col}    = max($mvs{$col} || 1, $set->{$col});
+            $set->{$col} /= $mvs{$col};
+         }
+         printf($format, map { ( $config{graph_char}->{val} x int( $width * $set->{$_} )) || '.' } @$visible );
+         $lines_printed++;
+
+      }
+   }
+   else { # 'v'
+      my $first_table = 0;
+      my @display_lines;
+      foreach my $tbl ( @visible ) {
+         push @display_lines, '', set_to_tbl($rows_for{$tbl}, $tbl);
+         push @display_lines, get_cxn_errors(@cxns)
+            if ( $config{debug}->{val} || !$first_table++ );
+      }
+      $clear_screen_sub->();
+      draw_screen( \@display_lines );
+   }
+}
+
+# display_explain {{{3
+sub display_explain {
+   my $info = shift;
+   my $cxn   = $info->{cxn};
+   my $db    = $info->{db};
+
+   my ( $mods, $query ) = rewrite_for_explain($info->{query});
+
+   my @display_lines;
+
+   if ( $query ) {
+
+      my $part = version_ge($dbhs{$cxn}->{dbh}, '5.1.5') ? 'PARTITIONS' : '';
+      $query = "EXPLAIN $part\n" . $query;
+
+      eval {
+         if ( $db ) {
+            do_query($cxn, "use $db");
+         }
+         my $sth = do_query($cxn, $query);
+
+         my $res;
+         while ( $res = $sth->fetchrow_hashref() ) {
+            map { $res->{$_} ||= '' } ( 'partitions', keys %$res);
+            my @this_table = create_caption("Sub-Part $res->{id}",
+               create_table2(
+                  $tbl_meta{explain}->{visible},
+                  meta_to_hdr('explain'),
+                  extract_values($res, $res, $res, 'explain')));
+            @display_lines = stack_next(\@display_lines, \@this_table, { pad => '  ', vsep => 2 });
+         }
+      };
+
+      if ( $EVAL_ERROR ) {
+         push @display_lines,
+            '',
+            "The query could not be explained.  Only SELECT queries can be "
+            . "explained; innotop tries to rewrite certain REPLACE and INSERT queries "
+            . "into SELECT, but this doesn't always succeed.";
+      }
+
+   }
+   else {
+      push @display_lines, '', 'The query could not be explained.';
+   }
+
+   if ( $mods ) {
+      push @display_lines, '', '[This query has been re-written to be explainable]';
+   }
+
+   unshift @display_lines, no_ctrl_char($query);
+   draw_screen(\@display_lines, { raw => 1 } );
+}
+
+# rewrite_for_explain {{{3
+sub rewrite_for_explain {
+   my $query = shift;
+
+   my $mods = 0;
+   my $orig = $query;
+   $mods += $query =~ s/^\s*(?:replace|insert).*?select/select/is;
+   $mods += $query =~ s/^
+      \s*create\s+(?:temporary\s+)?table
+      \s+(?:\S+\s+)as\s+select/select/xis;
+   $mods += $query =~ s/\s+on\s+duplicate\s+key\s+update.*$//is;
+   return ( $mods, $query );
+}
+
+# show_optimized_query {{{3
+sub show_optimized_query {
+   my $info = shift;
+   my $cxn   = $info->{cxn};
+   my $db    = $info->{db};
+   my $meta  = $dbhs{$cxn};
+
+   my @display_lines;
+
+   my ( $mods, $query ) = rewrite_for_explain($info->{query});
+
+   if ( $mods ) {
+      push @display_lines, '[This query has been re-written to be explainable]';
+   }
+
+   if ( $query ) {
+      push @display_lines, no_ctrl_char($info->{query});
+
+      eval {
+         if ( $db ) {
+            do_query($cxn, "use $db");
+         }
+         do_query( $cxn, 'EXPLAIN EXTENDED ' . $query ) or die "Can't explain query";
+         my $sth = do_query($cxn, 'SHOW WARNINGS');
+         my $res = $sth->fetchall_arrayref({});
+
+         if ( $res ) {
+            foreach my $result ( @$res ) {
+               push @display_lines, 'Note:', no_ctrl_char($result->{message});
+            }
+         }
+         else {
+            push @display_lines, '', 'The query optimization could not be generated.';
+         }
+      };
+
+      if ( $EVAL_ERROR ) {
+         push @display_lines, '', "The optimization could not be generated: $EVAL_ERROR";
+      }
+
+   }
+   else {
+      push @display_lines, '', 'The query optimization could not be generated.';
+   }
+
+   draw_screen(\@display_lines, { raw => 1 } );
+}
+
+# display_help {{{3
+sub display_help {
+   my $mode = $config{mode}->{val};
+
+   # Get globally mapped keys, then overwrite them with mode-specific ones.
+   my %keys = map {
+         $_ => $action_for{$_}->{label}
+      } keys %action_for;
+   foreach my $key ( keys %{$modes{$mode}->{action_for}} ) {
+      $keys{$key} = $modes{$mode}->{action_for}->{$key}->{label};
+   }
+   delete $keys{'?'};
+
+   # Split them into three kinds of keys: MODE keys, action keys, and
+   # magic (special character) keys.
+   my @modes   = sort grep { m/[A-Z]/   } keys %keys;
+   my @actions = sort grep { m/[a-z]/   } keys %keys;
+   my @magic   = sort grep { m/[^A-Z]/i } keys %keys;
+
+   my @display_lines = ( '', 'Switch to a different mode:' );
+
+   # Mode keys
+   my @all_modes = map { "$_  $modes{$_}->{hdr}" } @modes;
+   my @col1 = splice(@all_modes, 0, ceil(@all_modes/3));
+   my @col2 = splice(@all_modes, 0, ceil(@all_modes/2));
+   my $max1 = max(map {length($_)} @col1);
+   my $max2 = max(map {length($_)} @col2);
+   while ( @col1 ) {
+      push @display_lines, sprintf("   %-${max1}s  %-${max2}s  %s",
+         (shift @col1      || ''),
+         (shift @col2      || ''),
+         (shift @all_modes || ''));
+   }
+
+   # Action keys
+   my @all_actions = map { "$_  $keys{$_}" } @actions;
+   @col1 = splice(@all_actions, 0, ceil(@all_actions/2));
+   $max1 = max(map {length($_)} @col1);
+   push @display_lines, '', 'Actions:';
+   while ( @col1 ) {
+      push @display_lines, sprintf("   %-${max1}s  %s",
+         (shift @col1        || ''),
+         (shift @all_actions || ''));
+   }
+
+   # Magic keys
+   my @all_magic = map { sprintf('%4s', $action_for{$_}->{key} || $_) . "  $keys{$_}" } @magic;
+   @col1 = splice(@all_magic, 0, ceil(@all_magic/2));
+   $max1 = max(map {length($_)} @col1);
+   push @display_lines, '', 'Other:';
+   while ( @col1 ) {
+      push @display_lines, sprintf("%-${max1}s%s",
+         (shift @col1      || ''),
+         (shift @all_magic || ''));
+   }
+
+   $clear_screen_sub->();
+   draw_screen(\@display_lines, { show_all => 1 } );
+   pause();
+   $clear_screen_sub->();
+}
+
+# show_full_query {{{3
+sub show_full_query {
+   my $info = shift;
+   my @display_lines = no_ctrl_char($info->{query});
+   draw_screen(\@display_lines, { raw => 1 });
+}
+
+# Formatting functions {{{2
+
+# create_table2 {{{3
+# Makes a two-column table, labels on left, data on right.
+# Takes refs of @cols, %labels and %data, %user_prefs
+sub create_table2 {
+   my ( $cols, $labels, $data, $user_prefs ) = @_;
+   my @rows;
+
+   if ( @$cols && %$data ) {
+
+      # Override defaults
+      my $p = {
+         just  => '',
+         sep   => ':',
+         just1 => '-',
+      };
+      if ( $user_prefs ) {
+         map { $p->{$_} = $user_prefs->{$_} } keys %$user_prefs;
+      }
+
+      # Fix undef values
+      map { $data->{$_} = '' unless defined $data->{$_} } @$cols;
+
+      # Format the table
+      my $max_l = max(map{ length($labels->{$_}) } @$cols);
+      my $max_v = max(map{ length($data->{$_}) } @$cols);
+      my $format    = "%$p->{just}${max_l}s$p->{sep} %$p->{just1}${max_v}s";
+      foreach my $col ( @$cols ) {
+         push @rows, sprintf($format, $labels->{$col}, $data->{$col});
+      }
+   }
+   return @rows;
+}
+
+# stack_next {{{3
+# Stacks one display section next to the other.  Accepts left-hand arrayref,
+# right-hand arrayref, and options hashref.  Tries to stack as high as
+# possible, so
+# aaaaaa
+# bbb
+# can stack ccc next to the bbb.
+# NOTE: this DOES modify its arguments, even though it returns a new array.
+sub stack_next {
+   my ( $left, $right, $user_prefs ) = @_;
+   my @result;
+
+   my $p = {
+      pad   => ' ',
+      vsep  => 0,
+   };
+   if ( $user_prefs ) {
+      map { $p->{$_} = $user_prefs->{$_} } keys %$user_prefs;
+   }
+
+   # Find out how wide the LHS can be and still let the RHS fit next to it.
+   my $pad   = $p->{pad};
+   my $max_r = max( map { length($_) } @$right) || 0;
+   my $max_l = $this_term_size[0] - $max_r - length($pad);
+
+   # Find the minimum row on the LHS that the RHS will fit next to.
+   my $i = scalar(@$left) - 1;
+   while ( $i >= 0 && length($left->[$i]) <= $max_l ) {
+      $i--;
+   }
+   $i++;
+   my $offset = $i;
+
+   if ( $i < scalar(@$left) ) {
+      # Find the max width of the section of the LHS against which the RHS
+      # will sit.
+      my $max_i_in_common = min($i + scalar(@$right) - 1, scalar(@$left) - 1);
+      my $max_width = max( map { length($_) } @{$left}[$i..$max_i_in_common]);
+
+      # Append the RHS onto the LHS until one runs out.
+      while ( $i < @$left && $i - $offset < @$right ) {
+         my $format = "%-${max_width}s$pad%${max_r}s";
+         $left->[$i] = sprintf($format, $left->[$i], $right->[$i - $offset]);
+         $i++;
+      }
+      while ( $i - $offset < @$right ) {
+         # There is more RHS to push on the end of the array
+         push @$left,
+            sprintf("%${max_width}s$pad%${max_r}s", ' ', $right->[$i - $offset]);
+         $i++;
+      }
+      push @result, @$left;
+   }
+   else {
+      # There is no room to put them side by side.  Add them below, with
+      # a blank line above them if specified.
+      push @result, @$left;
+      push @result, (' ' x $this_term_size[0]) if $p->{vsep} && @$left;
+      push @result, @$right;
+   }
+   return @result;
+}
+
+# create_caption {{{3
+sub create_caption {
+   my ( $caption, @rows ) = @_;
+   if ( @rows ) {
+
+      # Calculate the width of what will be displayed, so it can be centered
+      # in that space.  When the thing is wider than the display, center the
+      # caption in the display.
+      my $width = min($this_term_size[0], max(map { length(ref($_) ? $_->[0] : $_) } @rows));
+
+      my $cap_len = length($caption);
+
+      # It may be narrow enough to pad the sides with underscores and save a
+      # line on the screen.
+      if ( $cap_len <= $width - 6 ) {
+         my $left = int(($width - 2 - $cap_len) / 2);
+         unshift @rows,
+            ("_" x $left) . " $caption " . ("_" x ($width - $left - $cap_len - 2));
+      }
+
+      # The caption is too wide to add underscores on each side.
+      else {
+
+         # Color is supported, so we can use terminal underlining.
+         if ( $config{color}->{val} ) {
+            my $left = int(($width - $cap_len) / 2);
+            unshift @rows, [
+               (" " x $left) . $caption . (" " x ($width - $left - $cap_len)),
+               'underline',
+            ];
+         }
+
+         # Color is not supported, so we have to add a line underneath to separate the
+         # caption from whatever it's captioning.
+         else {
+            my $left = int(($width - $cap_len) / 2);
+            unshift @rows, ('-' x $width);
+            unshift @rows, (" " x $left) . $caption . (" " x ($width - $left - $cap_len));
+         }
+
+         # The caption is wider than the thing it labels, so we have to pad the
+         # thing it labels to a consistent width.
+         if ( $cap_len > $width ) {
+            @rows = map {
+               ref($_)
+                  ? [ sprintf('%-' . $cap_len . 's', $_->[0]), $_->[1] ]
+                  : sprintf('%-' . $cap_len . 's', $_);
+            } @rows;
+         }
+
+      }
+   }
+   return @rows;
+}
+
+# create_table {{{3
+# Input: an arrayref of columns, hashref of col info, and an arrayref of hashes
+# Example: [ 'a', 'b' ]
+#          { a => spec, b => spec }
+#          [ { a => 1, b => 2}, { a => 3, b => 4 } ]
+# The 'spec' is a hashref of hdr => label, just => ('-' or '').  It also supports min and max-widths
+# vi the minw and maxw params.
+# Output: an array of strings, one per row.
+# Example:
+# Column One Column Two
+# ---------- ----------
+# 1          2
+# 3          4
+sub create_table {
+   my ( $cols, $info, $data, $prefs ) = @_;
+   $prefs ||= {};
+   $prefs->{no_hdr} ||= ($opts{n} && $clock != 1);
+
+   # Truncate rows that will surely be off screen even if this is the only table.
+   if ( !$opts{n} && !$prefs->{raw} && !$prefs->{show_all} && $this_term_size[1] < @$data-1 ) {
+      $data = [ @$data[0..$this_term_size[1] - 1] ];
+   }
+
+   my @rows = ();
+
+   if ( @$cols && %$info ) {
+
+      # Fix undef values, collapse whitespace.
+      foreach my $row ( @$data ) {
+         map { $row->{$_} = collapse_ws($row->{$_}) } @$cols;
+      }
+
+      my $col_sep = $opts{n} ? "\t" : '  ';
+
+      # Find each column's max width.
+      my %width_for;
+      if ( !$opts{n} ) {
+         %width_for = map {
+            my $col_name  = $_;
+            if ( $info->{$_}->{dec} ) {
+               # Align along the decimal point
+               my $max_rodp = max(0, map { $_->{$col_name} =~ m/([^\s\d-].*)$/ ? length($1) : 0 } @$data);
+               foreach my $row ( @$data ) {
+                  my $col = $row->{$col_name};
+                  my ( $l, $r ) = $col =~ m/^([\s\d]*)(.*)$/;
+                  $row->{$col_name} = sprintf("%s%-${max_rodp}s", $l, $r);
+               }
+            }
+            my $max_width = max( length($info->{$_}->{hdr}), map { length($_->{$col_name}) } @$data);
+            if ( $info->{$col_name}->{maxw} ) {
+               $max_width = min( $max_width, $info->{$col_name}->{maxw} );
+            }
+            if ( $info->{$col_name}->{minw} ) {
+               $max_width = max( $max_width, $info->{$col_name}->{minw} );
+            }
+            $col_name => $max_width;
+         } @$cols;
+      }
+
+      # The table header.
+      if ( !$config{hide_hdr}->{val} && !$prefs->{no_hdr} ) {
+         push @rows, $opts{n}
+            ? join( $col_sep, @$cols )
+            : join( $col_sep, map { sprintf( "%-$width_for{$_}s", trunc($info->{$_}->{hdr}, $width_for{$_}) ) } @$cols );
+         if ( $config{color}->{val} && $config{header_highlight}->{val} ) {
+            push @rows, [ pop @rows, $config{header_highlight}->{val} ];
+         }
+         elsif ( !$opts{n} ) {
+            push @rows, join( $col_sep, map { "-" x $width_for{$_} } @$cols );
+         }
+      }
+
+      # The table data.
+      if ( $opts{n} ) {
+         foreach my $item ( @$data ) {
+            push @rows, join($col_sep, map { $item->{$_} } @$cols );
+         }
+      }
+      else {
+         my $format = join( $col_sep,
+            map { "%$info->{$_}->{just}$width_for{$_}s" } @$cols );
+         foreach my $item ( @$data ) {
+            my $row = sprintf($format, map { trunc($item->{$_}, $width_for{$_}) } @$cols );
+            if ( $config{color}->{val} && $item->{_color} ) {
+               push @rows, [ $row, $item->{_color} ];
+            }
+            else {
+               push @rows, $row;
+            }
+         }
+      }
+   }
+
+   return @rows;
+}
+
+# Aggregates a table.  If $group_by is an arrayref of columns, the grouping key
+# is the specified columns; otherwise it's just the empty string (e.g.
+# everything is grouped as one group).
+sub apply_group_by {
+   my ( $tbl, $group_by, @rows ) = @_;
+   my $meta = $tbl_meta{$tbl};
+   my %is_group = map { $_ => 1 } @$group_by;
+   my @non_grp  = grep { !$is_group{$_} } keys %{$meta->{cols}};
+
+   my %temp_table;
+   foreach my $row ( @rows ) {
+      my $group_key
+         = @$group_by
+         ? '{' . join('}{', map { defined $_ ? $_ : '' } @{$row}{@$group_by}) . '}'
+         : '';
+      $temp_table{$group_key} ||= [];
+      push @{$temp_table{$group_key}}, $row;
+   }
+
+   # Crush the rows together...
+   my @new_rows;
+   foreach my $key ( sort keys %temp_table ) {
+      my $group = $temp_table{$key};
+      my %new_row;
+      @new_row{@$group_by} = @{$group->[0]}{@$group_by};
+      foreach my $col ( @non_grp ) {
+         my $agg = $meta->{cols}->{$col}->{agg} || 'first';
+         $new_row{$col} = $agg_funcs{$agg}->( map { $_->{$col} } @$group );
+      }
+      push @new_rows, \%new_row;
+   }
+   return @new_rows;
+}
+
+# set_to_tbl {{{3
+# Unifies all the work of filtering, sorting etc.  Alters the input.
+# TODO: pull all the little pieces out into subroutines and stick events in each of them.
+sub set_to_tbl {
+   my ( $rows, $tbl ) = @_;
+   my $meta = $tbl_meta{$tbl} or die "No such table $tbl in tbl_meta";
+
+   # don't show cxn if there's only one connection being displayed
+   my @visible;
+   if (scalar @{$modes{$config{mode}->{val}}->{connections}} == 1) {
+      map { push @visible, $_ if $_ !~ /^cxn$/ } @{$meta->{visible}};
+      delete $$rows[0]{cxn} if defined $$rows[0]{cxn};
+   }
+   else {
+      @visible = @{$meta->{visible}};
+   }
+
+   if ( !$meta->{pivot} ) {
+
+      # Hook in event listeners
+      foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_filter}} ) {
+         $listener->set_to_tbl_pre_filter($rows, $tbl);
+      }
+
+      # Apply filters.  Note that if the table is pivoted, filtering and sorting
+      # are applied later.
+      foreach my $filter ( @{$meta->{filters}} ) {
+         eval {
+            @$rows = grep { $filters{$filter}->{func}->($_) } @$rows;
+         };
+         if ( $EVAL_ERROR && $config{debug}->{val} ) {
+            die $EVAL_ERROR;
+         }
+      }
+
+      foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_sort}} ) {
+         $listener->set_to_tbl_pre_sort($rows, $tbl);
+      }
+
+      # Sort.  Note that if the table is pivoted, sorting might have the wrong
+      # columns and it could crash.  This will only be an issue if it's possible
+      # to toggle pivoting on and off, which it's not at the moment.
+      if ( @$rows && $meta->{sort_func} && !$meta->{aggregate} ) {
+         if ( $meta->{sort_dir} > 0 ) {
+            @$rows = $meta->{sort_func}->( @$rows );
+         }
+         else {
+            @$rows = reverse $meta->{sort_func}->( @$rows );
+         }
+      }
+
+   }
+
+   # Stop altering arguments now.
+   my @rows = @$rows;
+
+   foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_group}} ) {
+      $listener->set_to_tbl_pre_group(\@rows, $tbl);
+   }
+
+   # Apply group-by.
+   if ( $meta->{aggregate} ) {
+      @rows = apply_group_by($tbl, $meta->{group_by}, @rows);
+
+      # Sort.  Note that if the table is pivoted, sorting might have the wrong
+      # columns and it could crash.  This will only be an issue if it's possible
+      # to toggle pivoting on and off, which it's not at the moment.
+      if ( @rows && $meta->{sort_func} ) {
+         if ( $meta->{sort_dir} > 0 ) {
+            @rows = $meta->{sort_func}->( @rows );
+         }
+         else {
+            @rows = reverse $meta->{sort_func}->( @rows );
+         }
+      }
+
+   }
+
+   foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_colorize}} ) {
+      $listener->set_to_tbl_pre_colorize(\@rows, $tbl);
+   }
+
+   if ( !$meta->{pivot} ) {
+      # Colorize.  Adds a _color column to rows.
+      if ( @rows && $meta->{color_func} ) {
+         eval {
+            foreach my $row ( @rows ) {
+               $row->{_color} = $meta->{color_func}->($row);
+            }
+         };
+         if ( $EVAL_ERROR ) {
+            pause($EVAL_ERROR);
+         }
+      }
+   }
+
+   foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_transform}} ) {
+      $listener->set_to_tbl_pre_transform(\@rows, $tbl);
+   }
+
+   # Apply_transformations.
+   if ( @rows ) {
+      my $cols = $meta->{cols};
+      foreach my $col ( keys %{$rows->[0]} ) {
+         # Don't auto-vivify $tbl_meta{tbl}-{cols}->{_color}->{trans}
+         next if $col eq '_color';
+         foreach my $trans ( @{$cols->{$col}->{trans}} ) {
+            map { $_->{$col} = $trans_funcs{$trans}->($_->{$col}) } @rows;
+         }
+      }
+   }
+
+   my ($fmt_cols, $fmt_meta);
+
+   # Pivot.
+   if ( $meta->{pivot} ) {
+
+      foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_pivot}} ) {
+         $listener->set_to_tbl_pre_pivot(\@rows, $tbl);
+      }
+
+      my @vars = @{$meta->{visible}};
+      my @tmp  = map { { name => $_ } } @vars;
+      my @cols = 'name';
+      foreach my $i ( 0..@$rows-1 ) {
+         my $col = "set_$i";
+         push @cols, $col;
+         foreach my $j ( 0..@vars-1 ) {
+            $tmp[$j]->{$col} = $rows[$i]->{$vars[$j]};
+         }
+      }
+      $fmt_meta = { map { $_ => { hdr => $_, just => '-' } } @cols };
+      $fmt_cols = \@cols;
+      @rows = @tmp;
+
+      # Hook in event listeners
+      foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_filter}} ) {
+         $listener->set_to_tbl_pre_filter($rows, $tbl);
+      }
+
+      # Apply filters.
+      foreach my $filter ( @{$meta->{filters}} ) {
+         eval {
+            @rows = grep { $filters{$filter}->{func}->($_) } @rows;
+         };
+         if ( $EVAL_ERROR && $config{debug}->{val} ) {
+            die $EVAL_ERROR;
+         }
+      }
+
+      foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_sort}} ) {
+         $listener->set_to_tbl_pre_sort($rows, $tbl);
+      }
+
+      # Sort.
+      if ( @rows && $meta->{sort_func} ) {
+         if ( $meta->{sort_dir} > 0 ) {
+            @rows = $meta->{sort_func}->( @rows );
+         }
+         else {
+            @rows = reverse $meta->{sort_func}->( @rows );
+         }
+      }
+
+   }
+   else {
+      # If the table isn't pivoted, just show all columns that are supposed to
+      # be shown; but eliminate aggonly columns if the table isn't aggregated.
+      my $aggregated = $meta->{aggregate};
+      $fmt_cols = [ grep { $aggregated || !$meta->{cols}->{$_}->{aggonly} } @visible ];
+      $fmt_meta = { map  { $_ => $meta->{cols}->{$_}                      } @$fmt_cols };
+
+      # If the table is aggregated, re-order the group_by columns to the left of
+      # the display.
+      if ( $aggregated ) {
+         my %is_group = map { $_ => 1 } @{$meta->{group_by}};
+         $fmt_cols = [ @{$meta->{group_by}}, grep { !$is_group{$_} } @$fmt_cols ];
+      }
+   }
+
+   foreach my $listener ( @{$event_listener_for{set_to_tbl_pre_create}} ) {
+      $listener->set_to_tbl_pre_create(\@rows, $tbl);
+   }
+
+   @rows = create_table( $fmt_cols, $fmt_meta, \@rows);
+   if ( !$meta->{hide_caption} && !$opts{n} && $config{display_table_captions}->{val} ) {
+      @rows = create_caption($meta->{capt}, @rows)
+   }
+
+   foreach my $listener ( @{$event_listener_for{set_to_tbl_post_create}} ) {
+      $listener->set_to_tbl_post_create(\@rows, $tbl);
+   }
+
+   return @rows;
+}
+
+# meta_to_hdr {{{3
+sub meta_to_hdr {
+   my $tbl = shift;
+   my $meta = $tbl_meta{$tbl};
+   my %labels = map { $_ => $meta->{cols}->{$_}->{hdr} } @{$meta->{visible}};
+   return \%labels;
+}
+
+# commify {{{3
+# From perlfaq5: add commas.
+sub commify {
+   my ( $num ) = @_;
+   $num = 0 unless defined $num;
+   $num =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g;
+   return $num;
+}
+
+# set_precision {{{3
+# Trim to desired precision.
+sub set_precision {
+   my ( $num, $precision ) = @_;
+   $precision = $config{num_digits}->{val} if !defined $precision;
+   sprintf("%.${precision}f", $num);
+}
+
+# percent {{{3
+# Convert to percent
+sub percent {
+   my ( $num ) = @_;
+   $num = 0 unless defined $num;
+   my $digits = $config{num_digits}->{val};
+   return sprintf("%.${digits}f", $num * 100)
+      . ($config{show_percent}->{val} ? '%' : '');
+}
+
+# shorten {{{3
+sub shorten {
+   my ( $num, $opts ) = @_;
+
+   return $num if !defined($num) || $opts{n} || $num !~ m/$num_regex/;
+
+   $opts ||= {};
+   my $pad = defined $opts->{pad} ? $opts->{pad} : '';
+   my $num_digits = defined $opts->{num_digits}
+      ? $opts->{num_digits}
+      : $config{num_digits}->{val};
+   my $force = defined $opts->{force};
+
+   my $n = 0;
+   while ( $num >= 1_024 ) {
+      $num /= 1_024;
+      ++$n;
+   }
+   return sprintf(
+      $num =~ m/\./ || $n || $force
+         ? "%.${num_digits}f%s"
+         : '%d',
+      $num, ($pad,'k','M','G', 'T')[$n]);
+
+}
+
+# Utility functions {{{2
+# unique {{{3
+sub unique {
+   my %seen;
+   return grep { !$seen{$_}++ } @_;
+}
+
+# make_color_func {{{3
+sub make_color_func {
+   my ( $tbl ) = @_;
+   my @criteria;
+   foreach my $spec ( @{$tbl->{colors}} ) {
+      next unless exists $comp_ops{$spec->{op}};
+      my $val = $spec->{op} =~ m/^(?:eq|ne|le|ge|lt|gt)$/ ? "'$spec->{arg}'"
+              : $spec->{op} =~ m/^(?:=~|!~)$/             ? "m/" . quotemeta($spec->{arg}) . "/"
+              :                                             $spec->{arg};
+      push @criteria,
+         "( defined \$set->{$spec->{col}} && \$set->{$spec->{col}} $spec->{op} $val ) { return '$spec->{color}'; }";
+   }
+   return undef unless @criteria;
+   my $sub = eval 'sub { my ( $set ) = @_; if ' . join(" elsif ", @criteria) . '}';
+   die if $EVAL_ERROR;
+   return $sub;
+}
+
+# make_sort_func {{{3
+# Gets a list of sort columns from the table, like "+cxn -time" and returns a
+# subroutine that will sort that way.
+sub make_sort_func {
+   my ( $tbl ) = @_;
+   my @criteria;
+
+   # Pivoted tables can be sorted by 'name' and set_x columns; others must be
+   # sorted by existing columns.  TODO: this will crash if you toggle between
+   # pivoted and nonpivoted.  I have several other 'crash' notes about this if
+   # this ever becomes possible.
+
+   if ( $tbl->{pivot} ) {
+      # Sort type is not really possible on pivoted columns, because a 'column'
+      # contains data from an entire non-pivoted row, so there could be a mix of
+      # numeric and non-numeric data.  Thus everything has to be 'cmp' type.
+      foreach my $col ( split(/\s+/, $tbl->{sort_cols} ) ) {
+         next unless $col;
+         my ( $dir, $name ) = $col =~ m/([+-])?(\w+)$/;
+         next unless $name && $name =~ m/^(?:name|set_\d+)$/;
+         $dir ||= '+';
+         my $op = 'cmp';
+         my $df = "''";
+         push @criteria,
+            $dir eq '+'
+            ? "(\$a->{$name} || $df) $op (\$b->{$name} || $df)"
+            : "(\$b->{$name} || $df) $op (\$a->{$name} || $df)";
+      }
+   }
+   else {
+      foreach my $col ( split(/\s+/, $tbl->{sort_cols} ) ) {
+         next unless $col;
+         my ( $dir, $name ) = $col =~ m/([+-])?(\w+)$/;
+         next unless $name && $tbl->{cols}->{$name};
+         $dir ||= '+';
+         my $op = $tbl->{cols}->{$name}->{num} ? "<=>" : "cmp";
+         my $df = $tbl->{cols}->{$name}->{num} ? "0"   : "''";
+         push @criteria,
+            $dir eq '+'
+            ? "(\$a->{$name} || $df) $op (\$b->{$name} || $df)"
+            : "(\$b->{$name} || $df) $op (\$a->{$name} || $df)";
+      }
+   }
+   return sub { return @_ } unless @criteria;
+   my $sub = eval 'sub { sort {' . join("||", @criteria) . '} @_; }';
+   die if $EVAL_ERROR;
+   return $sub;
+}
+
+# trunc {{{3
+# Shortens text to specified length.
+sub trunc {
+   my ( $text, $len ) = @_;
+   if ( length($text) <= $len ) {
+      return $text;
+   }
+   return substr($text, 0, $len);
+}
+
+# donut {{{3
+# Takes out the middle of text to shorten it.
+sub donut {
+   my ( $text, $len ) = @_;
+   return $text if length($text) <= $len;
+   my $max = length($text) - $len;
+   my $min = $max - 1;
+
+   # Try to remove a single "word" from somewhere in the center
+   if ( $text =~ s/_[^_]{$min,$max}_/_/ ) {
+      return $text;
+   }
+
+   # Prefer removing the end of a "word"
+   if ( $text =~ s/([^_]+)[^_]{$max}_/$1_/ ) {
+      return $text;
+   }
+
+   $text = substr($text, 0, int($len/2))
+         . "_"
+         . substr($text, int($len/2) + $max + 1);
+   return $text;
+}
+
+# crunch {{{3
+# Removes vowels and compacts repeated letters to shorten text.
+sub crunch {
+   my ( $text, $len ) = @_;
+   return $text if $len && length($text) <= $len;
+   $text =~ s/^IB_\w\w_//;
+   $text =~ s/(?<![_ ])[aeiou]//g;
+   $text =~ s/(.)\1+/$1/g;
+   return $text;
+}
+
+# collapse_ws {{{3
+# Collapses all whitespace to a single space.
+sub collapse_ws {
+   my ( $text ) = @_;
+   return '' unless defined $text;
+   $text =~ s/\s+/ /g;
+   return $text;
+}
+
+# Strips out non-printable characters within fields, which freak terminals out.
+sub no_ctrl_char {
+   my ( $text ) = @_;
+   return '' unless defined $text;
+   my $charset = $config{charset}->{val};
+   if ( $charset && $charset eq 'unicode' ) {
+      $text =~ s/
+         ("(?:(?!(?<!\\)").)*"  # Double-quoted string
+         |'(?:(?!(?<!\\)').)*') # Or single-quoted string
+         /$1 =~ m#\p{IsC}# ? "[BINARY]" : $1/egx;
+   }
+   elsif ( $charset && $charset eq 'none' ) {
+      $text =~ s/
+         ("(?:(?!(?<!\\)").)*"
+         |'(?:(?!(?<!\\)').)*')
+         /[TEXT]/gx;
+   }
+   else { # The default is 'ascii'
+      $text =~ s/
+         ("(?:(?!(?<!\\)").)*"
+         |'(?:(?!(?<!\\)').)*')
+         /$1 =~ m#[^\040-\176]# ? "[BINARY]" : $1/egx;
+   }
+   return $text;
+}
+
+# word_wrap {{{3
+# Wraps text at word boundaries so it fits the screen.
+sub word_wrap {
+   my ( $text, $width) = @_;
+   $width ||= $this_term_size[0];
+   $text =~ s/(.{0,$width})(?:\s+|$)/$1\n/g;
+   $text =~ s/ +$//mg;
+   return $text;
+}
+
+# draw_screen {{{3
+# Prints lines to the screen.  The first argument is an arrayref.  Each
+# element of the array is either a string or an arrayref.  If it's a string it
+# just gets printed.  If it's an arrayref, the first element is the string to
+# print, and the second is args to colored().
+sub draw_screen {
+   my ( $display_lines, $prefs ) = @_;
+   if ( !$opts{n} && $config{show_statusbar}->{val} ) {
+      unshift @$display_lines, create_statusbar();
+   }
+
+   foreach my $listener ( @{$event_listener_for{draw_screen}} ) {
+      $listener->draw_screen($display_lines);
+   }
+
+   $clear_screen_sub->()
+      if $prefs->{clear} || !$modes{$config{mode}->{val}}->{no_clear_screen};
+   if ( $opts{n} || $prefs->{raw} ) {
+      my $num_lines = 0;
+      print join("\n",
+         map {
+            $num_lines++;
+            ref $_
+               ? colored($_->[0], $_->[1])
+               : $_;
+         }
+         grep { !$opts{n} || $_ } # Suppress empty lines
+         @$display_lines);
+      if ( $opts{n} && $num_lines ) {
+         print "\n";
+      }
+   }
+   else {
+      my $max_lines = $prefs->{show_all}
+         ? scalar(@$display_lines)- 1
+         : min(scalar(@$display_lines), $this_term_size[1]);
+      print join("\n",
+         map {
+            ref $_
+               ? colored(substr($_->[0], 0, $this_term_size[0]), $_->[1])
+               : substr($_, 0, $this_term_size[0]);
+         } @$display_lines[0..$max_lines - 1]);
+   }
+}
+
+# secs_to_time {{{3
+sub secs_to_time {
+   my ( $secs, $fmt ) = @_;
+   $secs ||= 0;
+   return '00:00' unless $secs;
+
+   # Decide what format to use, if not given
+   $fmt ||= $secs >= 86_400 ? 'd'
+          : $secs >= 3_600  ? 'h'
+          :                   'm';
+
+   return
+      $fmt eq 'd' ? sprintf(
+         "%d+%02d:%02d:%02d",
+         int($secs / 86_400),
+         int(($secs % 86_400) / 3_600),
+         int(($secs % 3_600) / 60),
+         $secs % 60)
+      : $fmt eq 'h' ? sprintf(
+         "%02d:%02d:%02d",
+         int(($secs % 86_400) / 3_600),
+         int(($secs % 3_600) / 60),
+         $secs % 60)
+      : sprintf(
+         "%02d:%02d",
+         int(($secs % 3_600) / 60),
+         $secs % 60);
+}
+
+# dulint_to_int {{{3
+# Takes a number that InnoDB formats as two ulint integers, like transaction IDs
+# and such, and turns it into a single integer
+sub dulint_to_int {
+   my $num = shift;
+   return 0 unless $num;
+   my ( $high, $low ) = $num =~ m/^(\d+) (\d+)$/;
+   return $low unless $high;
+   return $low + ( $high * $MAX_ULONG );
+}
+
+# create_statusbar {{{3
+sub create_statusbar {
+   my $mode = $config{mode}->{val};
+   my @cxns = sort { $a cmp $b } get_connections();
+
+   my $modeline        = ( $config{readonly}->{val} ? '[RO] ' : '' )
+                         . $modes{$mode}->{hdr} . " (? for help)";
+   my $mode_width      = length($modeline);
+   my $remaining_width = $this_term_size[0] - $mode_width - 1;
+   my $result;
+
+   # The thingie in top-right that says what we're monitoring.
+   my $cxn = '';
+
+   if ( 1 == @cxns && $dbhs{$cxns[0]} && $dbhs{$cxns[0]}->{dbh} ) {
+      $cxn = $dbhs{$cxns[0]}->{dbh}->{mysql_serverinfo} || '';
+   }
+   else {
+      if ( $modes{$mode}->{server_group} ) {
+         $cxn = "Servers: " . $modes{$mode}->{server_group};
+         my $err_count = grep { $dbhs{$_} && $dbhs{$_}->{err_count} } @cxns;
+         if ( $err_count ) {
+            $cxn .= "(" . ( scalar(@cxns) - $err_count ) . "/" . scalar(@cxns) . ")";
+         }
+      }
+      else {
+         $cxn = join(' ', map { ($dbhs{$_}->{err_count} ? '!' : '') . $_ }
+            grep { $dbhs{$_} } @cxns);
+      }
+   }
+
+   if ( 1 == @cxns ) {
+      get_driver_status(@cxns);
+      my $vars = $vars{$cxns[0]}->{$clock};
+      my $inc  = inc(0, $cxns[0]);
+
+      # Format server uptime human-readably, calculate QPS...
+      my $uptime = secs_to_time( $vars->{Uptime_hires} );
+      my $qps    = ($inc->{Questions}||0) / ($inc->{Uptime_hires}||1);
+      my $ibinfo = '';
+
+      if ( exists $vars->{IB_last_secs} ) {
+         $ibinfo .= "InnoDB $vars->{IB_last_secs}s ";
+         if ( $vars->{IB_got_all} ) {
+            if ( ($mode eq 'T' || $mode eq 'W')
+                  && $vars->{IB_tx_is_truncated} ) {
+               $ibinfo .= ':^|';
+            }
+            else {
+               $ibinfo .= ':-)';
+            }
+         }
+         else {
+            $ibinfo .= ':-(';
+         }
+      }
+      $result = sprintf(
+         "%-${mode_width}s %${remaining_width}s",
+         $modeline,
+         join(', ', grep { $_ } (
+            $cxns[0],
+            $uptime,
+            $ibinfo,
+            shorten($qps) . " QPS",
+            ($vars->{Threads} || 0) . "/" . ($vars->{Threads_running} || 0) . "/" . ($vars->{Threads_cached} || 0) . " con/run/cac thds",
+            $cxn)));
+   }
+   else {
+      $result = sprintf(
+         "%-${mode_width}s %${remaining_width}s",
+         $modeline,
+         $cxn);
+   }
+
+   return $config{color}->{val} ? [ $result, 'bold reverse' ] : $result;
+}
+
+# Database connections {{{3
+sub add_new_dsn {
+   my ( $name, $dsn, $dl_table, $have_user, $user, $have_pass, $pass, $savepass ) = @_;
+
+   if ( defined $name ) {
+      $name =~ s/[\s:;]//g;
+   }
+
+   if ( !$name ) {
+      print word_wrap("Choose a name for the connection.  It cannot contain "
+         . "whitespace, colons or semicolons."), "\n\n";
+      do {
+         $name = prompt("Enter a name");
+         $name =~ s/[\s:;]//g;
+      } until ( $name );
+   }
+
+   if ( !$dsn ) {
+      do {
+         $clear_screen_sub->();
+         print "Typical DSN strings look like\n   DBI:mysql:;host=hostname;port=port\n"
+            . "The db and port are optional and can usually be omitted.\n"
+            . "If you specify 'mysql_read_default_group=mysql' many options can be read\n"
+            . "from your mysql options files (~/.my.cnf, /etc/my.cnf).\n\n";
+         $dsn = prompt("Enter a DSN string", undef, "DBI:mysql:;mysql_read_default_group=mysql;host=$name");
+      } until ( $dsn );
+   }
+   if ( !$dl_table ) {
+      $clear_screen_sub->();
+      my $dl_table = prompt("Optional: enter a table (must not exist) to use when resetting InnoDB deadlock information",
+         undef, 'test.innotop_dl');
+   }
+
+   $connections{$name} = {
+      dsn       => $dsn,
+      dl_table  => $dl_table,
+      have_user => $have_user,
+      user      => $user,
+      have_pass => $have_pass,
+      pass      => $pass,
+      savepass  => $savepass
+   };
+}
+
+sub add_new_server_group {
+   my ( $name ) = @_;
+
+   if ( defined $name ) {
+      $name =~ s/[\s:;]//g;
+   }
+
+   if ( !$name ) {
+      print word_wrap("Choose a name for the group.  It cannot contain "
+         . "whitespace, colons or semicolons."), "\n\n";
+      do {
+         $name = prompt("Enter a name");
+         $name =~ s/[\s:;]//g;
+      } until ( $name );
+   }
+
+   my @cxns;
+   do {
+      $clear_screen_sub->();
+      @cxns = select_cxn("Choose servers for $name", keys %connections);
+   } until ( @cxns );
+
+   $server_groups{$name} = \@cxns;
+   return $name;
+}
+
+sub get_var_set {
+   my ( $name ) = @_;
+   while ( !$name || !exists($var_sets{$config{$name}->{val}}) ) {
+      $name = choose_var_set($name);
+   }
+   return $var_sets{$config{$name}->{val}}->{text};
+}
+
+sub add_new_var_set {
+   my ( $name ) = @_;
+
+   if ( defined $name ) {
+      $name =~ s/\W//g;
+   }
+
+   if ( !$name ) {
+      do {
+         $name = prompt("Enter a name");
+         $name =~ s/\W//g;
+      } until ( $name );
+   }
+
+   my $variables;
+   do {
+      $clear_screen_sub->();
+      $variables = prompt("Enter variables for $name", undef );
+   } until ( $variables );
+
+   $var_sets{$name} = { text => $variables, user => 1 };
+}
+
+sub next_server {
+   my $mode     = $config{mode}->{val};
+   my @cxns     = sort keys %connections;
+   my ($cur)    = get_connections($mode);
+   $cur         ||= $cxns[0];
+   my $pos      = grep { $_ lt $cur } @cxns;
+   my $newpos   = ($pos + 1) % @cxns;
+   $modes{$mode}->{server_group} = '';
+   $modes{$mode}->{connections} = [ $cxns[$newpos] ];
+   $clear_screen_sub->();
+}
+
+sub next_server_group {
+   my $mode = shift || $config{mode}->{val};
+   my @grps = sort keys %server_groups;
+   my $curr = $modes{$mode}->{server_group};
+
+   return unless @grps;
+
+   if ( $curr ) {
+      # Find the current group's position.
+      my $pos = 0;
+      while ( $curr ne $grps[$pos] ) {
+         $pos++;
+      }
+      $modes{$mode}->{server_group} = $grps[ ($pos + 1) % @grps ];
+   }
+   else {
+      $modes{$mode}->{server_group} = $grps[0];
+   }
+}
+
+# Get a list of connection names used in this mode.
+sub get_connections {
+   if ( $file ) {
+      return qw(file);
+   }
+   my $mode = shift || $config{mode}->{val};
+   my @connections = $modes{$mode}->{server_group}
+      ? @{$server_groups{$modes{$mode}->{server_group}}}
+      : @{$modes{$mode}->{connections}};
+   if ( $modes{$mode}->{one_connection} ) {
+      @connections = @connections ? $connections[0] : ();
+   }
+   return unique(@connections);
+}
+
+# Get a list of tables used in this mode.  If innotop is running non-interactively, just use the first.
+sub get_visible_tables {
+   my $mode = shift || $config{mode}->{val};
+   my @tbls = @{$modes{$mode}->{visible_tables}};
+   if ( $opts{n} ) {
+      return $tbls[0];
+   }
+   else {
+      return @tbls;
+   }
+}
+
+# Choose from among available connections or server groups.
+# If the mode has a server set in use, prefers that instead.
+sub choose_connections {
+   $clear_screen_sub->();
+   my $mode    = $config{mode}->{val};
+   my $meta    =  { map { $_ => $connections{$_}->{dsn} } keys %connections };
+   foreach my $group ( keys %server_groups ) {
+      $meta->{"#$group"} = join(' ', @{$server_groups{$group}});
+   }
+
+   my $choices = prompt_list("Choose connections or a group for $mode mode",
+      undef, sub { return keys %$meta }, $meta);
+
+   my @choices = unique(grep { $_ } split(/\s+/, $choices));
+   if ( @choices ) {
+      if ( $choices[0] =~ s/^#// && exists $server_groups{$choices[0]} ) {
+         $modes{$mode}->{server_group} = $choices[0];
+      }
+      else {
+         $modes{$mode}->{connections} = [ grep { exists $connections{$_} } @choices ];
+      }
+   }
+}
+
+# Accepts a DB connection name and the name of a prepared query (e.g. status, kill).
+# Also a list of params for the prepared query.  This allows not storing prepared
+# statements globally.  Returns a $sth that's been executed.
+# ERROR-HANDLING SEMANTICS: if the statement throws an error, propagate, but if the
+# connection has gone away or can't connect, DO NOT.  Just return undef.
+sub do_stmt {
+   my ( $cxn, $stmt_name, @args ) = @_;
+
+   return undef if $file;
+
+   # Test if the cxn should not even be tried
+   return undef if $dbhs{$cxn}
+      && $dbhs{$cxn}->{err_count} 
+      && ( !$dbhs{$cxn}->{dbh} || !$dbhs{$cxn}->{dbh}->{Active} || $dbhs{$cxn}->{mode} eq $config{mode}->{val} )
+      && $dbhs{$cxn}->{wake_up} > $clock;
+
+   my $sth;
+   my $retries = 1;
+   my $success = 0;
+   TRY:
+   while ( $retries-- >= 0 && !$success ) {
+
+      eval {
+         my $dbh = connect_to_db($cxn);
+
+         # If the prepared query doesn't exist, make it.
+         if ( !exists $dbhs{$cxn}->{stmts}->{$stmt_name} ) {
+            $dbhs{$cxn}->{stmts}->{$stmt_name} = $stmt_maker_for{$stmt_name}->($dbh);
+         }
+
+         $sth = $dbhs{$cxn}->{stmts}->{$stmt_name};
+         if ( $sth ) {
+            $sth->execute(@args);
+         }
+         $success = 1;
+      };
+      if ( $EVAL_ERROR ) {
+         if ( $EVAL_ERROR =~ m/$nonfatal_errs/ ) {
+            handle_cxn_error($cxn, $EVAL_ERROR);
+         }
+         else {
+            die "$cxn $stmt_name: $EVAL_ERROR";
+         }
+         if ( $retries < 0 ) {
+            $sth = undef;
+         }
+      }
+   }
+
+   if ( $sth && $sth->{NUM_OF_FIELDS} ) {
+      sleep($stmt_sleep_time_for{$stmt_name}) if $stmt_sleep_time_for{$stmt_name};
+      return $sth;
+   }
+}
+
+# Keeps track of error count, sleep times till retries, etc etc.
+# When there's an error we retry the connection every so often, increasing in
+# Fibonacci series to prevent too much banging on the server.
+sub handle_cxn_error {
+   my ( $cxn, $err ) = @_;
+   my $meta = $dbhs{$cxn};
+   $meta->{err_count}++;
+
+   # This is used so errors that have to do with permissions needed by the current
+   # mode will get displayed as long as we're in this mode, but get ignored if the
+   # mode changes.
+   $meta->{mode} = $config{mode}->{val};
+
+   # Strip garbage from the error text if possible.
+   $err =~ s/\s+/ /g;
+   if ( $err =~ m/failed: (.*?) at \S*innotop line/ ) {
+      $err = $1;
+   }
+
+   $meta->{last_err}   = $err;
+   my $sleep_time      = $meta->{this_sleep} + $meta->{prev_sleep};
+   $meta->{prev_sleep} = $meta->{this_sleep};
+   $meta->{this_sleep} = $sleep_time;
+   $meta->{wake_up}    = $clock + $sleep_time;
+   if ( $config{show_cxn_errors}->{val} ) {
+      print STDERR "Error at tick $clock $cxn $err" if $config{debug}->{val};
+   }
+}
+
+# Accepts a DB connection name and a (string) query.  Returns a $sth that's been
+# executed.
+sub do_query {
+   my ( $cxn, $query ) = @_;
+
+   return undef if $file;
+
+   # Test if the cxn should not even be tried
+   return undef if $dbhs{$cxn}
+      && $dbhs{$cxn}->{err_count} 
+      && ( !$dbhs{$cxn}->{dbh} || !$dbhs{$cxn}->{dbh}->{Active} || $dbhs{$cxn}->{mode} eq $config{mode}->{val} )
+      && $dbhs{$cxn}->{wake_up} > $clock;
+
+   my $sth;
+   my $retries = 1;
+   my $success = 0;
+   TRY:
+   while ( $retries-- >= 0 && !$success ) {
+
+      eval {
+         my $dbh = connect_to_db($cxn);
+
+         $sth = $dbh->prepare($query);
+         $sth->execute();
+         $success = 1;
+      };
+      if ( $EVAL_ERROR ) {
+         if ( $EVAL_ERROR =~ m/$nonfatal_errs/ ) {
+            handle_cxn_error($cxn, $EVAL_ERROR);
+         }
+         else {
+            die $EVAL_ERROR;
+         }
+         if ( $retries < 0 ) {
+            $sth = undef;
+         }
+      }
+   }
+   return $sth;
+}
+
+sub get_uptime {
+   my ( $cxn ) = @_;
+   $dbhs{$cxn}->{start_time} ||= time();
+   # Avoid dividing by zero
+   return (time() - $dbhs{$cxn}->{start_time}) || .001;
+}
+
+sub connect_to_db {
+   my ( $cxn ) = @_;
+
+   $dbhs{$cxn} ||= {
+      stmts      => {},  # bucket for prepared statements.
+      prev_sleep => 0,
+      this_sleep => 1,
+      wake_up    => 0,
+      start_time => 0,
+      dbh        => undef,
+   };
+   my $href = $dbhs{$cxn};
+
+   if ( !$href->{dbh} || ref($href->{dbh}) !~ m/DBI/ || !$href->{dbh}->ping ) {
+      my $dbh = get_new_db_connection($cxn);
+      @{$href}{qw(dbh err_count wake_up this_sleep start_time prev_sleep)}
+               = ($dbh, 0, 0, 1, 0, 0);
+
+      # Derive and store the server's start time in hi-res
+      my $uptime = $dbh->selectrow_hashref("show status like 'Uptime'")->{value};
+      $href->{start_time} = time() - $uptime;
+
+      # Set timeouts so an unused connection stays alive.
+      # For example, a connection might be used in Q mode but idle in T mode.
+      if ( version_ge($dbh, '4.0.3')) {
+         my $timeout = $config{cxn_timeout}->{val};
+         $dbh->do("set session wait_timeout=$timeout, interactive_timeout=$timeout");
+      }
+   }
+   return $href->{dbh};
+}
+
+# Compares versions like 5.0.27 and 4.1.15-standard-log
+sub version_ge {
+   my ( $dbh, $target ) = @_;
+   my $version = sprintf('%03d%03d%03d', $dbh->{mysql_serverinfo} =~ m/(\d+)/g);
+   return $version ge sprintf('%03d%03d%03d', $target =~ m/(\d+)/g);
+}
+
+# Extracts status values that can be gleaned from the DBD driver without doing a whole query.
+sub get_driver_status {
+   my @cxns = @_;
+   if ( !$info_gotten{driver_status}++ ) {
+      foreach my $cxn ( @cxns ) {
+         next unless $dbhs{$cxn} && $dbhs{$cxn}->{dbh} && $dbhs{$cxn}->{dbh}->{Active};
+         $vars{$cxn}->{$clock} ||= {};
+         my $vars = $vars{$cxn}->{$clock};
+         my %res = map {  $_ =~ s/ +/_/g; $_ } $dbhs{$cxn}->{dbh}->{mysql_stat} =~ m/(\w[^:]+): ([\d\.]+)/g;
+         map { $vars->{$_} ||= $res{$_} } keys %res;
+         $vars->{Uptime_hires} ||= get_uptime($cxn);
+         $vars->{cxn} = $cxn;
+      }
+   }
+}
+
+sub get_new_db_connection {
+   my ( $connection, $destroy ) = @_;
+   if ( $file ) {
+      die "You can't connect to a MySQL server while monitoring a file.  This is probably a bug.";
+   }
+
+   my $dsn = $connections{$connection}
+      or die "No connection named '$connection' is defined in your configuration";
+
+   # don't ask for a username if mysql_read_default_group=client is in the DSN
+   if ( !defined $dsn->{have_user} and $dsn->{dsn} !~ /mysql_read_default_group=client/ ) {
+      my $answer = prompt("Do you want to specify a username for $connection?", undef, 'n');
+      $dsn->{have_user} = $answer && $answer =~ m/1|y/i;
+   }
+
+   # don't ask for a password if mysql_read_default_group=client is in the DSN
+   if ( !defined $dsn->{have_pass} and $dsn->{dsn} !~ /mysql_read_default_group=client/ ) {
+      my $answer = prompt("Do you want to specify a password for $connection?", undef, 'n');
+      $dsn->{have_pass} = $answer && $answer =~ m/1|y/i;
+   }
+
+   if ( !$dsn->{user} && $dsn->{have_user} ) {
+      my $user = $ENV{USERNAME} || $ENV{USER} || getlogin() || getpwuid($REAL_USER_ID) || undef;
+      $dsn->{user} = prompt("Enter username for $connection", undef, $user);
+   }
+
+   if ( !defined $dsn->{user} ) {
+      $dsn->{user} = '';
+   }
+
+   if ( !$dsn->{pass} && !$dsn->{savepass} && $dsn->{have_pass} ) {
+      $dsn->{pass} = prompt_noecho("Enter password for '$dsn->{user}' on $connection");
+      print "\n";
+      if ( !defined($dsn->{savepass}) ) {
+         my $answer = prompt("Save password in plain text in the config file?", undef, 'y');
+         $dsn->{savepass} = $answer && $answer =~ m/1|y/i;
+      }
+   }
+
+   my $dbh = DBI->connect(
+      $dsn->{dsn}, $dsn->{user}, $dsn->{pass},
+      { RaiseError => 1, PrintError => 0, AutoCommit => 1 });
+   $dbh->{InactiveDestroy} = 1 unless $destroy; # Can't be set in $db_options
+   $dbh->{FetchHashKeyName} = 'NAME_lc'; # Lowercases all column names for fetchrow_hashref
+   return $dbh;
+}
+
+sub get_cxn_errors {
+   my @cxns = @_;
+   return () unless $config{show_cxn_errors_in_tbl}->{val};
+   return
+      map  { [ $_ . ': ' . $dbhs{$_}->{last_err}, 'red' ] }
+      grep { $dbhs{$_} && $dbhs{$_}->{err_count} && $dbhs{$_}->{mode} eq $config{mode}->{val} }
+      @cxns;
+}
+
+# Setup and tear-down functions {{{2
+
+# Takes a string and turns it into a hashref you can apply to %tbl_meta tables.  The string
+# can be in the form 'foo, bar, foo/bar, foo as bar' much like a SQL SELECT statement.
+sub compile_select_stmt {
+   my ($str) = @_;
+   my @exps = $str =~ m/\s*([^,]+(?i:\s+as\s+[^,\s]+)?)\s*(?=,|$)/g;
+   my %cols;
+   my @visible;
+   foreach my $exp ( @exps ) {
+      my ( $text, $colname );
+      if ( $exp =~ m/as\s+(\w+)\s*/ ) {
+         $colname = $1;
+         $exp =~ s/as\s+(\w+)\s*//;
+         $text    = $exp;
+      }
+      else {
+         $text = $colname = $exp;
+      }
+      my ($func, $err) = compile_expr($text);
+      $cols{$colname} = {
+         src  => $text,
+         hdr  => $colname,
+         num  => 0,
+         func => $func,
+      };
+      push @visible, $colname;
+   }
+   return (\%cols, \@visible);
+}
+
+# compile_filter {{{3
+sub compile_filter {
+   my ( $text ) = @_;
+   my ( $sub, $err );
+   eval "\$sub = sub { my \$set = shift; $text }";
+   if ( $EVAL_ERROR ) {
+      $EVAL_ERROR =~ s/at \(eval.*$//;
+      $sub = sub { return $EVAL_ERROR };
+      $err = $EVAL_ERROR;
+   }
+   return ( $sub, $err );
+}
+
+# compile_expr {{{3
+sub compile_expr {
+   my ( $expr ) = @_;
+   # Leave built-in functions alone so they get called as Perl functions, unless
+   # they are the only word in $expr, in which case treat them as hash keys.
+   if ( $expr =~ m/\W/ ) {
+      $expr =~ s/(?<!\{|\$)\b([A-Za-z]\w{2,})\b/is_func($1) ? $1 : "\$set->{$1}"/eg;
+   }
+   else {
+      $expr = "\$set->{$expr}";
+   }
+   my ( $sub, $err );
+   my $quoted = quotemeta($expr);
+   eval qq{
+      \$sub = sub {
+         my (\$set, \$cur, \$pre) = \@_;
+         my \$val = eval { $expr };
+         if ( \$EVAL_ERROR && \$config{debug}->{val} ) {
+            \$EVAL_ERROR =~ s/ at \\(eval.*//s;
+            die "\$EVAL_ERROR in expression $quoted";
+         }
+         return \$val;
+      }
+   };
+   if ( $EVAL_ERROR ) {
+      if ( $config{debug}->{val} ) {
+         die $EVAL_ERROR;
+      }
+      $EVAL_ERROR =~ s/ at \(eval.*$//;
+      $sub = sub { return $EVAL_ERROR };
+      $err = $EVAL_ERROR;
+   }
+   return ( $sub, $err );
+}
+
+# finish {{{3
+# This is a subroutine because it's called from a key to quit the program.
+sub finish {
+   save_config();
+   ReadMode('normal') unless $opts{n};
+   print "\n";
+   exit(0);
+}
+
+# core_dump {{{3
+sub core_dump {
+   my $msg = shift;
+   if ($config{debugfile}->{val} && $config{debug}->{val}) {
+      eval {
+         open my $file, '>>', $config{debugfile}->{val};
+         if ( %vars ) {
+            print $file "Current variables:\n" . Dumper(\%vars);
+         }
+         close $file;
+      };
+   }
+   print $msg;
+}
+
+# migrate_config {{{3
+sub migrate_config {
+
+   my ($old_filename, $new_filename) = @_;
+
+   # don't proceed if old file doesn't exist
+   if ( ! -f $old_filename ) {
+      die "Error migrating '$old_filename': file doesn't exist.\n";
+   }
+   # don't migrate files if new file exists
+   elsif ( -f $new_filename ) {
+      die "Error migrating '$old_filename' to '$new_filename': new file already exists.\n";
+   }
+   # if migrating from one file to another in the same directory, just rename them
+   if (dirname($old_filename) eq dirname($new_filename)) {
+      rename($old_filename, $new_filename)
+         or die "Can't rename '$old_filename' to '$new_filename': $OS_ERROR";
+   }
+   # otherwise, move the existing conf file to a temp file, make the necessary directory structure,
+   # and move the temp conf file to its new home
+   else {
+      my $tmp = File::Temp->new( TEMPLATE => 'innotopXXXXX', DIR => $homepath, SUFFIX => '.conf');
+      my $tmp_filename = $tmp->filename;
+      my $dirname = dirname($new_filename);
+      rename($old_filename, $tmp_filename)
+         or die "Can't rename '$old_filename' to '$tmp_filename': $OS_ERROR";
+      mkdir($dirname) or die "Can't create directory '$dirname': $OS_ERROR";
+      mkdir("$dirname/plugins") or die "Can't create directory '$dirname/plugins': $OS_ERROR";
+      rename($tmp_filename, $new_filename)
+         or die "Can't rename '$tmp_filename' to '$new_filename': $OS_ERROR";
+   }
+}
+
+# load_config {{{3
+sub load_config {
+    
+   my ($old_filename, $answer);
+
+   if ( $opts{u} or $opts{p} or $opts{h} or $opts{P} ) {
+     my @params = $dsn_parser->get_cxn_params(\%opts); # dsn=$params[0]
+     add_new_dsn($opts{h} || 'localhost', $params[0], 'test.innotop_dl', 
+                 $opts{u} ? 1 : 0, $opts{u}, $opts{p} ? 1 : 0, $opts{p});
+   }
+   if ($opts{c}) {
+      $conf_file = $opts{c};
+   }  
+   # innotop got upgraded and this is an old config file.
+   elsif ( -f "$homepath/.innotop" or -f "$homepath/.innotop/innotop.ini" ) {
+      $conf_file = $default_home_conf;
+      if ( -f  "$homepath/.innotop") {
+         $old_filename = "$homepath/.innotop";
+      }
+      elsif ( -f "$homepath/.innotop/innotop.ini" ) {
+         $old_filename = "$homepath/.innotop/innotop.ini";
+      }
+      $answer = pause("Innotop's default config location has moved to '$conf_file'.  Move old config file '$old_filename' there now? y/n");
+      if ( lc $answer eq 'y' ) {
+         migrate_config($old_filename, $conf_file);
+      }
+      else {
+         print "\nInnotop will now exit so you can fix the config file.\n";
+         exit(0);
+      }
+   }
+   elsif ( -f $default_home_conf ) {
+      $conf_file = $default_home_conf;
+   }
+   elsif ( -f $default_central_conf and not $opts{s} ) {
+      $conf_file = $default_central_conf;
+   }
+   else {
+      # If no config file was loaded, set readonly to 0 if the user wants to 
+      # write a config
+      $config{readonly}->{val} = 0 if $opts{w};
+      # If no connections have been defined, connect to a MySQL database 
+      # on localhost using mysql_read_default_group=client
+      if (!%connections) {
+         add_new_dsn('localhost', 
+                     'DBI:mysql:;host=localhost;mysql_read_default_group=client', 
+                     'test.innotop_dl');
+      }
+   }
+
+   if ( -f "$conf_file" ) {
+      open my $file, "<", $conf_file or die("Can't open '$conf_file': $OS_ERROR");
+
+      # Check config file version.  Just ignore if either innotop or the file has
+      # garbage in the version number.
+      if ( defined(my $line = <$file>) && $VERSION =~ m/\d/ ) {
+         chomp $line;
+         if ( my ($maj, $min, $rev) = $line =~ m/^version=(\d+)\.(\d+)(?:\.(\d+))?$/ ) {
+            $rev ||= 0;
+            my $cfg_ver          = sprintf('%03d-%03d-%03d', $maj, $min, $rev);
+            ( $maj, $min, $rev ) = $VERSION =~ m/^(\d+)\.(\d+)(?:\.(\d+))?$/;
+            $rev ||= 0;
+            my $innotop_ver      = sprintf('%03d-%03d-%03d', $maj, $min, $rev);
+
+            if ( $cfg_ver gt $innotop_ver ) {
+               pause("The config file is for a newer version of innotop and may not be read correctly.");
+            }
+            else {
+               my @ver_history = @config_versions;
+               while ( my ($start, $end) = splice(@ver_history, 0, 2) ) {
+                  # If the config file is between the endpoints and innotop is greater than
+                  # the endpoint, innotop has a newer config file format than the file.
+                  if ( $cfg_ver ge $start && $cfg_ver lt $end && $innotop_ver ge $end ) {
+                     my $msg = "innotop's config file format has changed.  Overwrite $conf_file?  y or n";
+                     if ( pause($msg) eq 'n' ) {
+                        $config{readonly}->{val} = 1;
+                        print "\ninnotop will not save any configuration changes you make.";
+                        pause();
+                        print "\n";
+                     }
+                     close $file;
+                     return;
+                  }
+               }
+            }
+         }
+      }
+
+      while ( my $line = <$file> ) {
+         chomp $line;
+         next unless $line =~ m/^\[([a-z_]+)\]$/;
+         if ( exists $config_file_sections{$1} ) {
+            $config_file_sections{$1}->{reader}->($file);
+         }
+         else {
+            warn "Unknown config file section '$1'";
+         }
+      }
+      close $file or die("Can't close $conf_file: $OS_ERROR");
+   }
+
+}
+
+# Do some post-processing on %tbl_meta: compile src properties into func etc.
+sub post_process_tbl_meta {
+   foreach my $table ( values %tbl_meta ) {
+      foreach my $col_name ( keys %{$table->{cols}} ) {
+         my $col_def = $table->{cols}->{$col_name};
+         my ( $sub, $err ) = compile_expr($col_def->{src});
+         $col_def->{func} = $sub;
+      }
+   }
+}
+
+# load_config_plugins {{{3
+sub load_config_plugins {
+   my ( $file ) = @_;
+
+   # First, find a list of all plugins that exist on disk, and get information about them.
+   my $dir = $config{plugin_dir}->{val};
+   foreach my $p_file ( <$dir/*.pm> ) {
+      my ($package, $desc);
+      eval {
+         open my $p_in, "<", $p_file or die $OS_ERROR;
+         while ( my $line = <$p_in> ) {
+            chomp $line;
+            if ( $line =~ m/^package\s+(.*?);/ ) {
+               $package = $1;
+            }
+            elsif ( $line =~ m/^# description: (.*)/ ) {
+               $desc = $1;
+            }
+            last if $package && $desc;
+         }
+         close $p_in;
+      };
+      if ( $package ) {
+         $plugins{$package} = {
+            file   => $p_file,
+            desc   => $desc,
+            class  => $package,
+            active => 0,
+         };
+         if ( $config{debug}->{val} && $EVAL_ERROR ) {
+            die $EVAL_ERROR;
+         }
+      }
+   }
+
+   # Now read which ones the user has activated.  Each line simply represents an active plugin.
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+      next unless $line && $plugins{$line};
+
+      my $obj;
+      eval {
+         require $plugins{$line}->{file};
+         $obj = $line->new(%pluggable_vars);
+         foreach my $event ( $obj->register_for_events() ) {
+            my $queue = $event_listener_for{$event};
+            if ( $queue ) {
+               push @$queue, $obj;
+            }
+         }
+      };
+      if ( $config{debug}->{val} && $EVAL_ERROR ) {
+         die $EVAL_ERROR;
+      }
+      if ( $obj ) {
+         $plugins{$line}->{active} = 1;
+         $plugins{$line}->{object} = $obj;
+      }
+   }
+}
+
+# save_config_plugins {{{3
+sub save_config_plugins {
+   my $file = shift;
+   foreach my $class ( sort keys %plugins ) {
+      next unless $plugins{$class}->{active};
+      print $file "$class\n";
+   }
+}
+
+# load_config_active_server_groups {{{3
+sub load_config_active_server_groups {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $mode, $group ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $mode && $group
+         && exists $modes{$mode} && exists $server_groups{$group};
+      $modes{$mode}->{server_group} = $group;
+   }
+}
+
+# save_config_active_server_groups {{{3
+sub save_config_active_server_groups {
+   my $file = shift;
+   foreach my $mode ( sort keys %modes ) {
+      print $file "$mode=$modes{$mode}->{server_group}\n";
+   }
+}
+
+# load_config_server_groups {{{3
+sub load_config_server_groups {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $name, $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $name && $rest;
+      my @vars = unique(grep { $_ && exists $connections{$_} } split(/\s+/, $rest));
+      next unless @vars;
+      $server_groups{$name} = \@vars;
+   }
+}
+
+# save_config_server_groups {{{3
+sub save_config_server_groups {
+   my $file = shift;
+   foreach my $set ( sort keys %server_groups ) {
+      print $file "$set=", join(' ', @{$server_groups{$set}}), "\n";
+   }
+}
+
+# load_config_varsets {{{3
+sub load_config_varsets {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $name, $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $name && $rest;
+      $var_sets{$name} = {
+         text => $rest,
+         user => 1,
+      };
+   }
+}
+
+# save_config_varsets {{{3
+sub save_config_varsets {
+   my $file = shift;
+   foreach my $varset ( sort keys %var_sets ) {
+      next unless $var_sets{$varset}->{user};
+      print $file "$varset=$var_sets{$varset}->{text}\n";
+   }
+}
+
+# load_config_group_by {{{3
+sub load_config_group_by {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $tbl , $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $tbl && exists $tbl_meta{$tbl};
+      my @parts = unique(grep { exists($tbl_meta{$tbl}->{cols}->{$_}) } split(/\s+/, $rest));
+      $tbl_meta{$tbl}->{group_by} = [ @parts ];
+      $tbl_meta{$tbl}->{cust}->{group_by} = 1;
+   }
+}
+
+# save_config_group_by {{{3
+sub save_config_group_by {
+   my $file = shift;
+   foreach my $tbl ( sort keys %tbl_meta ) {
+      next if $tbl_meta{$tbl}->{temp};
+      next unless $tbl_meta{$tbl}->{cust}->{group_by};
+      my $aref = $tbl_meta{$tbl}->{group_by};
+      print $file "$tbl=", join(' ', @$aref), "\n";
+   }
+}
+
+# load_config_filters {{{3
+sub load_config_filters {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $key, $rest ) = $line =~ m/^(.+?)=(.*)$/;
+      next unless $key && $rest;
+
+      my %parts = $rest =~ m/(\w+)='((?:(?!(?<!\\)').)*)'/g; # Properties are single-quoted
+      next unless $parts{text} && $parts{tbls};
+
+      foreach my $prop ( keys %parts ) {
+         # Un-escape escaping
+         $parts{$prop} =~ s/\\\\/\\/g;
+         $parts{$prop} =~ s/\\'/'/g;
+      }
+
+      my ( $sub, $err ) = compile_filter($parts{text});
+      my @tbls = unique(split(/\s+/, $parts{tbls}));
+      @tbls = grep { exists $tbl_meta{$_} } @tbls;
+      $filters{$key} = {
+         func => $sub,
+         text => $parts{text},
+         user => 1,
+         name => $key,
+         note => 'User-defined filter',
+         tbls => \@tbls,
+      }
+   }
+}
+
+# save_config_filters {{{3
+sub save_config_filters {
+   my $file = shift;
+   foreach my $key ( sort keys %filters ) {
+      next if !$filters{$key}->{user} || $filters{$key}->{quick};
+      my $text = $filters{$key}->{text};
+      $text =~ s/([\\'])/\\$1/g;
+      my $tbls = join(" ", @{$filters{$key}->{tbls}});
+      print $file "$key=text='$text' tbls='$tbls'\n";
+   }
+}
+
+# load_config_visible_tables {{{3
+sub load_config_visible_tables {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $mode, $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $mode && exists $modes{$mode};
+      $modes{$mode}->{visible_tables} =
+         [ unique(grep { $_ && exists $tbl_meta{$_} } split(/\s+/, $rest)) ];
+      $modes{$mode}->{cust}->{visible_tables} = 1;
+   }
+}
+
+# save_config_visible_tables {{{3
+sub save_config_visible_tables {
+   my $file = shift;
+   foreach my $mode ( sort keys %modes ) {
+      next unless $modes{$mode}->{cust}->{visible_tables};
+      my $tables = $modes{$mode}->{visible_tables};
+      print $file "$mode=", join(' ', @$tables), "\n";
+   }
+}
+
+# load_config_sort_cols {{{3
+sub load_config_sort_cols {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $key , $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $key && exists $tbl_meta{$key};
+      $tbl_meta{$key}->{sort_cols} = $rest;
+      $tbl_meta{$key}->{cust}->{sort_cols} = 1;
+      $tbl_meta{$key}->{sort_func} = make_sort_func($tbl_meta{$key});
+   }
+}
+
+# save_config_sort_cols {{{3
+sub save_config_sort_cols {
+   my $file = shift;
+   foreach my $tbl ( sort keys %tbl_meta ) {
+      next unless $tbl_meta{$tbl}->{cust}->{sort_cols};
+      my $col = $tbl_meta{$tbl}->{sort_cols};
+      print $file "$tbl=$col\n";
+   }
+}
+
+# load_config_active_filters {{{3
+sub load_config_active_filters {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $tbl , $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $tbl && exists $tbl_meta{$tbl};
+      my @parts = unique(grep { exists($filters{$_}) } split(/\s+/, $rest));
+      @parts = grep { grep { $tbl eq $_ } @{$filters{$_}->{tbls}} } @parts;
+      $tbl_meta{$tbl}->{filters} = [ @parts ];
+      $tbl_meta{$tbl}->{cust}->{filters} = 1;
+   }
+}
+
+# save_config_active_filters {{{3
+sub save_config_active_filters {
+   my $file = shift;
+   foreach my $tbl ( sort keys %tbl_meta ) {
+      next if $tbl_meta{$tbl}->{temp};
+      next unless $tbl_meta{$tbl}->{cust}->{filters};
+      my $aref = $tbl_meta{$tbl}->{filters};
+      print $file "$tbl=", join(' ', @$aref), "\n";
+   }
+}
+
+# load_config_active_columns {{{3
+sub load_config_active_columns {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $key , $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $key && exists $tbl_meta{$key};
+      my @parts = grep { exists($tbl_meta{$key}->{cols}->{$_}) } unique split(/ /, $rest);
+      $tbl_meta{$key}->{visible} = [ @parts ];
+      $tbl_meta{$key}->{cust}->{visible} = 1;
+   }
+}
+
+# save_config_active_columns {{{3
+sub save_config_active_columns {
+   my $file = shift;
+   foreach my $tbl ( sort keys %tbl_meta ) {
+      next unless $tbl_meta{$tbl}->{cust}->{visible};
+      my $aref = $tbl_meta{$tbl}->{visible};
+      print $file "$tbl=", join(' ', @$aref), "\n";
+   }
+}
+
+# save_config_tbl_meta {{{3
+sub save_config_tbl_meta {
+   my $file = shift;
+   foreach my $tbl ( sort keys %tbl_meta ) {
+      foreach my $col ( keys %{$tbl_meta{$tbl}->{cols}} ) {
+         my $meta = $tbl_meta{$tbl}->{cols}->{$col};
+         next unless $meta->{user};
+         print $file "$col=", join(
+            " ",
+            map {
+               # Some properties (trans) are arrays, others scalars
+               my $val = ref($meta->{$_}) ? join(',', @{$meta->{$_}}) : $meta->{$_};
+               $val =~ s/([\\'])/\\$1/g;  # Escape backslashes and single quotes
+               "$_='$val'";               # Enclose in single quotes
+            }
+            grep { $_ ne 'func' }
+            keys %$meta
+         ), "\n";
+      }
+   }
+}
+
+# save_config_config {{{3
+sub save_config_config {
+   my $file = shift;
+   foreach my $key ( sort keys %config ) {
+      eval {
+      if ( $key ne 'password' || $config{savepass}->{val} ) {
+         print $file "# $config{$key}->{note}\n"
+            or die "Cannot print to file: $OS_ERROR";
+         my $val = $config{$key}->{val};
+         $val = '' unless defined($val);
+         if ( ref( $val ) eq 'ARRAY' ) {
+            print $file "$key="
+               . join( " ", @$val ) . "\n"
+               or die "Cannot print to file: $OS_ERROR";
+         }
+         elsif ( ref( $val ) eq 'HASH' ) {
+            print $file "$key="
+               . join( " ",
+                  map { "$_:$val->{$_}" } keys %$val
+               ) . "\n";
+         }
+         else {
+            print $file "$key=$val\n";
+         }
+      }
+      };
+      if ( $EVAL_ERROR ) { print "$EVAL_ERROR in $key"; };
+   }
+
+}
+
+# load_config_config {{{3
+sub load_config_config {
+   my ( $file ) = @_;
+
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $name, $val ) = $line =~ m/^(.+?)=(.*)$/;
+      next unless defined $name && defined $val;
+
+      # Validate the incoming values...
+      if ( $name && exists( $config{$name} ) ) {
+         if ( !$config{$name}->{pat} || $val =~ m/$config{$name}->{pat}/ ) {
+            $config{$name}->{val} = $val;
+            $config{$name}->{read} = 1;
+         }
+      }
+   }
+}
+
+# load_config_tbl_meta {{{3
+sub load_config_tbl_meta {
+   my ( $file ) = @_;
+
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      # Each tbl_meta section has all the properties defined in %col_props.
+      my ( $col , $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $col;
+      my %parts = $rest =~ m/(\w+)='((?:(?!(?<!\\)').)*)'/g; # Properties are single-quoted
+
+      # Each section read from the config file has one extra property: which table it
+      # goes in.
+      my $tbl  = $parts{tbl}     or die "There's no table for tbl_meta $col";
+      my $meta = $tbl_meta{$tbl} or die "There's no table in tbl_meta named $tbl";
+
+      # The section is user-defined by definition (if that makes sense).
+      $parts{user} = 1;
+
+      # The column may already exist in the table, in which case this is just a
+      # customization.
+      $meta->{cols}->{$col} ||= {};
+
+      foreach my $prop ( keys %col_props ) {
+         if ( !defined($parts{$prop}) ) {
+            die "Undefined property $prop for column $col in table $tbl";
+         }
+
+         # Un-escape escaping
+         $parts{$prop} =~ s/\\\\/\\/g;
+         $parts{$prop} =~ s/\\'/'/g;
+
+         if ( ref $col_props{$prop} ) {
+            if ( $prop eq 'trans' ) {
+               $meta->{cols}->{$col}->{trans}
+                  = [ unique(grep { exists $trans_funcs{$_} } split(',', $parts{$prop})) ];
+            }
+            else {
+               $meta->{cols}->{$col}->{$prop} = [ split(',', $parts{$prop}) ];
+            }
+         }
+         else {
+            $meta->{cols}->{$col}->{$prop} = $parts{$prop};
+         }
+      }
+
+   }
+}
+
+# save_config {{{3
+sub save_config {
+   print "\n";
+   return if $config{readonly}->{val};
+   # return if no config file was loaded and -w wasn't specified
+   if (not $conf_file) {
+      if (not $opts{w}) {
+         return;
+      }
+      else {
+         # if no config was loaded but -w was specified,
+         # write to $default_home_conf
+         $conf_file = $default_home_conf;
+      }
+   }
+   elsif ($conf_file and $opts{w}) {
+     print "Loaded config file on start-up, so ignoring -w (see --help)\n"
+   }
+   
+   my $dirname  = dirname($conf_file);
+
+   # if directories don't exist, create them.  This could cause errors
+   # or warnings if a central config doesn't have readonly=1, but being
+   # flexible requires giving the user enough rope to hang themselves with.
+   if ( ! -d $dirname ) {
+      mkdir $dirname
+         or die "Can't create directory '$dirname': $OS_ERROR";
+   }
+   if ( ! -d "$dirname/plugins" ) {
+      mkdir "$dirname/plugins"
+         or warn "Can't create directory '$dirname/plugins': $OS_ERROR\n";
+   }
+
+   # Save to a temp file first, so a crash doesn't destroy the main config file
+   my $tmpfile = File::Temp->new( TEMPLATE => 'innotopXXXXX', DIR => $dirname, SUFFIX => '.conf.tmp');
+   open my $file, "+>", $tmpfile
+      or die("Can't write to $tmpfile: $OS_ERROR");
+   print $file "version=$VERSION\n";
+
+   foreach my $section ( @ordered_config_file_sections ) {
+      die "No such config file section $section" unless $config_file_sections{$section};
+      print $file "\n[$section]\n\n";
+      $config_file_sections{$section}->{writer}->($file);
+      print $file "\n[/$section]\n";
+   }
+
+   # Now clobber the main config file with the temp.
+   close $file or die("Can't close $tmpfile: $OS_ERROR");
+   rename($tmpfile, $conf_file) or die("Can't rename $tmpfile to $conf_file: $OS_ERROR");
+}
+
+# load_config_connections {{{3
+sub load_config_connections {
+   return if $opts{u} or $opts{p} or $opts{h} or $opts{P}; # don't load connections if DSN or user/pass options used
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $key , $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $key;
+      my %parts = $rest =~ m/(\S+?)=(\S*)/g;
+      my %conn  = map { $_ => $parts{$_} || '' } @conn_parts;
+      $connections{$key} = \%conn;
+   }
+}
+
+# save_config_connections {{{3
+sub save_config_connections {
+   my $file = shift;
+   foreach my $conn ( sort keys %connections ) {
+      my $href = $connections{$conn};
+      my @keys = $href->{savepass} ? @conn_parts : grep { $_ ne 'pass' } @conn_parts;
+      print $file "$conn=", join(' ', map { "$_=$href->{$_}" } grep { defined $href->{$_} } @keys), "\n";
+   }
+}
+
+sub load_config_colors {
+   my ( $file ) = @_;
+   my %rule_set_for;
+
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $tbl, $rule ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $tbl && $rule;
+      next unless exists $tbl_meta{$tbl};
+      my %parts = $rule =~ m/(\w+)='((?:(?!(?<!\\)').)*)'/g; # Properties are single-quoted
+      next unless $parts{col} && exists $tbl_meta{$tbl}->{cols}->{$parts{col}};
+      next unless $parts{op}  && exists $comp_ops{$parts{op}};
+      next unless defined $parts{arg};
+      next unless defined $parts{color};
+      my @colors = unique(grep { exists $ansicolors{$_} } split(/\W+/, $parts{color}));
+      next unless @colors;
+
+      # Finally!  Enough validation...
+      $rule_set_for{$tbl} ||= [];
+      push @{$rule_set_for{$tbl}}, \%parts;
+   }
+
+   foreach my $tbl ( keys %rule_set_for ) {
+      $tbl_meta{$tbl}->{colors} = $rule_set_for{$tbl};
+      $tbl_meta{$tbl}->{color_func} = make_color_func($tbl_meta{$tbl});
+      $tbl_meta{$tbl}->{cust}->{colors} = 1;
+   }
+}
+
+# save_config_colors {{{3
+sub save_config_colors {
+   my $file = shift;
+   foreach my $tbl ( sort keys %tbl_meta ) {
+      my $meta = $tbl_meta{$tbl};
+      next unless $meta->{cust}->{colors};
+      foreach my $rule ( @{$meta->{colors}} ) {
+         print $file "$tbl=", join(
+            ' ',
+            map {
+               my $val = $rule->{$_};
+               $val =~ s/([\\'])/\\$1/g;  # Escape backslashes and single quotes
+               "$_='$val'";               # Enclose in single quotes
+            }
+            qw(col op arg color)
+         ), "\n";
+      }
+   }
+}
+
+# load_config_active_connections {{{3
+sub load_config_active_connections {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $key , $rest ) = $line =~ m/^(.*?)=(.*)$/;
+      next unless $key && exists $modes{$key};
+      my @parts = grep { exists $connections{$_} } split(/ /, $rest);
+      $modes{$key}->{connections} = [ @parts ] if exists $modes{$key};
+   }
+}
+
+# save_config_active_connections {{{3
+sub save_config_active_connections {
+   my $file = shift;
+   foreach my $mode ( sort keys %modes ) {
+      my @connections = get_connections($mode);
+      print $file "$mode=", join(' ', @connections), "\n";
+   }
+}
+
+# load_config_stmt_sleep_times {{{3
+sub load_config_stmt_sleep_times {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $key , $val ) = split('=', $line);
+      next unless $key && defined $val && $val =~ m/$num_regex/;
+      $stmt_sleep_time_for{$key} = $val;
+   }
+}
+
+# save_config_stmt_sleep_times {{{3
+sub save_config_stmt_sleep_times {
+   my $file = shift;
+   foreach my $key ( sort keys %stmt_sleep_time_for ) {
+      print $file "$key=$stmt_sleep_time_for{$key}\n";
+   }
+}
+
+# load_config_mvs {{{3
+sub load_config_mvs {
+   my ( $file ) = @_;
+   while ( my $line = <$file> ) {
+      chomp $line;
+      next if $line =~ m/^#/;
+      last if $line =~ m/^\[/;
+
+      my ( $key , $val ) = split('=', $line);
+      next unless $key && defined $val && $val =~ m/$num_regex/;
+      $mvs{$key} = $val;
+   }
+}
+
+# save_config_mvs {{{3
+sub save_config_mvs {
+   my $file = shift;
+   foreach my $key ( sort keys %mvs ) {
+      print $file "$key=$mvs{$key}\n";
+   }
+}
+
+# edit_configuration {{{3
+sub edit_configuration {
+   my $key = '';
+   while ( $key ne 'q' ) {
+      $clear_screen_sub->();
+      my @display_lines = '';
+
+      if ( $key && $cfg_editor_action{$key} ) {
+         $cfg_editor_action{$key}->{func}->();
+      }
+
+      # Show help
+      push @display_lines, create_caption('What configuration do you want to edit?',
+      create_table2(
+         [ sort keys %cfg_editor_action ],
+         { map { $_ => $_ } keys %cfg_editor_action },
+         { map { $_ => $cfg_editor_action{$_}->{note} } keys %cfg_editor_action },
+         { sep => '  ' }));
+
+      draw_screen(\@display_lines);
+      $key = pause('');
+   }
+}
+
+# edit_configuration_variables {{{3
+sub edit_configuration_variables {
+   $clear_screen_sub->();
+   my $mode = $config{mode}->{val};
+
+   my %config_choices
+      = map  { $_ => $config{$_}->{note} || '' }
+        # Only config values that are marked as applying to this mode.
+        grep {
+           my $key = $_;
+           $config{$key}->{conf} &&
+              ( $config{$key}->{conf} eq 'ALL'
+              || grep { $mode eq $_ } @{$config{$key}->{conf}} )
+        } keys %config;
+
+   my $key = prompt_list(
+      "Enter the name of the variable you wish to configure",
+      '',
+      sub{ return keys %config_choices },
+      \%config_choices);
+
+   if ( exists($config_choices{$key}) ) {
+      get_config_interactive($key);
+   }
+}
+
+# edit_color_rules {{{3
+sub edit_color_rules {
+   my ( $tbl ) = @_;
+   $clear_screen_sub->();
+   $tbl ||= choose_visible_table();
+   if ( $tbl && exists($tbl_meta{$tbl}) ) {
+      my $meta = $tbl_meta{$tbl};
+      my @cols = ('', qw(col op arg color));
+      my $info = { map { $_ => { hdr => $_, just => '-', } }  @cols };
+      $info->{label}->{maxw} = 30;
+      my $key;
+      my $selected_rule;
+
+      # This loop builds a tabular view of the rules.
+      do {
+
+         # Show help
+         if ( $key && $key eq '?' ) {
+            my @display_lines = '';
+            push @display_lines, create_caption('Editor key mappings',
+            create_table2(
+               [ sort keys %color_editor_action ],
+               { map { $_ => $_ } keys %color_editor_action },
+               { map { $_ => $color_editor_action{$_}->{note} } keys %color_editor_action },
+               { sep => '  ' }));
+            draw_screen(\@display_lines);
+            pause();
+            $key = '';
+         }
+         else {
+
+            # Do the action specified
+            $selected_rule ||= 0;
+            if ( $key && $color_editor_action{$key} ) {
+               $selected_rule = $color_editor_action{$key}->{func}->($tbl, $selected_rule);
+               $selected_rule ||= 0;
+            }
+
+            # Build the table of rules.  If the terminal has color, the selected rule
+            # will be highlighted; otherwise a > at the left will indicate.
+            my $data = $meta->{colors} || [];
+            foreach my $i ( 0..@$data - 1  ) {
+               $data->[$i]->{''} = $i == $selected_rule ? '>' : '';
+            }
+            my @display_lines = create_table(\@cols, $info, $data);
+
+            # Highlight selected entry
+            for my $i ( 0 .. $#display_lines ) {
+               if ( $display_lines[$i] =~ m/^>/ ) {
+                  $display_lines[$i] = [ $display_lines[$i], 'reverse' ];
+               }
+            }
+
+            # Draw the screen and wait for a command.
+            unshift @display_lines, '',
+               "Editing color rules for $meta->{capt}.  Press ? for help, q to "
+               . "quit.", '';
+            draw_screen(\@display_lines);
+            print "\n\n", word_wrap('Rules are applied in order from top to '
+               . 'bottom.  The first matching rule wins and prevents the '
+               . 'rest of the rules from being applied.');
+            $key = pause('');
+         }
+      } while ( $key ne 'q' );
+      $meta->{color_func} = make_color_func($meta);
+   }
+}
+
+# add_quick_filter {{{3
+sub add_quick_filter {
+   my $tbl = choose_visible_table();
+   if ( $tbl && exists($tbl_meta{$tbl}) ) {
+      print "\n";
+      my $response = prompt_list(
+         "Enter column name and filter text",
+         '',
+         sub { return keys %{$tbl_meta{$tbl}->{cols}} },
+         ()
+      );
+      my ( $col, $text ) = split(/\s+/, $response, 2);
+
+      # You can't filter on a nonexistent column.  But if you filter on a pivoted
+      # table, the columns are different, so on a pivoted table, allow filtering
+      # on the 'name' column.
+      # NOTE: if a table is pivoted and un-pivoted, this will likely cause crashes.
+      # Currently not an issue since there's no way to toggle pivot/nopivot.
+      return unless $col && $text &&
+         (exists($tbl_meta{$tbl}->{cols}->{$col})
+            || ($tbl_meta{$tbl}->{pivot} && $col eq 'name'));
+
+      my ( $sub, $err ) = compile_filter( "defined \$set->{$col} && \$set->{$col} =~ m/$text/" );
+      return if !$sub || $err;
+      my $name = "quick_$tbl.$col";
+      $filters{$name} = {
+         func  => $sub,
+         text  => $text,
+         user  => 1,
+         quick => 1,
+         name  => $name,
+         note  => 'Quick-filter',
+         tbls  => [$tbl],
+      };
+      push @{$tbl_meta{$tbl}->{filters}}, $name;
+   }
+}
+
+# clear_quick_filters {{{3
+sub clear_quick_filters {
+   my $tbl = choose_visible_table(
+      # Only tables that have quick-filters
+      sub {
+         my ( $tbl ) = @_;
+         return scalar grep { $filters{$_}->{quick} } @{ $tbl_meta{$tbl}->{filters} };
+      }
+   );
+   if ( $tbl && exists($tbl_meta{$tbl}) ) {
+      my @current = @{$tbl_meta{$tbl}->{filters}};
+      @current = grep { !$filters{$_}->{quick} } @current;
+      $tbl_meta{$tbl}->{filters} = \@current;
+   }
+}
+
+sub edit_plugins {
+   $clear_screen_sub->();
+
+   my @cols = ('', qw(class desc active));
+   my $info = { map { $_ => { hdr => $_, just => '-', } }  @cols };
+   my @rows = map { $plugins{$_} } sort keys %plugins;
+   my $key;
+   my $selected;
+
+   # This loop builds a tabular view of the plugins.
+   do {
+
+      # Show help
+      if ( $key && $key eq '?' ) {
+         my @display_lines = '';
+         push @display_lines, create_caption('Editor key mappings',
+         create_table2(
+            [ sort keys %plugin_editor_action ],
+            { map { $_ => $_ } keys %plugin_editor_action },
+            { map { $_ => $plugin_editor_action{$_}->{note} } keys %plugin_editor_action },
+            { sep => '  ' }));
+         draw_screen(\@display_lines);
+         pause();
+         $key = '';
+      }
+
+      # Do the action specified
+      else {
+         $selected ||= 0;
+         if ( $key && $plugin_editor_action{$key} ) {
+            $selected = $plugin_editor_action{$key}->{func}->(\@rows, $selected);
+            $selected ||= 0;
+         }
+
+         # Build the table of plugins.
+         foreach my $row ( 0.. $#rows ) {
+            $rows[$row]->{''} = $row eq $selected ? '>' : ' ';
+         }
+         my @display_lines = create_table(\@cols, $info, \@rows);
+
+         # Highlight selected entry
+         for my $i ( 0 .. $#display_lines ) {
+            if ( $display_lines[$i] =~ m/^>/ ) {
+               $display_lines[$i] = [ $display_lines[$i], 'reverse' ];
+            }
+         }
+
+         # Draw the screen and wait for a command.
+         unshift @display_lines, '',
+            "Plugin Management.  Press ? for help, q to quit.", '';
+         draw_screen(\@display_lines);
+         $key = pause('');
+      }
+   } while ( $key ne 'q' );
+}
+
+# edit_table {{{3
+sub edit_table {
+   $clear_screen_sub->();
+   my ( $tbl ) = @_;
+   $tbl ||= choose_visible_table();
+   if ( $tbl && exists($tbl_meta{$tbl}) ) {
+      my $meta = $tbl_meta{$tbl};
+      my @cols = ('', qw(name hdr label src));
+      my $info = { map { $_ => { hdr => $_, just => '-', } }  @cols };
+      $info->{label}->{maxw} = 30;
+      my $key;
+      my $selected_column;
+
+      # This loop builds a tabular view of the tbl_meta's structure, showing each column
+      # in the entry as a row.
+      do {
+
+         # Show help
+         if ( $key && $key eq '?' ) {
+            my @display_lines = '';
+            push @display_lines, create_caption('Editor key mappings',
+            create_table2(
+               [ sort keys %tbl_editor_action ],
+               { map { $_ => $_ } keys %tbl_editor_action },
+               { map { $_ => $tbl_editor_action{$_}->{note} } keys %tbl_editor_action },
+               { sep => '  ' }));
+            draw_screen(\@display_lines);
+            pause();
+            $key = '';
+         }
+         else {
+
+            # Do the action specified
+            $selected_column ||= $meta->{visible}->[0];
+            if ( $key && $tbl_editor_action{$key} ) {
+               $selected_column = $tbl_editor_action{$key}->{func}->($tbl, $selected_column);
+               $selected_column ||= $meta->{visible}->[0];
+            }
+
+            # Build the pivoted view of the table's meta-data.  If the terminal has color,
+            # The selected row will be highlighted; otherwise a > at the left will indicate.
+            my $data = [];
+            foreach my $row ( @{$meta->{visible}} ) {
+               my %hash;
+               @hash{ @cols } = @{$meta->{cols}->{$row}}{@cols};
+               $hash{src}  = '' if ref $hash{src};
+               $hash{name} = $row;
+               $hash{''}   = $row eq $selected_column ? '>' : ' ';
+               push @$data, \%hash;
+            }
+            my @display_lines = create_table(\@cols, $info, $data);
+
+            # Highlight selected entry
+            for my $i ( 0 .. $#display_lines ) {
+               if ( $display_lines[$i] =~ m/^>/ ) {
+                  $display_lines[$i] = [ $display_lines[$i], 'reverse' ];
+               }
+            }
+
+            # Draw the screen and wait for a command.
+            unshift @display_lines, '',
+               "Editing table definition for $meta->{capt}.  Press ? for help, q to quit.", '';
+            draw_screen(\@display_lines, { clear => 1 });
+            $key = pause('');
+         }
+      } while ( $key ne 'q' );
+   }
+}
+
+# choose_mode_tables {{{3
+# Choose which table(s), and in what order, to display in a given mode.
+sub choose_mode_tables {
+   my $mode = $config{mode}->{val};
+   my @tbls = @{$modes{$mode}->{visible_tables}};
+   my $new  = prompt_list(
+      "Choose tables to display",
+      join(' ', @tbls),
+      sub { return @{$modes{$mode}->{tables}} },
+      { map { $_ => $tbl_meta{$_}->{capt} } @{$modes{$mode}->{tables}} }
+   );
+   $modes{$mode}->{visible_tables} =
+      [ unique(grep { $_ && exists $tbl_meta{$_} } split(/\s+/, $new)) ];
+   $modes{$mode}->{cust}->{visible_tables} = 1;
+}
+
+# choose_visible_table {{{3
+sub choose_visible_table {
+   my ( $grep_cond ) = @_;
+   my $mode = $config{mode}->{val};
+   my @tbls
+      = grep { $grep_cond ? $grep_cond->($_) : 1 }
+        @{$modes{$mode}->{visible_tables}};
+   my $tbl = $tbls[0];
+   if ( @tbls > 1 ) {
+      $tbl = prompt_list(
+         "Choose a table",
+         '',
+         sub { return @tbls },
+         { map { $_ => $tbl_meta{$_}->{capt} } @tbls }
+      );
+   }
+   return $tbl;
+}
+
+sub toggle_aggregate {
+   my ( $tbl ) = @_;
+   $tbl ||= choose_visible_table();
+   return unless $tbl && exists $tbl_meta{$tbl};
+   my $meta = $tbl_meta{$tbl};
+   $meta->{aggregate} ^= 1;
+}
+
+sub choose_filters {
+   my ( $tbl ) = @_;
+   $tbl ||= choose_visible_table();
+   return unless $tbl && exists $tbl_meta{$tbl};
+   my $meta = $tbl_meta{$tbl};
+   $clear_screen_sub->();
+
+   print "Choose filters for $meta->{capt}:\n";
+
+   my $ini = join(' ', @{$meta->{filters}});
+   my $val = prompt_list(
+      'Choose filters',
+      $ini,
+      sub { return keys %filters },
+      {
+         map  { $_ => $filters{$_}->{note} }
+         grep { grep { $tbl eq $_ } @{$filters{$_}->{tbls}} }
+         keys %filters
+      }
+   );
+
+   my @choices = unique(split(/\s+/, $val));
+   foreach my $new ( grep { !exists($filters{$_}) } @choices ) {
+      my $answer = prompt("There is no filter called '$new'.  Create it?", undef, 'y');
+      if ( $answer eq 'y' ) {
+         create_new_filter($new, $tbl);
+      }
+   }
+   @choices = grep { exists $filters{$_} } @choices;
+   @choices = grep { grep { $tbl eq $_ } @{$filters{$_}->{tbls}} } @choices;
+   $meta->{filters} = [ @choices ];
+   $meta->{cust}->{filters} = 1;
+}
+
+sub choose_group_cols {
+   my ( $tbl ) = @_;
+   $tbl ||= choose_visible_table();
+   return unless $tbl && exists $tbl_meta{$tbl};
+   $clear_screen_sub->();
+   my $meta = $tbl_meta{$tbl};
+   my $curr = join(', ', @{$meta->{group_by}});
+   my $val = prompt_list(
+      'Group-by columns',
+      $curr,
+      sub { return keys %{$meta->{cols}} },
+      { map { $_ => $meta->{cols}->{$_}->{label} } keys %{$meta->{cols}} });
+   if ( $curr ne $val ) {
+      $meta->{group_by} = [ grep { exists $meta->{cols}->{$_} } $val =~ m/(\w+)/g ];
+      $meta->{cust}->{group_by} = 1;
+   }
+}
+
+sub choose_sort_cols {
+   my ( $tbl ) = @_;
+   $tbl ||= choose_visible_table();
+   return unless $tbl && exists $tbl_meta{$tbl};
+   $clear_screen_sub->();
+   my $meta = $tbl_meta{$tbl};
+
+   my ( $cols, $hints );
+   if ( $meta->{pivot} ) {
+      $cols  = sub { qw(name set_0) };
+      $hints = { name => 'name', set_0 => 'set_0' };
+   }
+   else {
+      $cols  = sub { return keys %{$meta->{cols}} };
+      $hints = { map { $_ => $meta->{cols}->{$_}->{label} } keys %{$meta->{cols}} };
+   }
+
+   my $val = prompt_list(
+      'Sort columns (reverse sort with -col)',
+      $meta->{sort_cols},
+      $cols,
+      $hints );
+   if ( $meta->{sort_cols} ne $val ) {
+      $meta->{sort_cols} = $val;
+      $meta->{cust}->{sort_cols} = 1;
+      $tbl_meta{$tbl}->{sort_func} = make_sort_func($tbl_meta{$tbl});
+   }
+}
+
+# create_new_filter {{{3
+sub create_new_filter {
+   my ( $filter, $tbl ) = @_;
+   $clear_screen_sub->();
+
+   if ( !$filter || $filter =~ m/\W/ ) {
+      print word_wrap("Choose a name for the filter.  This name is not displayed, and is only used "
+            . "for internal reference.  It can only contain lowercase letters, numbers, and underscores.");
+      print "\n\n";
+      do {
+         $filter = prompt("Enter filter name");
+      } while ( !$filter || $filter =~ m/\W/ );
+   }
+
+   my $completion = sub { keys %{$tbl_meta{$tbl}->{cols}} };
+   my ( $err, $sub, $body );
+   do {
+      $clear_screen_sub->();
+      print word_wrap("A filter is a Perl subroutine that accepts a hashref of columns "
+         . "called \$set, and returns a true value if the filter accepts the row.  Example:\n"
+         . "   \$set->{active_secs} > 5\n"
+         . "will only allow rows if their active_secs column is greater than 5.");
+      print "\n\n";
+      if ( $err ) {
+         print "There's an error in your filter expression: $err\n\n";
+      }
+      $body = prompt("Enter subroutine body", undef, undef, $completion);
+      ( $sub, $err ) = compile_filter($body);
+   } while ( $err );
+
+   $filters{$filter} = {
+      func => $sub,
+      text => $body,
+      user => 1,
+      name => $filter,
+      note => 'User-defined filter',
+      tbls => [$tbl],
+   };
+}
+
+# get_config_interactive {{{3
+sub get_config_interactive {
+   my $key = shift;
+   $clear_screen_sub->();
+
+   # Print help first.
+   print "Enter a new value for '$key' ($config{$key}->{note}).\n";
+
+   my $current = ref($config{$key}->{val}) ? join(" ", @{$config{$key}->{val}}) : $config{$key}->{val};
+
+   my $new_value = prompt('Enter a value', $config{$key}->{pat}, $current);
+   $config{$key}->{val} = $new_value;
+}
+
+sub edit_current_var_set {
+   my $mode = $config{mode}->{val};
+   my $name = $config{"${mode}_set"}->{val};
+   my $variables = $var_sets{$name}->{text};
+
+   my $new = $variables;
+   do {
+      $clear_screen_sub->();
+      $new = prompt("Enter variables for $name", undef, $variables);
+   } until ( $new );
+
+   if ( $new ne $variables ) {
+      @{$var_sets{$name}}{qw(text user)} = ( $new, 1);
+   }
+}
+
+
+sub choose_var_set {
+   my ( $key ) = @_;
+   $clear_screen_sub->();
+
+   my $new_value = prompt_list(
+      'Choose a set of values to display, or enter the name of a new one',
+      $config{$key}->{val},
+      sub { return keys %var_sets },
+      { map { $_ => $var_sets{$_}->{text} } keys %var_sets });
+
+   if ( !exists $var_sets{$new_value} ) {
+      add_new_var_set($new_value);
+   }
+
+   $config{$key}->{val} = $new_value if exists $var_sets{$new_value};
+}
+
+sub switch_var_set {
+   my ( $cfg_var, $dir ) = @_;
+   my @var_sets = sort keys %var_sets;
+   my $cur      = $config{$cfg_var}->{val};
+   my $pos      = grep { $_ lt $cur } @var_sets;
+   my $newpos   = ($pos + $dir) % @var_sets;
+   $config{$cfg_var}->{val} = $var_sets[$newpos];
+   $clear_screen_sub->();
+}
+
+# Online configuration and prompting functions {{{2
+
+# edit_stmt_sleep_times {{{3
+sub edit_stmt_sleep_times {
+   $clear_screen_sub->();
+   my $stmt = prompt_list('Specify a statement', '', sub { return sort keys %stmt_maker_for });
+   return unless $stmt && exists $stmt_maker_for{$stmt};
+   $clear_screen_sub->();
+   my $curr_val = $stmt_sleep_time_for{$stmt} || 0;
+   my $new_val  = prompt('Specify a sleep delay after calling this SQL', $num_regex, $curr_val);
+   if ( $new_val ) {
+      $stmt_sleep_time_for{$stmt} = $new_val;
+   }
+   else {
+      delete $stmt_sleep_time_for{$stmt};
+   }
+}
+
+# edit_server_groups {{{3
+# Choose which server connections are in a server group.  First choose a group,
+# then choose which connections are in it.
+sub edit_server_groups {
+   $clear_screen_sub->();
+   my $mode  = $config{mode}->{val};
+   my $group = $modes{$mode}->{server_group};
+   my %curr  = %server_groups;
+   my $new   = choose_or_create_server_group($group, 'to edit');
+   $clear_screen_sub->();
+   if ( exists $curr{$new} ) {
+      # Don't do this step if the user just created a new server group,
+      # because part of that process was to choose connections.
+      my $cxns  = join(' ', @{$server_groups{$new}});
+      my @conns = choose_or_create_connection($cxns, 'for this group');
+      $server_groups{$new} = \@conns;
+   }
+}
+
+# choose_server_groups {{{3
+sub choose_server_groups {
+   $clear_screen_sub->();
+   my $mode  = $config{mode}->{val};
+   my $group = $modes{$mode}->{server_group};
+   my $new   = choose_or_create_server_group($group, 'for this mode');
+   $modes{$mode}->{server_group} = $new if exists $server_groups{$new};
+}
+
+sub choose_or_create_server_group {
+   my ( $group, $prompt ) = @_;
+   my $new   = '';
+
+   my @available = sort keys %server_groups;
+
+   if ( @available ) {
+      print "You can enter the name of a new group to create it.\n";
+
+      $new = prompt_list(
+         "Choose a server group $prompt",
+         $group,
+         sub { return @available },
+         { map { $_ => join(' ', @{$server_groups{$_}}) } @available });
+
+      $new =~ s/\s.*//;
+
+      if ( !exists $server_groups{$new} ) {
+         my $answer = prompt("There is no server group called '$new'.  Create it?", undef, "y");
+         if ( $answer eq 'y' ) {
+            add_new_server_group($new);
+         }
+      }
+   }
+   else {
+      $new = add_new_server_group();
+   }
+   return $new;
+}
+
+sub choose_or_create_connection {
+   my ( $cxns, $prompt ) = @_;
+   print "You can enter the name of a new connection to create it.\n";
+
+   my @available = sort keys %connections;
+   my $new_cxns = prompt_list(
+      "Choose connections $prompt",
+      $cxns,
+      sub { return @available },
+      { map { $_ => $connections{$_}->{dsn} } @available });
+
+   my @new = unique(grep { !exists $connections{$_} } split(/\s+/, $new_cxns));
+   foreach my $new ( @new ) {
+      my $answer = prompt("There is no connection called '$new'.  Create it?", undef, "y");
+      if ( $answer eq 'y' ) {
+         add_new_dsn($new);
+      }
+   }
+
+   return unique(grep { exists $connections{$_} } split(/\s+/, $new_cxns));
+}
+
+# choose_servers {{{3
+sub choose_servers {
+   $clear_screen_sub->();
+   my $mode = $config{mode}->{val};
+   my $cxns = join(' ', get_connections());
+   my @chosen = choose_or_create_connection($cxns, 'for this mode');
+   $modes{$mode}->{connections} = \@chosen;
+   $modes{$mode}->{server_group} = ''; # Clear this because it overrides {connections}
+}
+
+# display_license {{{3
+sub display_license {
+   $clear_screen_sub->();
+
+   print $innotop_license;
+
+   pause();
+}
+
+# Data-retrieval functions {{{2
+# get_status_info {{{3
+# Get SHOW STATUS and SHOW VARIABLES together.
+sub get_status_info {
+   my @cxns = @_;
+   if ( !$info_gotten{status}++ ) {
+      foreach my $cxn ( @cxns ) {
+         $vars{$cxn}->{$clock} ||= {};
+         my $vars = $vars{$cxn}->{$clock};
+
+         my $sth = do_stmt($cxn, 'SHOW_STATUS') or next;
+         my $res = $sth->fetchall_arrayref();
+         map { $vars->{$_->[0]} = $_->[1] || 0 } @$res;
+
+         # Calculate hi-res uptime and add cxn to the hash.  This duplicates get_driver_status,
+         # but it's most important to have consistency.
+         $vars->{Uptime_hires} ||= get_uptime($cxn);
+         $vars->{cxn} = $cxn;
+
+         # Add SHOW VARIABLES to the hash
+         $sth = do_stmt($cxn, 'SHOW_VARIABLES') or next;
+         $res = $sth->fetchall_arrayref();
+         map { $vars->{$_->[0]} = $_->[1] || 0 } @$res;
+      }
+   }
+}
+
+# Chooses a thread for explaining, killing, etc...
+# First arg is a func that can be called in grep.
+sub choose_thread {
+   my ( $grep_cond, $prompt ) = @_;
+
+   # Narrow the list to queries that can be explained.
+   my %thread_for = map {
+      # Eliminate innotop's own threads.
+      $_ => $dbhs{$_}->{dbh} ? $dbhs{$_}->{dbh}->{mysql_thread_id} : 0
+   } keys %connections;
+
+   my @candidates = grep {
+      $_->{id} != $thread_for{$_->{cxn}} && $grep_cond->($_)
+   } @current_queries;
+   return unless @candidates;
+
+   # Find out which server.
+   my @cxns = unique map { $_->{cxn} } @candidates;
+   my ( $cxn ) = select_cxn('On which server', @cxns);
+   return unless $cxn && exists($connections{$cxn});
+
+   # Re-filter the list of candidates to only those on this server
+   @candidates = grep { $_->{cxn} eq $cxn } @candidates;
+
+   # Find out which thread to do.
+   my $info;
+   if ( @candidates > 1 ) {
+
+      # Sort longest-active first, then longest-idle.
+      my $sort_func = sub {
+         my ( $a, $b ) = @_;
+         return  $a->{query} && !$b->{query} ? 1
+               : $b->{query} && !$a->{query} ? -1
+               : ($a->{time} || 0) <=> ($b->{time} || 0);
+      };
+      my @threads = map { $_->{id} } reverse sort { $sort_func->($a, $b) } @candidates;
+
+      print "\n";
+      my $thread = prompt_list($prompt,
+         $threads[0],
+         sub { return @threads });
+      return unless $thread && $thread =~ m/$int_regex/;
+
+      # Find the info hash of that query on that server.
+      ( $info ) = grep { $thread == $_->{id} } @candidates;
+   }
+   else {
+      $info = $candidates[0];
+   }
+   return $info;
+}
+
+# analyze_query {{{3
+# Allows the user to show fulltext, explain, show optimized...
+sub analyze_query {
+   my ( $action ) = @_;
+
+   my $info = choose_thread(
+      sub { $_[0]->{query} },
+      'Select a thread to analyze',
+   );
+   return unless $info;
+
+   my %actions = (
+      e => \&display_explain,
+      f => \&show_full_query,
+      o => \&show_optimized_query,
+   );
+   do {
+      $actions{$action}->($info);
+      print "\n";
+      $action = pause('Press e to explain, f for full query, o for optimized query');
+   } while ( exists($actions{$action}) );
+}
+
+# inc {{{3
+# Returns the difference between two sets of variables/status/innodb stuff.
+sub inc {
+   my ( $offset, $cxn ) = @_;
+   my $vars = $vars{$cxn};
+   if ( $offset < 0 ) {
+      return $vars->{$clock};
+   }
+   elsif ( exists $vars{$clock - $offset} && !exists $vars->{$clock - $offset - 1} ) {
+      return $vars->{$clock - $offset};
+   }
+   my $cur = $vars->{$clock - $offset};
+   my $pre = $vars->{$clock - $offset - 1};
+   return {
+      # Numeric variables get subtracted, non-numeric get passed straight through.
+      map  {
+         $_ =>
+            ( (defined $cur->{$_} && $cur->{$_} =~ m/$num_regex/)
+            ?  $cur->{$_} - ($pre->{$_} || 0)
+            :  $cur->{$_} )
+      } keys %{$cur}
+   };
+}
+
+# extract_values {{{3
+# Arguments are a set of values (which may be incremental, derived from
+# current and previous), current, and previous values.
+# TODO: there are a few places that don't remember prev set so can't pass it.
+sub extract_values {
+   my ( $set, $cur, $pre, $tbl ) = @_;
+
+   # Hook in event listeners
+   foreach my $listener ( @{$event_listener_for{extract_values}} ) {
+      $listener->extract_values($set, $cur, $pre, $tbl);
+   }
+
+   my $result = {};
+   my $meta   = $tbl_meta{$tbl};
+   my $cols   = $meta->{cols};
+   foreach my $key ( keys %$cols ) {
+      my $info = $cols->{$key}
+         or die "Column '$key' doesn't exist in $tbl";
+      die "No func defined for '$key' in $tbl"
+         unless $info->{func};
+      eval {
+         $result->{$key} = $info->{func}->($set, $cur, $pre)
+      };
+      if ( $EVAL_ERROR ) {
+         if ( $config{debug}->{val} ) {
+            die $EVAL_ERROR;
+         }
+         $result->{$key} = $info->{num} ? 0 : '';
+      }
+   }
+   return $result;
+}
+
+# get_full_processlist {{{3
+sub get_full_processlist {
+   my @cxns = @_;
+   my @result;
+   foreach my $cxn ( @cxns ) {
+      my $stmt = do_stmt($cxn, 'PROCESSLIST') or next;
+      my $arr  = $stmt->fetchall_arrayref({});
+      push @result, map { $_->{cxn} = $cxn; $_ } @$arr;
+   }
+   return @result;
+}
+
+# get_open_tables {{{3
+sub get_open_tables {
+   my @cxns = @_;
+   my @result;
+   foreach my $cxn ( @cxns ) {
+      my $stmt = do_stmt($cxn, 'OPEN_TABLES') or next;
+      my $arr  = $stmt->fetchall_arrayref({});
+      push @result, map { $_->{cxn} = $cxn; $_ } @$arr;
+   }
+   return @result;
+}
+
+# get_innodb_status {{{3
+sub get_innodb_status {
+   my ( $cxns, $addl_sections ) = @_;
+   if ( !$config{skip_innodb}->{val} && !$info_gotten{innodb_status}++ ) {
+
+      # Determine which sections need to be parsed
+      my %sections_required =
+         map  { $tbl_meta{$_}->{innodb} => 1 }
+         grep { $_ && $tbl_meta{$_}->{innodb} }
+         get_visible_tables();
+
+      # Add in any other sections the caller requested.
+      foreach my $sec ( @$addl_sections ) {
+         $sections_required{$sec} = 1;
+      }
+
+      foreach my $cxn ( @$cxns ) {
+         my $innodb_status_text;
+
+         if ( $file ) { # Try to fetch status text from the file.
+            my @stat = stat($file);
+
+            # Initialize the file.
+            if ( !$file_mtime ) {
+               # Initialize to 130k from the end of the file (because the limit
+               # on the size of innodb status is 128k even with Google's patches)
+               # and try to grab the last status from the file.
+               sysseek($file, (-128 * 1_024), 2);
+            }
+
+            # Read from the file.
+            my $buffer;
+            if ( !$file_mtime || $file_mtime != $stat[9] ) {
+               $file_data = '';
+               while ( sysread($file, $buffer, 4096) ) {
+                  $file_data .= $buffer;
+               }
+               $file_mtime = $stat[9];
+            }
+
+            # Delete everything but the last InnoDB status text from the file.
+            $file_data =~ s/\A.*(?=^=====================================\n...... ........ INNODB MONITOR OUTPUT)//ms;
+            $innodb_status_text = $file_data;
+         }
+
+         else {
+            my $stmt = do_stmt($cxn, 'INNODB_STATUS') or next;
+            $innodb_status_text = $stmt->fetchrow_hashref()->{status};
+         }
+
+         next unless $innodb_status_text
+            && substr($innodb_status_text, 0, 100) =~ m/INNODB MONITOR OUTPUT/;
+
+         # Parse and merge into %vars storage
+         my %innodb_status = (
+            $innodb_parser->get_status_hash(
+               $innodb_status_text,
+               $config{debug}->{val},
+               \%sections_required,
+               0, # don't parse full lock information
+            )
+         );
+         if ( !$innodb_status{IB_got_all} && $config{auto_wipe_dl}->{val} ) {
+            clear_deadlock($cxn);
+         }
+
+         # Merge using a hash slice, which is the fastest way
+         $vars{$cxn}->{$clock} ||= {};
+         my $hash = $vars{$cxn}->{$clock};
+         @{$hash}{ keys %innodb_status } = values %innodb_status;
+         $hash->{cxn} = $cxn;
+         $hash->{Uptime_hires} ||= get_uptime($cxn);
+      }
+   }
+}
+
+# clear_deadlock {{{3
+sub clear_deadlock {
+   my ( $cxn ) = @_;
+   return if $clearing_deadlocks++;
+   my $tbl = $connections{$cxn}->{dl_table};
+   return unless $tbl;
+
+   eval {
+      # Set up the table for creating a deadlock.
+      my $engine = version_ge($dbhs{$cxn}->{dbh}, '4.1.2') ? 'engine' : 'type';
+      return unless do_query($cxn, "drop table if exists $tbl");
+      return unless do_query($cxn, "create table $tbl(a int) $engine=innodb");
+      return unless do_query($cxn, "delete from $tbl");
+      return unless do_query($cxn, "insert into $tbl(a) values(0), (1)");
+      return unless do_query($cxn, "commit"); # Or the children will block against the parent
+
+      # Fork off two children to deadlock against each other.
+      my %children;
+      foreach my $child ( 0..1 ) {
+         my $pid = fork();
+         if ( defined($pid) && $pid == 0 ) { # I am a child
+            deadlock_thread( $child, $tbl, $cxn );
+         }
+         elsif ( !defined($pid) ) {
+            die("Unable to fork for clearing deadlocks!\n");
+         }
+         # I already exited if I'm a child, so I'm the parent.
+         $children{$child} = $pid;
+      }
+
+      # Wait for the children to exit.
+      foreach my $child ( keys %children ) {
+         my $pid = waitpid($children{$child}, 0);
+      }
+
+      # Clean up.
+      do_query($cxn, "drop table $tbl");
+   };
+   if ( $EVAL_ERROR ) {
+      print $EVAL_ERROR;
+      pause();
+   }
+
+   $clearing_deadlocks = 0;
+}
+
+sub get_master_logs {
+   my @cxns = @_;
+   my @result;
+   if ( !$info_gotten{master_logs}++ ) {
+      foreach my $cxn ( @cxns ) {
+         my $stmt = do_stmt($cxn, 'SHOW_MASTER_LOGS') or next;
+         push @result, @{$stmt->fetchall_arrayref({})};
+      }
+   }
+   return @result;
+}
+
+# get_master_slave_status {{{3
+sub get_master_slave_status {
+   my @cxns = @_;
+   if ( !$info_gotten{replication_status}++ ) {
+      foreach my $cxn ( @cxns ) {
+         $vars{$cxn}->{$clock} ||= {};
+         my $vars = $vars{$cxn}->{$clock};
+         $vars->{cxn} = $cxn;
+
+         my $stmt = do_stmt($cxn, 'SHOW_MASTER_STATUS') or next;
+         my $res = $stmt->fetchall_arrayref({})->[0];
+         @{$vars}{ keys %$res } = values %$res;
+         $stmt = do_stmt($cxn, 'SHOW_SLAVE_STATUS') or next;
+         $res = $stmt->fetchall_arrayref({})->[0];
+         @{$vars}{ keys %$res } = values %$res;
+         $vars->{Uptime_hires} ||= get_uptime($cxn);
+      }
+   }
+}
+
+sub is_func {
+   my ( $word ) = @_;
+   return defined(&$word)
+      || eval "my \$x= sub { $word  }; 1"
+      || $EVAL_ERROR !~ m/^Bareword/;
+}
+
+# Documentation {{{1
+# ############################################################################
+# I put this last as per the Dog book.
+# ############################################################################
+=pod
+
+=head1 NAME
+
+innotop - MySQL and InnoDB transaction/status monitor.
+
+=head1 SYNOPSIS
+
+To monitor servers normally:
+
+ innotop
+
+To monitor InnoDB status information from a file:
+
+ innotop /var/log/mysql/mysqld.err
+
+To run innotop non-interactively in a pipe-and-filter configuration:
+
+ innotop --count 5 -d 1 -n
+
+To monitor a database on another system using a particular username and password:
+
+ innotop -u <username> -p <password> -h <hostname>
+
+=head1 DESCRIPTION
+
+innotop monitors MySQL servers.  Each of its modes shows you a different aspect
+of what's happening in the server.  For example, there's a mode for monitoring
+replication, one for queries, and one for transactions.  innotop refreshes its
+data periodically, so you see an updating view.
+
+innotop has lots of features for power users, but you can start and run it with
+virtually no configuration.  If you're just getting started, see
+L<"QUICK-START">.  Press '?' at any time while running innotop for
+context-sensitive help.
+
+=head1 QUICK-START
+
+To start innotop, open a terminal or command prompt.  If you have installed
+innotop on your system, you should be able to just type "innotop" and press
+Enter; otherwise, you will need to change to innotop's directory and type "perl
+innotop".
+
+With no options specified, innotop will attempt to connect to a MySQL server on
+localhost using mysql_read_default_group=client for other connection
+parameters.  If you need to specify a different username and password, use the
+-u and -p options, respectively.  To monitor a MySQL database on another
+host, use the -h option.
+
+After you've connected, innotop should show you something like the following:
+
+ [RO] Query List (? for help) localhost, 01:11:19, 449.44 QPS, 14/7/163 con/run
+ CXN        When   Load  QPS    Slow  QCacheHit  KCacheHit  BpsIn    BpsOut 
+ localhost  Total  0.00  1.07k   697      0.00%     98.17%  476.83k  242.83k
+
+ CXN        Cmd    ID         User  Host      DB   Time   Query
+ localhost  Query  766446598  test  10.0.0.1  foo  00:02  INSERT INTO table (
+
+
+(This sample is truncated at the right so it will fit on a terminal when running
+'man innotop')
+
+If your server is busy, you'll see more output.  Notice the first line on the
+screen, which tells you that readonly is set to true ([RO]), what mode you're
+in and what server you're connected to.  You can change to other modes with
+keystrokes; press 'T' to switch to a list of InnoDB transactions, for example.
+
+Press the '?' key to see what keys are active in the current mode.  You can
+press any of these keys and innotop will either take the requested action or
+prompt you for more input.  If your system has Term::ReadLine support, you can
+use TAB and other keys to auto-complete and edit input.
+
+To quit innotop, press the 'q' key.
+
+=head1 OPTIONS
+
+innotop is mostly configured via its configuration file, but some of the
+configuration options can come from the command line.  You can also specify a
+file to monitor for InnoDB status output; see L<"MONITORING A FILE"> for more
+details.
+
+You can negate some options by prefixing the option name with --no.  For
+example, --noinc (or --no-inc) negates L<"--inc">.
+
+=over
+
+=item --color
+
+Enable or disable terminal coloring.  Corresponds to the L<"color"> config file
+setting.
+
+=item --config
+
+Specifies a configuration file to read.  This option is non-sticky, that is to
+say it does not persist to the configuration file itself.
+
+=item --count
+
+Refresh only the specified number of times (ticks) before exiting.  Each refresh
+is a pause for L<"interval"> seconds, followed by requesting data from MySQL
+connections and printing it to the terminal.
+
+=item --delay
+
+Specifies the amount of time to pause between ticks (refreshes).  Corresponds to
+the configuration option L<"interval">.
+
+=item --help
+
+Print a summary of command-line usage and exit.
+
+=item --host
+
+Host to connect to.
+
+=item --inc
+
+Specifies whether innotop should display absolute numbers or relative numbers
+(offsets from their previous values).  Corresponds to the configuration option
+L<"status_inc">.
+
+=item --mode
+
+Specifies the mode in which innotop should start.  Corresponds to the
+configuration option L<"mode">.
+
+=item --nonint
+
+Enable non-interactive operation.  See L<"NON-INTERACTIVE OPERATION"> for more.
+
+=item --password
+
+Password to use for connection.
+
+=item --port
+
+Port to use for connection.
+
+=item --skipcentral
+
+Don't read the central configuration file.
+
+=item --user
+
+User to use for connection.
+
+=item --version
+
+Output version information and exit.
+
+=item --write
+
+Sets the configuration option L<"readonly"> to 0, making innotop write the
+running configuration to ~/.innotop/innotop.conf on exit, if no configuration
+file was loaded at start-up.
+
+=back
+
+=head1 HOTKEYS
+
+innotop is interactive, and you control it with key-presses.
+
+=over
+
+=item *
+
+Uppercase keys switch between modes.
+
+=item *
+
+Lowercase keys initiate some action within the current mode.
+
+=item *
+
+Other keys do something special like change configuration or show the
+innotop license.
+
+=back
+
+Press '?' at any time to see the currently active keys and what they do.
+
+=head1 MODES
+
+Each of innotop's modes retrieves and displays a particular type of data from
+the servers you're monitoring.  You switch between modes with uppercase keys.
+The following is a brief description of each mode, in alphabetical order.  To
+switch to the mode, press the key listed in front of its heading in the
+following list:
+
+=over
+
+=item B: InnoDB Buffers
+
+This mode displays information about the InnoDB buffer pool, page statistics,
+insert buffer, and adaptive hash index.  The data comes from SHOW INNODB STATUS.
+
+This mode contains the L<"buffer_pool">, L<"page_statistics">,
+L<"insert_buffers">, and L<"adaptive_hash_index"> tables by default.
+
+=item C: Command Summary
+
+This mode is similar to mytop's Command Summary mode.  It shows the
+L<"cmd_summary"> table, which looks something like the following:
+
+ Command Summary (? for help) localhost, 25+07:16:43, 2.45 QPS, 3 thd, 5.0.40
+ _____________________ Command Summary _____________________
+ Name                    Value    Pct     Last Incr  Pct    
+ Select_scan             3244858  69.89%          2  100.00%
+ Select_range            1354177  29.17%          0    0.00%
+ Select_full_join          39479   0.85%          0    0.00%
+ Select_full_range_join     4097   0.09%          0    0.00%
+ Select_range_check            0   0.00%          0    0.00%
+
+The command summary table is built by extracting variables from
+L<"STATUS_VARIABLES">.  The variables must be numeric and must match the prefix
+given by the L<"cmd_filter"> configuration variable.  The variables are then
+sorted by value descending and compared to the last variable, as shown above.
+The percentage columns are percentage of the total of all variables in the
+table, so you can see the relative weight of the variables.
+
+The example shows what you see if the prefix is "Select_".  The default
+prefix is "Com_".  You can choose a prefix with the 's' key.
+
+It's rather like running SHOW VARIABLES LIKE "prefix%" with memory and
+nice formatting.
+
+Values are aggregated across all servers.  The Pct columns are not correctly
+aggregated across multiple servers.  This is a known limitation of the grouping
+algorithm that may be fixed in the future.
+
+=item D: InnoDB Deadlocks
+
+This mode shows the transactions involved in the last InnoDB deadlock.  A second
+table shows the locks each transaction held and waited for.  A deadlock is
+caused by a cycle in the waits-for graph, so there should be two locks held and
+one waited for unless the deadlock information is truncated.
+
+InnoDB puts deadlock information before some other information in the SHOW
+INNODB STATUS output.  If there are a lot of locks, the deadlock information can
+grow very large, and there is a limit on the size of the SHOW INNODB
+STATUS output.  A large deadlock can fill the entire output, or even be
+truncated, and prevent you from seeing other information at all.  If you are
+running innotop in another mode, for example T mode, and suddenly you don't see
+anything, you might want to check and see if a deadlock has wiped out the data
+you need.
+
+If it has, you can create a small deadlock to replace the large one.  Use the
+'w' key to 'wipe' the large deadlock with a small one.  This will not work
+unless you have defined a deadlock table for the connection (see L<"SERVER
+CONNECTIONS">).
+
+You can also configure innotop to automatically detect when a large deadlock
+needs to be replaced with a small one (see L<"auto_wipe_dl">).
+
+This mode displays the L<"deadlock_transactions"> and L<"deadlock_locks"> tables
+by default.
+
+=item F: InnoDB Foreign Key Errors
+
+This mode shows the last InnoDB foreign key error information, such as the
+table where it happened, when and who and what query caused it, and so on.
+
+InnoDB has a huge variety of foreign key error messages, and many of them are
+just hard to parse.  innotop doesn't always do the best job here, but there's
+so much code devoted to parsing this messy, unparseable output that innotop is
+likely never to be perfect in this regard.  If innotop doesn't show you what
+you need to see, just look at the status text directly.
+
+This mode displays the L<"fk_error"> table by default.
+
+=item I: InnoDB I/O Info
+
+This mode shows InnoDB's I/O statistics, including the I/O threads, pending I/O,
+file I/O miscellaneous, and log statistics.  It displays the L<"io_threads">,
+L<"pending_io">, L<"file_io_misc">, and L<"log_statistics"> tables by default.
+
+=item L: Locks
+
+This mode shows information about current locks.  At the moment only InnoDB
+locks are supported, and by default you'll only see locks for which transactions
+are waiting.  This information comes from the TRANSACTIONS section of the InnoDB
+status text.  If you have a very busy server, you may have frequent lock waits;
+it helps to be able to see which tables and indexes are the "hot spot" for
+locks.  If your server is running pretty well, this mode should show nothing.
+
+You can configure MySQL and innotop to monitor not only locks for which a
+transaction is waiting, but those currently held, too.  You can do this with the
+InnoDB Lock Monitor (L<http://dev.mysql.com/doc/en/innodb-monitor.html>).  It's
+not documented in the MySQL manual, but creating the lock monitor with the
+following statement also affects the output of SHOW INNODB STATUS, which innotop
+uses:
+
+  CREATE TABLE innodb_lock_monitor(a int) ENGINE=INNODB;
+
+This causes InnoDB to print its output to the MySQL file every 16 seconds or so,
+as stated in the manual, but it also makes the normal SHOW INNODB STATUS output
+include lock information, which innotop can parse and display (that's the
+undocumented feature).
+
+This means you can do what may have seemed impossible: to a limited extent
+(InnoDB truncates some information in the output), you can see which transaction
+holds the locks something else is waiting for.  You can also enable and disable
+the InnoDB Lock Monitor with the key mappings in this mode.
+
+This mode displays the L<"innodb_locks"> table by default.  Here's a sample of
+the screen when one connection is waiting for locks another connection holds:
+
+ _________________________________ InnoDB Locks __________________________
+ CXN        ID  Type    Waiting  Wait   Active  Mode  DB    Table  Index
+ localhost  12  RECORD        1  00:10   00:10  X     test  t1     PRIMARY
+ localhost  12  TABLE         0  00:10   00:10  IX    test  t1
+ localhost  12  RECORD        1  00:10   00:10  X     test  t1     PRIMARY
+ localhost  11  TABLE         0  00:00   00:25  IX    test  t1
+ localhost  11  RECORD        0  00:00   00:25  X     test  t1     PRIMARY
+
+You can see the first connection, ID 12, is waiting for a lock on the PRIMARY
+key on test.t1, and has been waiting for 10 seconds.  The second connection
+isn't waiting, because the Waiting column is 0, but it holds locks on the same
+index.  That tells you connection 11 is blocking connection 12.
+
+=item M: Master/Slave Replication Status
+
+This mode shows the output of SHOW SLAVE STATUS and SHOW MASTER STATUS in three
+tables.  The first two divide the slave's status into SQL and I/O thread status,
+and the last shows master status.  Filters are applied to eliminate non-slave
+servers from the slave tables, and non-master servers from the master table.
+
+This mode displays the L<"slave_sql_status">, L<"slave_io_status">, and
+L<"master_status"> tables by default.
+
+=item O: Open Tables
+
+This section comes from MySQL's SHOW OPEN TABLES command.  By default it is
+filtered to show tables which are in use by one or more queries, so you can
+get a quick look at which tables are 'hot'.  You can use this to guess which
+tables might be locked implicitly.
+
+This mode displays the L<"open_tables"> mode by default.
+
+=item Q: Query List
+
+This mode displays the output from SHOW FULL PROCESSLIST, much like B<mytop>'s
+query list mode.  This mode does B<not> show InnoDB-related information.  This
+is probably one of the most useful modes for general usage.
+
+There is an informative header that shows general status information about
+your server.  You can toggle it on and off with the 'h' key.  By default,
+innotop hides inactive processes and its own process.  You can toggle these on
+and off with the 'i' and 'a' keys.
+
+You can EXPLAIN a query from this mode with the 'e' key.  This displays the
+query's full text, the results of EXPLAIN, and in newer MySQL versions, even
+the optimized query resulting from EXPLAIN EXTENDED.  innotop also tries to
+rewrite certain queries to make them EXPLAIN-able.  For example, INSERT/SELECT
+statements are rewritable.
+
+This mode displays the L<"q_header"> and L<"processlist"> tables by default.
+
+=item R: InnoDB Row Operations and Semaphores
+
+This mode shows InnoDB row operations, row operation miscellaneous, semaphores,
+and information from the wait array.  It displays the L<"row_operations">,
+L<"row_operation_misc">, L<"semaphores">, and L<"wait_array"> tables by default.
+
+=item S: Variables & Status
+
+This mode calculates statistics, such as queries per second, and prints them out
+in several different styles.  You can show absolute values, or incremental values
+between ticks.
+
+You can switch between the views by pressing a key.  The 's' key prints a
+single line each time the screen updates, in the style of B<vmstat>.  The 'g'
+key changes the view to a graph of the same numbers, sort of like B<tload>.
+The 'v' key changes the view to a pivoted table of variable names on the left,
+with successive updates scrolling across the screen from left to right.  You can
+choose how many updates to put on the screen with the L<"num_status_sets">
+configuration variable.
+
+Headers may be abbreviated to fit on the screen in interactive operation.  You
+choose which variables to display with the 'c' key, which selects from
+predefined sets, or lets you create your own sets.  You can edit the current set
+with the 'e' key.
+
+This mode doesn't really display any tables like other modes.  Instead, it uses
+a table definition to extract and format the data, but it then transforms the
+result in special ways before outputting it.  It uses the L<"var_status"> table
+definition for this.
+
+=item T: InnoDB Transactions
+
+This mode shows transactions from the InnoDB monitor's output, in B<top>-like
+format.  This mode is the reason I wrote innotop.
+
+You can kill queries or processes with the 'k' and 'x' keys, and EXPLAIN a query
+with the 'e' or 'f' keys.  InnoDB doesn't print the full query in transactions,
+so explaining may not work right if the query is truncated.
+
+The informational header can be toggled on and off with the 'h' key.  By
+default, innotop hides inactive transactions and its own transaction.  You can
+toggle this on and off with the 'i' and 'a' keys.
+
+This mode displays the L<"t_header"> and L<"innodb_transactions"> tables by
+default.
+
+=back
+
+=head1 INNOTOP STATUS
+
+The first line innotop displays is a "status bar" of sorts.  What it contains
+depends on the mode you're in, and what servers you're monitoring.  The first
+few words are always [RO] (if readonly is set to 1), the innotop mode, such as
+"InnoDB Txns" for T mode, followed by a reminder to press '?' for help at any
+time.
+
+=head2 ONE SERVER
+
+The simplest case is when you're monitoring a single server.  In this case, the
+name of the connection is next on the status line.  This is the name you gave
+when you created the connection -- most likely the MySQL server's hostname.
+This is followed by the server's uptime.
+
+If you're in an InnoDB mode, such as T or B, the next word is "InnoDB" followed
+by some information about the SHOW INNODB STATUS output used to render the
+screen.  The first word is the number of seconds since the last SHOW INNODB
+STATUS, which InnoDB uses to calculate some per-second statistics.  The next is
+a smiley face indicating whether the InnoDB output is truncated.  If the smiley
+face is a :-), all is well; there is no truncation.  A :^| means the transaction
+list is so long, InnoDB has only printed out some of the transactions.  Finally,
+a frown :-( means the output is incomplete, which is probably due to a deadlock
+printing too much lock information (see L<"D: InnoDB Deadlocks">).
+
+The next two words indicate the server's queries per second (QPS) and how many
+threads (connections) exist.  Finally, the server's version number is the last
+thing on the line.
+
+=head2 MULTIPLE SERVERS
+
+If you are monitoring multiple servers (see L<"SERVER CONNECTIONS">), the status
+line does not show any details about individual servers.  Instead, it shows the
+names of the connections that are active.  Again, these are connection names you
+specified, which are likely to be the server's hostname.  A connection that has
+an error is prefixed with an exclamation point.
+
+If you are monitoring a group of servers (see L<"SERVER GROUPS">), the status
+line shows the name of the group.  If any connection in the group has an
+error, the group's name is followed by the fraction of the connections that
+don't have errors.
+
+See L<"ERROR HANDLING"> for more details about innotop's error handling.
+
+=head2 MONITORING A FILE
+
+If you give a filename on the command line, innotop will not connect to ANY
+servers at all.  It will watch the specified file for InnoDB status output and
+use that as its data source.  It will always show a single connection called
+'file'.  And since it can't connect to a server, it can't determine how long the
+server it's monitoring has been up; so it calculates the server's uptime as time
+since innotop started running.
+
+=head1 SERVER ADMINISTRATION
+
+While innotop is primarily a monitor that lets you watch and analyze your
+servers, it can also send commands to servers.  The most frequently useful
+commands are killing queries and stopping or starting slaves.
+
+You can kill a connection, or in newer versions of MySQL kill a query but not a
+connection, from L<"Q: Query List"> and L<"T: InnoDB Transactions"> modes.
+Press 'k' to issue a KILL command, or 'x' to issue a KILL QUERY command.
+innotop will prompt you for the server and/or connection ID to kill (innotop
+does not prompt you if there is only one possible choice for any input).
+innotop pre-selects the longest-running query, or the oldest connection.
+Confirm the command with 'y'.
+
+In L<"M: Master/Slave Replication Status"> mode, you can start and stop slaves
+with the 'a' and 'o' keys, respectively.  You can send these commands to many
+slaves at once.  innotop fills in a default command of START SLAVE or STOP SLAVE
+for you, but you can actually edit the command and send anything you wish, such
+as SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1 to make the slave skip one binlog event
+when it starts.
+
+You can also ask innotop to calculate the earliest binlog in use by any slave
+and issue a PURGE MASTER LOGS on the master.  Use the 'b' key for this.  innotop
+will prompt you for a master to run the command on, then prompt you for the
+connection names of that master's slaves (there is no way for innotop to
+determine this reliably itself).  innotop will find the minimum binlog in use by
+these slave connections and suggest it as the argument to PURGE MASTER LOGS.
+
+=head1 SERVER CONNECTIONS
+
+When you create a server connection using '@', innotop asks you for a series of
+inputs, as follows:
+
+=over
+
+=item DSN
+
+A DSN is a Data Source Name, which is the initial argument passed to the DBI
+module for connecting to a server.  It is usually of the form
+
+ DBI:mysql:;mysql_read_default_group=mysql;host=HOSTNAME
+
+Since this DSN is passed to the DBD::mysql driver, you should read the driver's
+documentation at L<"http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm"> for
+the exact details on all the options you can pass the driver in the DSN.  You
+can read more about DBI at L<http://dbi.perl.org/docs/>, and especially at
+L<http://search.cpan.org/~timb/DBI/DBI.pm>.
+
+The mysql_read_default_group=mysql option lets the DBD driver read your MySQL
+options files, such as ~/.my.cnf on UNIX-ish systems.  You can use this to avoid
+specifying a username or password for the connection.
+
+=item InnoDB Deadlock Table
+
+This optional item tells innotop a table name it can use to deliberately create
+a small deadlock (see L<"D: InnoDB Deadlocks">).  If you specify this option,
+you just need to be sure the table doesn't exist, and that innotop can create
+and drop the table with the InnoDB storage engine.  You can safely omit or just
+accept the default if you don't intend to use this.
+
+=item Username
+
+innotop will ask you if you want to specify a username.  If you say 'y', it will
+then prompt you for a user name.  If you have a MySQL option file that specifies
+your username, you don't have to specify a username.
+
+The username defaults to your login name on the system you're running innotop on.
+
+=item Password
+
+innotop will ask you if you want to specify a password.  Like the username, the
+password is optional, but there's an additional prompt that asks if you want to
+save the password in the innotop configuration file.  If you don't save it in
+the configuration file, innotop will prompt you for a password each time it
+starts.  Passwords in the innotop configuration file are saved in plain text,
+not encrypted in any way.
+
+=back
+
+Once you finish answering these questions, you should be connected to a server.
+But innotop isn't limited to monitoring a single server; you can define many
+server connections and switch between them by pressing the '@' key.  See
+L<"SWITCHING BETWEEN CONNECTIONS">.
+
+=head1 SERVER GROUPS
+
+If you have multiple MySQL instances, you can put them into named groups, such
+as 'all', 'masters', and 'slaves', which innotop can monitor all together.
+
+You can choose which group to monitor with the '#' key, and you can press the
+TAB key to switch to the next group.  If you're not currently monitoring a
+group, pressing TAB selects the first group.
+
+To create a group, press the '#' key and type the name of your new group, then
+type the names of the connections you want the group to contain.
+
+=head1 SWITCHING BETWEEN CONNECTIONS
+
+innotop lets you quickly switch which servers you're monitoring.  The most basic
+way is by pressing the '@' key and typing the name(s) of the connection(s) you
+want to use.  This setting is per-mode, so you can monitor different connections
+in each mode, and innotop remembers which connections you choose.
+
+You can quickly switch to the 'next' connection in alphabetical order with the
+'n' key.  If you're monitoring a server group (see L<"SERVER GROUPS">) this will
+switch to the first connection.
+
+You can also type many connection names, and innotop will fetch and display data
+from them all.  Just separate the connection names with spaces, for example
+"server1 server2."  Again, if you type the name of a connection that doesn't
+exist, innotop will prompt you for connection information and create the
+connection.
+
+Another way to monitor multiple connections at once is with server groups.  You
+can use the TAB key to switch to the 'next' group in alphabetical order, or if
+you're not monitoring any groups, TAB will switch to the first group.
+
+innotop does not fetch data in parallel from connections, so if you are
+monitoring a large group or many connections, you may notice increased delay
+between ticks.
+
+When you monitor more than one connection, innotop's status bar changes.  See
+L<"INNOTOP STATUS">.
+
+=head1 ERROR HANDLING
+
+Error handling is not that important when monitoring a single connection, but is
+crucial when you have many active connections.  A crashed server or lost
+connection should not crash innotop.  As a result, innotop will continue to run
+even when there is an error; it just won't display any information from the
+connection that had an error.  Because of this, innotop's behavior might confuse
+you.  It's a feature, not a bug!
+
+innotop does not continue to query connections that have errors, because they
+may slow innotop and make it hard to use, especially if the error is a problem
+connecting and causes a long time-out.  Instead, innotop retries the connection
+occasionally to see if the error still exists.  If so, it will wait until some
+point in the future.  The wait time increases in ticks as the Fibonacci series,
+so it tries less frequently as time passes.
+
+Since errors might only happen in certain modes because of the SQL commands
+issued in those modes, innotop keeps track of which mode caused the error.  If
+you switch to a different mode, innotop will retry the connection instead of
+waiting.
+
+By default innotop will display the problem in red text at the bottom of the
+first table on the screen.  You can disable this behavior with the
+L<"show_cxn_errors_in_tbl"> configuration option, which is enabled by default.
+If the L<"debug"> option is enabled, innotop will display the error at the
+bottom of every table, not just the first.  And if L<"show_cxn_errors"> is
+enabled, innotop will print the error text to STDOUT as well.  Error messages
+might only display in the mode that caused the error, depending on the mode and
+whether innotop is avoiding querying that connection.
+
+=head1 NON-INTERACTIVE OPERATION
+
+You can run innotop in non-interactive mode, in which case it is entirely
+controlled from the configuration file and command-line options.  To start
+innotop in non-interactive mode, give the L"<--nonint"> command-line option.
+This changes innotop's behavior in the following ways:
+
+=over
+
+=item *
+
+Certain Perl modules are not loaded.  Term::Readline is not loaded, since
+innotop doesn't prompt interactively.  Term::ANSIColor and Win32::Console::ANSI
+modules are not loaded.  Term::ReadKey is still used, since innotop may have to
+prompt for connection passwords when starting up.
+
+=item *
+
+innotop does not clear the screen after each tick.
+
+=item *
+
+innotop does not persist any changes to the configuration file.
+
+=item *
+
+If L<"--count"> is given and innotop is in incremental mode (see L<"status_inc">
+and L<"--inc">), innotop actually refreshes one more time than specified so it
+can print incremental statistics.  This suppresses output during the first
+tick, so innotop may appear to hang.
+
+=item *
+
+innotop only displays the first table in each mode.  This is so the output can
+be easily processed with other command-line utilities such as awk and sed.  To
+change which tables display in each mode, see L<"TABLES">.  Since L<"Q: Query
+List"> mode is so important, innotop automatically disables the L<"q_header">
+table.  This ensures you'll see the L<"processlist"> table, even if you have
+innotop configured to show the q_header table during interactive operation.
+Similarly, in L<"T: InnoDB Transactions"> mode, the L<"t_header"> table is
+suppressed so you see only the L<"innodb_transactions"> table.
+
+=item *
+
+All output is tab-separated instead of being column-aligned with whitespace, and
+innotop prints the full contents of each table instead of only printing one
+screenful at a time.
+
+=item *
+
+innotop only prints column headers once instead of every tick (see
+L<"hide_hdr">).  innotop does not print table captions (see
+L<"display_table_captions">).  innotop ensures there are no empty lines in the
+output.
+
+=item *
+
+innotop does not honor the L<"shorten"> transformation, which normally shortens
+some numbers to human-readable formats.
+
+=item *
+
+innotop does not print a status line (see L<"INNOTOP STATUS">).
+
+=back
+
+=head1 CONFIGURING
+
+Nearly everything about innotop is configurable.  Most things are possible to
+change with built-in commands, but you can also edit the configuration file.
+
+While running innotop, press the '$' key to bring up the configuration editing
+dialog.  Press another key to select the type of data you want to edit:
+
+=over
+
+=item S: Statement Sleep Times
+
+Edits SQL statement sleep delays, which make innotop pause for the specified
+amount of time after executing a statement.  See L<"SQL STATEMENTS"> for a
+definition of each statement and what it does.  By default innotop does not
+delay after any statements.
+
+This feature is included so you can customize the side-effects caused by
+monitoring your server.  You may not see any effects, but some innotop users
+have noticed that certain MySQL versions under very high load with InnoDB
+enabled take longer than usual to execute SHOW GLOBAL STATUS.  If innotop calls
+SHOW FULL PROCESSLIST immediately afterward, the processlist contains more
+queries than the machine actually averages at any given moment.  Configuring
+innotop to pause briefly after calling SHOW GLOBAL STATUS alleviates this
+effect.
+
+Sleep times are stored in the L<"stmt_sleep_times"> section of the configuration
+file.  Fractional-second sleeps are supported, subject to your hardware's
+limitations.
+
+=item c: Edit Columns
+
+Starts the table editor on one of the displayed tables.  See L<"TABLE EDITOR">.
+An alternative way to start the table editor without entering the configuration
+dialog is with the '^' key.
+
+=item g: General Configuration
+
+Starts the configuration editor to edit global and mode-specific configuration
+variables (see L<"MODES">).  innotop prompts you to choose a variable from among
+the global and mode-specific ones depending on the current mode.
+
+=item k: Row-Coloring Rules
+
+Starts the row-coloring rules editor on one of the displayed table(s).  See
+L<"COLORS"> for details.
+
+=item p: Manage Plugins
+
+Starts the plugin configuration editor.  See L<"PLUGINS"> for details.
+
+=item s: Server Groups
+
+Lets you create and edit server groups.  See L<"SERVER GROUPS">.
+
+=item t: Choose Displayed Tables
+
+Lets you choose which tables to display in this mode.  See L<"MODES"> and
+L<"TABLES">.
+
+=back
+
+=head1 CONFIGURATION FILE
+
+innotop's default configuration file locations are $HOME/.innotop and
+/etc/innotop/innotop.conf, and they are looked for in that order.  If the first
+configuration file exists, the second will not be processed.  Those can be
+overridden with the L<"--config"> command-line option.  You can edit it by hand
+safely, however innotop reads the configuration file when it starts, and, if
+readonly is set to 0, writes it out again when it exits.  Thus, if readonly is
+set to 0, any changes you make by hand while innotop is running will be lost.
+
+innotop doesn't store its entire configuration in the configuration file.  It
+has a huge set of default configuration values that it holds only in memory,
+and the configuration file only overrides these defaults.  When you customize a
+default setting, innotop notices, and then stores the customizations into the
+file.  This keeps the file size down, makes it easier to edit, and makes
+upgrades easier.
+
+A configuration file is read-only be default.  You can override that with
+L<"--write">.  See L<"readonly">.
+
+The configuration file is arranged into sections like an INI file.  Each
+section begins with [section-name] and ends with [/section-name].  Each
+section's entries have a different syntax depending on the data they need to
+store.  You can put comments in the file; any line that begins with a #
+character is a comment.  innotop will not read the comments, so it won't write
+them back out to the file when it exits.  Comments in read-only configuration
+files are still useful, though.
+
+The first line in the file is innotop's version number.  This lets innotop
+notice when the file format is not backwards-compatible, and upgrade smoothly
+without destroying your customized configuration.
+
+The following list describes each section of the configuration file and the data
+it contains:
+
+=over
+
+=item general
+
+The 'general' section contains global configuration variables and variables that
+may be mode-specific, but don't belong in any other section.  The syntax is a
+simple key=value list.  innotop writes a comment above each value to help you
+edit the file by hand.
+
+=over
+
+=item S_func
+
+Controls S mode presentation (see L<"S: Variables & Status">).  If g, values are
+graphed; if s, values are like vmstat; if p, values are in a pivoted table.
+
+=item S_set
+
+Specifies which set of variables to display in L<"S: Variables & Status"> mode.
+See L<"VARIABLE SETS">.
+
+=item auto_wipe_dl
+
+Instructs innotop to automatically wipe large deadlocks when it notices them.
+When this happens you may notice a slight delay.  At the next tick, you will
+usually see the information that was being truncated by the large deadlock.
+
+=item charset
+
+Specifies what kind of characters to allow through the L<"no_ctrl_char">
+transformation.  This keeps non-printable characters from confusing a
+terminal when you monitor queries that contain binary data, such as images.
+
+The default is 'ascii', which considers anything outside normal ASCII to be a
+control character.  The other allowable values are 'unicode' and 'none'.  'none'
+considers every character a control character, which can be useful for
+collapsing ALL text fields in queries.
+
+=item cmd_filter
+
+This is the prefix that filters variables in L<"C: Command Summary"> mode.
+
+=item color
+
+Whether terminal coloring is permitted.
+
+=item cxn_timeout
+
+On MySQL versions 4.0.3 and newer, this variable is used to set the connection's
+timeout, so MySQL doesn't close the connection if it is not used for a while.
+This might happen because a connection isn't monitored in a particular mode, for
+example.
+
+=item debug
+
+This option enables more verbose errors and makes innotop more strict in some
+places.  It can help in debugging filters and other user-defined code.  It also
+makes innotop write a lot of information to L<"debugfile"> when there is a
+crash.
+
+=item debugfile
+
+A file to which innotop will write information when there is a crash.  See
+L<"FILES">.
+
+=item display_table_captions
+
+innotop displays a table caption above most tables.  This variable suppresses or
+shows captions on all tables globally.  Some tables are configured with the
+hide_caption property, which overrides this.
+
+=item global
+
+Whether to show GLOBAL variables and status.  innotop only tries to do this on
+servers which support the GLOBAL option to SHOW VARIABLES and SHOW STATUS.  In
+some MySQL versions, you need certain privileges to do this; if you don't have
+them, innotop will not be able to fetch any variable and status data.  This
+configuration variable lets you run innotop and fetch what data you can even
+without the elevated privileges.
+
+I can no longer find or reproduce the situation where GLOBAL wasn't allowed, but
+I know there was one.
+
+=item graph_char
+
+Defines the character to use when drawing graphs in L<"S: Variables & Status">
+mode.
+
+=item header_highlight
+
+Defines how to highlight column headers.  This only works if Term::ANSIColor is
+available.  Valid values are 'bold' and 'underline'.
+
+=item hide_hdr
+
+Hides column headers globally.
+
+=item interval
+
+The interval at which innotop will refresh its data (ticks).  The interval is
+implemented as a sleep time between ticks, so the true interval will vary
+depending on how long it takes innotop to fetch and render data.
+
+This variable accepts fractions of a second.
+
+=item mode
+
+The mode in which innotop should start.  Allowable arguments are the same as the
+key presses that select a mode interactively.  See L<"MODES">.
+
+=item num_digits
+
+How many digits to show in fractional numbers and percents.  This variable's
+range is between 0 and 9 and can be set directly from L<"S: Variables & Status">
+mode with the '+' and '-' keys.  It is used in the L<"set_precision">,
+L<"shorten">, and L<"percent"> transformations.
+
+=item num_status_sets
+
+Controls how many sets of status variables to display in pivoted L<"S: Variables
+& Status"> mode.  It also controls the number of old sets of variables innotop
+keeps in its memory, so the larger this variable is, the more memory innotop
+uses.
+
+=item plugin_dir
+
+Specifies where plugins can be found.  By default, innotop stores plugins in the
+'plugins' subdirectory of your innotop configuration directory.
+
+=item readonly
+
+Whether the configuration file is readonly.  This cannot be set interactively.
+
+=item show_cxn_errors
+
+Makes innotop print connection errors to STDOUT.  See L<"ERROR HANDLING">.
+
+=item show_cxn_errors_in_tbl
+
+Makes innotop display connection errors as rows in the first table on screen.
+See L<"ERROR HANDLING">.
+
+=item show_percent
+
+Adds a '%' character after the value returned by the L<"percent">
+transformation.
+
+=item show_statusbar
+
+Controls whether to show the status bar in the display.  See L<"INNOTOP
+STATUS">.
+
+=item skip_innodb
+
+Disables fetching SHOW INNODB STATUS, in case your server(s) do not have InnoDB
+enabled and you don't want innotop to try to fetch it.  This can also be useful
+when you don't have the SUPER privilege, required to run SHOW INNODB STATUS.
+
+=item status_inc
+
+Whether to show absolute or incremental values for status variables.
+Incremental values are calculated as an offset from the last value innotop saw
+for that variable.  This is a global setting, but will probably become
+mode-specific at some point.  Right now it is honored a bit inconsistently; some
+modes don't pay attention to it.
+
+=back
+
+=item plugins
+
+This section holds a list of package names of active plugins.  If the plugin
+exists, innotop will activate it.  See L<"PLUGINS"> for more information.
+
+=item filters
+
+This section holds user-defined filters (see L<"FILTERS">).  Each line is in the
+format filter_name=text='filter text' tbls='table list'.
+
+The filter text is the text of the subroutine's code.  The table list is a list
+of tables to which the filter can apply.  By default, user-defined filters apply
+to the table for which they were created, but you can manually override that by
+editing the definition in the configuration file.
+
+=item active_filters
+
+This section stores which filters are active on each table.  Each line is in the
+format table_name=filter_list.
+
+=item tbl_meta
+
+This section stores user-defined or user-customized columns (see L<"COLUMNS">).
+Each line is in the format col_name=properties, where the properties are a
+name=quoted-value list.
+
+=item connections
+
+This section holds the server connections you have defined.  Each line is in
+the format name=properties, where the properties are a name=value list.  The
+properties are self-explanatory, and the only one that is treated specially is
+'pass' which is only present if 'savepass' is set.  This section of the
+configuration file will be skipped if any DSN, username, or password
+command-line options are used.  See L<"SERVER CONNECTIONS">.
+
+=item active_connections
+
+This section holds a list of which connections are active in each mode.  Each
+line is in the format mode_name=connection_list.
+
+=item server_groups
+
+This section holds server groups.  Each line is in the format
+name=connection_list.  See L<"SERVER GROUPS">.
+
+=item active_server_groups
+
+This section holds a list of which server group is active in each mode.  Each
+line is in the format mode_name=server_group.
+
+=item max_values_seen
+
+This section holds the maximum values seen for variables.  This is used to scale
+the graphs in L<"S: Variables & Status"> mode.  Each line is in the format
+name=value.
+
+=item active_columns
+
+This section holds table column lists.  Each line is in the format
+tbl_name=column_list.  See L<"COLUMNS">.
+
+=item sort_cols
+
+This section holds the sort definition.  Each line is in the format
+tbl_name=column_list.  If a column is prefixed with '-', that column sorts
+descending.  See L<"SORTING">.
+
+=item visible_tables
+
+This section defines which tables are visible in each mode.  Each line is in the
+format mode_name=table_list.  See L<"TABLES">.
+
+=item varsets
+
+This section defines variable sets for use in L<"S: Status & Variables"> mode.
+Each line is in the format name=variable_list.  See L<"VARIABLE SETS">.
+
+=item colors
+
+This section defines colorization rules.  Each line is in the format
+tbl_name=property_list.  See L<"COLORS">.
+
+=item stmt_sleep_times
+
+This section contains statement sleep times.  Each line is in the format
+statement_name=sleep_time.  See L<"S: Statement Sleep Times">.
+
+=item group_by
+
+This section contains column lists for table group_by expressions.  Each line is
+in the format tbl_name=column_list.  See L<"GROUPING">.
+
+=back
+
+=head1 CUSTOMIZING
+
+You can customize innotop a great deal.  For example, you can:
+
+=over
+
+=item *
+
+Choose which tables to display, and in what order.
+
+=item *
+
+Choose which columns are in those tables, and create new columns.
+
+=item *
+
+Filter which rows display with built-in filters, user-defined filters, and
+quick-filters.
+
+=item *
+
+Sort the rows to put important data first or group together related rows.
+
+=item *
+
+Highlight rows with color.
+
+=item *
+
+Customize the alignment, width, and formatting of columns, and apply
+transformations to columns to extract parts of their values or format the values
+as you wish (for example, shortening large numbers to familiar units).
+
+=item *
+
+Design your own expressions to extract and combine data as you need.  This gives
+you unlimited flexibility.
+
+=back
+
+All these and more are explained in the following sections.
+
+=head2 TABLES
+
+A table is what you'd expect: a collection of columns.  It also has some other
+properties, such as a caption.  Filters, sorting rules, and colorization rules
+belong to tables and are covered in later sections.
+
+Internally, table meta-data is defined in a data structure called %tbl_meta.
+This hash holds all built-in table definitions, which contain a lot of default
+instructions to innotop.  The meta-data includes the caption, a list of columns
+the user has customized, a list of columns, a list of visible columns, a list of
+filters, color rules, a sort-column list, sort direction, and some information
+about the table's data sources.  Most of this is customizable via the table
+editor (see L<"TABLE EDITOR">).
+
+You can choose which tables to show by pressing the '$' key.  See L<"MODES"> and
+L<"TABLES">.
+
+The table life-cycle is as follows:
+
+=over
+
+=item *
+
+Each table begins with a data source, which is an array of hashes.  See below
+for details on data sources.
+
+=item *
+
+Each element of the data source becomes a row in the final table.
+
+=item *
+
+For each element in the data source, innotop extracts values from the source and
+creates a row.  This row is another hash, which later steps will refer to as
+$set.  The values innotop extracts are determined by the table's columns.  Each
+column has an extraction subroutine, compiled from an expression (see
+L<"EXPRESSIONS">).  The resulting row is a hash whose keys are named the same as
+the column name.
+
+=item *
+
+innotop filters the rows, removing those that don't need to be displayed.  See
+L<"FILTERS">.
+
+=item *
+
+innotop sorts the rows.  See L<"SORTING">.
+
+=item *
+
+innotop groups the rows together, if specified.  See L<"GROUPING">.
+
+=item *
+
+innotop colorizes the rows.  See L<"COLORS">.
+
+=item *
+
+innotop transforms the column values in each row.  See L<"TRANSFORMATIONS">.
+
+=item *
+
+innotop optionally pivots the rows (see L<"PIVOTING">), then filters and sorts
+them.
+
+=item *
+
+innotop formats and justifies the rows as a table.  During this step, innotop
+applies further formatting to the column values, including alignment, maximum
+and minimum widths.  innotop also does final error checking to ensure there are
+no crashes due to undefined values.  innotop then adds a caption if specified,
+and the table is ready to print.
+
+=back
+
+The lifecycle is slightly different if the table is pivoted, as noted above.  To
+clarify, if the table is pivoted, the process is extract, group, transform,
+pivot, filter, sort, create.  If it's not pivoted, the process is extract,
+filter, sort, group, color, transform, create.  This slightly convoluted process
+doesn't map all that well to SQL, but pivoting complicates things pretty
+thoroughly.  Roughly speaking, filtering and sorting happen as late as needed to
+effect the final result as you might expect, but as early as possible for
+efficiency.
+
+Each built-in table is described below:
+
+=over
+
+=item adaptive_hash_index
+
+Displays data about InnoDB's adaptive hash index.  Data source:
+L<"STATUS_VARIABLES">.
+
+=item buffer_pool
+
+Displays data about InnoDB's buffer pool.  Data source: L<"STATUS_VARIABLES">.
+
+=item cmd_summary
+
+Displays weighted status variables.  Data source: L<"STATUS_VARIABLES">.
+
+=item deadlock_locks
+
+Shows which locks were held and waited for by the last detected deadlock.  Data
+source: L<"DEADLOCK_LOCKS">.
+
+=item deadlock_transactions
+
+Shows transactions involved in the last detected deadlock.  Data source:
+L<"DEADLOCK_TRANSACTIONS">.
+
+=item explain
+
+Shows the output of EXPLAIN.  Data source: L<"EXPLAIN">.
+
+=item file_io_misc
+
+Displays data about InnoDB's file and I/O operations.  Data source:
+L<"STATUS_VARIABLES">.
+
+=item fk_error
+
+Displays various data about InnoDB's last foreign key error.  Data source:
+L<"STATUS_VARIABLES">.
+
+=item innodb_locks
+
+Displays InnoDB locks.  Data source: L<"INNODB_LOCKS">.
+
+=item innodb_transactions
+
+Displays data about InnoDB's current transactions.  Data source:
+L<"INNODB_TRANSACTIONS">.
+
+=item insert_buffers
+
+Displays data about InnoDB's insert buffer.  Data source: L<"STATUS_VARIABLES">.
+
+=item io_threads
+
+Displays data about InnoDB's I/O threads.  Data source: L<"IO_THREADS">.
+
+=item log_statistics
+
+Displays data about InnoDB's logging system.  Data source: L<"STATUS_VARIABLES">.
+
+=item master_status
+
+Displays replication master status.  Data source: L<"STATUS_VARIABLES">.
+
+=item open_tables
+
+Displays open tables.  Data source: L<"OPEN_TABLES">.
+
+=item page_statistics
+
+Displays InnoDB page statistics.  Data source: L<"STATUS_VARIABLES">.
+
+=item pending_io
+
+Displays InnoDB pending I/O operations.  Data source: L<"STATUS_VARIABLES">.
+
+=item processlist
+
+Displays current MySQL processes (threads/connections).  Data source:
+L<"PROCESSLIST">.
+
+=item q_header
+
+Displays various status values.  Data source: L<"STATUS_VARIABLES">.
+
+=item row_operation_misc
+
+Displays data about InnoDB's row operations.  Data source:
+L<"STATUS_VARIABLES">.
+
+=item row_operations
+
+Displays data about InnoDB's row operations.  Data source:
+L<"STATUS_VARIABLES">.
+
+=item semaphores
+
+Displays data about InnoDB's semaphores and mutexes.  Data source:
+L<"STATUS_VARIABLES">.
+
+=item slave_io_status
+
+Displays data about the slave I/O thread.  Data source: 
+L<"STATUS_VARIABLES">.
+
+=item slave_sql_status
+
+Displays data about the slave SQL thread.  Data source: L<"STATUS_VARIABLES">.
+
+=item t_header
+
+Displays various InnoDB status values.  Data source: L<"STATUS_VARIABLES">.
+
+=item var_status
+
+Displays user-configurable data.  Data source: L<"STATUS_VARIABLES">.
+
+=item wait_array
+
+Displays data about InnoDB's OS wait array.  Data source: L<"OS_WAIT_ARRAY">.
+
+=back
+
+=head2 COLUMNS
+
+Columns belong to tables.  You can choose a table's columns by pressing the '^'
+key, which starts the L<"TABLE EDITOR"> and lets you choose and edit columns.
+Pressing 'e' from within the table editor lets you edit the column's properties:
+
+=over
+
+=item *
+
+hdr: a column header.  This appears in the first row of the table.
+
+=item *
+
+just: justification.  '-' means left-justified and '' means right-justified,
+just as with printf formatting codes (not a coincidence).
+
+=item *
+
+dec: whether to further align the column on the decimal point.
+
+=item *
+
+num: whether the column is numeric.  This affects how values are sorted
+(lexically or numerically).
+
+=item *
+
+label: a small note about the column, which appears in dialogs that help the
+user choose columns.
+
+=item *
+
+src: an expression that innotop uses to extract the column's data from its
+source (see L<"DATA SOURCES">).  See L<"EXPRESSIONS"> for more on expressions.
+
+=item *
+
+minw: specifies a minimum display width.  This helps stabilize the display,
+which makes it easier to read if the data is changing frequently.
+
+=item *
+
+maxw: similar to minw.
+
+=item *
+
+trans: a list of column transformations.  See L<"TRANSFORMATIONS">.
+
+=item *
+
+agg: an aggregate function.  See L<"GROUPING">.  The default is L<"first">.
+
+=item *
+
+aggonly: controls whether the column only shows when grouping is enabled on the
+table (see L<"GROUPING">).  By default, this is disabled.  This means columns
+will always be shown by default, whether grouping is enabled or not.  If a
+column's aggonly is set true, the column will appear when you toggle grouping on
+the table.  Several columns are set this way, such as the count column on
+L<"processlist"> and L<"innodb_transactions">, so you don't see a count when the
+grouping isn't enabled, but you do when it is.
+
+=back
+
+=head2 FILTERS
+
+Filters remove rows from the display.  They behave much like a WHERE clause in
+SQL.  innotop has several built-in filters, which remove irrelevant information
+like inactive queries, but you can define your own as well.  innotop also lets
+you create quick-filters, which do not get saved to the configuration file, and
+are just an easy way to quickly view only some rows.
+
+You can enable or disable a filter on any table.  Press the '%' key (mnemonic: %
+looks kind of like a line being filtered between two circles) and choose which
+table you want to filter, if asked.  You'll then see a list of possible filters
+and a list of filters currently enabled for that table.  Type the names of
+filters you want to apply and press Enter.
+
+=head3 USER-DEFINED FILTERS
+
+If you type a name that doesn't exist, innotop will prompt you to create the
+filter.  Filters are easy to create if you know Perl, and not hard if you don't.
+What you're doing is creating a subroutine that returns true if the row should
+be displayed.  The row is a hash reference passed to your subroutine as $set.
+
+For example, imagine you want to filter the processlist table so you only see
+queries that have been running more than five minutes.  Type a new name for your
+filter, and when prompted for the subroutine body, press TAB to initiate your
+terminal's auto-completion.  You'll see the names of the columns in the
+L<"processlist"> table (innotop generally tries to help you with auto-completion
+lists).  You want to filter on the 'time' column.  Type the text "$set->{time} >
+300" to return true when the query is more than five minutes old.  That's all
+you need to do.
+
+In other words, the code you're typing is surrounded by an implicit context,
+which looks like this:
+
+ sub filter {
+    my ( $set ) = @_;
+    # YOUR CODE HERE
+ }
+
+If your filter doesn't work, or if something else suddenly behaves differently,
+you might have made an error in your filter, and innotop is silently catching
+the error.  Try enabling L<"debug"> to make innotop throw an error instead.
+
+=head3 QUICK-FILTERS
+
+innotop's quick-filters are a shortcut to create a temporary filter that doesn't
+persist when you restart innotop.  To create a quick-filter, press the '/' key.
+innotop will prompt you for the column name and filter text.  Again, you can use
+auto-completion on column names.  The filter text can be just the text you want
+to "search for."  For example, to filter the L<"processlist"> table on queries
+that refer to the products table, type '/' and then 'info product'.
+
+The filter text can actually be any Perl regular expression, but of course a
+literal string like 'product' works fine as a regular expression.
+
+Behind the scenes innotop compiles the quick-filter into a specially tagged
+filter that is otherwise like any other filter.  It just isn't saved to the
+configuration file.
+
+To clear quick-filters, press the '\' key and innotop will clear them all at
+once.
+
+=head2 SORTING
+
+innotop has sensible built-in defaults to sort the most important rows to the
+top of the table.  Like anything else in innotop, you can customize how any
+table is sorted.
+
+To start the sort dialog, start the L<"TABLE EDITOR"> with the '^' key, choose a
+table if necessary, and press the 's' key.  You'll see a list of columns you can
+use in the sort expression and the current sort expression, if any.  Enter a
+list of columns by which you want to sort and press Enter.  If you want to
+reverse sort, prefix the column name with a minus sign.  For example, if you
+want to sort by column a ascending, then column b descending, type 'a -b'.  You
+can also explicitly add a + in front of columns you want to sort ascending, but
+it's not required.
+
+Some modes have keys mapped to open this dialog directly, and to quickly reverse
+sort direction.  Press '?' as usual to see which keys are mapped in any mode.
+
+=head2 GROUPING
+
+innotop can group, or aggregate, rows together (the terms are used
+interchangeably).  This is quite similar to an SQL GROUP BY clause.  You can
+specify to group on certain columns, or if you don't specify any, the entire set
+of rows is treated as one group.  This is quite like SQL so far, but unlike SQL,
+you can also select un-grouped columns.  innotop actually aggregates every
+column.  If you don't explicitly specify a grouping function, the default is
+'first'.  This is basically a convenience so you don't have to specify an
+aggregate function for every column you want in the result.
+
+You can quickly toggle grouping on a table with the '=' key, which toggles its
+aggregate property.  This property doesn't persist to the config file.
+
+The columns by which the table is grouped are specified in its group_by
+property.  When you turn grouping on, innotop places the group_by columns at the
+far left of the table, even if they're not supposed to be visible.  The rest of
+the visible columns appear in order after them.
+
+Two tables have default group_by lists and a count column built in:
+L<"processlist"> and L<"innodb_transactions">.  The grouping is by connection
+and status, so you can quickly see how many queries or transactions are in a
+given status on each server you're monitoring.  The time columns are aggregated
+as a sum; other columns are left at the default 'first' aggregation.
+
+By default, the table shown in L<"S: Variables & Status"> mode also uses
+grouping so you can monitor variables and status across many servers.  The
+default aggregation function in this mode is 'avg'.
+
+Valid grouping functions are defined in the %agg_funcs hash.  They include
+
+=over
+
+=item first
+
+Returns the first element in the group.
+
+=item count
+
+Returns the number of elements in the group, including undefined elements, much
+like SQL's COUNT(*).
+
+=item avg
+
+Returns the average of defined elements in the group.
+
+=item sum
+
+Returns the sum of elements in the group.
+
+=back
+
+Here's an example of grouping at work.  Suppose you have a very busy server with
+hundreds of open connections, and you want to see how many connections are in
+what status.  Using the built-in grouping rules, you can press 'Q' to enter
+L<"Q: Query List"> mode.  Press '=' to toggle grouping (if necessary, select the
+L<"processlist"> table when prompted).
+
+Your display might now look like the following:
+
+ Query List (? for help) localhost, 32:33, 0.11 QPS, 1 thd, 5.0.38-log
+ CXN        Cmd        Cnt  ID      User   Host           Time   Query       
+ localhost  Query      49    12933  webusr localhost      19:38  SELECT * FROM
+ localhost  Sending Da 23     2383  webusr localhost      12:43  SELECT col1,
+ localhost  Sleep      120     140  webusr localhost    5:18:12
+ localhost  Statistics 12    19213  webusr localhost      01:19  SELECT * FROM
+
+That's actually quite a worrisome picture.  You've got a lot of idle connections
+(Sleep), and some connections executing queries (Query and Sending Data).
+That's okay, but you also have a lot in Statistics status, collectively spending
+over a minute.  That means the query optimizer is having a really hard time
+optimizing your statements.  Something is wrong; it should normally take
+milliseconds to optimize queries.  You might not have seen this pattern if you
+didn't look at your connections in aggregate.  (This is a made-up example, but
+it can happen in real life).
+
+=head2 PIVOTING
+
+innotop can pivot a table for more compact display, similar to a Pivot Table in
+a spreadsheet (also known as a crosstab).  Pivoting a table makes columns into
+rows.  Assume you start with this table:
+
+ foo bar
+ === ===
+ 1   3
+ 2   4
+
+After pivoting, the table will look like this:
+
+ name set0 set1
+ ==== ==== ====
+ foo  1    2
+ bar  3    4
+
+To get reasonable results, you might need to group as well as pivoting.
+innotop currently does this for L<"S: Variables & Status"> mode.
+
+=head2 COLORS
+
+By default, innotop highlights rows with color so you can see at a glance which
+rows are more important.  You can customize the colorization rules and add your
+own to any table.  Open the table editor with the '^' key, choose a table if
+needed, and press 'o' to open the color editor dialog.
+
+The color editor dialog displays the rules applied to the table, in the order
+they are evaluated.  Each row is evaluated against each rule to see if the rule
+matches the row; if it does, the row gets the specified color, and no further
+rules are evaluated.  The rules look like the following:
+
+ state  eq  Locked       black on_red
+ cmd    eq  Sleep        white       
+ user   eq  system user  white       
+ cmd    eq  Connect      white       
+ cmd    eq  Binlog Dump  white       
+ time   >   600          red         
+ time   >   120          yellow      
+ time   >   60           green       
+ time   >   30           cyan        
+
+This is the default rule set for the L<"processlist"> table.  In order of
+priority, these rules make locked queries black on a red background, "gray out"
+connections from replication and sleeping queries, and make queries turn from
+cyan to red as they run longer.
+
+(For some reason, the ANSI color code "white" is actually a light gray.  Your
+terminal's display may vary; experiment to find colors you like).
+
+You can use keystrokes to move the rules up and down, which re-orders their
+priority.  You can also delete rules and add new ones.  If you add a new rule,
+innotop prompts you for the column, an operator for the comparison, a value
+against which to compare the column, and a color to assign if the rule matches.
+There is auto-completion and prompting at each step.
+
+The value in the third step needs to be correctly quoted.  innotop does not try
+to quote the value because it doesn't know whether it should treat the value as
+a string or a number.  If you want to compare the column against a string, as
+for example in the first rule above, you should enter 'Locked' surrounded by
+quotes.  If you get an error message about a bareword, you probably should have
+quoted something.
+
+=head2 EXPRESSIONS
+
+Expressions are at the core of how innotop works, and are what enables you to
+extend innotop as you wish.  Recall the table lifecycle explained in
+L<"TABLES">.  Expressions are used in the earliest step, where it extracts
+values from a data source to form rows.
+
+It does this by calling a subroutine for each column, passing it the source data
+set, a set of current values, and a set of previous values.  These are all
+needed so the subroutine can calculate things like the difference between this
+tick and the previous tick.
+
+The subroutines that extract the data from the set are compiled from
+expressions.  This gives significantly more power than just naming the values to
+fill the columns, because it allows the column's value to be calculated from
+whatever data is necessary, but avoids the need to write complicated and lengthy
+Perl code.
+
+innotop begins with a string of text that can look as simple as a value's name
+or as complicated as a full-fledged Perl expression.  It looks at each
+'bareword' token in the string and decides whether it's supposed to be a key
+into the $set hash.  A bareword is an unquoted value that isn't already
+surrounded by code-ish things like dollar signs or curly brackets.  If innotop
+decides that the bareword isn't a function or other valid Perl code, it converts
+it into a hash access.  After the whole string is processed, innotop compiles a
+subroutine, like this:
+
+ sub compute_column_value {
+    my ( $set, $cur, $pre ) = @_;
+    my $val = # EXPANDED STRING GOES HERE
+    return $val;
+ }
+
+Here's a concrete example, taken from the header table L<"q_header"> in L<"Q:
+Query List"> mode.  This expression calculates the qps, or Queries Per Second,
+column's values, from the values returned by SHOW STATUS:
+
+ Questions/Uptime_hires
+
+innotop decides both words are barewords, and transforms this expression into
+the following Perl code:
+
+ $set->{Questions}/$set->{Uptime_hires}
+
+When surrounded by the rest of the subroutine's code, this is executable Perl
+that calculates a high-resolution queries-per-second value.
+
+The arguments to the subroutine are named $set, $cur, and $pre.  In most cases,
+$set and $cur will be the same values.  However, if L<"status_inc"> is set, $cur
+will not be the same as $set, because $set will already contain values that are
+the incremental difference between $cur and $pre.
+
+Every column in innotop is computed by subroutines compiled in the same fashion.
+There is no difference between innotop's built-in columns and user-defined
+columns.  This keeps things consistent and predictable.
+
+=head2 TRANSFORMATIONS
+
+Transformations change how a value is rendered.  For example, they can take a
+number of seconds and display it in H:M:S format.  The following transformations
+are defined:
+
+=over
+
+=item commify
+
+Adds commas to large numbers every three decimal places.
+
+=item dulint_to_int
+
+Accepts two unsigned integers and converts them into a single longlong.  This is
+useful for certain operations with InnoDB, which uses two integers as
+transaction identifiers, for example.
+
+=item no_ctrl_char
+
+Removes quoted control characters from the value.  This is affected by the
+L<"charset"> configuration variable.
+
+This transformation only operates within quoted strings, for example, values to
+a SET clause in an UPDATE statement.  It will not alter the UPDATE statement,
+but will collapse the quoted string to [BINARY] or [TEXT], depending on the
+charset.
+
+=item percent
+
+Converts a number to a percentage by multiplying it by two, formatting it with
+L<"num_digits"> digits after the decimal point, and optionally adding a percent
+sign (see L<"show_percent">).
+
+=item secs_to_time
+
+Formats a number of seconds as time in days+hours:minutes:seconds format.
+
+=item set_precision
+
+Formats numbers with L<"num_digits"> number of digits after the decimal point.
+
+=item shorten
+
+Formats a number as a unit of 1024 (k/M/G/T) and with L<"num_digits"> number of
+digits after the decimal point.
+
+=back
+
+=head2 TABLE EDITOR
+
+The innotop table editor lets you customize tables with keystrokes.  You start
+the table editor with the '^' key.  If there's more than one table on the
+screen, it will prompt you to choose one of them.  Once you do, innotop will
+show you something like this:
+
+ Editing table definition for Buffer Pool.  Press ? for help, q to quit.
+ name               hdr          label                  src          
+ cxn                CXN          Connection from which  cxn          
+ buf_pool_size      Size         Buffer pool size       IB_bp_buf_poo
+ buf_free           Free Bufs    Buffers free in the b  IB_bp_buf_fre
+ pages_total        Pages        Pages total            IB_bp_pages_t
+ pages_modified     Dirty Pages  Pages modified (dirty  IB_bp_pages_m
+ buf_pool_hit_rate  Hit Rate     Buffer pool hit rate   IB_bp_buf_poo
+ total_mem_alloc    Memory       Total memory allocate  IB_bp_total_m
+ add_pool_alloc     Add'l Pool   Additonal pool alloca  IB_bp_add_poo
+
+The first line shows which table you're editing, and reminds you again to press
+'?' for a list of key mappings.  The rest is a tabular representation of the
+table's columns, because that's likely what you're trying to edit.  However, you
+can edit more than just the table's columns; this screen can start the filter
+editor, color rule editor, and more.
+
+Each row in the display shows a single column in the table you're editing, along
+with a couple of its properties such as its header and source expression (see
+L<"EXPRESSIONS">).
+
+The key mappings are Vim-style, as in many other places.  Pressing 'j' and 'k'
+moves the highlight up or down.  You can then (d)elete or (e)dit the highlighted
+column.  You can also (a)dd a column to the table.  This actually just activates
+one of the columns already defined for the table; it prompts you to choose from
+among the columns available but not currently displayed.  Finally, you can
+re-order the columns with the '+' and '-' keys.
+
+You can do more than just edit the columns with the table editor, you can also
+edit other properties, such as the table's sort expression and group-by
+expression.  Press '?' to see the full list, of course.
+
+If you want to really customize and create your own column, as opposed to just
+activating a built-in one that's not currently displayed, press the (n)ew key,
+and innotop will prompt you for the information it needs:
+
+=over
+
+=item *
+
+The column name: this needs to be a word without any funny characters, e.g. just
+letters, numbers and underscores.
+
+=item *
+
+The column header: this is the label that appears at the top of the column, in
+the table header.  This can have spaces and funny characters, but be careful not
+to make it too wide and waste space on-screen.
+
+=item *
+
+The column's data source: this is an expression that determines what data from
+the source (see L<"TABLES">) innotop will put into the column.  This can just be
+the name of an item in the source, or it can be a more complex expression, as
+described in L<"EXPRESSIONS">.
+
+=back
+
+Once you've entered the required data, your table has a new column.  There is no
+difference between this column and the built-in ones; it can have all the same
+properties and behaviors.  innotop will write the column's definition to the
+configuration file, so it will persist across sessions.
+
+Here's an example: suppose you want to track how many times your slaves have
+retried transactions.  According to the MySQL manual, the
+Slave_retried_transactions status variable gives you that data: "The total
+number of times since startup that the replication slave SQL thread has retried
+transactions. This variable was added in version 5.0.4."  This is appropriate to
+add to the L<"slave_sql_status"> table.
+
+To add the column, switch to the replication-monitoring mode with the 'M' key,
+and press the '^' key to start the table editor.  When prompted, choose
+slave_sql_status as the table, then press 'n' to create the column.  Type
+'retries' as the column name, 'Retries' as the column header, and
+'Slave_retried_transactions' as the source.  Now the column is created, and you
+see the table editor screen again.  Press 'q' to exit the table editor, and
+you'll see your column at the end of the table.
+
+=head1 VARIABLE SETS
+
+Variable sets are used in L<"S: Variables & Status"> mode to define more easily
+what variables you want to monitor.  Behind the scenes they are compiled to a
+list of expressions, and then into a column list so they can be treated just
+like columns in any other table, in terms of data extraction and
+transformations.  However, you're protected from the tedious details by a syntax
+that ought to feel very natural to you: a SQL SELECT list.
+
+The data source for variable sets, and indeed the entire S mode, is the
+combination of SHOW STATUS, SHOW VARIABLES, and SHOW INNODB STATUS.  Imagine
+that you had a huge table with one column per variable returned from those
+statements.  That's the data source for variable sets.  You can now query this
+data source just like you'd expect.  For example:
+
+ Questions, Uptime, Questions/Uptime as QPS
+
+Behind the scenes innotop will split that variable set into three expressions,
+compile them and turn them into a table definition, then extract as usual.  This
+becomes a "variable set," or a "list of variables you want to monitor."
+
+innotop lets you name and save your variable sets, and writes them to the
+configuration file.  You can choose which variable set you want to see with the
+'c' key, or activate the next and previous sets with the '>' and '<' keys.
+There are many built-in variable sets as well, which should give you a good
+start for creating your own.  Press 'e' to edit the current variable set, or
+just to see how it's defined.  To create a new one, just press 'c' and type its
+name.
+
+You may want to use some of the functions listed in L<"TRANSFORMATIONS"> to help
+format the results.  In particular, L<"set_precision"> is often useful to limit
+the number of digits you see.  Extending the above example, here's how:
+
+ Questions, Uptime, set_precision(Questions/Uptime) as QPS
+
+Actually, this still needs a little more work.  If your L<"interval"> is less
+than one second, you might be dividing by zero because Uptime is incremental in
+this mode by default.  Instead, use Uptime_hires:
+
+ Questions, Uptime, set_precision(Questions/Uptime_hires) as QPS
+
+This example is simple, but it shows how easy it is to choose which variables
+you want to monitor.
+
+=head1 PLUGINS
+
+innotop has a simple but powerful plugin mechanism by which you can extend
+or modify its existing functionality, and add new functionality.  innotop's
+plugin functionality is event-based: plugins register themselves to be called
+when events happen.  They then have a chance to influence the event.
+
+An innotop plugin is a Perl module placed in innotop's L<"plugin_dir">
+directory.  On UNIX systems, you can place a symbolic link to the module instead
+of putting the actual file there.  innotop automatically discovers the file.  If
+there is a corresponding entry in the L<"plugins"> configuration file section,
+innotop loads and activates the plugin.
+
+The module must conform to innotop's plugin interface.  Additionally, the source
+code of the module must be written in such a way that innotop can inspect the
+file and determine the package name and description.
+
+=head2 Package Source Convention
+
+innotop inspects the plugin module's source to determine the Perl package name.
+It looks for a line of the form "package Foo;" and if found, considers the
+plugin's package name to be Foo.  Of course the package name can be a valid Perl
+package name, with double semicolons and so on.
+
+It also looks for a description in the source code, to make the plugin editor
+more human-friendly.  The description is a comment line of the form "#
+description: Foo", where "Foo" is the text innotop will consider to be the
+plugin's description.
+
+=head2 Plugin Interface
+
+The innotop plugin interface is quite simple: innotop expects the plugin to be
+an object-oriented module it can call certain methods on.  The methods are
+
+=over
+
+=item new(%variables)
+
+This is the plugin's constructor.  It is passed a hash of innotop's variables,
+which it can manipulate (see L<"Plugin Variables">).  It must return a reference
+to the newly created plugin object.
+
+At construction time, innotop has only loaded the general configuration and
+created the default built-in variables with their default contents (which is
+quite a lot).  Therefore, the state of the program is exactly as in the innotop
+source code, plus the configuration variables from the L<"general"> section in
+the config file.
+
+If your plugin manipulates the variables, it is changing global data, which is
+shared by innotop and all plugins.  Plugins are loaded in the order they're
+listed in the config file.  Your plugin may load before or after another plugin,
+so there is a potential for conflict or interaction between plugins if they
+modify data other plugins use or modify.
+
+=item register_for_events()
+
+This method must return a list of events in which the plugin is interested, if
+any.  See L<"Plugin Events"> for the defined events.  If the plugin returns an
+event that's not defined, the event is ignored.
+
+=item event handlers
+
+The plugin must implement a method named the same as each event for which it has
+registered.  In other words, if the plugin returns qw(foo bar) from
+register_for_events(), it must have foo() and bar() methods.  These methods are
+callbacks for the events.  See L<"Plugin Events"> for more details about each
+event.
+
+=back
+
+=head2 Plugin Variables
+
+The plugin's constructor is passed a hash of innotop's variables, which it can
+manipulate.  It is probably a good idea if the plugin object saves a copy of it
+for later use.  The variables are defined in the innotop variable
+%pluggable_vars, and are as follows:
+
+=over
+
+=item action_for
+
+A hashref of key mappings.  These are innotop's global hot-keys.
+
+=item agg_funcs
+
+A hashref of functions that can be used for grouping.  See L<"GROUPING">.
+
+=item config
+
+The global configuration hash.
+
+=item connections
+
+A hashref of connection specifications.  These are just specifications of how to
+connect to a server.
+
+=item dbhs
+
+A hashref of innotop's database connections.  These are actual DBI connection
+objects.
+
+=item filters
+
+A hashref of filters applied to table rows.  See L<"FILTERS"> for more.
+
+=item modes
+
+A hashref of modes.  See L<"MODES"> for more.
+
+=item server_groups
+
+A hashref of server groups.  See L<"SERVER GROUPS">.
+
+=item tbl_meta
+
+A hashref of innotop's table meta-data, with one entry per table (see
+L<"TABLES"> for more information).
+
+=item trans_funcs
+
+A hashref of transformation functions.  See L<"TRANSFORMATIONS">.
+
+=item var_sets
+
+A hashref of variable sets.  See L<"VARIABLE SETS">.
+
+=back
+
+=head2 Plugin Events
+
+Each event is defined somewhere in the innotop source code.  When innotop runs
+that code, it executes the callback function for each plugin that expressed its
+interest in the event.  innotop passes some data for each event.  The events are
+defined in the %event_listener_for variable, and are as follows:
+
+=over
+
+=item extract_values($set, $cur, $pre, $tbl)
+
+This event occurs inside the function that extracts values from a data source.
+The arguments are the set of values, the current values, the previous values,
+and the table name.
+
+=item set_to_tbl
+
+Events are defined at many places in this subroutine, which is responsible for
+turning an arrayref of hashrefs into an arrayref of lines that can be printed to
+the screen.  The events all pass the same data: an arrayref of rows and the name
+of the table being created.  The events are set_to_tbl_pre_filter,
+set_to_tbl_pre_sort,set_to_tbl_pre_group, set_to_tbl_pre_colorize,
+set_to_tbl_pre_transform, set_to_tbl_pre_pivot, set_to_tbl_pre_create,
+set_to_tbl_post_create.
+
+=item draw_screen($lines)
+
+This event occurs inside the subroutine that prints the lines to the screen.
+$lines is an arrayref of strings.
+
+=back
+
+=head2 Simple Plugin Example
+
+The easiest way to explain the plugin functionality is probably with a simple
+example.  The following module adds a column to the beginning of every table and
+sets its value to 1.
+
+ use strict;
+ use warnings FATAL => 'all';
+ package Innotop::Plugin::Example;
+ # description: Adds an 'example' column to every table
+ sub new {
+    my ( $class, %vars ) = @_;
+    # Store reference to innotop's variables in $self
+    my $self = bless { %vars }, $class;
+    # Design the example column
+    my $col = {
+       hdr   => 'Example',
+       just  => '',
+       dec   => 0,
+       num   => 1,
+       label => 'Example',
+       src   => 'example', # Get data from this column in the data source
+       tbl   => '',
+       trans => [],
+    };
+    # Add the column to every table.
+    my $tbl_meta = $vars{tbl_meta};
+    foreach my $tbl ( values %$tbl_meta ) {
+       # Add the column to the list of defined columns
+       $tbl->{cols}->{example} = $col;
+       # Add the column to the list of visible columns
+       unshift @{$tbl->{visible}}, 'example';
+    }
+    # Be sure to return a reference to the object.
+    return $self;
+ }
+ # I'd like to be called when a data set is being rendered into a table, please.
+ sub register_for_events {
+    my ( $self ) = @_;
+    return qw(set_to_tbl_pre_filter);
+ }
+ # This method will be called when the event fires.
+ sub set_to_tbl_pre_filter {
+    my ( $self, $rows, $tbl ) = @_;
+    # Set the example column's data source to the value 1.
+    foreach my $row ( @$rows ) {
+       $row->{example} = 1;
+    }
+ }
+ 1;
+
+=head2 Plugin Editor
+
+The plugin editor lets you view the plugins innotop discovered and activate or
+deactivate them.  Start the editor by pressing $ to start the configuration
+editor from any mode.  Press the 'p' key to start the plugin editor.  You'll see
+a list of plugins innotop discovered.  You can use the 'j' and 'k' keys to move
+the highlight to the desired one, then press the * key to toggle it active or
+inactive.  Exit the editor and restart innotop for the changes to take effect.
+
+=head1 SQL STATEMENTS
+
+innotop uses a limited set of SQL statements to retrieve data from MySQL for
+display.  The statements are customized depending on the server version against
+which they are executed; for example, on MySQL 5 and newer, INNODB_STATUS
+executes "SHOW ENGINE INNODB STATUS", while on earlier versions it executes
+"SHOW INNODB STATUS".  The statements are as follows:
+
+ Statement           SQL executed
+ =================== ===============================
+ INNODB_STATUS       SHOW [ENGINE] INNODB STATUS
+ KILL_CONNECTION     KILL
+ KILL_QUERY          KILL QUERY
+ OPEN_TABLES         SHOW OPEN TABLES
+ PROCESSLIST         SHOW FULL PROCESSLIST
+ SHOW_MASTER_LOGS    SHOW MASTER LOGS
+ SHOW_MASTER_STATUS  SHOW MASTER STATUS
+ SHOW_SLAVE_STATUS   SHOW SLAVE STATUS
+ SHOW_STATUS         SHOW [GLOBAL] STATUS
+ SHOW_VARIABLES      SHOW [GLOBAL] VARIABLES
+
+=head1 DATA SOURCES
+
+Each time innotop extracts values to create a table (see L<"EXPRESSIONS"> and
+L<"TABLES">), it does so from a particular data source.  Largely because of the
+complex data extracted from SHOW INNODB STATUS, this is slightly messy.  SHOW
+INNODB STATUS contains a mixture of single values and repeated values that form
+nested data sets.
+
+Whenever innotop fetches data from MySQL, it adds two extra bits to each set:
+cxn and Uptime_hires.  cxn is the name of the connection from which the data
+came.  Uptime_hires is a high-resolution version of the server's Uptime status
+variable, which is important if your L<"interval"> setting is sub-second.
+
+Here are the kinds of data sources from which data is extracted:
+
+=over
+
+=item STATUS_VARIABLES
+
+This is the broadest category, into which the most kinds of data fall.  It
+begins with the combination of SHOW STATUS and SHOW VARIABLES, but other sources
+may be included as needed, for example, SHOW MASTER STATUS and SHOW SLAVE
+STATUS, as well as many of the non-repeated values from SHOW INNODB STATUS.
+
+=item DEADLOCK_LOCKS
+
+This data is extracted from the transaction list in the LATEST DETECTED DEADLOCK
+section of SHOW INNODB STATUS.  It is nested two levels deep: transactions, then
+locks.
+
+=item DEADLOCK_TRANSACTIONS
+
+This data is from the transaction list in the LATEST DETECTED DEADLOCK
+section of SHOW INNODB STATUS.  It is nested one level deep.
+
+=item EXPLAIN
+
+This data is from the result set returned by EXPLAIN.
+
+=item INNODB_TRANSACTIONS
+
+This data is from the TRANSACTIONS section of SHOW INNODB STATUS.
+
+=item IO_THREADS
+
+This data is from the list of threads in the the FILE I/O section of SHOW INNODB
+STATUS.
+
+=item INNODB_LOCKS
+
+This data is from the TRANSACTIONS section of SHOW INNODB STATUS and is nested
+two levels deep.
+
+=item OPEN_TABLES
+
+This data is from SHOW OPEN TABLES.
+
+=item PROCESSLIST
+
+This data is from SHOW FULL PROCESSLIST.
+
+=item OS_WAIT_ARRAY
+
+This data is from the SEMAPHORES section of SHOW INNODB STATUS and is nested one
+level deep.  It comes from the lines that look like this:
+
+ --Thread 1568861104 has waited at btr0cur.c line 424 ....
+
+=back
+
+=head1 MYSQL PRIVILEGES
+
+=over
+
+=item *
+
+You must connect to MySQL as a user who has the SUPER privilege for many of the
+functions.
+
+=item *
+
+If you don't have the SUPER privilege, you can still run some functions, but you
+won't necessarily see all the same data.
+
+=item *
+
+You need the PROCESS privilege to see the list of currently running queries in Q
+mode.
+
+=item *
+
+You need special privileges to start and stop slave servers.
+
+=item *
+
+You need appropriate privileges to create and drop the deadlock tables if needed
+(see L<"SERVER CONNECTIONS">).
+
+=back
+
+=head1 SYSTEM REQUIREMENTS
+
+You need Perl to run innotop, of course.  You also need a few Perl modules: DBI,
+DBD::mysql,  Term::ReadKey, and Time::HiRes.  These should be included with most
+Perl distributions, but in case they are not, I recommend using versions
+distributed with your operating system or Perl distribution, not from CPAN.
+Term::ReadKey in particular has been known to cause problems if installed from
+CPAN.
+
+If you have Term::ANSIColor, innotop will use it to format headers more readably
+and compactly.  (Under Microsoft Windows, you also need Win32::Console::ANSI for
+terminal formatting codes to be honored).  If you install Term::ReadLine,
+preferably Term::ReadLine::Gnu, you'll get nice auto-completion support.
+
+I run innotop on Gentoo GNU/Linux, Debian and Ubuntu, and I've had feedback from
+people successfully running it on Red Hat, CentOS, Solaris, and Mac OSX.  I
+don't see any reason why it won't work on other UNIX-ish operating systems, but
+I don't know for sure.  It also runs on Windows under ActivePerl without
+problem.
+
+innotop has been used on MySQL versions 3.23.58, 4.0.27, 4.1.0, 4.1.22, 5.0.26,
+5.1.15, and 5.2.3.  If it doesn't run correctly for you, that is a bug that
+should be reported.
+
+=head1 FILES
+
+$HOMEDIR/.innotop and/or /etc/innotop are used to store
+configuration information.  Files include the configuration file innotop.conf,
+the core_dump file which contains verbose error messages if L<"debug"> is
+enabled, and the plugins/ subdirectory.
+
+=head1 GLOSSARY OF TERMS
+
+=over
+
+=item tick
+
+A tick is a refresh event, when innotop re-fetches data from connections and
+displays it.
+
+=back
+
+=head1 ACKNOWLEDGEMENTS
+
+The following people and organizations are acknowledged for various reasons.
+Hopefully no one has been forgotten.
+
+Allen K. Smith,
+Aurimas Mikalauskas,
+Bartosz Fenski,
+Brian Miezejewski,
+Christian Hammers, 
+Cyril Scetbon,
+Dane Miller,
+David Multer,
+Dr. Frank Ullrich,
+Giuseppe Maxia,
+Google.com Site Reliability Engineers,
+Google Code,
+Jan Pieter Kunst,
+Jari Aalto,
+Jay Pipes,
+Jeremy Zawodny,
+Johan Idren,
+Kristian Kohntopp,
+Lenz Grimmer,
+Maciej Dobrzanski,
+Michiel Betel,
+MySQL AB,
+Paul McCullagh,
+Sebastien Estienne,
+Sourceforge.net,
+Steven Kreuzer,
+The Gentoo MySQL Team,
+Trevor Price,
+Yaar Schnitman,
+and probably more people that have not been included.
+
+(If your name has been misspelled, it's probably out of fear of putting
+international characters into this documentation; earlier versions of Perl might
+not be able to compile it then).
+
+=head1 COPYRIGHT, LICENSE AND WARRANTY
+
+This program is copyright (c) 2006 Baron Schwartz.
+Feedback and improvements are welcome.
+
+THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation, version 2; OR the Perl Artistic License.  On UNIX and similar
+systems, you can issue `man perlgpl' or `man perlartistic' to read these
+licenses.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA  02111-1307  USA.
+
+Execute innotop and press '!' to see this information at any time.
+
+=head1 AUTHOR
+
+Originally written by Baron Schwartz; currently maintained by Aaron Racine.
+
+=head1 BUGS
+
+You can report bugs, ask for improvements, and get other help and support at
+L<http://code.google.com/p/innotop/>.  There are mailing lists, a source code
+browser, a bug tracker, etc.  Please use these instead of contacting the
+maintainer or author directly, as it makes our job easier and benefits others if the
+discussions are permanent and public.  Of course, if you need to contact us in
+private, please do.
+
+=cut
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/innotop/innotop.1 b/mysql-wsrep-5.6/packaging/deb-in/extra/innotop/innotop.1
new file mode 100644 (file)
index 0000000..b2e7fce
--- /dev/null
@@ -0,0 +1,2084 @@
+.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.07)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
+.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
+.    ds L" ""
+.    ds R" ""
+.    ds C` ""
+.    ds C' ""
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L" ``
+.    ds R" ''
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.ie \nF \{\
+.    de IX
+.    tm Index:\\$1\t\\n%\t"\\$2"
+..
+.    nr % 0
+.    rr F
+.\}
+.el \{\
+.    de IX
+..
+.\}
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \" fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&
+.    ds #] \&
+.\}
+.    \" simple accents for nroff and troff
+.if n \{\
+.    ds ' \&
+.    ds ` \&
+.    ds ^ \&
+.    ds , \&
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "INNOTOP 1"
+.TH INNOTOP 1 "2009-03-09" "perl v5.10.0" "User Contributed Perl Documentation"
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+innotop \- MySQL and InnoDB transaction/status monitor.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+To monitor servers normally:
+.PP
+.Vb 1
+\& innotop
+.Ve
+.PP
+To monitor InnoDB status information from a file:
+.PP
+.Vb 1
+\& innotop /var/log/mysql/mysqld.err
+.Ve
+.PP
+To run innotop non-interactively in a pipe-and-filter configuration:
+.PP
+.Vb 1
+\& innotop \-\-count 5 \-d 1 \-n
+.Ve
+.PP
+To monitor a database on another system using a particular username and password:
+.PP
+.Vb 1
+\& innotop \-u <username> \-p <password> \-h <hostname>
+.Ve
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+innotop monitors MySQL servers.  Each of its modes shows you a different aspect
+of what's happening in the server.  For example, there's a mode for monitoring
+replication, one for queries, and one for transactions.  innotop refreshes its
+data periodically, so you see an updating view.
+.PP
+innotop has lots of features for power users, but you can start and run it with
+virtually no configuration.  If you're just getting started, see
+\&\*(L"QUICK-START\*(R".  Press '?' at any time while running innotop for
+context-sensitive help.
+.SH "QUICK-START"
+.IX Header "QUICK-START"
+To start innotop, open a terminal or command prompt.  If you have installed
+innotop on your system, you should be able to just type \*(L"innotop\*(R" and press
+Enter; otherwise, you will need to change to innotop's directory and type \*(L"perl
+innotop\*(R".
+.PP
+With no options specified, innotop will attempt to connect to a MySQL server on
+localhost using mysql_read_default_group=client for other connection
+parameters.  If you need to specify a different username and password, use the
+\&\-u and \-p options, respectively.  To monitor a MySQL database on another
+host, use the \-h option.
+.PP
+After you've connected, innotop should show you something like the following:
+.PP
+.Vb 1
+\& [RO] Query List (? for help) localhost, 01:11:19, 449.44 QPS, 14/7/163 con/run
+\& 
+\& CXN        When   Load  QPS    Slow  QCacheHit  KCacheHit  BpsIn    BpsOut 
+\& localhost  Total  0.00  1.07k   697      0.00%     98.17%  476.83k  242.83k
+\&
+\& CXN        Cmd    ID         User  Host      DB   Time   Query
+\& localhost  Query  766446598  test  10.0.0.1  foo  00:02  INSERT INTO table (
+.Ve
+.PP
+(This sample is truncated at the right so it will fit on a terminal when running
+\&'man innotop')
+.PP
+If your server is busy, you'll see more output.  Notice the first line on the
+screen, which tells you that readonly is set to true ([\s-1RO\s0]), what mode you're
+in and what server you're connected to.  You can change to other modes with
+keystrokes; press 'T' to switch to a list of InnoDB transactions, for example.
+.PP
+Press the '?' key to see what keys are active in the current mode.  You can
+press any of these keys and innotop will either take the requested action or
+prompt you for more input.  If your system has Term::ReadLine support, you can
+use \s-1TAB\s0 and other keys to auto-complete and edit input.
+.PP
+To quit innotop, press the 'q' key.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+innotop is mostly configured via its configuration file, but some of the
+configuration options can come from the command line.  You can also specify a
+file to monitor for InnoDB status output; see \*(L"\s-1MONITORING\s0 A \s-1FILE\s0\*(R" for more
+details.
+.PP
+You can negate some options by prefixing the option name with \-\-no.  For
+example, \-\-noinc (or \-\-no\-inc) negates \*(L"\-\-inc\*(R".
+.IP "\-\-color" 4
+.IX Item "--color"
+Enable or disable terminal coloring.  Corresponds to the \*(L"color\*(R" config file
+setting.
+.IP "\-\-config" 4
+.IX Item "--config"
+Specifies a configuration file to read.  This option is non-sticky, that is to
+say it does not persist to the configuration file itself.
+.IP "\-\-count" 4
+.IX Item "--count"
+Refresh only the specified number of times (ticks) before exiting.  Each refresh
+is a pause for \*(L"interval\*(R" seconds, followed by requesting data from MySQL
+connections and printing it to the terminal.
+.IP "\-\-delay" 4
+.IX Item "--delay"
+Specifies the amount of time to pause between ticks (refreshes).  Corresponds to
+the configuration option \*(L"interval\*(R".
+.IP "\-\-help" 4
+.IX Item "--help"
+Print a summary of command-line usage and exit.
+.IP "\-\-host" 4
+.IX Item "--host"
+Host to connect to.
+.IP "\-\-inc" 4
+.IX Item "--inc"
+Specifies whether innotop should display absolute numbers or relative numbers
+(offsets from their previous values).  Corresponds to the configuration option
+\&\*(L"status_inc\*(R".
+.IP "\-\-mode" 4
+.IX Item "--mode"
+Specifies the mode in which innotop should start.  Corresponds to the
+configuration option \*(L"mode\*(R".
+.IP "\-\-nonint" 4
+.IX Item "--nonint"
+Enable non-interactive operation.  See \*(L"NON-INTERACTIVE \s-1OPERATION\s0\*(R" for more.
+.IP "\-\-password" 4
+.IX Item "--password"
+Password to use for connection.
+.IP "\-\-port" 4
+.IX Item "--port"
+Port to use for connection.
+.IP "\-\-skipcentral" 4
+.IX Item "--skipcentral"
+Don't read the central configuration file.
+.IP "\-\-user" 4
+.IX Item "--user"
+User to use for connection.
+.IP "\-\-version" 4
+.IX Item "--version"
+Output version information and exit.
+.IP "\-\-write" 4
+.IX Item "--write"
+Sets the configuration option \*(L"readonly\*(R" to 0, making innotop write the
+running configuration to ~/.innotop/innotop.conf on exit, if no configuration
+file was loaded at start-up.
+.SH "HOTKEYS"
+.IX Header "HOTKEYS"
+innotop is interactive, and you control it with key-presses.
+.IP "\(bu" 4
+Uppercase keys switch between modes.
+.IP "\(bu" 4
+Lowercase keys initiate some action within the current mode.
+.IP "\(bu" 4
+Other keys do something special like change configuration or show the
+innotop license.
+.PP
+Press '?' at any time to see the currently active keys and what they do.
+.SH "MODES"
+.IX Header "MODES"
+Each of innotop's modes retrieves and displays a particular type of data from
+the servers you're monitoring.  You switch between modes with uppercase keys.
+The following is a brief description of each mode, in alphabetical order.  To
+switch to the mode, press the key listed in front of its heading in the
+following list:
+.IP "B: InnoDB Buffers" 4
+.IX Item "B: InnoDB Buffers"
+This mode displays information about the InnoDB buffer pool, page statistics,
+insert buffer, and adaptive hash index.  The data comes from \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0.
+.Sp
+This mode contains the \*(L"buffer_pool\*(R", \*(L"page_statistics\*(R",
+\&\*(L"insert_buffers\*(R", and \*(L"adaptive_hash_index\*(R" tables by default.
+.IP "C: Command Summary" 4
+.IX Item "C: Command Summary"
+This mode is similar to mytop's Command Summary mode.  It shows the
+\&\*(L"cmd_summary\*(R" table, which looks something like the following:
+.Sp
+.Vb 8
+\& Command Summary (? for help) localhost, 25+07:16:43, 2.45 QPS, 3 thd, 5.0.40
+\& _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ Command Summary _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_
+\& Name                    Value    Pct     Last Incr  Pct    
+\& Select_scan             3244858  69.89%          2  100.00%
+\& Select_range            1354177  29.17%          0    0.00%
+\& Select_full_join          39479   0.85%          0    0.00%
+\& Select_full_range_join     4097   0.09%          0    0.00%
+\& Select_range_check            0   0.00%          0    0.00%
+.Ve
+.Sp
+The command summary table is built by extracting variables from
+\&\*(L"\s-1STATUS_VARIABLES\s0\*(R".  The variables must be numeric and must match the prefix
+given by the \*(L"cmd_filter\*(R" configuration variable.  The variables are then
+sorted by value descending and compared to the last variable, as shown above.
+The percentage columns are percentage of the total of all variables in the
+table, so you can see the relative weight of the variables.
+.Sp
+The example shows what you see if the prefix is \*(L"Select_\*(R".  The default
+prefix is \*(L"Com_\*(R".  You can choose a prefix with the 's' key.
+.Sp
+It's rather like running \s-1SHOW\s0 \s-1VARIABLES\s0 \s-1LIKE\s0 \*(L"prefix%\*(R" with memory and
+nice formatting.
+.Sp
+Values are aggregated across all servers.  The Pct columns are not correctly
+aggregated across multiple servers.  This is a known limitation of the grouping
+algorithm that may be fixed in the future.
+.IP "D: InnoDB Deadlocks" 4
+.IX Item "D: InnoDB Deadlocks"
+This mode shows the transactions involved in the last InnoDB deadlock.  A second
+table shows the locks each transaction held and waited for.  A deadlock is
+caused by a cycle in the waits-for graph, so there should be two locks held and
+one waited for unless the deadlock information is truncated.
+.Sp
+InnoDB puts deadlock information before some other information in the \s-1SHOW\s0
+\&\s-1INNODB\s0 \s-1STATUS\s0 output.  If there are a lot of locks, the deadlock information can
+grow very large, and there is a limit on the size of the \s-1SHOW\s0 \s-1INNODB\s0
+\&\s-1STATUS\s0 output.  A large deadlock can fill the entire output, or even be
+truncated, and prevent you from seeing other information at all.  If you are
+running innotop in another mode, for example T mode, and suddenly you don't see
+anything, you might want to check and see if a deadlock has wiped out the data
+you need.
+.Sp
+If it has, you can create a small deadlock to replace the large one.  Use the
+\&'w' key to 'wipe' the large deadlock with a small one.  This will not work
+unless you have defined a deadlock table for the connection (see \*(L"\s-1SERVER\s0
+\&\s-1CONNECTIONS\s0\*(R").
+.Sp
+You can also configure innotop to automatically detect when a large deadlock
+needs to be replaced with a small one (see \*(L"auto_wipe_dl\*(R").
+.Sp
+This mode displays the \*(L"deadlock_transactions\*(R" and \*(L"deadlock_locks\*(R" tables
+by default.
+.IP "F: InnoDB Foreign Key Errors" 4
+.IX Item "F: InnoDB Foreign Key Errors"
+This mode shows the last InnoDB foreign key error information, such as the
+table where it happened, when and who and what query caused it, and so on.
+.Sp
+InnoDB has a huge variety of foreign key error messages, and many of them are
+just hard to parse.  innotop doesn't always do the best job here, but there's
+so much code devoted to parsing this messy, unparseable output that innotop is
+likely never to be perfect in this regard.  If innotop doesn't show you what
+you need to see, just look at the status text directly.
+.Sp
+This mode displays the \*(L"fk_error\*(R" table by default.
+.IP "I: InnoDB I/O Info" 4
+.IX Item "I: InnoDB I/O Info"
+This mode shows InnoDB's I/O statistics, including the I/O threads, pending I/O,
+file I/O miscellaneous, and log statistics.  It displays the \*(L"io_threads\*(R",
+\&\*(L"pending_io\*(R", \*(L"file_io_misc\*(R", and \*(L"log_statistics\*(R" tables by default.
+.IP "L: Locks" 4
+.IX Item "L: Locks"
+This mode shows information about current locks.  At the moment only InnoDB
+locks are supported, and by default you'll only see locks for which transactions
+are waiting.  This information comes from the \s-1TRANSACTIONS\s0 section of the InnoDB
+status text.  If you have a very busy server, you may have frequent lock waits;
+it helps to be able to see which tables and indexes are the \*(L"hot spot\*(R" for
+locks.  If your server is running pretty well, this mode should show nothing.
+.Sp
+You can configure MySQL and innotop to monitor not only locks for which a
+transaction is waiting, but those currently held, too.  You can do this with the
+InnoDB Lock Monitor (<http://dev.mysql.com/doc/en/innodb\-monitor.html>).  It's
+not documented in the MySQL manual, but creating the lock monitor with the
+following statement also affects the output of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0, which innotop
+uses:
+.Sp
+.Vb 1
+\&  CREATE TABLE innodb_lock_monitor(a int) ENGINE=INNODB;
+.Ve
+.Sp
+This causes InnoDB to print its output to the MySQL file every 16 seconds or so,
+as stated in the manual, but it also makes the normal \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0 output
+include lock information, which innotop can parse and display (that's the
+undocumented feature).
+.Sp
+This means you can do what may have seemed impossible: to a limited extent
+(InnoDB truncates some information in the output), you can see which transaction
+holds the locks something else is waiting for.  You can also enable and disable
+the InnoDB Lock Monitor with the key mappings in this mode.
+.Sp
+This mode displays the \*(L"innodb_locks\*(R" table by default.  Here's a sample of
+the screen when one connection is waiting for locks another connection holds:
+.Sp
+.Vb 7
+\& _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_ InnoDB Locks _\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_
+\& CXN        ID  Type    Waiting  Wait   Active  Mode  DB    Table  Index
+\& localhost  12  RECORD        1  00:10   00:10  X     test  t1     PRIMARY
+\& localhost  12  TABLE         0  00:10   00:10  IX    test  t1
+\& localhost  12  RECORD        1  00:10   00:10  X     test  t1     PRIMARY
+\& localhost  11  TABLE         0  00:00   00:25  IX    test  t1
+\& localhost  11  RECORD        0  00:00   00:25  X     test  t1     PRIMARY
+.Ve
+.Sp
+You can see the first connection, \s-1ID\s0 12, is waiting for a lock on the \s-1PRIMARY\s0
+key on test.t1, and has been waiting for 10 seconds.  The second connection
+isn't waiting, because the Waiting column is 0, but it holds locks on the same
+index.  That tells you connection 11 is blocking connection 12.
+.IP "M: Master/Slave Replication Status" 4
+.IX Item "M: Master/Slave Replication Status"
+This mode shows the output of \s-1SHOW\s0 \s-1SLAVE\s0 \s-1STATUS\s0 and \s-1SHOW\s0 \s-1MASTER\s0 \s-1STATUS\s0 in three
+tables.  The first two divide the slave's status into \s-1SQL\s0 and I/O thread status,
+and the last shows master status.  Filters are applied to eliminate non-slave
+servers from the slave tables, and non-master servers from the master table.
+.Sp
+This mode displays the \*(L"slave_sql_status\*(R", \*(L"slave_io_status\*(R", and
+\&\*(L"master_status\*(R" tables by default.
+.IP "O: Open Tables" 4
+.IX Item "O: Open Tables"
+This section comes from MySQL's \s-1SHOW\s0 \s-1OPEN\s0 \s-1TABLES\s0 command.  By default it is
+filtered to show tables which are in use by one or more queries, so you can
+get a quick look at which tables are 'hot'.  You can use this to guess which
+tables might be locked implicitly.
+.Sp
+This mode displays the \*(L"open_tables\*(R" mode by default.
+.IP "Q: Query List" 4
+.IX Item "Q: Query List"
+This mode displays the output from \s-1SHOW\s0 \s-1FULL\s0 \s-1PROCESSLIST\s0, much like \fBmytop\fR's
+query list mode.  This mode does \fBnot\fR show InnoDB-related information.  This
+is probably one of the most useful modes for general usage.
+.Sp
+There is an informative header that shows general status information about
+your server.  You can toggle it on and off with the 'h' key.  By default,
+innotop hides inactive processes and its own process.  You can toggle these on
+and off with the 'i' and 'a' keys.
+.Sp
+You can \s-1EXPLAIN\s0 a query from this mode with the 'e' key.  This displays the
+query's full text, the results of \s-1EXPLAIN\s0, and in newer MySQL versions, even
+the optimized query resulting from \s-1EXPLAIN\s0 \s-1EXTENDED\s0.  innotop also tries to
+rewrite certain queries to make them EXPLAIN-able.  For example, \s-1INSERT/SELECT\s0
+statements are rewritable.
+.Sp
+This mode displays the \*(L"q_header\*(R" and \*(L"processlist\*(R" tables by default.
+.IP "R: InnoDB Row Operations and Semaphores" 4
+.IX Item "R: InnoDB Row Operations and Semaphores"
+This mode shows InnoDB row operations, row operation miscellaneous, semaphores,
+and information from the wait array.  It displays the \*(L"row_operations\*(R",
+\&\*(L"row_operation_misc\*(R", \*(L"semaphores\*(R", and \*(L"wait_array\*(R" tables by default.
+.IP "S: Variables & Status" 4
+.IX Item "S: Variables & Status"
+This mode calculates statistics, such as queries per second, and prints them out
+in several different styles.  You can show absolute values, or incremental values
+between ticks.
+.Sp
+You can switch between the views by pressing a key.  The 's' key prints a
+single line each time the screen updates, in the style of \fBvmstat\fR.  The 'g'
+key changes the view to a graph of the same numbers, sort of like \fBtload\fR.
+The 'v' key changes the view to a pivoted table of variable names on the left,
+with successive updates scrolling across the screen from left to right.  You can
+choose how many updates to put on the screen with the \*(L"num_status_sets\*(R"
+configuration variable.
+.Sp
+Headers may be abbreviated to fit on the screen in interactive operation.  You
+choose which variables to display with the 'c' key, which selects from
+predefined sets, or lets you create your own sets.  You can edit the current set
+with the 'e' key.
+.Sp
+This mode doesn't really display any tables like other modes.  Instead, it uses
+a table definition to extract and format the data, but it then transforms the
+result in special ways before outputting it.  It uses the \*(L"var_status\*(R" table
+definition for this.
+.IP "T: InnoDB Transactions" 4
+.IX Item "T: InnoDB Transactions"
+This mode shows transactions from the InnoDB monitor's output, in \fBtop\fR\-like
+format.  This mode is the reason I wrote innotop.
+.Sp
+You can kill queries or processes with the 'k' and 'x' keys, and \s-1EXPLAIN\s0 a query
+with the 'e' or 'f' keys.  InnoDB doesn't print the full query in transactions,
+so explaining may not work right if the query is truncated.
+.Sp
+The informational header can be toggled on and off with the 'h' key.  By
+default, innotop hides inactive transactions and its own transaction.  You can
+toggle this on and off with the 'i' and 'a' keys.
+.Sp
+This mode displays the \*(L"t_header\*(R" and \*(L"innodb_transactions\*(R" tables by
+default.
+.SH "INNOTOP STATUS"
+.IX Header "INNOTOP STATUS"
+The first line innotop displays is a \*(L"status bar\*(R" of sorts.  What it contains
+depends on the mode you're in, and what servers you're monitoring.  The first
+few words are always [\s-1RO\s0] (if readonly is set to 1), the innotop mode, such as
+\&\*(L"InnoDB Txns\*(R" for T mode, followed by a reminder to press '?' for help at any
+time.
+.SS "\s-1ONE\s0 \s-1SERVER\s0"
+.IX Subsection "ONE SERVER"
+The simplest case is when you're monitoring a single server.  In this case, the
+name of the connection is next on the status line.  This is the name you gave
+when you created the connection \*(-- most likely the MySQL server's hostname.
+This is followed by the server's uptime.
+.PP
+If you're in an InnoDB mode, such as T or B, the next word is \*(L"InnoDB\*(R" followed
+by some information about the \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0 output used to render the
+screen.  The first word is the number of seconds since the last \s-1SHOW\s0 \s-1INNODB\s0
+\&\s-1STATUS\s0, which InnoDB uses to calculate some per-second statistics.  The next is
+a smiley face indicating whether the InnoDB output is truncated.  If the smiley
+face is a :\-), all is well; there is no truncation.  A :^| means the transaction
+list is so long, InnoDB has only printed out some of the transactions.  Finally,
+a frown :\-( means the output is incomplete, which is probably due to a deadlock
+printing too much lock information (see \*(L"D: InnoDB Deadlocks\*(R").
+.PP
+The next two words indicate the server's queries per second (\s-1QPS\s0) and how many
+threads (connections) exist.  Finally, the server's version number is the last
+thing on the line.
+.SS "\s-1MULTIPLE\s0 \s-1SERVERS\s0"
+.IX Subsection "MULTIPLE SERVERS"
+If you are monitoring multiple servers (see \*(L"\s-1SERVER\s0 \s-1CONNECTIONS\s0\*(R"), the status
+line does not show any details about individual servers.  Instead, it shows the
+names of the connections that are active.  Again, these are connection names you
+specified, which are likely to be the server's hostname.  A connection that has
+an error is prefixed with an exclamation point.
+.PP
+If you are monitoring a group of servers (see \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R"), the status
+line shows the name of the group.  If any connection in the group has an
+error, the group's name is followed by the fraction of the connections that
+don't have errors.
+.PP
+See \*(L"\s-1ERROR\s0 \s-1HANDLING\s0\*(R" for more details about innotop's error handling.
+.SS "\s-1MONITORING\s0 A \s-1FILE\s0"
+.IX Subsection "MONITORING A FILE"
+If you give a filename on the command line, innotop will not connect to \s-1ANY\s0
+servers at all.  It will watch the specified file for InnoDB status output and
+use that as its data source.  It will always show a single connection called
+\&'file'.  And since it can't connect to a server, it can't determine how long the
+server it's monitoring has been up; so it calculates the server's uptime as time
+since innotop started running.
+.SH "SERVER ADMINISTRATION"
+.IX Header "SERVER ADMINISTRATION"
+While innotop is primarily a monitor that lets you watch and analyze your
+servers, it can also send commands to servers.  The most frequently useful
+commands are killing queries and stopping or starting slaves.
+.PP
+You can kill a connection, or in newer versions of MySQL kill a query but not a
+connection, from \*(L"Q: Query List\*(R" and \*(L"T: InnoDB Transactions\*(R" modes.
+Press 'k' to issue a \s-1KILL\s0 command, or 'x' to issue a \s-1KILL\s0 \s-1QUERY\s0 command.
+innotop will prompt you for the server and/or connection \s-1ID\s0 to kill (innotop
+does not prompt you if there is only one possible choice for any input).
+innotop pre-selects the longest-running query, or the oldest connection.
+Confirm the command with 'y'.
+.PP
+In \*(L"Slave Replication Status\*(R"\*(L" in \*(R"M: Master mode, you can start and stop slaves
+with the 'a' and 'o' keys, respectively.  You can send these commands to many
+slaves at once.  innotop fills in a default command of \s-1START\s0 \s-1SLAVE\s0 or \s-1STOP\s0 \s-1SLAVE\s0
+for you, but you can actually edit the command and send anything you wish, such
+as \s-1SET\s0 \s-1GLOBAL\s0 SQL_SLAVE_SKIP_COUNTER=1 to make the slave skip one binlog event
+when it starts.
+.PP
+You can also ask innotop to calculate the earliest binlog in use by any slave
+and issue a \s-1PURGE\s0 \s-1MASTER\s0 \s-1LOGS\s0 on the master.  Use the 'b' key for this.  innotop
+will prompt you for a master to run the command on, then prompt you for the
+connection names of that master's slaves (there is no way for innotop to
+determine this reliably itself).  innotop will find the minimum binlog in use by
+these slave connections and suggest it as the argument to \s-1PURGE\s0 \s-1MASTER\s0 \s-1LOGS\s0.
+.SH "SERVER CONNECTIONS"
+.IX Header "SERVER CONNECTIONS"
+When you create a server connection using '@', innotop asks you for a series of
+inputs, as follows:
+.IP "\s-1DSN\s0" 4
+.IX Item "DSN"
+A \s-1DSN\s0 is a Data Source Name, which is the initial argument passed to the \s-1DBI\s0
+module for connecting to a server.  It is usually of the form
+.Sp
+.Vb 1
+\& DBI:mysql:;mysql_read_default_group=mysql;host=HOSTNAME
+.Ve
+.Sp
+Since this \s-1DSN\s0 is passed to the DBD::mysql driver, you should read the driver's
+documentation at \*(L"/search.cpan.org/dist/DBD\-mysql/lib/DBD/mysql.pm\*(R"\*(L" in \*(R"http: for
+the exact details on all the options you can pass the driver in the \s-1DSN\s0.  You
+can read more about \s-1DBI\s0 at <http://dbi.perl.org/docs/>, and especially at
+<http://search.cpan.org/~timb/DBI/DBI.pm>.
+.Sp
+The mysql_read_default_group=mysql option lets the \s-1DBD\s0 driver read your MySQL
+options files, such as ~/.my.cnf on UNIX-ish systems.  You can use this to avoid
+specifying a username or password for the connection.
+.IP "InnoDB Deadlock Table" 4
+.IX Item "InnoDB Deadlock Table"
+This optional item tells innotop a table name it can use to deliberately create
+a small deadlock (see \*(L"D: InnoDB Deadlocks\*(R").  If you specify this option,
+you just need to be sure the table doesn't exist, and that innotop can create
+and drop the table with the InnoDB storage engine.  You can safely omit or just
+accept the default if you don't intend to use this.
+.IP "Username" 4
+.IX Item "Username"
+innotop will ask you if you want to specify a username.  If you say 'y', it will
+then prompt you for a user name.  If you have a MySQL option file that specifies
+your username, you don't have to specify a username.
+.Sp
+The username defaults to your login name on the system you're running innotop on.
+.IP "Password" 4
+.IX Item "Password"
+innotop will ask you if you want to specify a password.  Like the username, the
+password is optional, but there's an additional prompt that asks if you want to
+save the password in the innotop configuration file.  If you don't save it in
+the configuration file, innotop will prompt you for a password each time it
+starts.  Passwords in the innotop configuration file are saved in plain text,
+not encrypted in any way.
+.PP
+Once you finish answering these questions, you should be connected to a server.
+But innotop isn't limited to monitoring a single server; you can define many
+server connections and switch between them by pressing the '@' key.  See
+\&\*(L"\s-1SWITCHING\s0 \s-1BETWEEN\s0 \s-1CONNECTIONS\s0\*(R".
+.SH "SERVER GROUPS"
+.IX Header "SERVER GROUPS"
+If you have multiple MySQL instances, you can put them into named groups, such
+as 'all', 'masters', and 'slaves', which innotop can monitor all together.
+.PP
+You can choose which group to monitor with the '#' key, and you can press the
+\&\s-1TAB\s0 key to switch to the next group.  If you're not currently monitoring a
+group, pressing \s-1TAB\s0 selects the first group.
+.PP
+To create a group, press the '#' key and type the name of your new group, then
+type the names of the connections you want the group to contain.
+.SH "SWITCHING BETWEEN CONNECTIONS"
+.IX Header "SWITCHING BETWEEN CONNECTIONS"
+innotop lets you quickly switch which servers you're monitoring.  The most basic
+way is by pressing the '@' key and typing the name(s) of the connection(s) you
+want to use.  This setting is per-mode, so you can monitor different connections
+in each mode, and innotop remembers which connections you choose.
+.PP
+You can quickly switch to the 'next' connection in alphabetical order with the
+\&'n' key.  If you're monitoring a server group (see \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R") this will
+switch to the first connection.
+.PP
+You can also type many connection names, and innotop will fetch and display data
+from them all.  Just separate the connection names with spaces, for example
+\&\*(L"server1 server2.\*(R"  Again, if you type the name of a connection that doesn't
+exist, innotop will prompt you for connection information and create the
+connection.
+.PP
+Another way to monitor multiple connections at once is with server groups.  You
+can use the \s-1TAB\s0 key to switch to the 'next' group in alphabetical order, or if
+you're not monitoring any groups, \s-1TAB\s0 will switch to the first group.
+.PP
+innotop does not fetch data in parallel from connections, so if you are
+monitoring a large group or many connections, you may notice increased delay
+between ticks.
+.PP
+When you monitor more than one connection, innotop's status bar changes.  See
+\&\*(L"\s-1INNOTOP\s0 \s-1STATUS\s0\*(R".
+.SH "ERROR HANDLING"
+.IX Header "ERROR HANDLING"
+Error handling is not that important when monitoring a single connection, but is
+crucial when you have many active connections.  A crashed server or lost
+connection should not crash innotop.  As a result, innotop will continue to run
+even when there is an error; it just won't display any information from the
+connection that had an error.  Because of this, innotop's behavior might confuse
+you.  It's a feature, not a bug!
+.PP
+innotop does not continue to query connections that have errors, because they
+may slow innotop and make it hard to use, especially if the error is a problem
+connecting and causes a long time-out.  Instead, innotop retries the connection
+occasionally to see if the error still exists.  If so, it will wait until some
+point in the future.  The wait time increases in ticks as the Fibonacci series,
+so it tries less frequently as time passes.
+.PP
+Since errors might only happen in certain modes because of the \s-1SQL\s0 commands
+issued in those modes, innotop keeps track of which mode caused the error.  If
+you switch to a different mode, innotop will retry the connection instead of
+waiting.
+.PP
+By default innotop will display the problem in red text at the bottom of the
+first table on the screen.  You can disable this behavior with the
+\&\*(L"show_cxn_errors_in_tbl\*(R" configuration option, which is enabled by default.
+If the \*(L"debug\*(R" option is enabled, innotop will display the error at the
+bottom of every table, not just the first.  And if \*(L"show_cxn_errors\*(R" is
+enabled, innotop will print the error text to \s-1STDOUT\s0 as well.  Error messages
+might only display in the mode that caused the error, depending on the mode and
+whether innotop is avoiding querying that connection.
+.SH "NON-INTERACTIVE OPERATION"
+.IX Header "NON-INTERACTIVE OPERATION"
+You can run innotop in non-interactive mode, in which case it is entirely
+controlled from the configuration file and command-line options.  To start
+innotop in non-interactive mode, give the L\*(L"<\-\-nonint\*(R"> command-line option.
+This changes innotop's behavior in the following ways:
+.IP "\(bu" 4
+Certain Perl modules are not loaded.  Term::Readline is not loaded, since
+innotop doesn't prompt interactively.  Term::ANSIColor and Win32::Console::ANSI
+modules are not loaded.  Term::ReadKey is still used, since innotop may have to
+prompt for connection passwords when starting up.
+.IP "\(bu" 4
+innotop does not clear the screen after each tick.
+.IP "\(bu" 4
+innotop does not persist any changes to the configuration file.
+.IP "\(bu" 4
+If \*(L"\-\-count\*(R" is given and innotop is in incremental mode (see \*(L"status_inc\*(R"
+and \*(L"\-\-inc\*(R"), innotop actually refreshes one more time than specified so it
+can print incremental statistics.  This suppresses output during the first
+tick, so innotop may appear to hang.
+.IP "\(bu" 4
+innotop only displays the first table in each mode.  This is so the output can
+be easily processed with other command-line utilities such as awk and sed.  To
+change which tables display in each mode, see \*(L"\s-1TABLES\s0\*(R".  Since \*(L"Q: Query
+List\*(R" mode is so important, innotop automatically disables the \*(L"q_header\*(R"
+table.  This ensures you'll see the \*(L"processlist\*(R" table, even if you have
+innotop configured to show the q_header table during interactive operation.
+Similarly, in \*(L"T: InnoDB Transactions\*(R" mode, the \*(L"t_header\*(R" table is
+suppressed so you see only the \*(L"innodb_transactions\*(R" table.
+.IP "\(bu" 4
+All output is tab-separated instead of being column-aligned with whitespace, and
+innotop prints the full contents of each table instead of only printing one
+screenful at a time.
+.IP "\(bu" 4
+innotop only prints column headers once instead of every tick (see
+\&\*(L"hide_hdr\*(R").  innotop does not print table captions (see
+\&\*(L"display_table_captions\*(R").  innotop ensures there are no empty lines in the
+output.
+.IP "\(bu" 4
+innotop does not honor the \*(L"shorten\*(R" transformation, which normally shortens
+some numbers to human-readable formats.
+.IP "\(bu" 4
+innotop does not print a status line (see \*(L"\s-1INNOTOP\s0 \s-1STATUS\s0\*(R").
+.SH "CONFIGURING"
+.IX Header "CONFIGURING"
+Nearly everything about innotop is configurable.  Most things are possible to
+change with built-in commands, but you can also edit the configuration file.
+.PP
+While running innotop, press the '$' key to bring up the configuration editing
+dialog.  Press another key to select the type of data you want to edit:
+.IP "S: Statement Sleep Times" 4
+.IX Item "S: Statement Sleep Times"
+Edits \s-1SQL\s0 statement sleep delays, which make innotop pause for the specified
+amount of time after executing a statement.  See \*(L"\s-1SQL\s0 \s-1STATEMENTS\s0\*(R" for a
+definition of each statement and what it does.  By default innotop does not
+delay after any statements.
+.Sp
+This feature is included so you can customize the side-effects caused by
+monitoring your server.  You may not see any effects, but some innotop users
+have noticed that certain MySQL versions under very high load with InnoDB
+enabled take longer than usual to execute \s-1SHOW\s0 \s-1GLOBAL\s0 \s-1STATUS\s0.  If innotop calls
+\&\s-1SHOW\s0 \s-1FULL\s0 \s-1PROCESSLIST\s0 immediately afterward, the processlist contains more
+queries than the machine actually averages at any given moment.  Configuring
+innotop to pause briefly after calling \s-1SHOW\s0 \s-1GLOBAL\s0 \s-1STATUS\s0 alleviates this
+effect.
+.Sp
+Sleep times are stored in the \*(L"stmt_sleep_times\*(R" section of the configuration
+file.  Fractional-second sleeps are supported, subject to your hardware's
+limitations.
+.IP "c: Edit Columns" 4
+.IX Item "c: Edit Columns"
+Starts the table editor on one of the displayed tables.  See \*(L"\s-1TABLE\s0 \s-1EDITOR\s0\*(R".
+An alternative way to start the table editor without entering the configuration
+dialog is with the '^' key.
+.IP "g: General Configuration" 4
+.IX Item "g: General Configuration"
+Starts the configuration editor to edit global and mode-specific configuration
+variables (see \*(L"\s-1MODES\s0\*(R").  innotop prompts you to choose a variable from among
+the global and mode-specific ones depending on the current mode.
+.IP "k: Row-Coloring Rules" 4
+.IX Item "k: Row-Coloring Rules"
+Starts the row-coloring rules editor on one of the displayed table(s).  See
+\&\*(L"\s-1COLORS\s0\*(R" for details.
+.IP "p: Manage Plugins" 4
+.IX Item "p: Manage Plugins"
+Starts the plugin configuration editor.  See \*(L"\s-1PLUGINS\s0\*(R" for details.
+.IP "s: Server Groups" 4
+.IX Item "s: Server Groups"
+Lets you create and edit server groups.  See \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R".
+.IP "t: Choose Displayed Tables" 4
+.IX Item "t: Choose Displayed Tables"
+Lets you choose which tables to display in this mode.  See \*(L"\s-1MODES\s0\*(R" and
+\&\*(L"\s-1TABLES\s0\*(R".
+.SH "CONFIGURATION FILE"
+.IX Header "CONFIGURATION FILE"
+innotop's default configuration file locations are \f(CW$HOME\fR/.innotop and
+/etc/innotop/innotop.conf, and they are looked for in that order.  If the first
+configuration file exists, the second will not be processed.  Those can be
+overridden with the \*(L"\-\-config\*(R" command-line option.  You can edit it by hand
+safely, however innotop reads the configuration file when it starts, and, if
+readonly is set to 0, writes it out again when it exits.  Thus, if readonly is
+set to 0, any changes you make by hand while innotop is running will be lost.
+.PP
+innotop doesn't store its entire configuration in the configuration file.  It
+has a huge set of default configuration values that it holds only in memory,
+and the configuration file only overrides these defaults.  When you customize a
+default setting, innotop notices, and then stores the customizations into the
+file.  This keeps the file size down, makes it easier to edit, and makes
+upgrades easier.
+.PP
+A configuration file is read-only be default.  You can override that with
+\&\*(L"\-\-write\*(R".  See \*(L"readonly\*(R".
+.PP
+The configuration file is arranged into sections like an \s-1INI\s0 file.  Each
+section begins with [section\-name] and ends with [/section\-name].  Each
+section's entries have a different syntax depending on the data they need to
+store.  You can put comments in the file; any line that begins with a #
+character is a comment.  innotop will not read the comments, so it won't write
+them back out to the file when it exits.  Comments in read-only configuration
+files are still useful, though.
+.PP
+The first line in the file is innotop's version number.  This lets innotop
+notice when the file format is not backwards-compatible, and upgrade smoothly
+without destroying your customized configuration.
+.PP
+The following list describes each section of the configuration file and the data
+it contains:
+.IP "general" 4
+.IX Item "general"
+The 'general' section contains global configuration variables and variables that
+may be mode-specific, but don't belong in any other section.  The syntax is a
+simple key=value list.  innotop writes a comment above each value to help you
+edit the file by hand.
+.RS 4
+.IP "S_func" 4
+.IX Item "S_func"
+Controls S mode presentation (see \*(L"S: Variables & Status\*(R").  If g, values are
+graphed; if s, values are like vmstat; if p, values are in a pivoted table.
+.IP "S_set" 4
+.IX Item "S_set"
+Specifies which set of variables to display in \*(L"S: Variables & Status\*(R" mode.
+See \*(L"\s-1VARIABLE\s0 \s-1SETS\s0\*(R".
+.IP "auto_wipe_dl" 4
+.IX Item "auto_wipe_dl"
+Instructs innotop to automatically wipe large deadlocks when it notices them.
+When this happens you may notice a slight delay.  At the next tick, you will
+usually see the information that was being truncated by the large deadlock.
+.IP "charset" 4
+.IX Item "charset"
+Specifies what kind of characters to allow through the \*(L"no_ctrl_char\*(R"
+transformation.  This keeps non-printable characters from confusing a
+terminal when you monitor queries that contain binary data, such as images.
+.Sp
+The default is 'ascii', which considers anything outside normal \s-1ASCII\s0 to be a
+control character.  The other allowable values are 'unicode' and 'none'.  'none'
+considers every character a control character, which can be useful for
+collapsing \s-1ALL\s0 text fields in queries.
+.IP "cmd_filter" 4
+.IX Item "cmd_filter"
+This is the prefix that filters variables in \*(L"C: Command Summary\*(R" mode.
+.IP "color" 4
+.IX Item "color"
+Whether terminal coloring is permitted.
+.IP "cxn_timeout" 4
+.IX Item "cxn_timeout"
+On MySQL versions 4.0.3 and newer, this variable is used to set the connection's
+timeout, so MySQL doesn't close the connection if it is not used for a while.
+This might happen because a connection isn't monitored in a particular mode, for
+example.
+.IP "debug" 4
+.IX Item "debug"
+This option enables more verbose errors and makes innotop more strict in some
+places.  It can help in debugging filters and other user-defined code.  It also
+makes innotop write a lot of information to \*(L"debugfile\*(R" when there is a
+crash.
+.IP "debugfile" 4
+.IX Item "debugfile"
+A file to which innotop will write information when there is a crash.  See
+\&\*(L"\s-1FILES\s0\*(R".
+.IP "display_table_captions" 4
+.IX Item "display_table_captions"
+innotop displays a table caption above most tables.  This variable suppresses or
+shows captions on all tables globally.  Some tables are configured with the
+hide_caption property, which overrides this.
+.IP "global" 4
+.IX Item "global"
+Whether to show \s-1GLOBAL\s0 variables and status.  innotop only tries to do this on
+servers which support the \s-1GLOBAL\s0 option to \s-1SHOW\s0 \s-1VARIABLES\s0 and \s-1SHOW\s0 \s-1STATUS\s0.  In
+some MySQL versions, you need certain privileges to do this; if you don't have
+them, innotop will not be able to fetch any variable and status data.  This
+configuration variable lets you run innotop and fetch what data you can even
+without the elevated privileges.
+.Sp
+I can no longer find or reproduce the situation where \s-1GLOBAL\s0 wasn't allowed, but
+I know there was one.
+.IP "graph_char" 4
+.IX Item "graph_char"
+Defines the character to use when drawing graphs in \*(L"S: Variables & Status\*(R"
+mode.
+.IP "header_highlight" 4
+.IX Item "header_highlight"
+Defines how to highlight column headers.  This only works if Term::ANSIColor is
+available.  Valid values are 'bold' and 'underline'.
+.IP "hide_hdr" 4
+.IX Item "hide_hdr"
+Hides column headers globally.
+.IP "interval" 4
+.IX Item "interval"
+The interval at which innotop will refresh its data (ticks).  The interval is
+implemented as a sleep time between ticks, so the true interval will vary
+depending on how long it takes innotop to fetch and render data.
+.Sp
+This variable accepts fractions of a second.
+.IP "mode" 4
+.IX Item "mode"
+The mode in which innotop should start.  Allowable arguments are the same as the
+key presses that select a mode interactively.  See \*(L"\s-1MODES\s0\*(R".
+.IP "num_digits" 4
+.IX Item "num_digits"
+How many digits to show in fractional numbers and percents.  This variable's
+range is between 0 and 9 and can be set directly from \*(L"S: Variables & Status\*(R"
+mode with the '+' and '\-' keys.  It is used in the \*(L"set_precision\*(R",
+\&\*(L"shorten\*(R", and \*(L"percent\*(R" transformations.
+.IP "num_status_sets" 4
+.IX Item "num_status_sets"
+Controls how many sets of status variables to display in pivoted \*(L"S: Variables
+& Status\*(R" mode.  It also controls the number of old sets of variables innotop
+keeps in its memory, so the larger this variable is, the more memory innotop
+uses.
+.IP "plugin_dir" 4
+.IX Item "plugin_dir"
+Specifies where plugins can be found.  By default, innotop stores plugins in the
+\&'plugins' subdirectory of your innotop configuration directory.
+.IP "readonly" 4
+.IX Item "readonly"
+Whether the configuration file is readonly.  This cannot be set interactively.
+.IP "show_cxn_errors" 4
+.IX Item "show_cxn_errors"
+Makes innotop print connection errors to \s-1STDOUT\s0.  See \*(L"\s-1ERROR\s0 \s-1HANDLING\s0\*(R".
+.IP "show_cxn_errors_in_tbl" 4
+.IX Item "show_cxn_errors_in_tbl"
+Makes innotop display connection errors as rows in the first table on screen.
+See \*(L"\s-1ERROR\s0 \s-1HANDLING\s0\*(R".
+.IP "show_percent" 4
+.IX Item "show_percent"
+Adds a '%' character after the value returned by the \*(L"percent\*(R"
+transformation.
+.IP "show_statusbar" 4
+.IX Item "show_statusbar"
+Controls whether to show the status bar in the display.  See \*(L"\s-1INNOTOP\s0
+\&\s-1STATUS\s0\*(R".
+.IP "skip_innodb" 4
+.IX Item "skip_innodb"
+Disables fetching \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0, in case your server(s) do not have InnoDB
+enabled and you don't want innotop to try to fetch it.  This can also be useful
+when you don't have the \s-1SUPER\s0 privilege, required to run \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0.
+.IP "status_inc" 4
+.IX Item "status_inc"
+Whether to show absolute or incremental values for status variables.
+Incremental values are calculated as an offset from the last value innotop saw
+for that variable.  This is a global setting, but will probably become
+mode-specific at some point.  Right now it is honored a bit inconsistently; some
+modes don't pay attention to it.
+.RE
+.RS 4
+.RE
+.IP "plugins" 4
+.IX Item "plugins"
+This section holds a list of package names of active plugins.  If the plugin
+exists, innotop will activate it.  See \*(L"\s-1PLUGINS\s0\*(R" for more information.
+.IP "filters" 4
+.IX Item "filters"
+This section holds user-defined filters (see \*(L"\s-1FILTERS\s0\*(R").  Each line is in the
+format filter_name=text='filter text' tbls='table list'.
+.Sp
+The filter text is the text of the subroutine's code.  The table list is a list
+of tables to which the filter can apply.  By default, user-defined filters apply
+to the table for which they were created, but you can manually override that by
+editing the definition in the configuration file.
+.IP "active_filters" 4
+.IX Item "active_filters"
+This section stores which filters are active on each table.  Each line is in the
+format table_name=filter_list.
+.IP "tbl_meta" 4
+.IX Item "tbl_meta"
+This section stores user-defined or user-customized columns (see \*(L"\s-1COLUMNS\s0\*(R").
+Each line is in the format col_name=properties, where the properties are a
+name=quoted\-value list.
+.IP "connections" 4
+.IX Item "connections"
+This section holds the server connections you have defined.  Each line is in
+the format name=properties, where the properties are a name=value list.  The
+properties are self-explanatory, and the only one that is treated specially is
+\&'pass' which is only present if 'savepass' is set.  This section of the
+configuration file will be skipped if any \s-1DSN\s0, username, or password
+command-line options are used.  See \*(L"\s-1SERVER\s0 \s-1CONNECTIONS\s0\*(R".
+.IP "active_connections" 4
+.IX Item "active_connections"
+This section holds a list of which connections are active in each mode.  Each
+line is in the format mode_name=connection_list.
+.IP "server_groups" 4
+.IX Item "server_groups"
+This section holds server groups.  Each line is in the format
+name=connection_list.  See \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R".
+.IP "active_server_groups" 4
+.IX Item "active_server_groups"
+This section holds a list of which server group is active in each mode.  Each
+line is in the format mode_name=server_group.
+.IP "max_values_seen" 4
+.IX Item "max_values_seen"
+This section holds the maximum values seen for variables.  This is used to scale
+the graphs in \*(L"S: Variables & Status\*(R" mode.  Each line is in the format
+name=value.
+.IP "active_columns" 4
+.IX Item "active_columns"
+This section holds table column lists.  Each line is in the format
+tbl_name=column_list.  See \*(L"\s-1COLUMNS\s0\*(R".
+.IP "sort_cols" 4
+.IX Item "sort_cols"
+This section holds the sort definition.  Each line is in the format
+tbl_name=column_list.  If a column is prefixed with '\-', that column sorts
+descending.  See \*(L"\s-1SORTING\s0\*(R".
+.IP "visible_tables" 4
+.IX Item "visible_tables"
+This section defines which tables are visible in each mode.  Each line is in the
+format mode_name=table_list.  See \*(L"\s-1TABLES\s0\*(R".
+.IP "varsets" 4
+.IX Item "varsets"
+This section defines variable sets for use in \*(L"S: Status & Variables\*(R" mode.
+Each line is in the format name=variable_list.  See \*(L"\s-1VARIABLE\s0 \s-1SETS\s0\*(R".
+.IP "colors" 4
+.IX Item "colors"
+This section defines colorization rules.  Each line is in the format
+tbl_name=property_list.  See \*(L"\s-1COLORS\s0\*(R".
+.IP "stmt_sleep_times" 4
+.IX Item "stmt_sleep_times"
+This section contains statement sleep times.  Each line is in the format
+statement_name=sleep_time.  See \*(L"S: Statement Sleep Times\*(R".
+.IP "group_by" 4
+.IX Item "group_by"
+This section contains column lists for table group_by expressions.  Each line is
+in the format tbl_name=column_list.  See \*(L"\s-1GROUPING\s0\*(R".
+.SH "CUSTOMIZING"
+.IX Header "CUSTOMIZING"
+You can customize innotop a great deal.  For example, you can:
+.IP "\(bu" 4
+Choose which tables to display, and in what order.
+.IP "\(bu" 4
+Choose which columns are in those tables, and create new columns.
+.IP "\(bu" 4
+Filter which rows display with built-in filters, user-defined filters, and
+quick-filters.
+.IP "\(bu" 4
+Sort the rows to put important data first or group together related rows.
+.IP "\(bu" 4
+Highlight rows with color.
+.IP "\(bu" 4
+Customize the alignment, width, and formatting of columns, and apply
+transformations to columns to extract parts of their values or format the values
+as you wish (for example, shortening large numbers to familiar units).
+.IP "\(bu" 4
+Design your own expressions to extract and combine data as you need.  This gives
+you unlimited flexibility.
+.PP
+All these and more are explained in the following sections.
+.SS "\s-1TABLES\s0"
+.IX Subsection "TABLES"
+A table is what you'd expect: a collection of columns.  It also has some other
+properties, such as a caption.  Filters, sorting rules, and colorization rules
+belong to tables and are covered in later sections.
+.PP
+Internally, table meta-data is defined in a data structure called \f(CW%tbl_meta\fR.
+This hash holds all built-in table definitions, which contain a lot of default
+instructions to innotop.  The meta-data includes the caption, a list of columns
+the user has customized, a list of columns, a list of visible columns, a list of
+filters, color rules, a sort-column list, sort direction, and some information
+about the table's data sources.  Most of this is customizable via the table
+editor (see \*(L"\s-1TABLE\s0 \s-1EDITOR\s0\*(R").
+.PP
+You can choose which tables to show by pressing the '$' key.  See \*(L"\s-1MODES\s0\*(R" and
+\&\*(L"\s-1TABLES\s0\*(R".
+.PP
+The table life-cycle is as follows:
+.IP "\(bu" 4
+Each table begins with a data source, which is an array of hashes.  See below
+for details on data sources.
+.IP "\(bu" 4
+Each element of the data source becomes a row in the final table.
+.IP "\(bu" 4
+For each element in the data source, innotop extracts values from the source and
+creates a row.  This row is another hash, which later steps will refer to as
+\&\f(CW$set\fR.  The values innotop extracts are determined by the table's columns.  Each
+column has an extraction subroutine, compiled from an expression (see
+\&\*(L"\s-1EXPRESSIONS\s0\*(R").  The resulting row is a hash whose keys are named the same as
+the column name.
+.IP "\(bu" 4
+innotop filters the rows, removing those that don't need to be displayed.  See
+\&\*(L"\s-1FILTERS\s0\*(R".
+.IP "\(bu" 4
+innotop sorts the rows.  See \*(L"\s-1SORTING\s0\*(R".
+.IP "\(bu" 4
+innotop groups the rows together, if specified.  See \*(L"\s-1GROUPING\s0\*(R".
+.IP "\(bu" 4
+innotop colorizes the rows.  See \*(L"\s-1COLORS\s0\*(R".
+.IP "\(bu" 4
+innotop transforms the column values in each row.  See \*(L"\s-1TRANSFORMATIONS\s0\*(R".
+.IP "\(bu" 4
+innotop optionally pivots the rows (see \*(L"\s-1PIVOTING\s0\*(R"), then filters and sorts
+them.
+.IP "\(bu" 4
+innotop formats and justifies the rows as a table.  During this step, innotop
+applies further formatting to the column values, including alignment, maximum
+and minimum widths.  innotop also does final error checking to ensure there are
+no crashes due to undefined values.  innotop then adds a caption if specified,
+and the table is ready to print.
+.PP
+The lifecycle is slightly different if the table is pivoted, as noted above.  To
+clarify, if the table is pivoted, the process is extract, group, transform,
+pivot, filter, sort, create.  If it's not pivoted, the process is extract,
+filter, sort, group, color, transform, create.  This slightly convoluted process
+doesn't map all that well to \s-1SQL\s0, but pivoting complicates things pretty
+thoroughly.  Roughly speaking, filtering and sorting happen as late as needed to
+effect the final result as you might expect, but as early as possible for
+efficiency.
+.PP
+Each built-in table is described below:
+.IP "adaptive_hash_index" 4
+.IX Item "adaptive_hash_index"
+Displays data about InnoDB's adaptive hash index.  Data source:
+\&\*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "buffer_pool" 4
+.IX Item "buffer_pool"
+Displays data about InnoDB's buffer pool.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "cmd_summary" 4
+.IX Item "cmd_summary"
+Displays weighted status variables.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "deadlock_locks" 4
+.IX Item "deadlock_locks"
+Shows which locks were held and waited for by the last detected deadlock.  Data
+source: \*(L"\s-1DEADLOCK_LOCKS\s0\*(R".
+.IP "deadlock_transactions" 4
+.IX Item "deadlock_transactions"
+Shows transactions involved in the last detected deadlock.  Data source:
+\&\*(L"\s-1DEADLOCK_TRANSACTIONS\s0\*(R".
+.IP "explain" 4
+.IX Item "explain"
+Shows the output of \s-1EXPLAIN\s0.  Data source: \*(L"\s-1EXPLAIN\s0\*(R".
+.IP "file_io_misc" 4
+.IX Item "file_io_misc"
+Displays data about InnoDB's file and I/O operations.  Data source:
+\&\*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "fk_error" 4
+.IX Item "fk_error"
+Displays various data about InnoDB's last foreign key error.  Data source:
+\&\*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "innodb_locks" 4
+.IX Item "innodb_locks"
+Displays InnoDB locks.  Data source: \*(L"\s-1INNODB_LOCKS\s0\*(R".
+.IP "innodb_transactions" 4
+.IX Item "innodb_transactions"
+Displays data about InnoDB's current transactions.  Data source:
+\&\*(L"\s-1INNODB_TRANSACTIONS\s0\*(R".
+.IP "insert_buffers" 4
+.IX Item "insert_buffers"
+Displays data about InnoDB's insert buffer.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "io_threads" 4
+.IX Item "io_threads"
+Displays data about InnoDB's I/O threads.  Data source: \*(L"\s-1IO_THREADS\s0\*(R".
+.IP "log_statistics" 4
+.IX Item "log_statistics"
+Displays data about InnoDB's logging system.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "master_status" 4
+.IX Item "master_status"
+Displays replication master status.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "open_tables" 4
+.IX Item "open_tables"
+Displays open tables.  Data source: \*(L"\s-1OPEN_TABLES\s0\*(R".
+.IP "page_statistics" 4
+.IX Item "page_statistics"
+Displays InnoDB page statistics.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "pending_io" 4
+.IX Item "pending_io"
+Displays InnoDB pending I/O operations.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "processlist" 4
+.IX Item "processlist"
+Displays current MySQL processes (threads/connections).  Data source:
+\&\*(L"\s-1PROCESSLIST\s0\*(R".
+.IP "q_header" 4
+.IX Item "q_header"
+Displays various status values.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "row_operation_misc" 4
+.IX Item "row_operation_misc"
+Displays data about InnoDB's row operations.  Data source:
+\&\*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "row_operations" 4
+.IX Item "row_operations"
+Displays data about InnoDB's row operations.  Data source:
+\&\*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "semaphores" 4
+.IX Item "semaphores"
+Displays data about InnoDB's semaphores and mutexes.  Data source:
+\&\*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "slave_io_status" 4
+.IX Item "slave_io_status"
+Displays data about the slave I/O thread.  Data source: 
+\&\*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "slave_sql_status" 4
+.IX Item "slave_sql_status"
+Displays data about the slave \s-1SQL\s0 thread.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "t_header" 4
+.IX Item "t_header"
+Displays various InnoDB status values.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "var_status" 4
+.IX Item "var_status"
+Displays user-configurable data.  Data source: \*(L"\s-1STATUS_VARIABLES\s0\*(R".
+.IP "wait_array" 4
+.IX Item "wait_array"
+Displays data about InnoDB's \s-1OS\s0 wait array.  Data source: \*(L"\s-1OS_WAIT_ARRAY\s0\*(R".
+.SS "\s-1COLUMNS\s0"
+.IX Subsection "COLUMNS"
+Columns belong to tables.  You can choose a table's columns by pressing the '^'
+key, which starts the \*(L"\s-1TABLE\s0 \s-1EDITOR\s0\*(R" and lets you choose and edit columns.
+Pressing 'e' from within the table editor lets you edit the column's properties:
+.IP "\(bu" 4
+hdr: a column header.  This appears in the first row of the table.
+.IP "\(bu" 4
+just: justification.  '\-' means left-justified and '' means right-justified,
+just as with printf formatting codes (not a coincidence).
+.IP "\(bu" 4
+dec: whether to further align the column on the decimal point.
+.IP "\(bu" 4
+num: whether the column is numeric.  This affects how values are sorted
+(lexically or numerically).
+.IP "\(bu" 4
+label: a small note about the column, which appears in dialogs that help the
+user choose columns.
+.IP "\(bu" 4
+src: an expression that innotop uses to extract the column's data from its
+source (see \*(L"\s-1DATA\s0 \s-1SOURCES\s0\*(R").  See \*(L"\s-1EXPRESSIONS\s0\*(R" for more on expressions.
+.IP "\(bu" 4
+minw: specifies a minimum display width.  This helps stabilize the display,
+which makes it easier to read if the data is changing frequently.
+.IP "\(bu" 4
+maxw: similar to minw.
+.IP "\(bu" 4
+trans: a list of column transformations.  See \*(L"\s-1TRANSFORMATIONS\s0\*(R".
+.IP "\(bu" 4
+agg: an aggregate function.  See \*(L"\s-1GROUPING\s0\*(R".  The default is \*(L"first\*(R".
+.IP "\(bu" 4
+aggonly: controls whether the column only shows when grouping is enabled on the
+table (see \*(L"\s-1GROUPING\s0\*(R").  By default, this is disabled.  This means columns
+will always be shown by default, whether grouping is enabled or not.  If a
+column's aggonly is set true, the column will appear when you toggle grouping on
+the table.  Several columns are set this way, such as the count column on
+\&\*(L"processlist\*(R" and \*(L"innodb_transactions\*(R", so you don't see a count when the
+grouping isn't enabled, but you do when it is.
+.SS "\s-1FILTERS\s0"
+.IX Subsection "FILTERS"
+Filters remove rows from the display.  They behave much like a \s-1WHERE\s0 clause in
+\&\s-1SQL\s0.  innotop has several built-in filters, which remove irrelevant information
+like inactive queries, but you can define your own as well.  innotop also lets
+you create quick-filters, which do not get saved to the configuration file, and
+are just an easy way to quickly view only some rows.
+.PP
+You can enable or disable a filter on any table.  Press the '%' key (mnemonic: %
+looks kind of like a line being filtered between two circles) and choose which
+table you want to filter, if asked.  You'll then see a list of possible filters
+and a list of filters currently enabled for that table.  Type the names of
+filters you want to apply and press Enter.
+.PP
+\fIUSER-DEFINED \s-1FILTERS\s0\fR
+.IX Subsection "USER-DEFINED FILTERS"
+.PP
+If you type a name that doesn't exist, innotop will prompt you to create the
+filter.  Filters are easy to create if you know Perl, and not hard if you don't.
+What you're doing is creating a subroutine that returns true if the row should
+be displayed.  The row is a hash reference passed to your subroutine as \f(CW$set\fR.
+.PP
+For example, imagine you want to filter the processlist table so you only see
+queries that have been running more than five minutes.  Type a new name for your
+filter, and when prompted for the subroutine body, press \s-1TAB\s0 to initiate your
+terminal's auto-completion.  You'll see the names of the columns in the
+\&\*(L"processlist\*(R" table (innotop generally tries to help you with auto-completion
+lists).  You want to filter on the 'time' column.  Type the text \*(L"$set\->{time} >
+300\*(R" to return true when the query is more than five minutes old.  That's all
+you need to do.
+.PP
+In other words, the code you're typing is surrounded by an implicit context,
+which looks like this:
+.PP
+.Vb 4
+\& sub filter {
+\&    my ( $set ) = @_;
+\&    # YOUR CODE HERE
+\& }
+.Ve
+.PP
+If your filter doesn't work, or if something else suddenly behaves differently,
+you might have made an error in your filter, and innotop is silently catching
+the error.  Try enabling \*(L"debug\*(R" to make innotop throw an error instead.
+.PP
+\fIQUICK-FILTERS\fR
+.IX Subsection "QUICK-FILTERS"
+.PP
+innotop's quick-filters are a shortcut to create a temporary filter that doesn't
+persist when you restart innotop.  To create a quick-filter, press the '/' key.
+innotop will prompt you for the column name and filter text.  Again, you can use
+auto-completion on column names.  The filter text can be just the text you want
+to \*(L"search for.\*(R"  For example, to filter the \*(L"processlist\*(R" table on queries
+that refer to the products table, type '/' and then 'info product'.
+.PP
+The filter text can actually be any Perl regular expression, but of course a
+literal string like 'product' works fine as a regular expression.
+.PP
+Behind the scenes innotop compiles the quick-filter into a specially tagged
+filter that is otherwise like any other filter.  It just isn't saved to the
+configuration file.
+.PP
+To clear quick-filters, press the '\e' key and innotop will clear them all at
+once.
+.SS "\s-1SORTING\s0"
+.IX Subsection "SORTING"
+innotop has sensible built-in defaults to sort the most important rows to the
+top of the table.  Like anything else in innotop, you can customize how any
+table is sorted.
+.PP
+To start the sort dialog, start the \*(L"\s-1TABLE\s0 \s-1EDITOR\s0\*(R" with the '^' key, choose a
+table if necessary, and press the 's' key.  You'll see a list of columns you can
+use in the sort expression and the current sort expression, if any.  Enter a
+list of columns by which you want to sort and press Enter.  If you want to
+reverse sort, prefix the column name with a minus sign.  For example, if you
+want to sort by column a ascending, then column b descending, type 'a \-b'.  You
+can also explicitly add a + in front of columns you want to sort ascending, but
+it's not required.
+.PP
+Some modes have keys mapped to open this dialog directly, and to quickly reverse
+sort direction.  Press '?' as usual to see which keys are mapped in any mode.
+.SS "\s-1GROUPING\s0"
+.IX Subsection "GROUPING"
+innotop can group, or aggregate, rows together (the terms are used
+interchangeably).  This is quite similar to an \s-1SQL\s0 \s-1GROUP\s0 \s-1BY\s0 clause.  You can
+specify to group on certain columns, or if you don't specify any, the entire set
+of rows is treated as one group.  This is quite like \s-1SQL\s0 so far, but unlike \s-1SQL\s0,
+you can also select un-grouped columns.  innotop actually aggregates every
+column.  If you don't explicitly specify a grouping function, the default is
+\&'first'.  This is basically a convenience so you don't have to specify an
+aggregate function for every column you want in the result.
+.PP
+You can quickly toggle grouping on a table with the '=' key, which toggles its
+aggregate property.  This property doesn't persist to the config file.
+.PP
+The columns by which the table is grouped are specified in its group_by
+property.  When you turn grouping on, innotop places the group_by columns at the
+far left of the table, even if they're not supposed to be visible.  The rest of
+the visible columns appear in order after them.
+.PP
+Two tables have default group_by lists and a count column built in:
+\&\*(L"processlist\*(R" and \*(L"innodb_transactions\*(R".  The grouping is by connection
+and status, so you can quickly see how many queries or transactions are in a
+given status on each server you're monitoring.  The time columns are aggregated
+as a sum; other columns are left at the default 'first' aggregation.
+.PP
+By default, the table shown in \*(L"S: Variables & Status\*(R" mode also uses
+grouping so you can monitor variables and status across many servers.  The
+default aggregation function in this mode is 'avg'.
+.PP
+Valid grouping functions are defined in the \f(CW%agg_funcs\fR hash.  They include
+.IP "first" 4
+.IX Item "first"
+Returns the first element in the group.
+.IP "count" 4
+.IX Item "count"
+Returns the number of elements in the group, including undefined elements, much
+like \s-1SQL\s0's \s-1COUNT\s0(*).
+.IP "avg" 4
+.IX Item "avg"
+Returns the average of defined elements in the group.
+.IP "sum" 4
+.IX Item "sum"
+Returns the sum of elements in the group.
+.PP
+Here's an example of grouping at work.  Suppose you have a very busy server with
+hundreds of open connections, and you want to see how many connections are in
+what status.  Using the built-in grouping rules, you can press 'Q' to enter
+\&\*(L"Q: Query List\*(R" mode.  Press '=' to toggle grouping (if necessary, select the
+\&\*(L"processlist\*(R" table when prompted).
+.PP
+Your display might now look like the following:
+.PP
+.Vb 1
+\& Query List (? for help) localhost, 32:33, 0.11 QPS, 1 thd, 5.0.38\-log
+\& 
+\& CXN        Cmd        Cnt  ID      User   Host           Time   Query       
+\& localhost  Query      49    12933  webusr localhost      19:38  SELECT * FROM
+\& localhost  Sending Da 23     2383  webusr localhost      12:43  SELECT col1,
+\& localhost  Sleep      120     140  webusr localhost    5:18:12
+\& localhost  Statistics 12    19213  webusr localhost      01:19  SELECT * FROM
+.Ve
+.PP
+That's actually quite a worrisome picture.  You've got a lot of idle connections
+(Sleep), and some connections executing queries (Query and Sending Data).
+That's okay, but you also have a lot in Statistics status, collectively spending
+over a minute.  That means the query optimizer is having a really hard time
+optimizing your statements.  Something is wrong; it should normally take
+milliseconds to optimize queries.  You might not have seen this pattern if you
+didn't look at your connections in aggregate.  (This is a made-up example, but
+it can happen in real life).
+.SS "\s-1PIVOTING\s0"
+.IX Subsection "PIVOTING"
+innotop can pivot a table for more compact display, similar to a Pivot Table in
+a spreadsheet (also known as a crosstab).  Pivoting a table makes columns into
+rows.  Assume you start with this table:
+.PP
+.Vb 4
+\& foo bar
+\& === ===
+\& 1   3
+\& 2   4
+.Ve
+.PP
+After pivoting, the table will look like this:
+.PP
+.Vb 4
+\& name set0 set1
+\& ==== ==== ====
+\& foo  1    2
+\& bar  3    4
+.Ve
+.PP
+To get reasonable results, you might need to group as well as pivoting.
+innotop currently does this for \*(L"S: Variables & Status\*(R" mode.
+.SS "\s-1COLORS\s0"
+.IX Subsection "COLORS"
+By default, innotop highlights rows with color so you can see at a glance which
+rows are more important.  You can customize the colorization rules and add your
+own to any table.  Open the table editor with the '^' key, choose a table if
+needed, and press 'o' to open the color editor dialog.
+.PP
+The color editor dialog displays the rules applied to the table, in the order
+they are evaluated.  Each row is evaluated against each rule to see if the rule
+matches the row; if it does, the row gets the specified color, and no further
+rules are evaluated.  The rules look like the following:
+.PP
+.Vb 9
+\& state  eq  Locked       black on_red
+\& cmd    eq  Sleep        white       
+\& user   eq  system user  white       
+\& cmd    eq  Connect      white       
+\& cmd    eq  Binlog Dump  white       
+\& time   >   600          red         
+\& time   >   120          yellow      
+\& time   >   60           green       
+\& time   >   30           cyan
+.Ve
+.PP
+This is the default rule set for the \*(L"processlist\*(R" table.  In order of
+priority, these rules make locked queries black on a red background, \*(L"gray out\*(R"
+connections from replication and sleeping queries, and make queries turn from
+cyan to red as they run longer.
+.PP
+(For some reason, the \s-1ANSI\s0 color code \*(L"white\*(R" is actually a light gray.  Your
+terminal's display may vary; experiment to find colors you like).
+.PP
+You can use keystrokes to move the rules up and down, which re-orders their
+priority.  You can also delete rules and add new ones.  If you add a new rule,
+innotop prompts you for the column, an operator for the comparison, a value
+against which to compare the column, and a color to assign if the rule matches.
+There is auto-completion and prompting at each step.
+.PP
+The value in the third step needs to be correctly quoted.  innotop does not try
+to quote the value because it doesn't know whether it should treat the value as
+a string or a number.  If you want to compare the column against a string, as
+for example in the first rule above, you should enter 'Locked' surrounded by
+quotes.  If you get an error message about a bareword, you probably should have
+quoted something.
+.SS "\s-1EXPRESSIONS\s0"
+.IX Subsection "EXPRESSIONS"
+Expressions are at the core of how innotop works, and are what enables you to
+extend innotop as you wish.  Recall the table lifecycle explained in
+\&\*(L"\s-1TABLES\s0\*(R".  Expressions are used in the earliest step, where it extracts
+values from a data source to form rows.
+.PP
+It does this by calling a subroutine for each column, passing it the source data
+set, a set of current values, and a set of previous values.  These are all
+needed so the subroutine can calculate things like the difference between this
+tick and the previous tick.
+.PP
+The subroutines that extract the data from the set are compiled from
+expressions.  This gives significantly more power than just naming the values to
+fill the columns, because it allows the column's value to be calculated from
+whatever data is necessary, but avoids the need to write complicated and lengthy
+Perl code.
+.PP
+innotop begins with a string of text that can look as simple as a value's name
+or as complicated as a full-fledged Perl expression.  It looks at each
+\&'bareword' token in the string and decides whether it's supposed to be a key
+into the \f(CW$set\fR hash.  A bareword is an unquoted value that isn't already
+surrounded by code-ish things like dollar signs or curly brackets.  If innotop
+decides that the bareword isn't a function or other valid Perl code, it converts
+it into a hash access.  After the whole string is processed, innotop compiles a
+subroutine, like this:
+.PP
+.Vb 5
+\& sub compute_column_value {
+\&    my ( $set, $cur, $pre ) = @_;
+\&    my $val = # EXPANDED STRING GOES HERE
+\&    return $val;
+\& }
+.Ve
+.PP
+Here's a concrete example, taken from the header table \*(L"q_header\*(R" in \*(L"Q:
+Query List\*(R" mode.  This expression calculates the qps, or Queries Per Second,
+column's values, from the values returned by \s-1SHOW\s0 \s-1STATUS:\s0
+.PP
+.Vb 1
+\& Questions/Uptime_hires
+.Ve
+.PP
+innotop decides both words are barewords, and transforms this expression into
+the following Perl code:
+.PP
+.Vb 1
+\& $set\->{Questions}/$set\->{Uptime_hires}
+.Ve
+.PP
+When surrounded by the rest of the subroutine's code, this is executable Perl
+that calculates a high-resolution queries-per-second value.
+.PP
+The arguments to the subroutine are named \f(CW$set\fR, \f(CW$cur\fR, and \f(CW$pre\fR.  In most cases,
+\&\f(CW$set\fR and \f(CW$cur\fR will be the same values.  However, if \*(L"status_inc\*(R" is set, \f(CW$cur\fR
+will not be the same as \f(CW$set\fR, because \f(CW$set\fR will already contain values that are
+the incremental difference between \f(CW$cur\fR and \f(CW$pre\fR.
+.PP
+Every column in innotop is computed by subroutines compiled in the same fashion.
+There is no difference between innotop's built-in columns and user-defined
+columns.  This keeps things consistent and predictable.
+.SS "\s-1TRANSFORMATIONS\s0"
+.IX Subsection "TRANSFORMATIONS"
+Transformations change how a value is rendered.  For example, they can take a
+number of seconds and display it in H:M:S format.  The following transformations
+are defined:
+.IP "commify" 4
+.IX Item "commify"
+Adds commas to large numbers every three decimal places.
+.IP "dulint_to_int" 4
+.IX Item "dulint_to_int"
+Accepts two unsigned integers and converts them into a single longlong.  This is
+useful for certain operations with InnoDB, which uses two integers as
+transaction identifiers, for example.
+.IP "no_ctrl_char" 4
+.IX Item "no_ctrl_char"
+Removes quoted control characters from the value.  This is affected by the
+\&\*(L"charset\*(R" configuration variable.
+.Sp
+This transformation only operates within quoted strings, for example, values to
+a \s-1SET\s0 clause in an \s-1UPDATE\s0 statement.  It will not alter the \s-1UPDATE\s0 statement,
+but will collapse the quoted string to [\s-1BINARY\s0] or [\s-1TEXT\s0], depending on the
+charset.
+.IP "percent" 4
+.IX Item "percent"
+Converts a number to a percentage by multiplying it by two, formatting it with
+\&\*(L"num_digits\*(R" digits after the decimal point, and optionally adding a percent
+sign (see \*(L"show_percent\*(R").
+.IP "secs_to_time" 4
+.IX Item "secs_to_time"
+Formats a number of seconds as time in days+hours:minutes:seconds format.
+.IP "set_precision" 4
+.IX Item "set_precision"
+Formats numbers with \*(L"num_digits\*(R" number of digits after the decimal point.
+.IP "shorten" 4
+.IX Item "shorten"
+Formats a number as a unit of 1024 (k/M/G/T) and with \*(L"num_digits\*(R" number of
+digits after the decimal point.
+.SS "\s-1TABLE\s0 \s-1EDITOR\s0"
+.IX Subsection "TABLE EDITOR"
+The innotop table editor lets you customize tables with keystrokes.  You start
+the table editor with the '^' key.  If there's more than one table on the
+screen, it will prompt you to choose one of them.  Once you do, innotop will
+show you something like this:
+.PP
+.Vb 1
+\& Editing table definition for Buffer Pool.  Press ? for help, q to quit.
+\& 
+\& name               hdr          label                  src          
+\& cxn                CXN          Connection from which  cxn          
+\& buf_pool_size      Size         Buffer pool size       IB_bp_buf_poo
+\& buf_free           Free Bufs    Buffers free in the b  IB_bp_buf_fre
+\& pages_total        Pages        Pages total            IB_bp_pages_t
+\& pages_modified     Dirty Pages  Pages modified (dirty  IB_bp_pages_m
+\& buf_pool_hit_rate  Hit Rate     Buffer pool hit rate   IB_bp_buf_poo
+\& total_mem_alloc    Memory       Total memory allocate  IB_bp_total_m
+\& add_pool_alloc     Add\*(Aql Pool   Additonal pool alloca  IB_bp_add_poo
+.Ve
+.PP
+The first line shows which table you're editing, and reminds you again to press
+\&'?' for a list of key mappings.  The rest is a tabular representation of the
+table's columns, because that's likely what you're trying to edit.  However, you
+can edit more than just the table's columns; this screen can start the filter
+editor, color rule editor, and more.
+.PP
+Each row in the display shows a single column in the table you're editing, along
+with a couple of its properties such as its header and source expression (see
+\&\*(L"\s-1EXPRESSIONS\s0\*(R").
+.PP
+The key mappings are Vim-style, as in many other places.  Pressing 'j' and 'k'
+moves the highlight up or down.  You can then (d)elete or (e)dit the highlighted
+column.  You can also (a)dd a column to the table.  This actually just activates
+one of the columns already defined for the table; it prompts you to choose from
+among the columns available but not currently displayed.  Finally, you can
+re-order the columns with the '+' and '\-' keys.
+.PP
+You can do more than just edit the columns with the table editor, you can also
+edit other properties, such as the table's sort expression and group-by
+expression.  Press '?' to see the full list, of course.
+.PP
+If you want to really customize and create your own column, as opposed to just
+activating a built-in one that's not currently displayed, press the (n)ew key,
+and innotop will prompt you for the information it needs:
+.IP "\(bu" 4
+The column name: this needs to be a word without any funny characters, e.g. just
+letters, numbers and underscores.
+.IP "\(bu" 4
+The column header: this is the label that appears at the top of the column, in
+the table header.  This can have spaces and funny characters, but be careful not
+to make it too wide and waste space on-screen.
+.IP "\(bu" 4
+The column's data source: this is an expression that determines what data from
+the source (see \*(L"\s-1TABLES\s0\*(R") innotop will put into the column.  This can just be
+the name of an item in the source, or it can be a more complex expression, as
+described in \*(L"\s-1EXPRESSIONS\s0\*(R".
+.PP
+Once you've entered the required data, your table has a new column.  There is no
+difference between this column and the built-in ones; it can have all the same
+properties and behaviors.  innotop will write the column's definition to the
+configuration file, so it will persist across sessions.
+.PP
+Here's an example: suppose you want to track how many times your slaves have
+retried transactions.  According to the MySQL manual, the
+Slave_retried_transactions status variable gives you that data: \*(L"The total
+number of times since startup that the replication slave \s-1SQL\s0 thread has retried
+transactions. This variable was added in version 5.0.4.\*(R"  This is appropriate to
+add to the \*(L"slave_sql_status\*(R" table.
+.PP
+To add the column, switch to the replication-monitoring mode with the 'M' key,
+and press the '^' key to start the table editor.  When prompted, choose
+slave_sql_status as the table, then press 'n' to create the column.  Type
+\&'retries' as the column name, 'Retries' as the column header, and
+\&'Slave_retried_transactions' as the source.  Now the column is created, and you
+see the table editor screen again.  Press 'q' to exit the table editor, and
+you'll see your column at the end of the table.
+.SH "VARIABLE SETS"
+.IX Header "VARIABLE SETS"
+Variable sets are used in \*(L"S: Variables & Status\*(R" mode to define more easily
+what variables you want to monitor.  Behind the scenes they are compiled to a
+list of expressions, and then into a column list so they can be treated just
+like columns in any other table, in terms of data extraction and
+transformations.  However, you're protected from the tedious details by a syntax
+that ought to feel very natural to you: a \s-1SQL\s0 \s-1SELECT\s0 list.
+.PP
+The data source for variable sets, and indeed the entire S mode, is the
+combination of \s-1SHOW\s0 \s-1STATUS\s0, \s-1SHOW\s0 \s-1VARIABLES\s0, and \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0.  Imagine
+that you had a huge table with one column per variable returned from those
+statements.  That's the data source for variable sets.  You can now query this
+data source just like you'd expect.  For example:
+.PP
+.Vb 1
+\& Questions, Uptime, Questions/Uptime as QPS
+.Ve
+.PP
+Behind the scenes innotop will split that variable set into three expressions,
+compile them and turn them into a table definition, then extract as usual.  This
+becomes a \*(L"variable set,\*(R" or a \*(L"list of variables you want to monitor.\*(R"
+.PP
+innotop lets you name and save your variable sets, and writes them to the
+configuration file.  You can choose which variable set you want to see with the
+\&'c' key, or activate the next and previous sets with the '>' and '<' keys.
+There are many built-in variable sets as well, which should give you a good
+start for creating your own.  Press 'e' to edit the current variable set, or
+just to see how it's defined.  To create a new one, just press 'c' and type its
+name.
+.PP
+You may want to use some of the functions listed in \*(L"\s-1TRANSFORMATIONS\s0\*(R" to help
+format the results.  In particular, \*(L"set_precision\*(R" is often useful to limit
+the number of digits you see.  Extending the above example, here's how:
+.PP
+.Vb 1
+\& Questions, Uptime, set_precision(Questions/Uptime) as QPS
+.Ve
+.PP
+Actually, this still needs a little more work.  If your \*(L"interval\*(R" is less
+than one second, you might be dividing by zero because Uptime is incremental in
+this mode by default.  Instead, use Uptime_hires:
+.PP
+.Vb 1
+\& Questions, Uptime, set_precision(Questions/Uptime_hires) as QPS
+.Ve
+.PP
+This example is simple, but it shows how easy it is to choose which variables
+you want to monitor.
+.SH "PLUGINS"
+.IX Header "PLUGINS"
+innotop has a simple but powerful plugin mechanism by which you can extend
+or modify its existing functionality, and add new functionality.  innotop's
+plugin functionality is event-based: plugins register themselves to be called
+when events happen.  They then have a chance to influence the event.
+.PP
+An innotop plugin is a Perl module placed in innotop's \*(L"plugin_dir\*(R"
+directory.  On \s-1UNIX\s0 systems, you can place a symbolic link to the module instead
+of putting the actual file there.  innotop automatically discovers the file.  If
+there is a corresponding entry in the \*(L"plugins\*(R" configuration file section,
+innotop loads and activates the plugin.
+.PP
+The module must conform to innotop's plugin interface.  Additionally, the source
+code of the module must be written in such a way that innotop can inspect the
+file and determine the package name and description.
+.SS "Package Source Convention"
+.IX Subsection "Package Source Convention"
+innotop inspects the plugin module's source to determine the Perl package name.
+It looks for a line of the form \*(L"package Foo;\*(R" and if found, considers the
+plugin's package name to be Foo.  Of course the package name can be a valid Perl
+package name, with double semicolons and so on.
+.PP
+It also looks for a description in the source code, to make the plugin editor
+more human-friendly.  The description is a comment line of the form \*(L"#
+description: Foo\*(R", where \*(L"Foo\*(R" is the text innotop will consider to be the
+plugin's description.
+.SS "Plugin Interface"
+.IX Subsection "Plugin Interface"
+The innotop plugin interface is quite simple: innotop expects the plugin to be
+an object-oriented module it can call certain methods on.  The methods are
+.IP "new(%variables)" 4
+.IX Item "new(%variables)"
+This is the plugin's constructor.  It is passed a hash of innotop's variables,
+which it can manipulate (see \*(L"Plugin Variables\*(R").  It must return a reference
+to the newly created plugin object.
+.Sp
+At construction time, innotop has only loaded the general configuration and
+created the default built-in variables with their default contents (which is
+quite a lot).  Therefore, the state of the program is exactly as in the innotop
+source code, plus the configuration variables from the \*(L"general\*(R" section in
+the config file.
+.Sp
+If your plugin manipulates the variables, it is changing global data, which is
+shared by innotop and all plugins.  Plugins are loaded in the order they're
+listed in the config file.  Your plugin may load before or after another plugin,
+so there is a potential for conflict or interaction between plugins if they
+modify data other plugins use or modify.
+.IP "\fIregister_for_events()\fR" 4
+.IX Item "register_for_events()"
+This method must return a list of events in which the plugin is interested, if
+any.  See \*(L"Plugin Events\*(R" for the defined events.  If the plugin returns an
+event that's not defined, the event is ignored.
+.IP "event handlers" 4
+.IX Item "event handlers"
+The plugin must implement a method named the same as each event for which it has
+registered.  In other words, if the plugin returns qw(foo bar) from
+\&\fIregister_for_events()\fR, it must have \fIfoo()\fR and \fIbar()\fR methods.  These methods are
+callbacks for the events.  See \*(L"Plugin Events\*(R" for more details about each
+event.
+.SS "Plugin Variables"
+.IX Subsection "Plugin Variables"
+The plugin's constructor is passed a hash of innotop's variables, which it can
+manipulate.  It is probably a good idea if the plugin object saves a copy of it
+for later use.  The variables are defined in the innotop variable
+\&\f(CW%pluggable_vars\fR, and are as follows:
+.IP "action_for" 4
+.IX Item "action_for"
+A hashref of key mappings.  These are innotop's global hot-keys.
+.IP "agg_funcs" 4
+.IX Item "agg_funcs"
+A hashref of functions that can be used for grouping.  See \*(L"\s-1GROUPING\s0\*(R".
+.IP "config" 4
+.IX Item "config"
+The global configuration hash.
+.IP "connections" 4
+.IX Item "connections"
+A hashref of connection specifications.  These are just specifications of how to
+connect to a server.
+.IP "dbhs" 4
+.IX Item "dbhs"
+A hashref of innotop's database connections.  These are actual \s-1DBI\s0 connection
+objects.
+.IP "filters" 4
+.IX Item "filters"
+A hashref of filters applied to table rows.  See \*(L"\s-1FILTERS\s0\*(R" for more.
+.IP "modes" 4
+.IX Item "modes"
+A hashref of modes.  See \*(L"\s-1MODES\s0\*(R" for more.
+.IP "server_groups" 4
+.IX Item "server_groups"
+A hashref of server groups.  See \*(L"\s-1SERVER\s0 \s-1GROUPS\s0\*(R".
+.IP "tbl_meta" 4
+.IX Item "tbl_meta"
+A hashref of innotop's table meta-data, with one entry per table (see
+\&\*(L"\s-1TABLES\s0\*(R" for more information).
+.IP "trans_funcs" 4
+.IX Item "trans_funcs"
+A hashref of transformation functions.  See \*(L"\s-1TRANSFORMATIONS\s0\*(R".
+.IP "var_sets" 4
+.IX Item "var_sets"
+A hashref of variable sets.  See \*(L"\s-1VARIABLE\s0 \s-1SETS\s0\*(R".
+.SS "Plugin Events"
+.IX Subsection "Plugin Events"
+Each event is defined somewhere in the innotop source code.  When innotop runs
+that code, it executes the callback function for each plugin that expressed its
+interest in the event.  innotop passes some data for each event.  The events are
+defined in the \f(CW%event_listener_for\fR variable, and are as follows:
+.ie n .IP "extract_values($set, $cur, $pre, $tbl)" 4
+.el .IP "extract_values($set, \f(CW$cur\fR, \f(CW$pre\fR, \f(CW$tbl\fR)" 4
+.IX Item "extract_values($set, $cur, $pre, $tbl)"
+This event occurs inside the function that extracts values from a data source.
+The arguments are the set of values, the current values, the previous values,
+and the table name.
+.IP "set_to_tbl" 4
+.IX Item "set_to_tbl"
+Events are defined at many places in this subroutine, which is responsible for
+turning an arrayref of hashrefs into an arrayref of lines that can be printed to
+the screen.  The events all pass the same data: an arrayref of rows and the name
+of the table being created.  The events are set_to_tbl_pre_filter,
+set_to_tbl_pre_sort,set_to_tbl_pre_group, set_to_tbl_pre_colorize,
+set_to_tbl_pre_transform, set_to_tbl_pre_pivot, set_to_tbl_pre_create,
+set_to_tbl_post_create.
+.IP "draw_screen($lines)" 4
+.IX Item "draw_screen($lines)"
+This event occurs inside the subroutine that prints the lines to the screen.
+\&\f(CW$lines\fR is an arrayref of strings.
+.SS "Simple Plugin Example"
+.IX Subsection "Simple Plugin Example"
+The easiest way to explain the plugin functionality is probably with a simple
+example.  The following module adds a column to the beginning of every table and
+sets its value to 1.
+.PP
+.Vb 2
+\& use strict;
+\& use warnings FATAL => \*(Aqall\*(Aq;
+\& 
+\& package Innotop::Plugin::Example;
+\& # description: Adds an \*(Aqexample\*(Aq column to every table
+\& 
+\& sub new {
+\&    my ( $class, %vars ) = @_;
+\&    # Store reference to innotop\*(Aqs variables in $self
+\&    my $self = bless { %vars }, $class;
+\& 
+\&    # Design the example column
+\&    my $col = {
+\&       hdr   => \*(AqExample\*(Aq,
+\&       just  => \*(Aq\*(Aq,
+\&       dec   => 0,
+\&       num   => 1,
+\&       label => \*(AqExample\*(Aq,
+\&       src   => \*(Aqexample\*(Aq, # Get data from this column in the data source
+\&       tbl   => \*(Aq\*(Aq,
+\&       trans => [],
+\&    };
+\& 
+\&    # Add the column to every table.
+\&    my $tbl_meta = $vars{tbl_meta};
+\&    foreach my $tbl ( values %$tbl_meta ) {
+\&       # Add the column to the list of defined columns
+\&       $tbl\->{cols}\->{example} = $col;
+\&       # Add the column to the list of visible columns
+\&       unshift @{$tbl\->{visible}}, \*(Aqexample\*(Aq;
+\&    }
+\& 
+\&    # Be sure to return a reference to the object.
+\&    return $self;
+\& }
+\& 
+\& # I\*(Aqd like to be called when a data set is being rendered into a table, please.
+\& sub register_for_events {
+\&    my ( $self ) = @_;
+\&    return qw(set_to_tbl_pre_filter);
+\& }
+\& 
+\& # This method will be called when the event fires.
+\& sub set_to_tbl_pre_filter {
+\&    my ( $self, $rows, $tbl ) = @_;
+\&    # Set the example column\*(Aqs data source to the value 1.
+\&    foreach my $row ( @$rows ) {
+\&       $row\->{example} = 1;
+\&    }
+\& }
+\& 
+\& 1;
+.Ve
+.SS "Plugin Editor"
+.IX Subsection "Plugin Editor"
+The plugin editor lets you view the plugins innotop discovered and activate or
+deactivate them.  Start the editor by pressing $ to start the configuration
+editor from any mode.  Press the 'p' key to start the plugin editor.  You'll see
+a list of plugins innotop discovered.  You can use the 'j' and 'k' keys to move
+the highlight to the desired one, then press the * key to toggle it active or
+inactive.  Exit the editor and restart innotop for the changes to take effect.
+.SH "SQL STATEMENTS"
+.IX Header "SQL STATEMENTS"
+innotop uses a limited set of \s-1SQL\s0 statements to retrieve data from MySQL for
+display.  The statements are customized depending on the server version against
+which they are executed; for example, on MySQL 5 and newer, \s-1INNODB_STATUS\s0
+executes \*(L"\s-1SHOW\s0 \s-1ENGINE\s0 \s-1INNODB\s0 \s-1STATUS\s0\*(R", while on earlier versions it executes
+\&\*(L"\s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0\*(R".  The statements are as follows:
+.PP
+.Vb 12
+\& Statement           SQL executed
+\& =================== ===============================
+\& INNODB_STATUS       SHOW [ENGINE] INNODB STATUS
+\& KILL_CONNECTION     KILL
+\& KILL_QUERY          KILL QUERY
+\& OPEN_TABLES         SHOW OPEN TABLES
+\& PROCESSLIST         SHOW FULL PROCESSLIST
+\& SHOW_MASTER_LOGS    SHOW MASTER LOGS
+\& SHOW_MASTER_STATUS  SHOW MASTER STATUS
+\& SHOW_SLAVE_STATUS   SHOW SLAVE STATUS
+\& SHOW_STATUS         SHOW [GLOBAL] STATUS
+\& SHOW_VARIABLES      SHOW [GLOBAL] VARIABLES
+.Ve
+.SH "DATA SOURCES"
+.IX Header "DATA SOURCES"
+Each time innotop extracts values to create a table (see \*(L"\s-1EXPRESSIONS\s0\*(R" and
+\&\*(L"\s-1TABLES\s0\*(R"), it does so from a particular data source.  Largely because of the
+complex data extracted from \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0, this is slightly messy.  \s-1SHOW\s0
+\&\s-1INNODB\s0 \s-1STATUS\s0 contains a mixture of single values and repeated values that form
+nested data sets.
+.PP
+Whenever innotop fetches data from MySQL, it adds two extra bits to each set:
+cxn and Uptime_hires.  cxn is the name of the connection from which the data
+came.  Uptime_hires is a high-resolution version of the server's Uptime status
+variable, which is important if your \*(L"interval\*(R" setting is sub-second.
+.PP
+Here are the kinds of data sources from which data is extracted:
+.IP "\s-1STATUS_VARIABLES\s0" 4
+.IX Item "STATUS_VARIABLES"
+This is the broadest category, into which the most kinds of data fall.  It
+begins with the combination of \s-1SHOW\s0 \s-1STATUS\s0 and \s-1SHOW\s0 \s-1VARIABLES\s0, but other sources
+may be included as needed, for example, \s-1SHOW\s0 \s-1MASTER\s0 \s-1STATUS\s0 and \s-1SHOW\s0 \s-1SLAVE\s0
+\&\s-1STATUS\s0, as well as many of the non-repeated values from \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0.
+.IP "\s-1DEADLOCK_LOCKS\s0" 4
+.IX Item "DEADLOCK_LOCKS"
+This data is extracted from the transaction list in the \s-1LATEST\s0 \s-1DETECTED\s0 \s-1DEADLOCK\s0
+section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0.  It is nested two levels deep: transactions, then
+locks.
+.IP "\s-1DEADLOCK_TRANSACTIONS\s0" 4
+.IX Item "DEADLOCK_TRANSACTIONS"
+This data is from the transaction list in the \s-1LATEST\s0 \s-1DETECTED\s0 \s-1DEADLOCK\s0
+section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0.  It is nested one level deep.
+.IP "\s-1EXPLAIN\s0" 4
+.IX Item "EXPLAIN"
+This data is from the result set returned by \s-1EXPLAIN\s0.
+.IP "\s-1INNODB_TRANSACTIONS\s0" 4
+.IX Item "INNODB_TRANSACTIONS"
+This data is from the \s-1TRANSACTIONS\s0 section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0.
+.IP "\s-1IO_THREADS\s0" 4
+.IX Item "IO_THREADS"
+This data is from the list of threads in the the \s-1FILE\s0 I/O section of \s-1SHOW\s0 \s-1INNODB\s0
+\&\s-1STATUS\s0.
+.IP "\s-1INNODB_LOCKS\s0" 4
+.IX Item "INNODB_LOCKS"
+This data is from the \s-1TRANSACTIONS\s0 section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0 and is nested
+two levels deep.
+.IP "\s-1OPEN_TABLES\s0" 4
+.IX Item "OPEN_TABLES"
+This data is from \s-1SHOW\s0 \s-1OPEN\s0 \s-1TABLES\s0.
+.IP "\s-1PROCESSLIST\s0" 4
+.IX Item "PROCESSLIST"
+This data is from \s-1SHOW\s0 \s-1FULL\s0 \s-1PROCESSLIST\s0.
+.IP "\s-1OS_WAIT_ARRAY\s0" 4
+.IX Item "OS_WAIT_ARRAY"
+This data is from the \s-1SEMAPHORES\s0 section of \s-1SHOW\s0 \s-1INNODB\s0 \s-1STATUS\s0 and is nested one
+level deep.  It comes from the lines that look like this:
+.Sp
+.Vb 1
+\& \-\-Thread 1568861104 has waited at btr0cur.c line 424 ....
+.Ve
+.SH "MYSQL PRIVILEGES"
+.IX Header "MYSQL PRIVILEGES"
+.IP "\(bu" 4
+You must connect to MySQL as a user who has the \s-1SUPER\s0 privilege for many of the
+functions.
+.IP "\(bu" 4
+If you don't have the \s-1SUPER\s0 privilege, you can still run some functions, but you
+won't necessarily see all the same data.
+.IP "\(bu" 4
+You need the \s-1PROCESS\s0 privilege to see the list of currently running queries in Q
+mode.
+.IP "\(bu" 4
+You need special privileges to start and stop slave servers.
+.IP "\(bu" 4
+You need appropriate privileges to create and drop the deadlock tables if needed
+(see \*(L"\s-1SERVER\s0 \s-1CONNECTIONS\s0\*(R").
+.SH "SYSTEM REQUIREMENTS"
+.IX Header "SYSTEM REQUIREMENTS"
+You need Perl to run innotop, of course.  You also need a few Perl modules: \s-1DBI\s0,
+DBD::mysql,  Term::ReadKey, and Time::HiRes.  These should be included with most
+Perl distributions, but in case they are not, I recommend using versions
+distributed with your operating system or Perl distribution, not from \s-1CPAN\s0.
+Term::ReadKey in particular has been known to cause problems if installed from
+\&\s-1CPAN\s0.
+.PP
+If you have Term::ANSIColor, innotop will use it to format headers more readably
+and compactly.  (Under Microsoft Windows, you also need Win32::Console::ANSI for
+terminal formatting codes to be honored).  If you install Term::ReadLine,
+preferably Term::ReadLine::Gnu, you'll get nice auto-completion support.
+.PP
+I run innotop on Gentoo GNU/Linux, Debian and Ubuntu, and I've had feedback from
+people successfully running it on Red Hat, CentOS, Solaris, and Mac \s-1OSX\s0.  I
+don't see any reason why it won't work on other UNIX-ish operating systems, but
+I don't know for sure.  It also runs on Windows under ActivePerl without
+problem.
+.PP
+innotop has been used on MySQL versions 3.23.58, 4.0.27, 4.1.0, 4.1.22, 5.0.26,
+5.1.15, and 5.2.3.  If it doesn't run correctly for you, that is a bug that
+should be reported.
+.SH "FILES"
+.IX Header "FILES"
+\&\f(CW$HOMEDIR\fR/.innotop and/or /etc/innotop are used to store
+configuration information.  Files include the configuration file innotop.conf,
+the core_dump file which contains verbose error messages if \*(L"debug\*(R" is
+enabled, and the plugins/ subdirectory.
+.SH "GLOSSARY OF TERMS"
+.IX Header "GLOSSARY OF TERMS"
+.IP "tick" 4
+.IX Item "tick"
+A tick is a refresh event, when innotop re-fetches data from connections and
+displays it.
+.SH "ACKNOWLEDGEMENTS"
+.IX Header "ACKNOWLEDGEMENTS"
+The following people and organizations are acknowledged for various reasons.
+Hopefully no one has been forgotten.
+.PP
+Allen K. Smith,
+Aurimas Mikalauskas,
+Bartosz Fenski,
+Brian Miezejewski,
+Christian Hammers, 
+Cyril Scetbon,
+Dane Miller,
+David Multer,
+Dr. Frank Ullrich,
+Giuseppe Maxia,
+Google.com Site Reliability Engineers,
+Google Code,
+Jan Pieter Kunst,
+Jari Aalto,
+Jay Pipes,
+Jeremy Zawodny,
+Johan Idren,
+Kristian Kohntopp,
+Lenz Grimmer,
+Maciej Dobrzanski,
+Michiel Betel,
+MySQL \s-1AB\s0,
+Paul McCullagh,
+Sebastien Estienne,
+Sourceforge.net,
+Steven Kreuzer,
+The Gentoo MySQL Team,
+Trevor Price,
+Yaar Schnitman,
+and probably more people that have not been included.
+.PP
+(If your name has been misspelled, it's probably out of fear of putting
+international characters into this documentation; earlier versions of Perl might
+not be able to compile it then).
+.SH "COPYRIGHT, LICENSE AND WARRANTY"
+.IX Header "COPYRIGHT, LICENSE AND WARRANTY"
+This program is copyright (c) 2006 Baron Schwartz.
+Feedback and improvements are welcome.
+.PP
+\&\s-1THIS\s0 \s-1PROGRAM\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0
+\&\s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0
+\&\s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.
+.PP
+This program is free software; you can redistribute it and/or modify it under
+the terms of the \s-1GNU\s0 General Public License as published by the Free Software
+Foundation, version 2; \s-1OR\s0 the Perl Artistic License.  On \s-1UNIX\s0 and similar
+systems, you can issue `man perlgpl' or `man perlartistic' to read these
+licenses.
+.PP
+You should have received a copy of the \s-1GNU\s0 General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, \s-1MA\s0  02111\-1307  \s-1USA\s0.
+.PP
+Execute innotop and press '!' to see this information at any time.
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+Originally written by Baron Schwartz; currently maintained by Aaron Racine.
+.SH "BUGS"
+.IX Header "BUGS"
+You can report bugs, ask for improvements, and get other help and support at
+<http://code.google.com/p/innotop/>.  There are mailing lists, a source code
+browser, a bug tracker, etc.  Please use these instead of contacting the
+maintainer or author directly, as it makes our job easier and benefits others if the
+discussions are permanent and public.  Of course, if you need to contact us in
+private, please do.
index 24940f46d238797593f8e405fa53bce286cd7aab..32c317fd0757b5265767148039101d3d4ba3c285 100644 (file)
 # * IMPORTANT: Additional settings that can override those from this file!
 #   The files must end with '.cnf', otherwise they'll be ignored.
 #
+
+# You can copy this to one of:
+# - "/etc/mysql/my.cnf" to set global options,
+# - "~/.my.cnf" to set user-specific options.
+# 
+# One can use all long options that the program supports.
+# Run program with --help to get a list of available options and with
+# --print-defaults to see which it would actually understand and use.
+#
+
+# This will be passed to all mysql clients
+# It has been reported that passwords should be enclosed with ticks/quotes
+# escpecially if they contain "#" chars...
+# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
+
+# Here is entries for some specific programs
+# The following values assume you have at least 32M ram
+
 !includedir /etc/mysql/conf.d/
index 4b2177691dc6cbf5fdfd09788416784162c19cb3..61c5ec50cfbfe754e905e4d7589fb4941403ed7f 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
+# Script modified to handle the specific needs of the "wsrep" plugin
+# which enables a MySQL server to act as a node in Galera Cluster.
+# Modifications
+# Copyright (c) 2015, 2016, Codership Oy
+
 # Scripts to run by MySQL systemd service
 #
-# Needed argument: pre
+# Needed argument: pre | post
 #
 # pre mode  :  try to perform sanity check for configuration, log, data
 # post mode :  ping server until answer is received
 
+
 # Include helper functions
 . /usr/share/mysql/mysql-helpers
 
 sanity () {
+       if [ ! -r /etc/mysql/my.cnf ]; then
+                systemd-cat -t mysql -p err \
+                       echo "MySQL configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives."
+               exit 1
+       fi
+
 # Make sure database and required directories exist
        verify_ready
        verify_database
 
-
        @DEB_INIT_APPARMOR@
+}
 
-       if [ ! -r /etc/mysql/my.cnf ]; then
-               echo "MySQL configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives."
-               exit 1
-       fi
+pinger () {
+    server_up=false
+    for i in $(seq 1 30); do
+        sleep 1
+        if mysqladmin ping >/dev/null 2>&1; then
+            server_up=true
+            break
+        fi
+    done
+    clear_recover_pos
+    if [ ! $server_up ]; then
+        systemd-cat -t mysql -p err \
+            echo "MySQL server not started"
+        exit 1
+    fi
 }
 
 case $1 in
        "pre")  sanity ;;
-       "post") pinger ;;
+        "post") pinger ;;
 esac
index 15369855280d25c612b41ee39ad02604a331e42d..be2e27253e91eb7208cb0bf4fbbd6292c54712c5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 #
-# The MySQL @PRODUCTNAMEC@ Server configuration file.
+# The MySQL database server configuration file.
+#
+# You can copy this to one of:
+# - "/etc/mysql/my.cnf" to set global options,
+# - "~/.my.cnf" to set user-specific options.
+# 
+# One can use all long options that the program supports.
+# Run program with --help to get a list of available options and with
+# --print-defaults to see which it would actually understand and use.
 #
 # For explanations see
 # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
 
+#
 # * IMPORTANT: Additional settings that can override those from this file!
 #   The files must end with '.cnf', otherwise they'll be ignored.
 #
+
 !includedir /etc/mysql/conf.d/
 !includedir /etc/mysql/mysql.conf.d/
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/mysql.conf.d/mysqld.cnf b/mysql-wsrep-5.6/packaging/deb-in/extra/mysql.conf.d/mysqld.cnf
new file mode 100644 (file)
index 0000000..c5ad705
--- /dev/null
@@ -0,0 +1,100 @@
+#
+# The MySQL database server configuration file.
+#
+# You can copy this to one of:
+# - "/etc/mysql/my.cnf" to set global options,
+# - "~/.my.cnf" to set user-specific options.
+# 
+# One can use all long options that the program supports.
+# Run program with --help to get a list of available options and with
+# --print-defaults to see which it would actually understand and use.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# This will be passed to all mysql clients
+# It has been reported that passwords should be enclosed with ticks/quotes
+# escpecially if they contain "#" chars...
+# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
+
+# Here is entries for some specific programs
+# The following values assume you have at least 32M ram
+
+[mysqld]
+#
+# * Basic Settings
+#
+user           = mysql
+pid-file       = /var/run/mysqld/mysqld.pid
+socket         = /var/run/mysqld/mysqld.sock
+port           = 3306
+basedir                = /usr
+datadir                = /var/lib/mysql
+tmpdir         = /tmp
+lc-messages-dir        = /usr/share/mysql
+skip-external-locking
+#
+# Instead of skip-networking the default is now to listen only on
+# localhost which is more compatible and is not less secure.
+bind-address           = 127.0.0.1
+#
+# * Fine Tuning
+#
+key_buffer_size                = 16M
+max_allowed_packet     = 16M
+thread_stack           = 192K
+thread_cache_size       = 8
+# This replaces the startup script and checks MyISAM tables if needed
+# the first time they are touched
+myisam-recover-options  = BACKUP
+#max_connections        = 100
+#table_cache            = 64
+#thread_concurrency     = 10
+#
+# * Query Cache Configuration
+#
+query_cache_limit      = 1M
+query_cache_size        = 16M
+#
+# * Logging and Replication
+#
+# Both location gets rotated by the cronjob.
+# Be aware that this log type is a performance killer.
+# As of 5.1 you can enable the log at runtime!
+#general_log_file        = /var/log/mysql/mysql.log
+#general_log             = 1
+#
+# Error log - should be very few entries.
+#
+log_error = /var/log/mysql/error.log
+#
+# Here you can see queries with especially long duration
+#log_slow_queries      = /var/log/mysql/mysql-slow.log
+#long_query_time = 2
+#log-queries-not-using-indexes
+#
+# The following can be used as easy to replay backup logs or for replication.
+# note: if you are setting up a replication slave, see README.Debian about
+#       other settings you may need to change.
+#server-id             = 1
+#log_bin                       = /var/log/mysql/mysql-bin.log
+expire_logs_days       = 10
+max_binlog_size   = 100M
+#binlog_do_db          = include_database_name
+#binlog_ignore_db      = include_database_name
+#
+# * InnoDB
+#
+# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
+# Read the manual for more InnoDB related options. There are many!
+#
+# * Security Features
+#
+# Read the manual, too, if you want chroot!
+# chroot = /var/lib/mysql/
+#
+# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
+#
+# ssl-ca=/etc/mysql/cacert.pem
+# ssl-cert=/etc/mysql/server-cert.pem
+# ssl-key=/etc/mysql/server-key.pem
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/mysql.conf.d/mysqld_safe_syslog.cnf b/mysql-wsrep-5.6/packaging/deb-in/extra/mysql.conf.d/mysqld_safe_syslog.cnf
new file mode 100644 (file)
index 0000000..3b0445d
--- /dev/null
@@ -0,0 +1,2 @@
+[mysqld_safe]
+syslog
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/mysqlreport b/mysql-wsrep-5.6/packaging/deb-in/extra/mysqlreport
new file mode 100644 (file)
index 0000000..402a5be
--- /dev/null
@@ -0,0 +1,1298 @@
+#!/usr/bin/perl -w
+
+# mysqlreport v3.5 Apr 16 2008
+# http://hackmysql.com/mysqlreport
+
+# mysqlreport makes an easy-to-read report of important MySQL status values.
+# Copyright 2006-2008 Daniel Nichter
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# The GNU General Public License is available at:
+# http://www.gnu.org/copyleft/gpl.html
+
+use strict;
+use File::Temp qw(tempfile);
+use DBI;
+use Getopt::Long;
+eval { require Term::ReadKey; };
+my $RK = ($@ ? 0 : 1);
+
+sub have_op;
+
+my $WIN = ($^O eq 'MSWin32' ? 1 : 0);
+my %op;
+my %mycnf; # ~/.my.cnf
+my ($tmpfile_fh, $tmpfile);
+my ($stat_name, $stat_val, $stat_label);
+my $MySQL_version;
+my (%stats, %vars); # SHOW STATUS, SHOW VARIABLES
+my (%DMS_vals, %Com_vals, %ib_vals);
+my ($dbh, $query);
+my ($questions, $key_read_ratio, $key_write_ratio, $dms, $slow_query_t);
+my ($key_cache_block_size, $key_buffer_used, $key_buffer_usage);
+my ($qc_mem_used, $qc_hi_r, $qc_ip_r); # Query Cache
+my $have_innodb_vals;
+my ($ib_bp_used, $ib_bp_total, $ib_bp_read_ratio);
+my ($relative_live, $relative_infiles);
+my $real_uptime;
+my (%stats_present, %stats_past); # For relative reports
+      
+GetOptions (
+   \%op,
+   "user=s",
+   "password:s",
+   "host=s",
+   "port=s",
+   "socket=s",
+   "no-mycnf",
+   "infile|in=s",
+   "outfile=s",
+   "flush-status",
+   "email=s",
+   "r|relative:i",
+   "c|report-count=i",
+   "detach",
+   "help|?",
+   "debug"
+);
+
+show_help_and_exit() if $op{'help'};
+
+get_user_mycnf() unless $op{'no-mycnf'};
+
+# Command line options override ~/.my.cnf
+$mycnf{'host'}   = $op{'host'}   if have_op 'host';
+$mycnf{'port'}   = $op{'port'}   if have_op 'port';
+$mycnf{'socket'} = $op{'socket'} if have_op 'socket'; 
+$mycnf{'user'}   = $op{'user'}   if have_op 'user';
+
+$mycnf{'user'} ||= $ENV{'USER'};
+
+if(exists $op{'password'})
+{
+   if($op{'password'} eq '') # Prompt for password
+   {
+      Term::ReadKey::ReadMode(2) if $RK;
+      print "Password for database user $mycnf{'user'}: ";
+      chomp($mycnf{'pass'} = <STDIN>);
+      Term::ReadKey::ReadMode(0), print "\n" if $RK;
+   }
+   else { $mycnf{'pass'} = $op{'password'}; } # Use password given on command line
+}
+
+$op{'com'} ||= 3;
+$op{'c'}   ||= 1; # Used in collect_reports() if --r given integer value
+
+$relative_live    = 0;
+$relative_infiles = 0;
+
+if(defined $op{'r'})
+{
+   if($op{r}) { $relative_live    = 1; }  # if -r was given an integer value
+   else       { $relative_infiles = 1; }
+}
+
+# The report is written to a tmp file first.
+# Later it will be moved to $op{'outfile'} or emailed $op{'email'} if needed.
+($tmpfile_fh, $tmpfile) = tempfile() or die "Cannot open temporary file for writing: $!\n";
+
+if($op{'detach'})
+{
+   $SIG{'TERM'} = 'sig_handler';
+
+   if(fork())
+   {
+      print "mysqlreport has forked and detached.\n";
+      print "While running detached, mysqlreport writes reports to '$tmpfile'.\n";
+
+      exit;
+   }
+
+   open(STDIN, "</dev/null");
+   open(STDOUT, "> $tmpfile") or die "Cannot dup STDOUT: $!\n";
+   open(STDERR, "> $tmpfile") or die "Cannot dup STDERR: $!\n";
+}
+
+select $tmpfile_fh;
+$| = 1 if ($op{'detach'} || $relative_live);
+
+print "tmp file: $tmpfile\n" if $op{debug};
+
+# Connect to MySQL
+if(!$op{'infile'} && !$relative_infiles)
+{
+   connect_to_MySQL();
+}
+
+$have_innodb_vals = 1; # This might be set to 0 later in get_MySQL_version()
+
+if(defined $op{'r'})
+{
+   if($relative_live)
+   { 
+      print STDERR "mysqlreport is writing relative reports to '$tmpfile'.\n" unless $op{'detach'}; 
+      get_MySQL_version();
+      collect_reports();
+   }
+
+   if($relative_infiles) { read_relative_infiles(); }
+}
+else
+{
+   if(!$op{'infile'})
+   {
+      get_MySQL_version();
+      get_vals();
+      get_vars();
+   }
+   else
+   {
+      read_infile($op{'infile'});
+   }
+
+   get_Com_values();
+
+   set_myisam_vals();
+   set_ib_vals() if $have_innodb_vals;
+
+   write_report();
+}
+
+exit_tasks_and_cleanup();
+
+exit;
+
+#
+# Subroutines
+#
+sub show_help_and_exit
+{
+   print <<"HELP";
+mysqlreport v3.5 Apr 16 2008
+mysqlreport makes an easy-to-read report of important MySQL status values.
+
+Command line options (abbreviations work):
+   --user USER       Connect to MySQL as USER
+   --password PASS   Use PASS or prompt for MySQL user's password
+   --host ADDRESS    Connect to MySQL at ADDRESS
+   --port PORT       Connect to MySQL at PORT
+   --socket SOCKET   Connect to MySQL at SOCKET
+   --no-mycnf        Don't read ~/.my.cnf
+   --infile FILE     Read status values from FILE instead of MySQL
+   --outfile FILE    Write report to FILE
+   --email ADDRESS   Email report to ADDRESS (doesn't work on Windows)
+   --flush-status    Issue FLUSH STATUS; after getting current values
+   --relative X      Generate relative reports. If X is an integer,
+                     reports are live from the MySQL server X seconds apart.
+                     If X is a list of infiles (file1 file2 etc.),
+                     reports are generated from the infiles in the order
+                     that they are given.
+   --report-count N  Collect N number of live relative reports (default 1)
+   --detach          Fork and detach from terminal (run in background)
+   --help            Prints this
+   --debug           Print debugging information
+
+Visit http://hackmysql.com/mysqlreport for more information.
+HELP
+
+   exit;
+}
+
+sub get_user_mycnf
+{
+   print "get_user_mycnf\n" if $op{debug};
+
+   return if $WIN;
+   open MYCNF, "$ENV{HOME}/.my.cnf" or return;
+   while(<MYCNF>)
+   {
+      if(/^(.+?)\s*=\s*"?(.+?)"?\s*$/)
+      {
+         $mycnf{$1} = $2;
+         print "get_user_mycnf: read '$1 = $2'\n" if $op{debug};
+      }
+   }
+   $mycnf{'pass'} ||= $mycnf{'password'} if exists $mycnf{'password'};
+   close MYCNF;
+}
+
+sub connect_to_MySQL
+{
+   print "connect_to_MySQL\n" if $op{debug};
+
+   my $dsn;
+
+   if($mycnf{'socket'} && -S $mycnf{'socket'})
+   {
+      $dsn = "DBI:mysql:mysql_socket=$mycnf{socket}";
+   }
+   elsif($mycnf{'host'})
+   {
+      $dsn = "DBI:mysql:host=$mycnf{host}" . ($mycnf{port} ? ";port=$mycnf{port}" : "");
+   }
+   else
+   {
+      $dsn = "DBI:mysql:host=localhost";
+   }
+
+   print "connect_to_MySQL: DBI DSN: $dsn\n" if $op{debug};
+
+   $dbh = DBI->connect($dsn, $mycnf{'user'}, $mycnf{'pass'}) or die;
+}
+
+sub collect_reports
+{
+   print "collect_reports\n" if $op{debug};
+
+   my $i;
+
+   get_vals();
+   get_vars();
+
+   get_Com_values();
+
+   %stats_past = %stats;
+
+   set_myisam_vals();
+   set_ib_vals() if $have_innodb_vals;
+
+   print "#\n# Beginning report, 0 0:0:0\n#\n";
+
+   write_report();
+
+   for($i = 0; $i < $op{'c'}; $i++)
+   {
+      $dbh->disconnect();
+
+      sleep($op{'r'});
+
+      connect_to_MySQL();
+
+      print "\n#\n# Interval report " , $i + 1 , ", +", sec_to_dhms(($i + 1) * $op{'r'}), "\n#\n";
+
+      get_vals();
+
+      write_relative_report();
+   }
+}
+
+sub read_relative_infiles
+{
+   print "read_relative_infiles\n" if $op{debug};
+
+   my $slurp;    # Used to check infiles for multiple sets of status values
+   my $n_stats;  # Number of multiple sets of status values in an infile
+   my $infile;
+   my $report_n; # Report number
+
+   $report_n = 1;
+
+   foreach $infile (@ARGV)
+   {
+      # Read all of infile into $slurp
+      open INFILE, "< $infile" or warn and next;
+      $slurp = do { local $/;  <INFILE> };
+      close INFILE;
+
+      $n_stats = 0;
+
+      # Count number of status value sets
+      $n_stats++ while $slurp =~ /Aborted_clients/g;
+
+      print "read_relative_infiles: found $n_stats sets of status values in file '$infile'\n"
+         if $op{debug};
+
+      if($n_stats == 1)
+      {
+         read_infile($infile);
+         relative_infile_report($report_n++);
+      }
+
+      if($n_stats > 1)
+      {
+         my @tmpfile_fh;
+         my @tmpfile_name;
+         my $i;
+         my $stat_n;  # Status value set number
+
+         # Create a tmp file for each set of status values
+         for($i = 0; $i < $n_stats; $i++)
+         {
+            my ($fh, $name) = tempfile()
+               or die "read_relative_infiles: cannot open temporary file for writing: $!\n";
+
+            push(@tmpfile_fh, $fh);
+            push(@tmpfile_name, $name);
+
+            print "read_relative_infiles: created tmp file '$name' for set $i\n" if $op{debug};
+         }
+
+         $i = 0;
+         $stat_n = 0;
+
+         select $tmpfile_fh[$i];
+
+         # Read infile again and copy each set of status values to seperate tmp files
+         open INFILE, "< $infile" or warn and next;
+         while(<INFILE>)
+         {
+            next if /^\+/;
+            next if /^$/;
+
+            # The infile must begin with the system variable values.
+            # Therefore, the first occurance of Aborted_clients indicates the beginning
+            # of the first set of status values if no sets have occured yet ($stat_n == 0).
+            # In this case, the following status values are printed to the current fh,
+            # along with the system variable values read thus far, until Aborted_clients
+            # occurs again. Then begins the second and subsequent sets of status values.
+
+            if(/Aborted_clients/)
+            {
+               print and next if $stat_n++ == 0;
+               select $tmpfile_fh[++$i];
+            }
+
+            print;
+         }
+         close INFILE;
+
+         # Re-select the main tmp file into which the reports are being written.
+         select $tmpfile_fh;
+
+         for($i = 0; $i < $n_stats; $i++)
+         {
+            close $tmpfile_fh[$i];
+
+            print "read_relative_infiles: reading set $i tmp file '$tmpfile_name[$i]'\n"
+               if $op{debug};
+
+            read_infile($tmpfile_name[$i]);
+            relative_infile_report($report_n++);
+
+            if($WIN) { `del $tmpfile_name[$i]`;   }
+            else     { `rm -f $tmpfile_name[$i]`; }
+
+            print "read_relative_infiles: deleted set $i tmp file '$tmpfile_name[$i]'\n"
+               if $op{debug};
+         }
+
+      } # if($n_stats > 1)
+   } # foreach $infile (@files)
+}
+
+sub relative_infile_report
+{
+   print "relative_infile_report\n" if $op{debug};
+
+   my $report_n = shift;
+
+   if($report_n == 1)
+   {
+      get_Com_values();
+
+      %stats_past = %stats;
+
+      set_myisam_vals();
+      set_ib_vals() if $have_innodb_vals;
+
+      print "#\n# Beginning report, 0 0:0:0\n#\n";
+
+      write_report();
+   }
+   else
+   {
+      print "\n#\n# Interval report ", $report_n - 1, ", +",
+         sec_to_dhms($stats{Uptime} - $stats_past{Uptime}),
+         "\n#\n";
+
+      write_relative_report();
+   }
+}
+
+sub get_vals
+{
+   print "get_vals\n" if $op{debug};
+
+   my @row;
+
+   # Get status values
+   if($MySQL_version >= 50002)
+   {
+      $query = $dbh->prepare("SHOW GLOBAL STATUS;");
+   }
+   else
+   {
+      $query = $dbh->prepare("SHOW STATUS;");
+   }
+   $query->execute();
+   while(@row = $query->fetchrow_array()) { $stats{$row[0]} = $row[1]; }
+
+   $real_uptime = $stats{'Uptime'};
+}
+
+sub get_vars
+{
+   print "get_vars\n" if $op{debug};
+
+   my @row;
+
+   # Get server system variables
+   $query = $dbh->prepare("SHOW VARIABLES;");
+   $query->execute();
+   while(@row = $query->fetchrow_array()) { $vars{$row[0]} = $row[1]; }
+
+   # table_cache was renamed to table_open_cache in MySQL 5.1.3
+   if($MySQL_version >= 50103)
+   {
+      $vars{'table_cache'} = $vars{'table_open_cache'};
+   }
+}
+
+sub read_infile
+{
+   print "read_infile\n" if $op{debug};
+
+   my $infile = shift;
+
+   # Default required system variable values if not set in INFILE.
+   # As of mysqlreport v3.5 the direct output from SHOW VARIABLES;
+   # can be put into INFILE instead. See http://hackmysql.com/mysqlreportdoc
+   # for details.
+   $vars{'version'} = "0.0.0"         if !exists $vars{'version'};
+   $vars{'table_cache'} = 64          if !exists $vars{'table_cache'};
+   $vars{'max_connections'} = 100     if !exists $vars{'max_connections'};
+   $vars{'key_buffer_size'} = 8388600 if !exists $vars{'key_buffer_size'}; # 8M
+   $vars{'thread_cache_size'} = 0     if !exists $vars{'thread_cache_size'}; 
+   $vars{'tmp_table_size'} = 0        if !exists $vars{'tmp_table_size'};
+   $vars{'long_query_time'} = '?'     if !exists $vars{'long_query_time'};
+   $vars{'log_slow_queries'} = '?'    if !exists $vars{'log_slow_queries'};
+
+   # One should also add:
+   #    key_cache_block_size
+   #    query_cache_size
+   # to INFILE if needed.
+
+   open INFILE, "< $infile" or die "Cannot open INFILE '$infile': $!\n";
+
+   while(<INFILE>)
+   {
+      last if !defined $_;
+
+      next if /^\+/;  # skip divider lines 
+      next if /^$/;   # skip blank lines
+
+      next until /(Aborted_clients|back_log|=)/;
+
+      if($1 eq 'Aborted_clients')  # status values
+      {
+         print "read_infile: start stats\n" if $op{debug};
+
+         while($_)
+         {
+            chomp;
+            if(/([A-Za-z_]+)[\s\t|]+(\d+)/)
+            {
+               $stats{$1} = $2;
+               print "read_infile: save $1 = $2\n" if $op{debug};
+            }
+            else { print "read_infile: ignore '$_'\n" if $op{debug}; }
+
+            last if $1 eq 'Uptime';  # exit while() if end of status values
+            $_ = <INFILE>; # otherwise, read next line of status values
+         }
+      }
+      elsif($1 eq  'back_log')  # system variable values
+      {
+         print "read_infile: start vars\n" if $op{debug};
+
+         while($_)
+         {
+            chomp;
+            if(/([A-Za-z_]+)[\s\t|]+([\w\.\-]+)/)  # This will exclude some vars
+            {                                      # like pid_file which we don't need
+               $vars{$1} = $2;
+               print "read_infile: save $1 = $2\n" if $op{debug};
+            }
+            else { print "read_infile: ignore '$_'\n" if $op{debug}; }
+
+            last if $1 eq 'wait_timeout';  # exit while() if end of vars
+            $_ = <INFILE>; # otherwise, read next line of vars
+         }
+      }
+      elsif($1 eq '=')  # old style, manually added system variable values
+      {
+         print "read_infile: start old vars\n" if $op{debug};
+
+         while($_ && $_ =~ /=/)
+         {
+            chomp;
+            if(/^\s*(\w+)\s*=\s*([0-9.]+)(M*)\s*$/)  # e.g.: key_buffer_size = 128M
+            {
+               $vars{$1} = ($3 ? $2 * 1024 * 1024 : $2);
+               print "read_infile: read '$_' as $1 = $vars{$1}\n" if $op{debug};
+            }
+            else { print "read_infile: ignore '$_'\n" if $op{debug}; }
+
+            $_ = <INFILE>; # otherwise, read next line of old vars
+         }
+
+         redo;
+      }
+      else
+      {
+         print "read_infile: unrecognized line: '$_'\n" if $op{debug};
+      }
+   }
+
+   close INFILE;
+
+   $real_uptime = $stats{'Uptime'};
+
+   $vars{'table_cache'} = $vars{'table_open_cache'} if exists $vars{'table_open_cache'};
+
+   get_MySQL_version();
+}
+
+sub get_MySQL_version
+{
+   print "get_MySQL_version\n" if $op{debug};
+
+   return if $MySQL_version;
+
+   my ($major, $minor, $patch);
+
+   if($op{'infile'} || $relative_infiles)
+   {
+      ($major, $minor, $patch) = ($vars{'version'} =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
+   }
+   else
+   {
+      my @row;
+
+      $query = $dbh->prepare("SHOW VARIABLES LIKE 'version';");
+      $query->execute();
+      @row = $query->fetchrow_array();
+      ($major, $minor, $patch) = ($row[1] =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
+   }
+
+   $MySQL_version = sprintf("%d%02d%02d", $major, $minor, $patch);
+
+   # Innodb_ status values were added in 5.0.2
+   if($MySQL_version < 50002)
+   {
+      $have_innodb_vals = 0;
+      print "get_MySQL_version: no InnoDB reports because MySQL version is older than 5.0.2\n" if $op{debug};
+   }
+}
+
+sub set_myisam_vals
+{
+   print "set_myisam_vals\n" if $op{debug};
+
+   $questions = $stats{'Questions'};
+
+   $key_read_ratio = sprintf "%.2f",
+                     ($stats{'Key_read_requests'} ?
+                      100 - ($stats{'Key_reads'} / $stats{'Key_read_requests'}) * 100 :
+                      0);
+
+   $key_write_ratio = sprintf "%.2f",
+                      ($stats{'Key_write_requests'} ?
+                       100 - ($stats{'Key_writes'} / $stats{'Key_write_requests'}) * 100 :
+                       0);
+
+   $key_cache_block_size = (defined $vars{'key_cache_block_size'} ?
+                            $vars{'key_cache_block_size'} :
+                            1024);
+
+   $key_buffer_used = $stats{'Key_blocks_used'} * $key_cache_block_size;
+
+   if(defined $stats{'Key_blocks_unused'}) # MySQL 4.1.2+
+   {
+      $key_buffer_usage =  $vars{'key_buffer_size'} -
+                           ($stats{'Key_blocks_unused'} * $key_cache_block_size);
+   }
+   else { $key_buffer_usage = -1; }
+
+   # Data Manipulation Statements: http://dev.mysql.com/doc/refman/5.0/en/data-manipulation.html
+   %DMS_vals =
+   (
+      SELECT  => $stats{'Com_select'},
+      INSERT  => $stats{'Com_insert'}  + $stats{'Com_insert_select'},
+      REPLACE => $stats{'Com_replace'} + $stats{'Com_replace_select'},
+      UPDATE  => $stats{'Com_update'}  +
+                 (exists $stats{'Com_update_multi'} ? $stats{'Com_update_multi'} : 0),
+      DELETE  => $stats{'Com_delete'}  +
+                 (exists $stats{'Com_delete_multi'} ? $stats{'Com_delete_multi'} : 0)
+   );
+
+   $dms = $DMS_vals{SELECT} + $DMS_vals{INSERT} + $DMS_vals{REPLACE} + $DMS_vals{UPDATE} + $DMS_vals{DELETE};
+
+   $slow_query_t = format_u_time($vars{long_query_time});
+
+}
+
+sub set_ib_vals
+{
+   print "set_ib_vals\n" if $op{debug};
+
+   $ib_bp_used  = ($stats{'Innodb_buffer_pool_pages_total'} -
+                   $stats{'Innodb_buffer_pool_pages_free'}) *
+                   $stats{'Innodb_page_size'};
+
+   $ib_bp_total = $stats{'Innodb_buffer_pool_pages_total'} * $stats{'Innodb_page_size'};
+
+   $ib_bp_read_ratio = sprintf "%.2f",
+                       ($stats{'Innodb_buffer_pool_read_requests'} ?
+                        100 - ($stats{'Innodb_buffer_pool_reads'} /
+                           $stats{'Innodb_buffer_pool_read_requests'}) * 100 :
+                        0);
+}
+
+sub write_relative_report
+{
+   print "write_relative_report\n" if $op{debug};
+
+   %stats_present = %stats;
+
+   for(keys %stats)
+   {
+      if($stats_past{$_} =~ /\d+/)
+      {
+         if($stats_present{$_} >= $stats_past{$_}) # Avoid negative values
+         {
+            $stats{$_} = $stats_present{$_} - $stats_past{$_};
+         }
+      }
+   }
+
+   # These values are either "at present" or "high water marks".
+   # Therefore, it is more logical to not relativize these values.
+   # Doing otherwise causes strange and misleading values.
+   $stats{'Key_blocks_used'}      = $stats_present{'Key_blocks_used'};
+   $stats{'Open_tables'}          = $stats_present{'Open_tables'};
+   $stats{'Max_used_connections'} = $stats_present{'Max_used_connections'};
+   $stats{'Threads_running'}      = $stats_present{'Threads_running'};
+   $stats{'Threads_connected'}    = $stats_present{'Threads_connected'};
+   $stats{'Threads_cached'}       = $stats_present{'Threads_cached'};
+   $stats{'Qcache_free_blocks'}   = $stats_present{'Qcache_free_blocks'};
+   $stats{'Qcache_total_blocks'}  = $stats_present{'Qcache_total_blocks'};
+   $stats{'Qcache_free_memory'}   = $stats_present{'Qcache_free_memory'};
+   if($have_innodb_vals)
+   {
+      $stats{'Innodb_page_size'}                 = $stats_present{'Innodb_page_size'};
+      $stats{'Innodb_buffer_pool_pages_data'}    = $stats_present{'Innodb_buffer_pool_pages_data'};
+      $stats{'Innodb_buffer_pool_pages_dirty'}   = $stats_present{'Innodb_buffer_pool_pages_dirty'};
+      $stats{'Innodb_buffer_pool_pages_free'}    = $stats_present{'Innodb_buffer_pool_pages_free'};
+      $stats{'Innodb_buffer_pool_pages_latched'} = $stats_present{'Innodb_buffer_pool_pages_latched'};
+      $stats{'Innodb_buffer_pool_pages_misc'}    = $stats_present{'Innodb_buffer_pool_pages_misc'};
+      $stats{'Innodb_buffer_pool_pages_total'}   = $stats_present{'Innodb_buffer_pool_pages_total'};
+      $stats{'Innodb_data_pending_fsyncs'}       = $stats_present{'Innodb_data_pending_fsyncs'};
+      $stats{'Innodb_data_pending_reads'}        = $stats_present{'Innodb_data_pending_reads'};
+      $stats{'Innodb_data_pending_writes'}       = $stats_present{'Innodb_data_pending_writes'};
+
+      # Innodb_row_lock_ values were added in MySQL 5.0.3
+      if($MySQL_version >= 50003)
+      {
+         $stats{'Innodb_row_lock_current_waits'} = $stats_present{'Innodb_row_lock_current_waits'};
+         $stats{'Innodb_row_lock_time_avg'}      = $stats_present{'Innodb_row_lock_time_avg'};
+         $stats{'Innodb_row_lock_time_max'}      = $stats_present{'Innodb_row_lock_time_max'};
+      }
+   }
+
+   get_Com_values();
+
+   %stats_past = %stats_present;
+
+   set_myisam_vals();
+   set_ib_vals() if $have_innodb_vals;
+
+   write_report();
+}
+
+sub write_report
+{
+   print "write_report\n" if $op{debug};
+
+   $~ = 'MYSQL_TIME', write;
+   $~ = 'KEY_BUFF_MAX', write;
+   if($key_buffer_usage != -1) { $~ = 'KEY_BUFF_USAGE', write }
+   $~ = 'KEY_RATIOS', write;
+   write_DTQ();
+   $~ = 'SLOW_DMS', write;
+   write_DMS();
+   write_Com();
+   $~ = 'SAS', write; 
+   write_qcache(); 
+   $~ = 'REPORT_END', write;
+   $~ = 'TAB', write;
+
+   write_InnoDB() if $have_innodb_vals;
+}
+
+sub sec_to_dhms # Seconds to days hours:minutes:seconds
+{
+   my $s = shift;
+   my ($d, $h, $m) = (0, 0, 0);
+
+   return '0 0:0:0' if $s <= 0;
+
+   if($s >= 86400)
+   {
+      $d = int $s / 86400;
+      $s -= $d * 86400;
+   }
+
+   if($s >= 3600)
+   {
+     $h = int $s / 3600;
+     $s -= $h * 3600;
+   }
+   
+   $m = int $s / 60;
+   $s -= $m * 60;
+   
+   return "$d $h:$m:$s";
+}
+
+sub make_short
+{
+   my ($number, $kb, $d) = @_;
+   my $n = 0;
+   my $short;
+
+   $d ||= 2;
+
+   if($kb) { while ($number > 1023) { $number /= 1024; $n++; }; }
+   else { while ($number > 999) { $number /= 1000; $n++; }; }
+
+   $short = sprintf "%.${d}f%s", $number, ('','k','M','G','T')[$n];
+   if($short =~ /^(.+)\.(00)$/) { return $1; } # 12.00 -> 12 but not 12.00k -> 12k
+
+   return $short;
+}
+
+# What began as a simple but great idea has become the new standard:
+# long_query_time in microseconds. For MySQL 5.1.21+ and 6.0.4+ this
+# is now standard. For 4.1 and 5.0 patches, the architects of this
+# idea provide: http://www.mysqlperformanceblog.com/mysql-patches/
+# Relevant notes in MySQL manual:
+# http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html
+# http://dev.mysql.com/doc/refman/6.0/en/slow-query-log.html
+#
+# The format_u_time sub simply beautifies long_query_time.
+
+sub format_u_time  # format microsecond (µ) time value
+{
+   # 0.000000 - 0.000999 = 0 - 999 µ
+   # 0.001000 - 0.999999 = 1 ms - 999.999 ms
+   # 1.000000 - n.nnnnnn = 1 s - n.nnnnn s
+
+   my $t = shift;
+   my $f;  # formatted µ time
+   my $u = chr(($WIN ? 230 : 181));
+
+   $t = 0 if $t < 0;
+
+   if($t > 0 && $t <= 0.000999)
+   {
+      $f = ($t * 1000000) . " $u";
+   }
+   elsif($t >= 0.001000 && $t <= 0.999999)
+   {
+      $f = ($t * 1000) . ' ms';
+   }
+   elsif($t >= 1)
+   {
+      $f = ($t * 1) . ' s';  # * 1 to remove insignificant zeros
+   }
+   else
+   {
+      $f = 0;  # $t should = 0 at this point
+   }
+
+   return $f;
+}
+
+sub perc # Percentage
+{
+   my($is, $of) = @_;
+   $is = 0 if (not defined $is);
+   return sprintf "%.2f", ($is * 100) / ($of ||= 1);
+}
+
+sub t # Time average per second
+{
+   my $val = shift;
+   return 0 if !$val;
+   return(make_short($val / $stats{'Uptime'}, 0, 1));
+}
+
+sub email_report # Email given report to $op{'email'}
+{
+   print "email_report\n" if $op{debug};
+
+   return if $WIN;
+
+   my $report = shift;
+
+   open SENDMAIL, "|/usr/sbin/sendmail -t";
+   print SENDMAIL "From: mysqlreport\n";
+   print SENDMAIL "To: $op{email}\n";
+   print SENDMAIL "Subject: MySQL status report on " . ($mycnf{'host'} || 'localhost') . "\n\n";
+   print SENDMAIL `cat $report`;
+   close SENDMAIL;
+}
+
+sub cat_report # Print given report to screen
+{
+   print "cat_report\n" if $op{debug};
+
+   my $report = shift;
+   my @report;
+
+   open REPORT, "< $report";
+   @report = <REPORT>;
+   close REPORT;
+   print @report;
+}
+
+sub get_Com_values
+{
+   print "get_Com_values\n" if $op{debug};
+
+   %Com_vals = ();
+
+   # Make copy of just the Com_ values
+   for(keys %stats)
+   {
+      if(grep /^Com_/, $_ and $stats{$_} > 0)
+      {
+         /^Com_(.*)/;
+         $Com_vals{$1} = $stats{$_};
+      }
+   }
+
+   # Remove DMS values
+   delete $Com_vals{'select'};
+   delete $Com_vals{'insert'};
+   delete $Com_vals{'insert_select'};
+   delete $Com_vals{'replace'};
+   delete $Com_vals{'replace_select'};
+   delete $Com_vals{'update'};
+   delete $Com_vals{'update_multi'} if exists $Com_vals{'update_multi'};
+   delete $Com_vals{'delete'};
+   delete $Com_vals{'delete_multi'} if exists $Com_vals{'delete_multi'};
+}
+
+sub write_DTQ # Write DTQ report in descending order by values
+{
+   print "write_DTQ\n" if $op{debug};
+
+   $~ = 'DTQ';
+
+   my %DTQ;
+   my $first = 1;
+
+   # Total Com values
+   $stat_val = 0;
+   for(values %Com_vals) { $stat_val += $_; }
+   $DTQ{'Com_'} = $stat_val;
+
+   $DTQ{'DMS'}      = $dms;
+   $DTQ{'QC Hits'}  = $stats{'Qcache_hits'} if $stats{'Qcache_hits'} != 0;
+   $DTQ{'COM_QUIT'} = int (($stats{'Connections'} - 2) - ($stats{'Aborted_clients'} / 2));
+
+   $stat_val = 0;
+   for(values %DTQ) { $stat_val += $_; }
+   if($questions != $stat_val)
+   {
+      $DTQ{($questions > $stat_val ? '+Unknown' : '-Unknown')} = abs $questions - $stat_val;
+   }
+
+   for(sort { $DTQ{$b} <=> $DTQ{$a} } keys(%DTQ))
+   {
+      if($first) { $stat_label = '%Total:'; $first = 0; }
+      else       { $stat_label = ''; }
+
+      $stat_name = $_;
+      $stat_val  = $DTQ{$_};
+      write;
+   }
+}
+
+sub write_DMS # Write DMS report in descending order by values
+{
+   print "write_DMS\n" if $op{debug};
+
+   $~ = 'DMS';
+
+   for(sort { $DMS_vals{$b} <=> $DMS_vals{$a} } keys(%DMS_vals))
+   {
+      $stat_name = $_;
+      $stat_val  = $DMS_vals{$_};
+      write;
+   }
+}
+
+sub write_Com # Write COM report in descending order by values
+{
+   print "write_Com\n" if $op{debug};
+
+   my $i = $op{'com'};
+
+   $~ = 'COM_1';
+
+   # Total Com values and write first line of COM report
+   $stat_label = '%Total:' unless $op{'dtq'};
+   $stat_val   = 0;
+   for(values %Com_vals) { $stat_val += $_; }
+   write;
+
+   $~ = 'COM_2';
+
+   # Sort remaining Com values, print only the top $op{'com'} number of values
+   for(sort { $Com_vals{$b} <=> $Com_vals{$a} } keys(%Com_vals))
+   {
+      $stat_name = $_;
+      $stat_val  = $Com_vals{$_};
+      write;
+
+      last if !(--$i);
+   }
+}
+
+sub write_qcache
+{
+   print "write_qcache\n" if $op{debug};
+
+   # Query cache was added in 4.0.1, but have_query_cache was added in 4.0.2,
+   # ergo this method is slightly more reliable
+   return if not exists $vars{'query_cache_size'};
+   return if $vars{'query_cache_size'} == 0;
+
+   $qc_mem_used = $vars{'query_cache_size'} - $stats{'Qcache_free_memory'};
+   $qc_hi_r = sprintf "%.2f", $stats{'Qcache_hits'} / ($stats{'Qcache_inserts'} ||= 1);
+   $qc_ip_r = sprintf "%.2f", $stats{'Qcache_inserts'} / ($stats{'Qcache_lowmem_prunes'} ||= 1);
+
+   $~ = 'QCACHE';
+   write;
+}
+
+sub write_InnoDB
+{
+   print "write_InnoDB\n" if $op{debug};
+
+   return if not defined $stats{'Innodb_page_size'};
+
+   $stats{'Innodb_buffer_pool_pages_latched'} = 0 if not defined $stats{'Innodb_buffer_pool_pages_latched'};
+
+   $~ = 'IB';
+   write;
+
+   # Innodb_row_lock_ values were added in MySQL 5.0.3
+   if($MySQL_version >= 50003)
+   {
+      $~ = 'IB_LOCK';
+      write;
+   }
+
+   # Data, Pages, Rows
+   $~ = 'IB_DPR';
+   write;
+}
+
+sub have_op
+{
+   my $key = shift;
+   return 1 if (exists $op{$key} && $op{$key} ne '');
+   return 0;
+}
+
+sub sig_handler
+{
+   print "\nReceived signal at " , scalar localtime , "\n";
+   exit_tasks_and_cleanup();
+   exit;
+}
+
+sub exit_tasks_and_cleanup
+{
+   print "exit_tasks_and_cleanup\n" if $op{debug};
+
+   close $tmpfile_fh;
+   select STDOUT unless $op{'detach'};
+
+   email_report($tmpfile) if $op{'email'};
+
+   cat_report($tmpfile) unless $op{'detach'};
+
+   if($op{'outfile'})
+   {
+      if($WIN) { `move $tmpfile $op{outfile}`; }
+      else     { `mv $tmpfile $op{outfile}`;   }
+   }
+   else
+   {
+      if($WIN) { `del $tmpfile`;   }
+      else     { `rm -f $tmpfile`; }
+   }
+
+   if(!$op{'infile'} && !$relative_infiles)
+   {
+      if($op{'flush-status'})
+      {
+         $query = $dbh->prepare("FLUSH STATUS;");
+         $query->execute();
+      }
+
+      $query->finish();
+      $dbh->disconnect();
+   }
+}
+
+#
+# Formats
+#
+
+format MYSQL_TIME =
+MySQL @<<<<<<<<<<<<<<<<  uptime @<<<<<<<<<<<   @>>>>>>>>>>>>>>>>>>>>>>>>
+$vars{'version'}, sec_to_dhms($real_uptime), (($op{infile} || $relative_infiles) ? '' : scalar localtime)
+.
+
+format KEY_BUFF_MAX =
+
+__ Key _________________________________________________________________
+Buffer used   @>>>>>> of @>>>>>>  %Used: @>>>>>
+make_short($key_buffer_used, 1), make_short($vars{'key_buffer_size'}, 1), perc($key_buffer_used, $vars{'key_buffer_size'})
+.
+
+format KEY_BUFF_USAGE =
+  Current     @>>>>>>            %Usage: @>>>>>
+make_short($key_buffer_usage, 1), perc($key_buffer_usage, $vars{'key_buffer_size'})
+.
+
+format KEY_RATIOS =
+Write hit     @>>>>>%
+$key_write_ratio
+Read hit      @>>>>>%
+$key_read_ratio
+
+__ Questions ___________________________________________________________
+Total       @>>>>>>>>  @>>>>>/s
+make_short($questions), t($questions)
+.
+
+format DTQ =
+  @<<<<<<<  @>>>>>>>>  @>>>>>/s  @>>>>>> @>>>>>
+$stat_name, make_short($stat_val), t($stat_val), $stat_label, perc($stat_val, $questions)
+.
+
+format SLOW_DMS =
+Slow @<<<<<<< @>>>>>>  @>>>>>/s          @>>>>>  %DMS: @>>>>>  Log: @>> 
+$slow_query_t, make_short($stats{'Slow_queries'}), t($stats{'Slow_queries'}), perc($stats{'Slow_queries'}, $questions), perc($stats{'Slow_queries'}, $dms), $vars{'log_slow_queries'}
+DMS         @>>>>>>>>  @>>>>>/s          @>>>>>
+make_short($dms), t($dms), perc($dms, $questions)
+.
+
+format DMS =
+  @<<<<<<<  @>>>>>>>>  @>>>>>/s          @>>>>>        @>>>>>
+$stat_name, make_short($stat_val), t($stat_val), perc($stat_val, $questions), perc($stat_val, $dms)
+.
+
+format COM_1 =
+Com_        @>>>>>>>>  @>>>>>/s          @>>>>>
+make_short($stat_val), t($stat_val), perc($stat_val, $questions)
+.
+
+format COM_2 =
+  @<<<<<<<<<< @>>>>>>  @>>>>>/s          @>>>>>
+$stat_name, make_short($stat_val), t($stat_val), perc($stat_val, $questions)
+.
+
+format SAS =
+
+__ SELECT and Sort _____________________________________________________
+Scan          @>>>>>>   @>>>>/s %SELECT: @>>>>>
+make_short($stats{'Select_scan'}), t($stats{'Select_scan'}), perc($stats{'Select_scan'}, $stats{'Com_select'})
+Range         @>>>>>>   @>>>>/s          @>>>>>
+make_short($stats{'Select_range'}), t($stats{'Select_range'}), perc($stats{'Select_range'}, $stats{'Com_select'})
+Full join     @>>>>>>   @>>>>/s          @>>>>>
+make_short($stats{'Select_full_join'}), t($stats{'Select_full_join'}), perc($stats{'Select_full_join'}, $stats{'Com_select'})
+Range check   @>>>>>>   @>>>>/s          @>>>>>
+make_short($stats{'Select_range_check'}), t($stats{'Select_range_check'}), perc($stats{'Select_range_check'}, $stats{'Com_select'})
+Full rng join @>>>>>>   @>>>>/s          @>>>>>
+make_short($stats{'Select_full_range_join'}), t($stats{'Select_full_range_join'}), perc($stats{'Select_full_range_join'}, $stats{'Com_select'})
+Sort scan     @>>>>>>   @>>>>/s
+make_short($stats{'Sort_scan'}), t($stats{'Sort_scan'})
+Sort range    @>>>>>>   @>>>>/s
+make_short($stats{'Sort_range'}), t($stats{'Sort_range'})
+Sort mrg pass @>>>>>>   @>>>>/s
+make_short($stats{'Sort_merge_passes'}), t($stats{'Sort_merge_passes'})
+.
+
+format QCACHE =
+
+__ Query Cache _________________________________________________________
+Memory usage  @>>>>>> of @>>>>>>  %Used: @>>>>>
+make_short($qc_mem_used, 1), make_short($vars{'query_cache_size'}, 1), perc($qc_mem_used, $vars{'query_cache_size'})
+Block Fragmnt @>>>>>%
+perc($stats{'Qcache_free_blocks'}, $stats{'Qcache_total_blocks'})
+Hits          @>>>>>>   @>>>>/s
+make_short($stats{'Qcache_hits'}), t($stats{'Qcache_hits'})
+Inserts       @>>>>>>   @>>>>/s
+make_short($stats{'Qcache_inserts'}), t($stats{'Qcache_inserts'})
+Insrt:Prune @>>>>>>:1   @>>>>/s
+make_short($qc_ip_r), t($stats{'Qcache_inserts'} - $stats{'Qcache_lowmem_prunes'})
+Hit:Insert  @>>>>>>:1
+$qc_hi_r, t($qc_hi_r)
+.
+
+# Not really the end...
+format REPORT_END =
+
+__ Table Locks _________________________________________________________
+Waited      @>>>>>>>>  @>>>>>/s  %Total: @>>>>>
+make_short($stats{'Table_locks_waited'}), t($stats{'Table_locks_waited'}), perc($stats{'Table_locks_waited'}, $stats{'Table_locks_waited'} + $stats{'Table_locks_immediate'});
+Immediate   @>>>>>>>>  @>>>>>/s
+make_short($stats{'Table_locks_immediate'}), t($stats{'Table_locks_immediate'})
+
+__ Tables ______________________________________________________________
+Open        @>>>>>>>> of @>>>    %Cache: @>>>>>
+$stats{'Open_tables'}, $vars{'table_cache'}, perc($stats{'Open_tables'}, $vars{'table_cache'})
+Opened      @>>>>>>>>  @>>>>>/s
+make_short($stats{'Opened_tables'}), t($stats{'Opened_tables'})
+
+__ Connections _________________________________________________________
+Max used    @>>>>>>>> of @>>>      %Max: @>>>>>
+$stats{'Max_used_connections'}, $vars{'max_connections'}, perc($stats{'Max_used_connections'}, $vars{'max_connections'})
+Total       @>>>>>>>>  @>>>>>/s
+make_short($stats{'Connections'}), t($stats{'Connections'})
+
+__ Created Temp ________________________________________________________
+Disk table  @>>>>>>>>  @>>>>>/s
+make_short($stats{'Created_tmp_disk_tables'}), t($stats{'Created_tmp_disk_tables'})
+Table       @>>>>>>>>  @>>>>>/s    Size: @>>>>>
+make_short($stats{'Created_tmp_tables'}), t($stats{'Created_tmp_tables'}), make_short($vars{'tmp_table_size'}, 1, 1)
+File        @>>>>>>>>  @>>>>>/s
+make_short($stats{'Created_tmp_files'}), t($stats{'Created_tmp_files'})
+.
+
+format TAB =
+
+__ Threads _____________________________________________________________
+Running     @>>>>>>>> of @>>>
+$stats{'Threads_running'}, $stats{'Threads_connected'}
+Cached      @>>>>>>>> of @>>>      %Hit: @>>>>>
+$stats{'Threads_cached'}, $vars{'thread_cache_size'}, make_short(100 - perc($stats{'Threads_created'}, $stats{'Connections'}))
+Created     @>>>>>>>>  @>>>>>/s
+make_short($stats{'Threads_created'}), t($stats{'Threads_created'})
+Slow        @>>>>>>>>  @>>>>>/s
+$stats{'Slow_launch_threads'}, t($stats{'Slow_launch_threads'})
+
+__ Aborted _____________________________________________________________
+Clients     @>>>>>>>>  @>>>>>/s
+make_short($stats{'Aborted_clients'}), t($stats{'Aborted_clients'})
+Connects    @>>>>>>>>  @>>>>>/s
+make_short($stats{'Aborted_connects'}), t($stats{'Aborted_connects'})
+
+__ Bytes _______________________________________________________________
+Sent        @>>>>>>>>  @>>>>>/s
+make_short($stats{'Bytes_sent'}), t($stats{'Bytes_sent'})
+Received    @>>>>>>>>  @>>>>>/s
+make_short($stats{'Bytes_received'}), t($stats{'Bytes_received'})
+.
+
+format IB =
+
+__ InnoDB Buffer Pool __________________________________________________
+Usage         @>>>>>> of @>>>>>>  %Used: @>>>>>
+make_short($ib_bp_used, 1), make_short($ib_bp_total, 1), perc($ib_bp_used, $ib_bp_total)
+Read hit      @>>>>>%
+$ib_bp_read_ratio;
+Pages
+  Free      @>>>>>>>>            %Total: @>>>>>
+make_short($stats{'Innodb_buffer_pool_pages_free'}), perc($stats{'Innodb_buffer_pool_pages_free'}, $stats{'Innodb_buffer_pool_pages_total'})
+  Data      @>>>>>>>>                    @>>>>> %Drty: @>>>>>
+make_short($stats{'Innodb_buffer_pool_pages_data'}), perc($stats{'Innodb_buffer_pool_pages_data'}, $stats{'Innodb_buffer_pool_pages_total'}), perc($stats{'Innodb_buffer_pool_pages_dirty'}, $stats{'Innodb_buffer_pool_pages_data'})
+  Misc      @>>>>>>>>                    @>>>>>
+  $stats{'Innodb_buffer_pool_pages_misc'}, perc($stats{'Innodb_buffer_pool_pages_misc'}, $stats{'Innodb_buffer_pool_pages_total'})
+  Latched   @>>>>>>>>                    @>>>>>
+$stats{'Innodb_buffer_pool_pages_latched'}, perc($stats{'Innodb_buffer_pool_pages_latched'}, $stats{'Innodb_buffer_pool_pages_total'})
+Reads       @>>>>>>>>  @>>>>>/s  
+make_short($stats{'Innodb_buffer_pool_read_requests'}), t($stats{'Innodb_buffer_pool_read_requests'})
+  From file @>>>>>>>>  @>>>>>/s          @>>>>>
+make_short($stats{'Innodb_buffer_pool_reads'}), t($stats{'Innodb_buffer_pool_reads'}), perc($stats{'Innodb_buffer_pool_reads'}, $stats{'Innodb_buffer_pool_read_requests'})
+  Ahead Rnd @>>>>>>>>  @>>>>>/s
+$stats{'Innodb_buffer_pool_read_ahead_rnd'}, t($stats{'Innodb_buffer_pool_read_ahead_rnd'})
+  Ahead Sql @>>>>>>>>  @>>>>>/s
+$stats{'Innodb_buffer_pool_read_ahead_seq'}, t($stats{'Innodb_buffer_pool_read_ahead_seq'})
+Writes      @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_buffer_pool_write_requests'}), t($stats{'Innodb_buffer_pool_write_requests'})
+Flushes     @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_buffer_pool_pages_flushed'}), t($stats{'Innodb_buffer_pool_pages_flushed'})
+Wait Free   @>>>>>>>>  @>>>>>/s
+$stats{'Innodb_buffer_pool_wait_free'}, t($stats{'Innodb_buffer_pool_wait_free'})
+.
+
+format IB_LOCK =
+
+__ InnoDB Lock _________________________________________________________
+Waits       @>>>>>>>>  @>>>>>/s
+$stats{'Innodb_row_lock_waits'}, t($stats{'Innodb_row_lock_waits'})
+Current     @>>>>>>>>
+$stats{'Innodb_row_lock_current_waits'}
+Time acquiring
+  Total     @>>>>>>>> ms
+$stats{'Innodb_row_lock_time'}
+  Average   @>>>>>>>> ms
+$stats{'Innodb_row_lock_time_avg'}
+  Max       @>>>>>>>> ms
+$stats{'Innodb_row_lock_time_max'}
+.
+
+format IB_DPR =
+
+__ InnoDB Data, Pages, Rows ____________________________________________
+Data
+  Reads     @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_data_reads'}), t($stats{'Innodb_data_reads'})
+  Writes    @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_data_writes'}), t($stats{'Innodb_data_writes'})
+  fsync     @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_data_fsyncs'}), t($stats{'Innodb_data_fsyncs'})
+  Pending
+    Reads   @>>>>>>>>
+$stats{'Innodb_data_pending_reads'}, t($stats{'Innodb_data_pending_reads'})
+    Writes  @>>>>>>>>
+$stats{'Innodb_data_pending_writes'}, t($stats{'Innodb_data_pending_writes'})
+    fsync   @>>>>>>>>
+$stats{'Innodb_data_pending_fsyncs'}, t($stats{'Innodb_data_pending_fsyncs'})
+
+Pages
+  Created   @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_pages_created'}), t($stats{'Innodb_pages_created'})
+  Read      @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_pages_read'}), t($stats{'Innodb_pages_read'})
+  Written   @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_pages_written'}), t($stats{'Innodb_pages_written'})
+
+Rows
+  Deleted   @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_rows_deleted'}), t($stats{'Innodb_rows_deleted'})
+  Inserted  @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_rows_inserted'}), t($stats{'Innodb_rows_inserted'})
+  Read      @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_rows_read'}), t($stats{'Innodb_rows_read'})
+  Updated   @>>>>>>>>  @>>>>>/s
+make_short($stats{'Innodb_rows_updated'}), t($stats{'Innodb_rows_updated'})
+.
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/mysqlreport.1 b/mysql-wsrep-5.6/packaging/deb-in/extra/mysqlreport.1
new file mode 100644 (file)
index 0000000..5ae6b9e
--- /dev/null
@@ -0,0 +1,180 @@
+.TH "mysqlreport" "1" "2.5 2006-09-01 (docrev 2006-05-19)" "Daniel Nichter" "MYSQL"
+.SH "NAME"
+.LP 
+mysqlreport \- Makes a friendly report of important MySQL status values
+.SH "SYNTAX"
+.LP 
+mysqlreport [\fIoptions\fP]
+.SH "DESCRIPTION"
+.LP 
+mysqlreport makes a friendly report of important MySQL status values. Actually,
+it makes a friendly report of nearly every status value from SHOW STATUS.
+Unlike SHOW STATUS which simply dumps over 100 values to screen in one long
+list, mysqlreport interprets and formats the values and presents the basic
+values and many more inferred values in a human\-readable format. Numerous
+example reports are available at the mysqlreport web page at
+http://hackmysql.com/mysqlreport.
+
+The benefit of mysqlreport is that it allows you to very quickly see a wide
+array of performance indicators for your MySQL server which would otherwise
+need to be calculated by hand from all the various SHOW STATUS values. For
+example, the Index Read Ratio is an important value but it's not present in
+SHOW STATUS; it's an inferred value (the ratio of Key_reads to
+Key_read_requests).
+
+This documentation outlines all the command line options in mysqlreport, most
+of which control which reports are printed. This document does not address
+how to interpret these reports; that topic is covered in the document Guide
+To Understanding mysqlreport at http://hackmysql.com/mysqlreportguide.
+
+.SH "OPTIONS"
+Technically, command line options are in the form \-\-option, but \-option works
+too. All options can be abbreviated if the abbreviation is unique. For example,
+option \-\-host can be abbreviated \-\-ho but not \-\-h because \-\-h is ambiguous: it
+could mean \-\-host or \-\-help.
+
+.LP 
+
+.TP 
+\fB\-\-help\fR
+Output help information and exit.
+
+.TP 
+\fB\-\-user USER\fR
+
+.TP 
+\fB\-\-password\fR
+As of version 2.3 \-\-password can take the password on the
+command line like "\-\-password FOO". Using \-\-password
+alone without giving a password on the command line
+causes mysqlreport to prompt for a password.
+
+.TP 
+\fB\-\-host ADDRESS\fR
+
+.TP 
+\fB\-\-port PORT\fR
+
+.TP
+\fB\-\-socket SOCKET\fR
+
+.TP 
+\fB\-\-no\-mycnf\fR
+\-\-no\-mycnf makes mysqlreport not read ~/.my.cnf which it does by default
+otherwise. \-\-user and \-\-password always override values from ~/.my.cnf.
+
+.TP 
+\fB\-\-dtq\fR
+Print Distribution of Total Queries (DTQ) report (under
+Total in Questions report). Queries (or Questions) can
+be divided into four main areas: DMS (see \-\-dms below),
+Com_ (see \-\-com below), COM_QUIT (see COM_QUIT and
+Questions at http://hackmysql.com/com_quit), and
+Unknown. \-\-dtq lists the number of queries in each of
+these areas in descending order.
+
+.TP 
+\fB\-\-dms\fR
+Print Data Manipulation Statements (DMS) report (under
+DMS in Questions report). DMS are those from the MySQL
+manual section 13.2. Data Manipulation Statements.
+(Currently, mysqlreport considers only SELECT, INSERT,
+REPLACE, UPDATE, and DELETE.) Each DMS is listed in
+descending order by count.
+
+.TP 
+\fB\-\-com N\fR
+Print top N number of non\-DMS Com_ status values in
+descending order (after DMS in Questions report). If N
+is not given, default is 3. Such non\-DMS Com_ values
+include Com_change_db, Com_show_tables, Com_rollback,
+etc.
+
+.TP 
+\fB\-\-sas\fR
+Print report for Select_ and Sort_ status values (after
+Questions report). See MySQL Select and Sort Status
+Variables at http://hackmysql.com/selectandsort.
+
+.TP
+\fB\-\-tab\fR
+Print Threads, Aborted, and Bytes status reports (after
+Created temp report). As of mysqlreport v2.3 the
+Threads report reports on all Threads_ status values.
+
+.TP
+\fB\-\-qcache\fR
+Print Query Cache report.
+.TP
+\fB\-\-all\fR
+Equivalent to "\-\-dtq \-\-dms \-\-com 3 \-\-sas \-\-qcache".
+(Notice \-\-tab is not invoked by \-\-all.)
+
+.TP
+\fB\-\-infile FILE\fR
+Instead of getting SHOW STATUS values from MySQL, read
+values from FILE. FILE is often a copy of the output of
+SHOW STATUS including formatting characters (|, +, \-).
+mysqlreport expects FILE to have the format
+" value number " where value is only alpha and
+underscore characters (A\-Z and _) and number is a
+positive integer. Anything before, between, or after
+value and number is ignored. mysqlreport also needs
+the following MySQL server variables: version,
+table_cache, max_connections, key_buffer_size,
+query_cache_size. These values can be specified in
+INFILE in the format "name = value" where name is one
+of the aforementioned server variables and value is a
+positive integer with or without a trailing M and
+possible periods (for version). For example, to specify
+an 18M key_buffer_size: key_buffer_size = 18M. Or, a
+256 table_cache: table_cache = 256. The M implies
+Megabytes not million, so 18M means 18,874,368 not
+18,000,000. If these server variables are not specified
+the following defaults are used (respectively) which
+may cause strange values to be reported: 0.0.0, 64,
+100, 8M, 0.
+
+.TP
+\fB\-\-outfile FILE\fR  
+After printing the report to screen, print the report
+to FILE too. Internally, mysqlreport always writes the
+report to a temp file first: /tmp/mysqlreport.PID on
+*nix, c:\mysqlreport.PID on Windows (PID is the
+script's process ID). Then it prints the temp file to
+screen. Then if \-\-outfile is specified, the temp file
+is copied to OUTFILE. After \-\-email (below), the temp
+file is deleted.
+
+.TP
+\fB\-\-email ADDRESS\fR
+After printing the report to screen, email the report
+to ADDRESS. This option requires sendmail in
+/usr/sbin/, therefore it does not work on Windows.
+/usr/sbin/sendmail can be a sym link to qmail, for
+example, or any MTA that emulates sendmail's \-t
+command line option and operation. The FROM: field is
+"mysqlreport", SUBJECT: is "MySQL status report".
+
+.TP
+\fB\-\-flush\-status\fR
+Execute a "FLUSH STATUS;" after generating the reports.
+If you do not have permissions in MySQL to do this an
+error from DBD::mysql::st will be printed after the
+reports.
+
+.SH "AUTHORS"
+.LP 
+Daniel Nichter
+
+If mysqlreport breaks, send me a message from 
+http://hackmysql.com/feedback 
+with the error.
+
+.SH "SEE ALSO"
+.LP 
+mytop(1)
+.LP
+The comprehensive Guide To Understanding mysqlreport at 
+http://hackmysql.com/mysqlreportguide.
+
diff --git a/mysql-wsrep-5.6/packaging/deb-in/extra/source_mysql-5.6.py b/mysql-wsrep-5.6/packaging/deb-in/extra/source_mysql-5.6.py
new file mode 100644 (file)
index 0000000..41f7bbe
--- /dev/null
@@ -0,0 +1,54 @@
+'''apport package hook for mysql-5.6
+
+(c) 2009 Canonical Ltd.
+Author: Mathias Gug <mathias.gug@canonical.com>
+'''
+
+from __future__ import print_function, unicode_literals
+import os, os.path
+
+from apport.hookutils import *
+
+def _add_my_conf_files(report, filename):
+    key = 'MySQLConf' + path_to_key(filename)
+    report[key] = ""
+    for line in read_file(filename).split('\n'):
+        try:
+            if 'password' in line.split('=')[0]:
+                line = "%s = @@APPORTREPLACED@@" % (line.split('=')[0])
+            report[key] += line + '\n'
+        except IndexError:
+            continue
+
+def add_info(report):
+    attach_conffiles(report, 'mysql-server-5.6', conffiles=None)
+    key = 'Logs' + path_to_key('/var/log/daemon.log')
+    report[key] = ""
+    for line in read_file('/var/log/daemon.log').split('\n'):
+        try:
+            if 'mysqld' in line.split()[4]:
+                report[key] += line + '\n'
+        except IndexError:
+            continue
+    if os.path.exists('/var/log/mysql/error.log'):
+        key = 'Logs' + path_to_key('/var/log/mysql/error.log')
+        report[key] = ""
+        for line in read_file('/var/log/mysql/error.log').split('\n'):
+            report[key] += line + '\n'
+    attach_mac_events(report, '/usr/sbin/mysqld')
+    attach_file(report,'/etc/apparmor.d/usr.sbin.mysqld')
+    _add_my_conf_files(report, '/etc/mysql/my.cnf')
+    _add_my_conf_files(report, '/etc/mysql/mysql.cnf')
+    for d in ['/etc/mysql/conf.d', '/etc/mysql/mysql.conf.d']:
+        for f in os.listdir(d):
+            _add_my_conf_files(report, os.path.join(d, f))
+    try:
+        report['MySQLVarLibDirListing'] = str(os.listdir('/var/lib/mysql'))
+    except OSError:
+        report['MySQLVarLibDirListing'] = str(False)
+
+if __name__ == '__main__':
+    report = {}
+    add_info(report)
+    for key in report:
+        print('%s: %s' % (key, report[key].split('\n', 1)[0]))
diff --git a/mysql-wsrep-5.6/packaging/deb-in/gbp.conf b/mysql-wsrep-5.6/packaging/deb-in/gbp.conf
new file mode 100644 (file)
index 0000000..054c4e0
--- /dev/null
@@ -0,0 +1,8 @@
+[DEFAULT]
+# Ignore requirement to use branch name 'master' to make it easier
+# for contributors to work with feature and bugfix branches
+ignore-branch = True
+
+upstream-branch = 5.6-v25
+upstream-tree = branch
+pristine-tar = False
diff --git a/mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.README.Maintainer.in b/mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.README.Maintainer.in
new file mode 100644 (file)
index 0000000..f24cdcd
--- /dev/null
@@ -0,0 +1,4 @@
+The examples directory includes files that might be needed by some
+developers:
+- header files not installed by default
+- the example file udf_example.c
diff --git a/mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.examples.in b/mysql-wsrep-5.6/packaging/deb-in/libmysqlclient-dev.examples.in
new file mode 100644 (file)
index 0000000..80a749f
--- /dev/null
@@ -0,0 +1 @@
+sql/udf_example.cc
index 29d904671e199066656ff5fdce09584dbce78272..8c649ccee2000bad784be7ac923d3dba21721f7f 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
+usr/bin/mysql_config
 usr/include/mysql/*.h
 usr/include/mysql/mysql/*.h
+usr/include/mysql/mysql/*.h.pp
 usr/include/mysql/mysql/psi/*.h
 usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient_r.a
 usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlclient_r.so
 usr/lib/*/libmysqlservices.a
-usr/bin/mysql_config
-usr/share/man/man1/mysql_config.1
 usr/share/aclocal/mysql.m4
+usr/share/man/man1/mysql_config.1
 # legal
 usr/share/doc/libmysqlclient-dev/@DEB_INSTALL_LICENSEFILE@
 usr/share/doc/libmysqlclient-dev/README
index 5f7ef63484c99df3f7d4584a930fd9e7c10064d2..32f23c29e8b1283ae01690077bcdcc2b587e94de 100644 (file)
@@ -14,6 +14,7 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 usr/lib/*/libmysqlclient.so.18*
+usr/lib/*/libmysqlclient_r.so.18*
 # legal
 usr/share/doc/libmysqlclient18/@DEB_INSTALL_LICENSEFILE@
 usr/share/doc/libmysqlclient18/README
diff --git a/mysql-wsrep-5.6/packaging/deb-in/libmysqld-dev.install.in b/mysql-wsrep-5.6/packaging/deb-in/libmysqld-dev.install.in
deleted file mode 100644 (file)
index 2e5065f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-usr/lib/*/libmysqld.a
-usr/lib/*/libmysqld-debug.a
-# legal
-usr/share/doc/libmysqld-dev/@DEB_INSTALL_LICENSEFILE@
-usr/share/doc/libmysqld-dev/README
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-client.install.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-client.install.in
deleted file mode 100644 (file)
index 26ae1bf..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-# legal
-usr/share/doc/mysql-client/@DEB_INSTALL_LICENSEFILE@
-usr/share/doc/mysql-client/README
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-bench.install.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-bench.install.in
deleted file mode 100644 (file)
index cefabaa..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-usr/lib/mysql/sql-bench/*
-# legal
-usr/share/doc/mysql-@DEB_PRODUCTNAME@-bench/@DEB_INSTALL_LICENSEFILE@
-usr/share/doc/mysql-@DEB_PRODUCTNAME@-bench/README
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-bench.lintian-overrides.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-bench.lintian-overrides.in
deleted file mode 100644 (file)
index f4c1687..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-# Additional license file is needed so overriding this warning
-mysql-@DEB_PRODUCTNAME@-bench: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-bench/@DEB_INSTALL_LICENSEFILE@.gz
-mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.README.Debian.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.README.Debian.in
new file mode 100644 (file)
index 0000000..b245638
--- /dev/null
@@ -0,0 +1,4 @@
+FAQ:
+
+Q: My <tab> completition is gone, why?
+A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf!
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.docs.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.docs.in
new file mode 100644 (file)
index 0000000..5394213
--- /dev/null
@@ -0,0 +1,2 @@
+README
+debian/extra/innotop/changelog.innotop
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.install.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.install.in
new file mode 100644 (file)
index 0000000..7572d2b
--- /dev/null
@@ -0,0 +1,21 @@
+# this executable reprsent the embedded mysql server client
+debian/extra/innotop/innotop usr/bin/
+debian/extra/mysqlreport usr/bin/
+usr/bin/myisam_ftdump
+usr/bin/mysql
+usr/bin/mysql_config_editor
+usr/bin/mysql_find_rows
+usr/bin/mysql_fix_extensions
+usr/bin/mysql_waitpid
+usr/bin/mysqlaccess
+usr/bin/mysqladmin
+usr/bin/mysqlbug
+usr/bin/mysqlcheck
+usr/bin/mysqldump
+usr/bin/mysqldumpslow
+usr/bin/mysqlimport
+usr/bin/mysqlshow
+usr/bin/mysqlslap
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/README
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.links.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.links.in
new file mode 100644 (file)
index 0000000..1953168
--- /dev/null
@@ -0,0 +1,3 @@
+usr/bin/mysqlcheck usr/bin/mysqlanalyze
+usr/bin/mysqlcheck usr/bin/mysqloptimize
+usr/bin/mysqlcheck usr/bin/mysqlrepair
similarity index 64%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client.lintian-overrides.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.lintian-overrides.in
index cbdada715d592be5ceb45d6843ad49773bd868db..1b36d50d77172404e873ccc795643fdb7ab57634 100644 (file)
@@ -14,8 +14,8 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 # Additional license file is needed so overriding this warning
-mysql-@DEB_PRODUCTNAME@-client: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-client/LICENSE.mysql
-mysql-@DEB_PRODUCTNAME@-client: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-client/@DEB_INSTALL_LICENSEFILE@.gz
-mysql-@DEB_PRODUCTNAME@-client: copyright-should-refer-to-common-license-file-for-lgpl
+mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/LICENSE.mysql
+mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz
+mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl
 # Due to static linking this cannot be avoided and hence being overridden
-mysql-@DEB_PRODUCTNAME@-client: embedded-library
+mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@: embedded-library
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.manpages.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client-SERIES.manpages.in
new file mode 100644 (file)
index 0000000..b2cd1c9
--- /dev/null
@@ -0,0 +1,14 @@
+debian/extra/innotop/innotop.1
+debian/extra/mysqlreport.1
+debian/tmp/usr/share/man/man1/mysqlman.1
+debian/tmp/usr/share/man/man1/myisam_ftdump.1
+debian/tmp/usr/share/man/man1/mysql.1
+debian/tmp/usr/share/man/man1/mysql_config_editor.1
+debian/tmp/usr/share/man/man1/mysqladmin.1
+debian/tmp/usr/share/man/man1/mysqlcheck.1
+debian/tmp/usr/share/man/man1/mysqldump.1
+debian/tmp/usr/share/man/man1/mysqldumpslow.1
+debian/tmp/usr/share/man/man1/mysqlimport.1
+debian/tmp/usr/share/man/man1/mysqlman.1
+debian/tmp/usr/share/man/man1/mysqlshow.1
+debian/tmp/usr/share/man/man1/mysqlslap.1
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client.conffiles.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-client.conffiles.in
deleted file mode 100644 (file)
index 84c59f2..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/usr/share/mysql/charsets/armscii8.xml
-/usr/share/mysql/charsets/ascii.xml
-/usr/share/mysql/charsets/cp1250.xml
-/usr/share/mysql/charsets/cp1251.xml
-/usr/share/mysql/charsets/cp1256.xml
-/usr/share/mysql/charsets/cp1257.xml
-/usr/share/mysql/charsets/cp850.xml
-/usr/share/mysql/charsets/cp852.xml
-/usr/share/mysql/charsets/cp866.xml
-/usr/share/mysql/charsets/dec8.xml
-/usr/share/mysql/charsets/geostd8.xml
-/usr/share/mysql/charsets/greek.xml
-/usr/share/mysql/charsets/hebrew.xml
-/usr/share/mysql/charsets/hp8.xml
-/usr/share/mysql/charsets/Index.xml
-/usr/share/mysql/charsets/keybcs2.xml
-/usr/share/mysql/charsets/koi8r.xml
-/usr/share/mysql/charsets/koi8u.xml
-/usr/share/mysql/charsets/latin1.xml
-/usr/share/mysql/charsets/latin2.xml
-/usr/share/mysql/charsets/latin5.xml
-/usr/share/mysql/charsets/latin7.xml
-/usr/share/mysql/charsets/macce.xml
-/usr/share/mysql/charsets/macroman.xml
-/usr/share/mysql/charsets/swe7.xml
similarity index 76%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-common.install.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.install.in
index c8d8e9e3cff293433b162af897fbd9ad37449697..c5a54d68788cffe8ffddfc7119156f2d52dbf63c 100644 (file)
 
 # configuration file and script
 debian/extra/conf.d  etc/mysql/
+debian/extra/configure-symlinks usr/share/mysql-common/
 debian/extra/my.cnf.fallback etc/mysql/
 
 usr/share/mysql/docs/ChangeLog
 usr/share/mysql/docs/INFO_SRC
 usr/share/mysql/docs/INFO_BIN
+# charsets
+usr/share/mysql/charsets/*.xml
+usr/share/mysql/charsets/README
 # legal
-usr/share/doc/mysql-common/@DEB_INSTALL_LICENSEFILE@
-usr/share/doc/mysql-common/README
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/README
similarity index 65%
rename from mysql-wsrep-5.6/packaging/deb-in/libmysqld-dev.lintian-overrides.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.lintian-overrides.in
index 557a62ec69afb2b2fe1949f6db9c975d88073f52..85bf33a0c491f7172067783f405c7809d60a1557 100644 (file)
@@ -14,6 +14,6 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 # Additional license file is needed so overriding this warning
-libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
-libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/@DEB_INSTALL_LICENSEFILE@.gz
-libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
+mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/LICENSE.mysql
+mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz
+mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.maintscript.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.maintscript.in
new file mode 100644 (file)
index 0000000..39652e2
--- /dev/null
@@ -0,0 +1,2 @@
+rm_conffile /etc/mysql/conf.d/.keepme 5.6.22-1~ mysql-common
+rm_conffile /etc/mysql/my.cnf 5.6.22-1~ mysql-common
similarity index 95%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-common.postrm.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.postrm.in
index f79a243935de38b77fc387460d735409815bc405..fb916686ba2fa777f189d3e71584c178d2702a0e 100644 (file)
@@ -19,7 +19,6 @@ set -e
 
 if [ "$1" = "purge" ]; then
        rmdir /etc/mysql 2>/dev/null || true
-       update-alternatives --remove-all my.cnf
 fi
 
 #DEBHELPER#
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.preinst.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.preinst.in
new file mode 100644 (file)
index 0000000..905e454
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+    if dpkg --compare-versions "$2" lt-nl "5.6.25-3~" ; then
+
+        # revert fallback my.cnf symlink setup performed by mariadb-common
+        # from 10.0.17-1~exp2 upto 10.0.20-2
+        if [ -L /etc/mysql/my.cnf ] && [ -f /etc/mysql/my.cnf.old ]; then
+            if [ "$(readlink /etc/mysql/my.cnf)" = "mariadb.cnf" ]; then
+                echo "Reverting my.cnf -> mariadb.cnf symlink setup by mariadb-common"
+                rm /etc/mysql/my.cnf
+                mv /etc/mysql/my.cnf.old /etc/mysql/my.cnf
+            fi
+        fi
+
+        # recover from mysql-common 5.6.25-2 turning this symlinked
+        # mariadb.cnf into my.cnf.migrated
+        if [ -f /etc/mysql/my.cnf.migrated ]; then
+            if [ "$(md5sum /etc/mysql/my.cnf.migrated | awk '{ print $1 }')" = "4720bbc1a03252fbb9eb83b55f0b6e10" ]; then
+                # unmodified mariadb.cnf with the migration header prepended
+                # by mysql-common.postinst
+                echo "Removing incorrect /etc/mysql/my.cnf.migrated that was actually mariadb.cnf"
+                rm /etc/mysql/my.cnf.migrated
+                if [ -f /etc/mysql/my.cnf.old ]; then
+                    echo "Renaming (possibly unmodified) /etc/mysql/my.cnf.old to /etc/mysql/my.cnf.migrated"
+                    mv /etc/mysql/my.cnf.old /etc/mysql/my.cnf.migrated
+                else
+                    update-alternatives --remove my.cnf /etc/mysql/my.cnf.migrated
+                fi
+            fi
+        fi
+
+    fi
+fi
+
+#DEBHELPER#
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.prerm.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-common-SERIES.prerm.in
new file mode 100644 (file)
index 0000000..c7f9af4
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = "remove" ]; then
+  update-alternatives --remove my.cnf /etc/mysql/my.cnf.fallback
+  update-alternatives --remove my.cnf /etc/mysql/my.cnf.migrated
+fi
+
+#DEBHELPER#
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.README.Debian.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.README.Debian.in
new file mode 100644 (file)
index 0000000..741243f
--- /dev/null
@@ -0,0 +1,109 @@
+* MYSQL WON'T START OR STOP?:
+=============================
+You may never ever delete the special mysql user "debian-sys-maint". This
+user together with the credentials in /etc/mysql/debian.cnf are used by the
+init scripts to stop the server as they would require knowledge of the mysql
+root users password else.
+So in most of the times you can fix the situation by making sure that the
+debian.cnf file contains the right password, e.g. by setting a new one
+(remember to do a "flush privileges" then).
+
+* WHAT TO DO AFTER UPGRADES:
+============================
+The privilege tables are automatically updated so all there is left is read
+the changelogs on dev.mysql.com to see if any changes affect custom apps.
+
+* WHAT TO DO AFTER INSTALLATION:
+================================
+The MySQL manual describes certain steps to do at this stage in a separate
+chapter.  They are not necessary as the Debian packages does them
+automatically.
+
+The only thing that is left over for the admin is 
+ - setting the passwords
+ - creating new users and databases
+ - read the rest of this text
+
+* DOWNGRADING TO 4.0 or 4.1:
+============================
+Unsupported. Period.
+But if you do and get problems or make interesting experiences, mail me, it
+might help others.
+Ok, if you really want, I would recommend to "mysqldump --opt" all tables,
+then purge 4.1, delete /var/lib/mysql, install 4.0 and insert the dumps.  Be
+carefully, though, with the "mysql" table, you might not simply overwrite that
+one as the password for the mysql "debian-sys-maint" user is stored in
+/etc/mysql/debian.cnf and needed by /etc/init.d/ to start mysql and check if
+it's alive. 
+
+* SOME APPLICATION CAN NO LONGER CONNECT:
+=========================================
+This application is probably linked against libmysqlclient12 or below and
+somebody has created a mysql user with new-style passwords.
+The old_passwords=1 option in /etc/mysql/my.cnf might help. If not the
+application that inserted the user has to be changed or the application that
+tries to connect updated to libmysqlclient14 or -15.
+
+* NETWORKING:
+=============
+For security reasons, the Debian package has enabled networking only on the
+loop-back device using "bind-address" in /etc/mysql/my.cnf.  Check with
+"netstat -tlnp" where it is listening. If your connection is aborted
+immediately see if "mysqld: all" or similar is in /etc/hosts.allow and read
+hosts_access(5).
+
+* WHERE IS THE DOCUMENTATION?:
+==============================
+Unfortunately due to licensing restrictions, debian currently not able
+to provide the mysql-doc package in any format.  For the most up to date
+documentation, please go to http://dev.mysql.com/doc.
+
+* PASSWORDS:
+============
+It is strongly recommended to set a password for the mysql root user (which
+  /usr/bin/mysql -u root -D mysql -e "update user set password=password('new-password') where user='root'"
+  /usr/bin/mysql -u root -e "flush privileges"
+If you already had a password set add "-p" before "-u" to the lines above.
+
+
+If you are tired to type the password in every time or want to automate your
+scripts you can store it in the file $HOME/.my.cnf. It should be chmod 0600
+(-rw------- username username .my.cnf) to ensure that nobody else can read
+it.  Every other configuration parameter can be stored there, too. You will
+find an example below and more information in the MySQL manual in
+/usr/share/doc/mysql-doc or www.mysql.com.
+
+ATTENTION: It is necessary, that a .my.cnf from root always contains a "user"
+line wherever there is a "password" line, else, the Debian maintenance
+scripts, that use /etc/mysql/debian.cnf, will use the username
+"debian-sys-maint" but the password that is in root's .my.cnf. Also note,
+that every change you make in the /root/.my.cnf will affect the mysql cron
+script, too.
+
+        # an example of $HOME/.my.cnf
+       [client]
+       user            = your-mysql-username
+       password        = enter-your-good-new-password-here
+
+* BIG_ROWS FOR EVEN MORE ROWS IN A TABLE:
+=========================================
+If you ever run out of rows in a table there is the possibility of building
+the package with "-DBIG_ROWS" which, according to a MySQL employee on
+packagers@lists.mysql.com should lead to a 64bit row index (I guess > 2^32
+rows) but also to an approx. 5% performance loss.
+
+* BerkeleyDB Storage Engine
+===========================
+Support for BerkeleyDB has been removed in 5.1, and consequently both the
+have-bdb and skip-bdb configuration options will cause the server to fail. 
+Removing the options from /etc/mysql/my.cnf will fix this problem.
+
+* FURTHER NOTES ON REPLICATION
+===============================
+If the MySQL server is acting as a replication slave, you should not
+set --tmpdir to point to a directory on a memory-based filesystem or to
+a directory that is cleared when the server host restarts. A replication
+slave needs some of its temporary files to survive a machine restart so
+that it can replicate temporary tables or LOAD DATA INFILE operations. If
+files in the temporary file directory are lost when the server restarts,
+replication fails.
similarity index 97%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.dirs.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.dirs.in
index de6a09f8bc52185b93afcb3028818cff155693c9..761dcd01d36b3a934a6edf9412fceccf9fdd3e16 100644 (file)
@@ -14,3 +14,4 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 etc/mysql/mysql.conf.d
+var/lib/mysql-upgrade
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.examples.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.examples.in
new file mode 100644 (file)
index 0000000..3fe7d4b
--- /dev/null
@@ -0,0 +1,3 @@
+debian/tmp/usr/lib/mysql/plugin/daemon_example.ini
+debian/tmp/usr/share/mysql/wsrep.cnf
+debian/tmp/usr/share/mysql/magic
similarity index 66%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.install.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.install.in
index 951c80fcc20d990154c5949549f34b16365ba11c..75a63c82f3a9040a9919af2900e5614c8c1753ac 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
+# debian/extra/mysql-systemd-start usr/share/mysql/
+#debian/extra/mysql.cnf etc/mysql/
+# debian/extra/mysql.conf.d etc/mysql/
+# debian/extra/source_mysql-5.7.py usr/share/apport/package-hooks/
+@DEB_INSTALL_SERVER_APPARMOR@
+etc/mysql/debian-start
 # binaries
 usr/bin/innochecksum
 usr/bin/msql2mysql
+usr/bin/mysqlhotcopy
+usr/bin/mysql_convert_table_format
 usr/bin/myisamchk
 usr/bin/myisamlog
 usr/bin/myisampack
 usr/bin/my_print_defaults
-usr/bin/mysql_convert_table_format
-usr/bin/mysql_install_db
+usr/bin/mysqld_multi
+usr/scripts/mysql_install_db usr/bin/
+usr/bin/mysql_plugin
 usr/bin/mysql_secure_installation
-@DEB_PLUGIN_SETPERMISSION@
+usr/bin/mysql_setpermission
 usr/bin/mysql_tzinfo_to_sql
 usr/bin/mysql_upgrade
-usr/bin/mysql_zap
-usr/bin/mysqld_multi
-usr/bin/mysqld_safe
 usr/bin/mysqlbinlog
-usr/bin/mysqlhotcopy
+usr/bin/mysql_zap
 usr/bin/perror
 usr/bin/replace
 usr/bin/resolveip
-usr/bin/resolve_stack_dump
+usr/bin/resolve_stack_dump usr/lib/mysql/
+usr/bin/wsrep_sst_common
+usr/bin/wsrep_sst_mysqldump
+usr/bin/wsrep_sst_rsync
+usr/bin/wsrep_sst_xtrabackup
+usr/bin/wsrep_sst_xtrabackup-v2
+# plugins
+usr/lib/mysql/plugin/adt_null.so
+usr/lib/mysql/plugin/auth_socket.so
+usr/lib/mysql/plugin/connection_control.so
+usr/lib/mysql/plugin/innodb_engine.so
+usr/lib/mysql/plugin/libmemcached.so
+usr/lib/mysql/plugin/mypluglib.so
+usr/lib/mysql/plugin/mysql_no_login.so
+usr/lib/mysql/plugin/semisync_master.so
+usr/lib/mysql/plugin/semisync_slave.so
+usr/lib/mysql/plugin/validate_password.so
+@DEB_INSTALL_SERVER_PLUGINS@
+# server
 usr/sbin/mysqld
-# debug binary
-usr/sbin/mysqld-debug
 # man pages
 usr/share/man/man1/innochecksum.1
 usr/share/man/man1/msql2mysql.1
@@ -48,16 +70,14 @@ usr/share/man/man1/myisamlog.1
 usr/share/man/man1/myisampack.1
 usr/share/man/man1/my_print_defaults.1
 usr/share/man/man1/mysql-stress-test.pl.1
-usr/share/man/man1/mysql_convert_table_format.1
 usr/share/man/man1/mysql_install_db.1
+usr/share/man/man1/mysql_plugin.1
 usr/share/man/man1/mysql_secure_installation.1
 @DEB_MAN_SETPERMISSION@
 usr/share/man/man1/mysql_tzinfo_to_sql.1
 usr/share/man/man1/mysql_upgrade.1
 usr/share/man/man1/mysql_zap.1
 usr/share/man/man1/mysqlbinlog.1
-usr/share/man/man1/mysqld_multi.1
-usr/share/man/man1/mysqld_safe.1
 usr/share/man/man1/perror.1
 usr/share/man/man1/replace.1
 usr/share/man/man1/resolveip.1
@@ -69,40 +89,32 @@ debian/extra/mysql.cnf  etc/mysql/
 debian/extra/mysqld.cnf /etc/mysql/mysql.conf.d/
 # app armor profile
 @DEB_INSTALL_SERVER_APPARMOR@
+# startup files, depending on mechanism used by distro
+@DEB_FILES_STARTUP@
 # SQL files
 usr/share/mysql/*.sql
-# plugins
-usr/lib/mysql/plugin/adt_null.so
-usr/lib/mysql/plugin/auth_socket.so
-usr/lib/mysql/plugin/connection_control.so
-usr/lib/mysql/plugin/innodb_engine.so
-usr/lib/mysql/plugin/libmemcached.so
-usr/lib/mysql/plugin/mypluglib.so
-usr/lib/mysql/plugin/mysql_no_login.so
-usr/lib/mysql/plugin/semisync_master.so
-usr/lib/mysql/plugin/semisync_slave.so
-usr/lib/mysql/plugin/validate_password.so
-usr/lib/mysql/plugin/debug/adt_null.so
-usr/lib/mysql/plugin/debug/auth_socket.so
-usr/lib/mysql/plugin/debug/connection_control.so
-usr/lib/mysql/plugin/debug/innodb_engine.so
-usr/lib/mysql/plugin/debug/libmemcached.so
-usr/lib/mysql/plugin/debug/mypluglib.so
-usr/lib/mysql/plugin/debug/mysql_no_login.so
-usr/lib/mysql/plugin/debug/semisync_master.so
-usr/lib/mysql/plugin/debug/semisync_slave.so
-usr/lib/mysql/plugin/debug/validate_password.so
-@DEB_INSTALL_SERVER_PLUGINS@
 # support files
+usr/share/mysql/debian-start.inc.sh
+# usr/share/mysql/debian_create_root_user.sql
 usr/share/mysql/dictionary.txt
+# usr/share/mysql/echo_stderr
+usr/share/mysql/fill_help_tables.sql
+usr/share/mysql/innodb_memcached_config.sql
 usr/share/mysql/magic
 usr/share/mysql/mysql-log-rotate
+usr/share/mysql/mysql_security_commands.sql
+usr/share/mysql/mysql_system_tables.sql
+usr/share/mysql/mysql_system_tables_data.sql
+usr/share/mysql/mysql_test_data_timezone.sql
+usr/share/mysql/wsrep.cnf
+usr/share/mysql/wsrep_notify
 usr/share/mysql/mysql-helpers
 # localized error msgs
 usr/share/mysql/*/errmsg.sys
 usr/share/mysql/errmsg-utf8.txt
 @DEB_INSTALL_SERVER_SYSTEMD@
-usr/share/mysql/mysqld_multi.server
 # legal
-usr/share/doc/mysql-@DEB_PRODUCTNAME@-server/@DEB_INSTALL_LICENSEFILE@
-usr/share/doc/mysql-@DEB_PRODUCTNAME@-server/README
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/README
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/@DEB_WSREP_README@
similarity index 62%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-client.lintian-overrides.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.lintian-overrides.in
index 2e2b13e56a42e577617f1728e93a499cff254783..193e4692fe416b06ba67afbcac1ecbb5b3acd869 100644 (file)
@@ -14,6 +14,8 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 # Additional license file is needed so overriding this warning
-mysql-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
-mysql-client: extra-license-file usr/share/doc/mysql-client/@DEB_INSTALL_LICENSEFILE@.gz
-mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
+mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/LICENSE.mysql
+mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz
+mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl
+mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@: embedded-library
+
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.paranoid.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.paranoid.in
new file mode 100644 (file)
index 0000000..aaeb8b0
--- /dev/null
@@ -0,0 +1,8 @@
+/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
+/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$
+mysqld\[[0-9]+\]: $
+mysqld\[[0-9]+\]: Version: .* socket: '/var/run/mysqld/mysqld.sock'  port: 3306$
+mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
+usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
+usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.server.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.server.in
new file mode 100644 (file)
index 0000000..8c4c38c
--- /dev/null
@@ -0,0 +1,17 @@
+/etc/init.d/mysql\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
+/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$
+mysqld\[[0-9]+\]: ?$
+mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed
+mysqld\[[0-9]+\]: .*InnoDB: Started;
+mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$
+mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$
+mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$
+mysqld\[[0-9]+\]: Version: .* socket
+mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
+usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
+usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.workstation.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.logcheck.ignore.workstation.in
new file mode 100644 (file)
index 0000000..8c4c38c
--- /dev/null
@@ -0,0 +1,17 @@
+/etc/init.d/mysql\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+/etc/init.d/mysql\[[0-9]+\]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists\!$
+/etc/init.d/mysql\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$
+/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$
+mysqld\[[0-9]+\]: ?$
+mysqld\[[0-9]+\]: .*InnoDB: Shutdown completed
+mysqld\[[0-9]+\]: .*InnoDB: Started;
+mysqld\[[0-9]+\]: .*InnoDB: Starting shutdown\.\.\.$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Normal shutdown$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: ready for connections\.$
+mysqld\[[0-9]+\]: .*\[Note\] /usr/sbin/mysqld: Shutdown complete$
+mysqld\[[0-9]+\]: /usr/sbin/mysqld: ready for connections\.$
+mysqld\[[0-9]+\]: .*/usr/sbin/mysqld: Shutdown Complete$
+mysqld\[[0-9]+\]: Version: .* socket
+mysqld\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$
+usermod\[[0-9]+\]: change user `mysql' GID from `([0-9]+)' to `\1'$
+usermod\[[0-9]+\]: change user `mysql' shell from `/bin/false' to `/bin/false'$
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.mysql-server.logrotate.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.mysql-server.logrotate.in
new file mode 100644 (file)
index 0000000..2d9c71a
--- /dev/null
@@ -0,0 +1,27 @@
+# - I put everything in one block and added sharedscripts, so that mysql gets 
+#   flush-logs'd only once.
+#   Else the binary logs would automatically increase by n times every day.
+# - The error log is obsolete, messages go to syslog now.
+/var/log/mysql.log /var/log/mysql/*log {
+       daily
+       rotate 7
+       missingok
+       create 640 mysql adm
+       compress
+       sharedscripts
+       postrotate
+               test -x /usr/bin/mysqladmin || exit 0
+               # If this fails, check debian.conf! 
+               MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+               if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then
+                 # Really no mysqld or rather a missing debian-sys-maint user?
+                 # If this occurs and is not a error please report a bug.
+                 #if ps cax | grep -q mysqld; then
+                 if killall -q -s0 -umysql mysqld; then
+                   exit 1
+                 fi 
+               else
+                 $MYADMIN flush-logs
+               fi
+       endscript
+}
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.init.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.init.in
new file mode 100755 (executable)
index 0000000..4954928
--- /dev/null
@@ -0,0 +1,197 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides:          mysql
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Should-Start:      $network $time
+# Should-Stop:       $network $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start and stop the mysql database server daemon
+# Description:       Controls the main MySQL database server daemon "mysqld"
+#                    and its wrapper script "mysqld_safe".
+### END INIT INFO
+#
+set -e
+set -u
+${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
+
+test -x /usr/bin/mysqld_safe || exit 0
+
+. /lib/lsb/init-functions
+
+SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
+CONF=/etc/mysql/my.cnf
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+
+# priority can be overriden and "-s" adds output to stderr
+ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"
+
+# Safeguard (relative paths, core dumps..)
+cd /
+umask 077
+
+# mysqladmin likes to read /root/.my.cnf. This is usually not what I want
+# as many admins e.g. only store a password without a username there and
+# so break my scripts.
+export HOME=/etc/mysql/
+
+## Fetch a particular option from mysql's invocation.
+#
+# Usage: void mysqld_get_param option
+mysqld_get_param() {
+       /usr/sbin/mysqld --print-defaults \
+               | tr " " "\n" \
+               | grep -- "--$1" \
+               | tail -n 1 \
+               | cut -d= -f2
+}
+
+## Do some sanity checks before even trying to start mysqld.
+sanity_checks() {
+  # check for config file
+  if [ ! -r /etc/mysql/my.cnf ]; then
+    log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
+    echo                "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER
+  fi
+
+  # check for diskspace shortage
+  datadir=`mysqld_get_param datadir`
+  if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
+    log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
+    echo                "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
+    exit 1
+  fi
+}
+
+## Checks if there is a server running and if so if it is accessible.
+#
+# check_alive insists on a pingable server
+# check_dead also fails if there is a lost mysqld in the process list
+#
+# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
+mysqld_status () {
+    ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
+
+    ps_alive=0
+    pidfile=`mysqld_get_param pid-file`
+    if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
+    
+    if [ "$1" = "check_alive"  -a  $ping_alive = 1 ] ||
+       [ "$1" = "check_dead"   -a  $ping_alive = 0  -a  $ps_alive = 0 ]; then
+       return 0 # EXIT_SUCCESS
+    else
+       if [ "$2" = "warn" ]; then
+           echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
+       fi
+       return 1 # EXIT_FAILURE
+    fi
+}
+
+#
+# main()
+#
+
+case "${1:-''}" in
+  'start'|'bootstrap')
+       sanity_checks;
+       # Start daemon
+       if [ "$1" = "bootstrap" ]; then
+           log_daemon_msg "Starting first Galera Cluster node" "mysqld"
+           BOOTSTRAP='--wsrep-new-cluster'
+       else
+           log_daemon_msg "Starting MySQL database server" "mysqld"
+           BOOTSTRAP=''
+       fi
+       if mysqld_status check_alive nowarn; then
+          log_progress_msg "already running"
+          log_end_msg 0
+       else
+           # Could be removed during boot
+           test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
+
+           # Start MySQL! 
+           su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe $BOOTSTRAP > /dev/null 2>&1 &"
+
+           # 6s was reported in #352070 to be too few when using ndbcluster
+           # 14s was reported in #736452 to be too few with large installs
+           for i in $(seq 1 30); do
+                sleep 1
+               if mysqld_status check_alive nowarn ; then break; fi
+               log_progress_msg "."
+           done
+           if mysqld_status check_alive warn; then
+                log_end_msg 0
+               # Now start mysqlcheck or whatever the admin wants.
+               output=$(/etc/mysql/debian-start)
+               [ -n "$output" ] && log_action_msg "$output"
+           else
+               log_end_msg 1
+               log_failure_msg "Please take a look at the syslog"
+           fi
+       fi
+       ;;
+
+  'stop')
+       # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
+       # at least for cron, we can rely on it here, too. (although we have 
+       # to specify it explicit as e.g. sudo environments points to the normal
+       # users home and not /root)
+       log_daemon_msg "Stopping MySQL database server" "mysqld"
+       if ! mysqld_status check_dead nowarn; then
+         set +e
+         shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
+         set -e
+         if [ "$r" -ne 0 ]; then
+           log_end_msg 1
+           [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
+           log_daemon_msg "Killing MySQL database server by signal" "mysqld"
+           killall -15 mysqld
+            server_down=
+           for i in 1 2 3 4 5 6 7 8 9 10; do
+              sleep 1
+              if mysqld_status check_dead nowarn; then server_down=1; break; fi
+            done
+          if test -z "$server_down"; then killall -9 mysqld; fi
+         fi
+        fi
+
+        if ! mysqld_status check_dead warn; then
+         log_end_msg 1
+         log_failure_msg "Please stop MySQL manually and read /usr/share/doc/mysql-server-5.7/README.Debian.gz!"
+         exit -1
+       else
+         log_end_msg 0
+        fi
+       ;;
+
+  'restart')
+       set +e; $SELF stop; set -e
+       $SELF start 
+       ;;
+
+  'reload'|'force-reload')
+       log_daemon_msg "Reloading MySQL database server" "mysqld"
+       $MYADMIN reload
+       log_end_msg 0
+       ;;
+
+  'status')
+       if mysqld_status check_alive nowarn; then
+         log_action_msg "$($MYADMIN version)"
+       else
+         log_action_msg "MySQL is stopped."
+         exit 3
+       fi
+       ;;
+
+  *)
+       echo "Usage: $SELF start|stop|restart|reload|force-reload|status|bootstrap"
+       exit 1
+       ;;
+esac
+
+# Some success paths end up returning non-zero so exit 0 explicitly. See
+# bug #739846.
+exit 0
similarity index 79%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.mysql.service.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.mysql.service.in
index 241e458cfe0736a32b47f6335c22ca4ce009785f..c117a3f5740041976e7333b1646f6127726ef55e 100644 (file)
@@ -25,10 +25,15 @@ WantedBy=multi-user.target
 [Service]
 User=mysql
 Group=mysql
+Type=forking
 PermissionsStartOnly=true
+PIDFile=/var/run/mysqld/mysqld.pid
 @DEB_SERVICE_SERVER_EXECPRE@
-ExecStart=/usr/bin/mysqld_safe
-ExecStartPost=/usr/share/mysql/mysql-systemd-start post
+ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS $MYSQLD_RECOVER_START
+@DEB_SERVICE_SERVER_EXECPOST@
 TimeoutSec=600
 LimitNOFILE = 5000
 Restart=on-failure
+RestartPreventExitStatus=1
+RuntimeDirectory=mysqld
+RuntimeDirectoryMode=755
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.templates.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.templates.in
new file mode 100644 (file)
index 0000000..bdf6b0b
--- /dev/null
@@ -0,0 +1,88 @@
+Template: mysql-@DEB_PRODUCTNAME@-server/root-pass
+Type: password
+_Description: Enter root password:
+ Please provide a strong password that will be set for the root account of your MySQL database.
+ Leave it blank to enable password less login using UNIX socket based authentication.
+
+Template: mysql-@DEB_PRODUCTNAME@-server/re-root-pass
+Type: password
+_Description: Re-enter root password:
+ Now that you have selected a password for the root account, please confirm by typing it again. Do not share the password with anyone.
+
+Template: mysql-@DEB_PRODUCTNAME@-server/root-pass-mismatch
+Type: error
+_Description: The two passwords did not match
+ Please try again. Make sure you type the exact same password twice.
+
+Template: mysql-@DEB_PRODUCTNAME@-server/remove-data-dir
+Type: boolean
+Default: false
+_Description: Remove data directories ?
+ This operation will remove the data directory at '/var/lib/mysql' that stores all the databases, tables and related meta-data.
+ Additionally, any import or export files stored at '/var/lib/mysql-files' will be removed along with directory, as well as the contents of
+ /var/lib/mysql-keyring.
+ It is highly recommended to take data backup before removing the data directories.
+
+Template: mysql-@DEB_PRODUCTNAME@-server/data-dir
+Type: note
+_Description: Data directory found when no MySQL server package is installed
+ A data directory '/var/lib/mysql' is present on this system when no MySQL server 
+ package is currently installed on the system. The directory may be under control of
+ server package received from third-party vendors. It may also be an unclaimed data
+ directory from previous removal of mysql packages.
+ .
+ It is highly recommended to take data backup. If you have not done so, now would be
+ the time to take backup in another shell. Once completed, press 'Ok' to continue.
+
+Template: mysql-@DEB_PRODUCTNAME@-server/really_downgrade
+Type: boolean
+Default: false
+_Description: Really proceed with downgrade?
+ A file named /var/lib/mysql/debian-*.flag exists on this system.
+ .
+ Such a file is an indication that a mysql-server package with a higher
+ version has been installed previously.
+ .
+ There is no guarantee that the version you're currently installing
+ will be able to use the current databases.
+
+Template: mysql-@DEB_PRODUCTNAME@-server/nis_warning
+Type: note
+_Description: Important note for NIS/YP users
+ Using MySQL under NIS/YP requires a mysql user account to be added on
+ the local system with:
+ .
+  adduser --system --group --home /var/lib/mysql mysql
+ .
+ You should also check the permissions and ownership of the
+ /var/lib/mysql directory:
+ .
+  /var/lib/mysql: drwxr-xr-x   mysql    mysql
+
+Template: mysql-@DEB_PRODUCTNAME@-server/postrm_remove_databases
+Type: boolean
+Default: false
+_Description: Remove all MySQL databases?
+ The /var/lib/mysql directory which contains the MySQL databases is about
+ to be removed.
+ .
+ This will also erase all data in /var/lib/mysql-files as well as
+ /var/lib/mysql-keyring.
+ .
+ If you're removing the MySQL package in order to later install a more
+ recent version or if a different mysql-server package is already
+ using it, the data should be kept.
+
+Template: mysql-@DEB_PRODUCTNAME@-server/start_on_boot
+Type: boolean
+Default: true
+_Description: Start the MySQL server on boot?
+ The MySQL server can be launched automatically at boot time or manually
+ with the '/etc/init.d/mysql start' command.
+
+Template: mysql-@DEB_PRODUCTNAME@-server/no_upgrade_when_using_ndb
+Type: error
+_Description: NDB Cluster seems to be in use
+ MySQL-5.7 no longer provides NDB Cluster support. Please migrate to the new
+ mysql-cluster-server package and remove all lines starting with "ndb" from
+ all config files below /etc/mysql/.
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.upstart.disabled.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server-SERIES.upstart.disabled.in
new file mode 100644 (file)
index 0000000..fa7f208
--- /dev/null
@@ -0,0 +1,63 @@
+description     "MySQL 5.7 Server"
+author          "Mario Limonciello <superm1@ubuntu.com>"
+
+start on runlevel [2345]
+stop on starting rc RUNLEVEL=[016]
+
+respawn
+respawn limit 2 5
+
+env HOME=/etc/mysql
+umask 007
+
+# The default of 5 seconds is too low for mysql which needs to flush buffers
+kill timeout 300
+
+pre-start script
+    ## Fetch a particular option from mysql's invocation.
+    # Usage: void mysqld_get_param option
+    mysqld_get_param() {
+      /usr/sbin/mysqld --print-defaults \
+        | tr " " "\n" \
+        | grep -- "--$1" \
+        | tail -n 1 \
+        | cut -d= -f2
+    }
+
+    # priority can be overriden and "-s" adds output to stderr
+    ERR_LOGGER="logger -p daemon.err -t /etc/init/mysql.conf -i"
+
+    #Sanity checks
+    [ -r $HOME/my.cnf ]
+    [ -d /var/run/mysqld ] || install -m 755 -o mysql -g root -d /var/run/mysqld
+    /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+    # check for diskspace shortage
+    datadir=`mysqld_get_param datadir`
+    BLOCKSIZE=`LC_ALL=C df --portability $datadir/. | tail -n 1 | awk '{print $4}'`
+    if [ $BLOCKSIZE -le 4096 ] ; then
+      echo "$0: ERROR: The partition with $datadir is too full!" >&2
+      echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
+      exit 1
+    fi
+end script
+
+exec /usr/sbin/mysqld
+
+post-start script
+   for i in `seq 1 30` ; do
+        /usr/bin/mysqladmin --defaults-file="${HOME}"/debian.cnf ping && {
+            exec "${HOME}"/debian-start
+            # should not reach this line
+            exit 2
+        }
+        statusnow=`status`
+        if echo $statusnow | grep -q 'stop/' ; then
+            exit 0
+        elif echo $statusnow | grep -q 'respawn/' ; then
+            exit 1
+        fi
+        sleep 1
+    done
+    exit 1
+end script
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.lintian-overrides.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.lintian-overrides.in
deleted file mode 100644 (file)
index 0b32115..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-# Additional license file is needed so overriding this warning
-mysql-@DEB_PRODUCTNAME@-server: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-server/LICENSE.mysql
-mysql-@DEB_PRODUCTNAME@-server: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-server/@DEB_INSTALL_LICENSEFILE@.gz
-mysql-@DEB_PRODUCTNAME@-server: copyright-should-refer-to-common-license-file-for-lgpl
-# Due to static linking this cannot be avoided and hence being overridden
-mysql-@DEB_PRODUCTNAME@-server: embedded-library
-# Since we ship debug plugins so this error is overridden
-mysql-@DEB_PRODUCTNAME@-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.mysql.init.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.mysql.init.in
deleted file mode 100644 (file)
index 0ebb7ae..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/bash
-#
-### BEGIN INIT INFO
-# Provides:          mysql
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Should-Start:      $network $time
-# Should-Stop:       $network $time
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start/ Stop MySQL @DEB_PRODUCTNAMEC@ Server daemon
-# Description:       This service script facilitates startup and shutdown of
-#                    mysqld daemon throught its wrapper script mysqld_safe
-### END INIT INFO
-#
-
-# Copyright (c) 2015, 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
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-. /lib/lsb/init-functions
-. /usr/share/mysql/mysql-helpers
-cd /
-umask 077
-
-# In case server is taking more to start or stop increase the timeout here
-STARTTIMEOUT=180
-STOPTIMEOUT=60
-
-# We need to check that the binaries exist; When upgrading from community to commercial this
-# script will be run after community is removed but before commercial is installed
-VERSION="unknown"
-if pathfind mysqld; then
-       VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
-fi
-
-MYSQLRUN=/var/run/mysqld
-MYSQLDATA=$(get_mysql_option mysqld datadir "/var/lib/mysql")
-MYSQLFILES=/var/lib/mysql-files
-MYSQLKEYRING=/var/lib/mysql-keyring
-MYSQLLOG=/var/log/mysql
-
-case "$1" in
-  'start')
-       if [ "$(get_running)" -eq 1 ];
-       then
-               log_action_msg "A MySQL Server is already started"
-       else
-               verify_ready
-               verify_database
-
-               @DEB_INIT_APPARMOR@
-
-               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
-               verify_server start
-               if [ "$?" -eq 0 ];
-               then
-                       log_action_msg "MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION} is started"
-               else
-                       log_action_msg "MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION} did not start. Please check logs for more details."
-               fi
-       fi
-       ;;
-
-  'stop')
-       if [ "$(get_running)" -eq 1 ];
-       then
-               killall -u mysql
-               verify_server stop
-               if [ "$?" -eq 0 ];
-               then
-                       log_action_msg "MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION} is stopped"
-               else
-                       log_action_msg "Attempt to shutdown MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION} timed out"
-               fi
-       else
-               log_action_msg "MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION} is already stopped"
-       fi
-       ;;
-
-  'restart'|'reload'|'force-reload')
-       log_action_msg "Stopping MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION}"
-       $0 stop
-       log_action_msg "Re-starting MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION}"
-       $0 start
-       ;;
-
-  'status')
-       if [ "$(get_running)" -eq 1 ];
-       then
-               log_action_msg "MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION} is running"
-       else
-               log_action_msg "MySQL @DEB_PRODUCTNAMEC@ Server ${VERSION} is not running"
-               exit 3
-       fi
-       ;;
-
-  *)
-       echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
-       exit 1
-       ;;
-esac
-
-exit 0
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.templates.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-server.templates.in
deleted file mode 100644 (file)
index 85366ad..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-Template: mysql-@DEB_PRODUCTNAME@-server/root-pass
-Type: password
-Description: Enter root password:
- Please provide a strong password that will be set for the root account of your MySQL database.
- Leave it blank to enable password less login using UNIX socket based authentication.
-
-Template: mysql-@DEB_PRODUCTNAME@-server/re-root-pass
-Type: password
-Description: Re-enter root password:
- Now that you have selected a password for the root account, please confirm by typing it again. Do not share the password with anyone.
-
-Template: mysql-@DEB_PRODUCTNAME@-server/root-pass-mismatch
-Type: error
-Description: The two passwords did not match
- Please try again. Make sure you type the exact same password twice.
-
-Template: mysql-@DEB_PRODUCTNAME@-server/remove-data-dir
-Type: boolean
-Default: false
-Description: Remove data directories ?
- This operation will remove the data directory at '/var/lib/mysql' that stores all the databases, tables and related meta-data.
- Additionally, any import or export files stored at '/var/lib/mysql-files' will be removed along with directory.
- Finally, any files in '/var/lib/mysql-keyring' will be deleted.
- It is highly recommended to take data backup before removing the data directories.
-
-Template: mysql-@DEB_PRODUCTNAME@-server/data-dir
-Type: note
-Description: Data directory found when no MySQL server package is installed
- A data directory '/var/lib/mysql' is present on this system when no MySQL server
- package is currently installed on the system. The directory may be under control of
- server package received from third-party vendors. It may also be an unclaimed data
- directory from previous removal of mysql packages.
- .
- It is highly recommended to take data backup. If you have not done so, now would be
- the time to take backup in another shell. Once completed, press 'Ok' to continue.
similarity index 83%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source.install.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source-SERIES.install.in
index 8fb9456673993f983ce6186912fbec78344b11e6..3469197e45fe89140f902db0d546313d3cc1482a 100644 (file)
@@ -17,5 +17,5 @@
 ../*.tar.gz usr/src/mysql/
 @DEB_INSTALL_SOURCE_XZ@
 # legal
-usr/share/doc/mysql-@DEB_PRODUCTNAME@-source/@DEB_INSTALL_LICENSEFILE@
-usr/share/doc/mysql-@DEB_PRODUCTNAME@-source/README
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/README
similarity index 65%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source.lintian-overrides.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-source-SERIES.lintian-overrides.in
index d5c9ec3811f2bed3f1d1ec9e2bfbb6271eaad7ac..c3a10b2f203f17a04f22481319c3581fd1339746 100644 (file)
@@ -14,6 +14,6 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 # Additional license file is needed so overriding this warning
-mysql-@DEB_PRODUCTNAME@-source: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-source/LICENSE.mysql
-mysql-@DEB_PRODUCTNAME@-source: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-source/@DEB_INSTALL_LICENSEFILE@.gz
-mysql-@DEB_PRODUCTNAME@-source: copyright-should-refer-to-common-license-file-for-lgpl
+mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/LICENSE.mysql
+mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz
+mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test-SERIES.install.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test-SERIES.install.in
new file mode 100644 (file)
index 0000000..5408123
--- /dev/null
@@ -0,0 +1,69 @@
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+# binaries
+usr/bin/mysql_client_test
+usr/bin/mysqltest
+# manpages
+usr/share/man/man1/mysql_client_test.1
+usr/share/man/man1/mysql-test-run.pl.1
+usr/share/man/man1/mysqltest.1
+# plugins
+usr/lib/mysql/plugin/auth.so
+usr/lib/mysql/plugin/auth_test_plugin.so
+usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/libdaemon_example.so
+usr/lib/mysql/plugin/qa_auth_client.so
+usr/lib/mysql/plugin/qa_auth_interface.so
+usr/lib/mysql/plugin/qa_auth_server.so
+usr/lib/mysql/plugin/test_udf_services.so
+#usr/lib/mysql/plugin/debug/auth.so
+#usr/lib/mysql/plugin/debug/auth_test_plugin.so
+#usr/lib/mysql/plugin/debug/daemon_example.ini
+# usr/lib/mysql/plugin/debug/ha_example.so
+#usr/lib/mysql/plugin/debug/libdaemon_example.so
+# usr/lib/mysql/plugin/debug/libtest_framework.so
+# usr/lib/mysql/plugin/debug/libtest_services.so
+# usr/lib/mysql/plugin/debug/libtest_services_threaded.so
+# usr/lib/mysql/plugin/debug/libtest_session_detach.so
+# usr/lib/mysql/plugin/debug/libtest_session_info.so
+# usr/lib/mysql/plugin/debug/libtest_session_in_thd.so
+# usr/lib/mysql/plugin/debug/libtest_sql_2_sessions.so
+# usr/lib/mysql/plugin/debug/libtest_sql_all_col_types.so
+# usr/lib/mysql/plugin/debug/libtest_sql_cmds_1.so
+# usr/lib/mysql/plugin/debug/libtest_sql_commit.so
+# usr/lib/mysql/plugin/debug/libtest_sql_complex.so
+# usr/lib/mysql/plugin/debug/libtest_sql_errors.so
+# usr/lib/mysql/plugin/debug/libtest_sql_lock.so
+# usr/lib/mysql/plugin/debug/libtest_sql_processlist.so
+# usr/lib/mysql/plugin/debug/libtest_sql_replication.so
+# usr/lib/mysql/plugin/debug/libtest_sql_shutdown.so
+# usr/lib/mysql/plugin/debug/libtest_sql_sqlmode.so
+# usr/lib/mysql/plugin/debug/libtest_sql_stored_procedures_functions.so
+# usr/lib/mysql/plugin/debug/libtest_sql_views_triggers.so
+# usr/lib/mysql/plugin/debug/libtest_x_sessions_deinit.so
+# usr/lib/mysql/plugin/debug/libtest_x_sessions_init.so
+#usr/lib/mysql/plugin/debug/qa_auth_client.so
+#usr/lib/mysql/plugin/debug/qa_auth_interface.so
+#usr/lib/mysql/plugin/debug/qa_auth_server.so
+# usr/lib/mysql/plugin/debug/replication_observers_example_plugin.so
+# usr/lib/mysql/plugin/debug/rewrite_example.so
+# usr/lib/mysql/plugin/debug/test_security_context.so
+#usr/lib/mysql/plugin/debug/test_udf_services.so
+# test suite
+usr/lib/mysql-test/*
+# legal
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
+usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/README
similarity index 66%
rename from mysql-wsrep-5.6/packaging/deb-in/mysql-common.lintian-overrides.in
rename to mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test-SERIES.lintian-overrides.in
index f0bee937f2bdb76b3edaaaf678d48e04c25fa235..c066c4eb59e0e689130240ed77fb858c19348729 100644 (file)
@@ -14,6 +14,6 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 # Additional license file is needed so overriding this warning
-mysql-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
-mysql-common: extra-license-file usr/share/doc/mysql-common/@DEB_INSTALL_LICENSEFILE@.gz
-mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
+mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/LICENSE.mysql
+mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@.gz
+mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.install.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.install.in
deleted file mode 100644 (file)
index e05f6d2..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-# binaries
-usr/bin/mysql_client_test
-usr/bin/mysql_client_test_embedded
-usr/bin/mysqltest
-usr/bin/mysqltest_embedded
-# manpages
-usr/share/man/man1/mysql_client_test.1
-usr/share/man/man1/mysql_client_test_embedded.1
-usr/share/man/man1/mysql-test-run.pl.1
-usr/share/man/man1/mysqltest.1
-usr/share/man/man1/mysqltest_embedded.1
-# plugins
-usr/lib/mysql/plugin/auth.so
-usr/lib/mysql/plugin/auth_test_plugin.so
-usr/lib/mysql/plugin/daemon_example.ini
-usr/lib/mysql/plugin/libdaemon_example.so
-usr/lib/mysql/plugin/qa_auth_client.so
-usr/lib/mysql/plugin/qa_auth_interface.so
-usr/lib/mysql/plugin/qa_auth_server.so
-usr/lib/mysql/plugin/test_udf_services.so
-usr/lib/mysql/plugin/debug/auth.so
-usr/lib/mysql/plugin/debug/auth_test_plugin.so
-usr/lib/mysql/plugin/debug/daemon_example.ini
-usr/lib/mysql/plugin/debug/libdaemon_example.so
-usr/lib/mysql/plugin/debug/qa_auth_client.so
-usr/lib/mysql/plugin/debug/qa_auth_interface.so
-usr/lib/mysql/plugin/debug/qa_auth_server.so
-usr/lib/mysql/plugin/debug/test_udf_services.so
-# test suite
-usr/lib/mysql-test/*
-# legal
-usr/share/doc/mysql-@DEB_PRODUCTNAME@-test/@DEB_INSTALL_LICENSEFILE@
-usr/share/doc/mysql-@DEB_PRODUCTNAME@-test/README
diff --git a/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.lintian-overrides.in b/mysql-wsrep-5.6/packaging/deb-in/mysql-packagesource-test.lintian-overrides.in
deleted file mode 100644 (file)
index 7680f39..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
-# Additional license file is needed so overriding this warning
-mysql-@DEB_PRODUCTNAME@-test: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-test/LICENSE.mysql
-mysql-@DEB_PRODUCTNAME@-test: extra-license-file usr/share/doc/mysql-@DEB_PRODUCTNAME@-test/@DEB_INSTALL_LICENSEFILE@.gz
-mysql-@DEB_PRODUCTNAME@-test: copyright-should-refer-to-common-license-file-for-lgpl
diff --git a/mysql-wsrep-5.6/packaging/deb-in/patches/series b/mysql-wsrep-5.6/packaging/deb-in/patches/series
deleted file mode 100644 (file)
index e8dd728..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
-
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/POTFILES.in b/mysql-wsrep-5.6/packaging/deb-in/po/POTFILES.in
new file mode 100644 (file)
index 0000000..9631ecb
--- /dev/null
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/ar.po b/mysql-wsrep-5.6/packaging/deb-in/po/ar.po
new file mode 100644 (file)
index 0000000..4c371ff
--- /dev/null
@@ -0,0 +1,252 @@
+# translation of templates.po to Arabic
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Ossama M. Khayat <okhayat@yahoo.com>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: templates\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2007-05-01 13:04+0300\n"
+"Last-Translator: Ossama M. Khayat <okhayat@yahoo.com>\n"
+"Language-Team: Arabic <support@arabeyes.org>\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=6; plural=n==1 ? 0 : n==0 ? 1 : n==2 ? 2: n%100>=3 && "
+"n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n"
+": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n"
+": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n"
+": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n"
+": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n"
+": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n"
+": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "هل فعلاً تريد التثبيط؟"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "هناك ملف مسمى /var/lib/mysql/debian-*.flag موجود على هذا النظام."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid ""
+#| "Such file is an indication that a mysql-server package with a higher "
+#| "version has been installed earlier."
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"هذا الملف دلالة على أن نسخة أحدث من حزمة mysql-server تم تثبيتها مسبقاً."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"ليست هناك أية ضمانة أن النسخة التي تقوم بتثبيتها ستكون قادرة على استخدام "
+"قواعد البيانات الحالية."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "ملاحظة هامة لمستخدمي NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid ""
+#| "You should also check the permissions and the owner of the /var/lib/mysql "
+#| "directory:"
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr "عليك أيضاً أن تقوم بالتأكد من صلاحيات مالك الملف /var/lib/mysql: "
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "إزالة جميع قواعد بيانات MySQL؟"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr "الدليل /var/lib/mysql الذي يحتوي قواعد بيانات MySQL ستتم إزالته."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"إن كنت تقوم بإزالة حزمة MySQL كي تقوم لاحقاً بتثبيت نسخة أحدث أو إن كانت حزمة "
+"mysql-server مختلفة تستخدمها، فيجب إبقاء البيانات."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "تشغيل خادم MySQL عند الإقلاع؟"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"يمكن تشغيل خادم MySQL آلياً وقت الإقلاع أو يدوياً باستخدام الأمر '/etc/init.d/"
+"mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص بـMySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"مع أنه ليس إجبارياً، ولكن من المستحسن أن تقوم بتعيين كلمة مرور خاصة بمستخدم "
+"MySQL الإداري \"root\"."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid "If that field is left blank, the password will not be changed."
+msgid "If this field is left blank, the password will not be changed."
+msgstr "إن ترك الحقل فارغاً، فلن يتم تغيير كلمة المرور."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+#, fuzzy
+#| msgid "New password for the MySQL \"root\" user:"
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص بـMySQL:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "تعذر تعيين كلمة مرور للمستخدم \"root\" الخاص بـMySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"حدث خطأ أثناء تعيين كلمة المرور لمستخدم MySQL الإداري. قد يكون هذا حدث بسبب "
+"أن حساب المستخدم له كلمة مرور معيّنة مسبقاً، أو بسبب مشكلة في الاتصال مع خادم "
+"MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "You should check the account's password after tha package installation."
+msgid "You should check the account's password after the package installation."
+msgstr "يجب عليك التحقق من كلمة مرور الحساب عقب تثبيت الحزمة."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"الرجاء قراءة الملف /usr/share/doc/mysql-server-5.6/README.Debian للمزيد من "
+"المعلومات."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "كي تستخدم MySQL، يجب إضافة المُدخلات التالية الخاصة بالمستخدمين والمجموعات "
+#~ "إلى النظام:"
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "هل تريد دعم اتصالات MySQL من الأجهزة التي تعمل على ديبيان \"sarge\" أو "
+#~ "أقدم؟"
+
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "في إصدارات عملاء MySQL القديمة من ديبيان، لم تكن كلمات المرور تحفظ بشكل "
+#~ "آمن. ولقد حل هذه المشكلة بعدها، غير أن العملاء (مثل PHP) المتصلين من "
+#~ "أجهزة تعمل على ديبيان Sarge 3.1 لن يكونوا قادرين على الاتصال باستخدام "
+#~ "الحسابات الحديثة أو الحسابات التي تم تغيير كلمة مرورها."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/ca.po b/mysql-wsrep-5.6/packaging/deb-in/po/ca.po
new file mode 100644 (file)
index 0000000..7b0721c
--- /dev/null
@@ -0,0 +1,227 @@
+# mysql-dfsg (debconf) translation to Catalan.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Aleix Badia i Bosch <abadia@ica.es> 2004
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-4.1\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2004-01-31 19:20GMT\n"
+"Last-Translator: Aleix Badia i Bosch <abadia@ica.es>\n"
+"Language-Team: Debian L10n Catalan <debian-l10n-catalan@lists.debian.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Aquest fitxer indica que anteriorment s'ha instaŀlat un paquet mysql-server "
+"amb una versió posterior."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"No hi ha cap garantia que la versió que esteu instaŀlant actualment puga "
+"emprar les bases de dades actuals."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid "Important note for NIS/YP users!"
+msgid "Important note for NIS/YP users"
+msgstr "Nota important pels usuaris de NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Si empreu MySQL sota NIS/YP, heu d'afegir un compte d'usuari mysql al "
+"sistema local amb:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"També hauríeu de comprovar els permisos i propietaris del directori /var/"
+"lib/mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"El directori /var/lib/mysql que conté les bases de dades de MySQL està a "
+"punt deser suprimit."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Si esteu suprimint el paquet MySQL per a posteriorment instaŀlar una versió "
+"més recent, o si un paquet mysql-server diferent ja l'està emprant, les "
+"dades s'haurien de mantenir."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+#, fuzzy
+#| msgid "Should MySQL start on boot?"
+msgid "Start the MySQL server on boot?"
+msgstr "Voleu que el MySQL s'iniciï a l'arrencada ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+#, fuzzy
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"El MySQL es pot executar automàticament a l'arrencada o manualment amb "
+"l'ordre «/etc/init.d/mysql start»."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Tot i que no és requerida, és molt recomanable que establiu una "
+"contrasenya per a «root», l'usuari administratiu del MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"S'ha produït un error en establir la contrasenya de l'usuari administratiu "
+"del MySQL. Això pot haver passat perquè el compte ja té una una "
+"contrasenya, o per un problema de comunicació amb el servidor de MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"Hauríeu de comprovar la contrasenya del compte després de la instaŀlació "
+"del paquet."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Llegiu el fitxer /usr/share/doc/mysql-server-5.1/README.Debian per a obtenir "
+"més informació."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+"Les dos contrasenyes que heu introduït no són la mateixa. Proveu-ho de nou."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+
+#~ msgid ""
+#~ "MySQL-5.1 no longer provides NDB Cluster support. Please migrate to the "
+#~ "new "
+#~ msgstr ""
+#~ "El MySQL-5.1 ja no implementa el clúster NDB. Migreu al nou paquet mysql-"
+#~ "cluster i suprimiu totes les línies que comencen per «ndb» de tots els "
+#~ "fitxers de configuració sota /etc/mysql/."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/cs.po b/mysql-wsrep-5.6/packaging/deb-in/po/cs.po
new file mode 100644 (file)
index 0000000..a6be13b
--- /dev/null
@@ -0,0 +1,346 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.6\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2007-05-01 13:01+0200\n"
+"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
+"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Opravdu pokračovat v degradaci?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "V systému existuje soubor /var/lib/mysql/debian-*.flag."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid ""
+#| "Such file is an indication that a mysql-server package with a higher "
+#| "version has been installed earlier."
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr "To znamená, že již byl nainstalován balík mysql-server s vyšší verzí."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Neexistuje žádná záruka, že momentálně instalovaná verze bude umět pracovat "
+"se stávajícími databázemi."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Důležitá poznámka pro uživatele NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid ""
+#| "You should also check the permissions and the owner of the /var/lib/mysql "
+#| "directory:"
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Také byste měli zkontrolovat vlastníka a oprávnění adresáře /var/lib/mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Odstranit všechny MySQL databáze?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"Adresář /var/lib/mysql, ve kterém se nachází MySQL databáze, bude odstraněn."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Jestliže odstraňujete balík MySQL za účelem instalace novější verze MySQL, "
+"nebo pokud tato data souběžně využívá jiný balík mysql-server, měli byste "
+"data ponechat."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Spustit MySQL server při startu systému?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL se může spouštět automaticky při startu systému, nebo ručně příkazem '/"
+"etc/init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nové heslo MySQL uživatele \"root\":"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Přestože to není nezbytné, je silně doporučeno nastavit heslo u "
+"správcovského MySQL účtu \"root\"."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid "If that field is left blank, the password will not be changed."
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Ponecháte-li pole prázdné, heslo se nezmění."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+#, fuzzy
+#| msgid "New password for the MySQL \"root\" user:"
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Nové heslo MySQL uživatele \"root\":"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Nelze nastavit heslo MySQL uživatele \"root\""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Během nastavování hesla pro správcovského uživatele MySQL se vyskytla chyba. "
+"To se mohlo stát třeba proto, protože uživatel již měl heslo nastaveno, nebo "
+"protože nastal problém v komunikaci s MySQL serverem."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "You should check the account's password after tha package installation."
+msgid "You should check the account's password after the package installation."
+msgstr "Po instalaci balíku byste měli heslo ověřit."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Více informací naleznete v /usr/share/doc/mysql-server-5.6/README.Debian."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "Abyste mohli MySQL používat, musíte v systému založit následující "
+#~ "uživatele a skupiny:"
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Aktualizace nelze provést pokud jsou přítomny tabulky ISAM!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.6 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "Poslední verze MySQL již nemohou používat starý formát tabulek ISAM a "
+#~ "před aktualizací je nutné převést tyto tabulky např. do formátu MyISAM "
+#~ "pomocí \"mysql_convert_table_format\" nebo \"ALTER TABLE x ENGINE=MyISAM"
+#~ "\". Instalace mysql-server-5.6 se nyní přeruší. V případě, že se mezitím "
+#~ "odinstaloval původní mysql-server-4.1, jednoduše jej znovu nainstalujte a "
+#~ "tabulky převeďte."
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "Podporovat MySQL připojení z počítačů používajících Debian Sarge nebo "
+#~ "starší?"
+
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "Způsob, jakým se dříve ukládala hesla, nebyl příliš bezpečný. To se nyní "
+#~ "zlepšilo, ale nevýhodou je, že se klienti z Debianu 3.1 Sarge (např. PHP) "
+#~ "nebudou moci připojit na nové účty, nebo na účty, u nichž se heslo "
+#~ "změnilo."
+
+#~ msgid ""
+#~ "To use mysql you must install an equivalent user and group to the "
+#~ "following and ensure yourself that /var/lib/mysql has the right "
+#~ "permissions (the uid/gid may be different)."
+#~ msgstr ""
+#~ "Abyste mohli mysql používat, musíte do následujících souborů přidat "
+#~ "ekvivalentního uživatele a skupinu a zajistit, že /var/lib/mysql má "
+#~ "správná práva (uid/gid se mohou lišit)."
+
+#~ msgid "Remove the databases used by all MySQL versions?"
+#~ msgstr "Odstranit databáze používané všemi verzemi MySQL?"
+
+#~ msgid ""
+#~ "If you do not provide a password no changes will be made to the account."
+#~ msgstr "Nezadáte-li heslo, žádné změny se s účtem neprovedou."
+
+#~ msgid ""
+#~ "When installation finishes, you should verify that the account is "
+#~ "properly protected with a password (see README.Debian for more "
+#~ "information)."
+#~ msgstr ""
+#~ "Po skončení instalace byste měli ověřit, že je účet chráněn heslem (více "
+#~ "informací naleznete v souboru README.Debian)."
+
+#~ msgid "Update Hints"
+#~ msgstr "Poznámky k aktualizaci"
+
+#~ msgid ""
+#~ "You have to run \"mysql_upgrade\" after the upgrade, else tables can be  "
+#~ "corrupted! This script also enhances the privilege tables but is not  "
+#~ "supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Po aktualizaci ještě musíte spustit \"mysql_upgrade\", protože jinak by "
+#~ "se tabulky mohly narušit! Tento skript také rozšiřuje tabulky privilegií, "
+#~ "ovšem neměl by uživatelům přidat více práv, než měli dosud."
+
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Také si přečtěte http://www.mysql.com/doc/en/Upgrade.html"
+
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "MySQL se nainstaluje pouze v případě, že používáte nenumerické jméno "
+#~ "počítače, které se dá přeložit přes soubor /etc/hosts. Např. když příkaz "
+#~ "\"hostname\" vrátí \"diamond\", tak v /etc/hosts musí existovat obdobný "
+#~ "řádek jako \"10.0.0.1 diamond\"."
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Bude vytvořen nový mysql uživatel \"debian-sys-maint\". Tento mysql účet "
+#~ "se používá ve startovacích, ukončovacích a cronových skriptech. Nemažte "
+#~ "jej."
+
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Nezapomeňte nastavit heslo pro účet administrátora MySQL! Používáte-li /"
+#~ "root/.my.cnf, vždy zde zadejte jak řádek \"user\", tak řádek \"password"
+#~ "\". Nikdy zde nezadávejte jenom heslo!"
+
+#~ msgid ""
+#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
+#~ "by all MySQL versions, not necessarily only the one you are about to "
+#~ "purge?"
+#~ msgstr ""
+#~ "Mám odstranit kompletní adresářový strom /var/lib/mysql, který se používá "
+#~ "pro všechny verze MySQL, tedy ne nutně pouze pro verzi, kterou se "
+#~ "chystáte vyčistit?"
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/da.po b/mysql-wsrep-5.6/packaging/deb-in/po/da.po
new file mode 100644 (file)
index 0000000..94019aa
--- /dev/null
@@ -0,0 +1,222 @@
+# Danish translation mysql-5.1.
+# Copyright (C) 2010 mysql-5.1 & nedenstående oversættere.
+# This file is distributed under the same license as the mysql-5.1 package.
+# Claus Hindsgaul <claus_h@image.dk> 2005, 2006, 2007.
+# Joe Hansen <joedalton2@yahoo.dk>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-5.1\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2010-10-07 05:26+0100\n"
+"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
+"Language-Team: Danish <debian-l10n-danish@lists.debian.org> \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Ønsker du virkelig at fortsætte nedgraderingen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "Der er en fil med navnet /var/lib/mysql/debian-*.flag på dette system."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Sådan en fil tyder på, at der tidligere har været installeret en højere "
+"version af mysql-server-pakken."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Det kan ikke garanteres at den version, du er ved at installere, kan benytte "
+"data fra de eksisterende databaser."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Vigtig oplysning til NIS/YP-brugere"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Brug af MySQL under NIS/YP kræver at en mysql-brugerkonto tilføjes på det "
+"lokale system med:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Du bør også tjekke rettighederne og ejerskabet af mappen /var/lib/mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Fjern alle MySQL-databaser?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"Mappen /var/lib/mysql, der indeholder MySQL-databaserne, er ved at blive "
+"fjernet."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Hvis du fjerner MySQL-pakken for senere at installere en nyere version, "
+"eller hvis en anden mysql-server-pakke allerede benytter den, bør dataene "
+"bevares."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Start MySQL-serveren under systemopstart?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL-serveren kan enten startes op automatisk under systemopstarten, eller "
+"manuelt med kommandoen '/etc/init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Ny adgangskode for MySQL's »rootbruger«:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Selvom det ikke kræves, anbefales det kraftigt, at du sætter en adgangskode "
+"for MySQL's administrationsbruger »root«."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Hvis du lader dette felt stå tomt, vil adgangskoden ikke blive ændret."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Gentag adgangskode for MySQL's »root-bruger«:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Kunne ikke sætte adgangskoden for MySQL's »root-bruger«"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Der opstod en fejl, da adgangskoden for MySQL's administrationsbruger blev "
+"forsøgt ændret. Dette kan være sket, fordi brugeren allerede har en "
+"adgangskode, eller fordi der var problemer med at kommunikere med MySQL-"
+"serveren."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr "Du bør tjekke kontoens adgangskode efter pakkeinstallationen."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Læs venligst filen /usr/share/doc/mysql-server-5.1/README.Debian for "
+"yderligere oplysninger."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Inddatafejl for adgangskode"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+"De to adgangskoder du indtastede var ikke de samme. Forsøg venligst igen."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "NDB-cluster ser ud til at være i brug"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+#, fuzzy
+#| msgid ""
+#| "MySQL-5.1 no longer provides NDB Cluster support. Please migrate to the "
+#| "new mysql-cluster package and remove all lines starting with \"ndb\" from "
+#| "all config files below /etc/mysql/."
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.1 tilbyder ikke længere NDB-clusterunderstøttelse. Migrer venligst "
+"til den nye pakke mysql-cluster og fjern alle linjer der starter med »ndb« "
+"fra alle konfigurationsfiler under /etc/mysql/."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/de.po b/mysql-wsrep-5.6/packaging/deb-in/po/de.po
new file mode 100644 (file)
index 0000000..844f393
--- /dev/null
@@ -0,0 +1,230 @@
+# translation of mysql-dfsg-5.6_5.6.8-1_de.po to Deutsch
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans#
+#    Developers do not need to manually edit POT or PO files.
+#
+# Alwin Meschede <ameschede@gmx.de>, 2006, 2007.
+# Thomas Mueller <thomas.mueller@tmit.eu>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg 5.6.23-2\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2012-06-03 10:33+0200\n"
+"Last-Translator: Thomas Mueller <thomas.mueller@tmit.eu>\n"
+"Language-Team: german <debian-l10n-german@lists.debian.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms:  nplurals=2; plural=(n != 1);\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Möchten Sie wirklich eine ältere Version einspielen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+"Auf diesem System existiert eine Datei mit dem Namen /var/lib/mysql/debian-*."
+"flag"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Diese Datei ist ein Hinweis darauf, dass früher ein MySQL-Server-Paket mit "
+"einer höheren Version installiert war."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Es kann nicht garantiert werden, dass die gegenwärtig zu installierende "
+"Version dessen Daten benutzen kann."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Wichtige Anmerkung für NIS/YP-Benutzer!"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Falls MySQL mit NIS/YP genutzt wird, ist ein »mysql«-Benutzerkonto auf dem "
+"lokalen System notwendig:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Sie sollten außerdem Besitzer und Zugriffsrechte des Verzeichnisses /var/lib/"
+"mysql überprüfen:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Alle MySQL-Datenbanken entfernen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"Das Verzeichnis /var/lib/mysql mit den MySQL-Datenbanken soll entfernt "
+"werden."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Falls geplant ist, nur eine höhere Version von MySQL zu installieren oder "
+"ein anderes mysql-server-Paket dieses bereits benutzt, sollten die Daten "
+"behalten werden."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Soll der MySQL-Server automatisch beim Booten starten?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"Der MySQL-Dienst kann entweder automatisch beim Systemstart oder manuell "
+"durch Eingabe des Befehls »/etc/init.d/mysql start« gestartet werden."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Neues Passwort für den MySQL »root«-Benutzer:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Obwohl es nicht zwingend erforderlich ist, wird nachdrücklich empfohlen für "
+"den administrativen MySQL »root«-Benutzer ein Passwort zu setzen."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Wenn dieses Feld freigelassen wird, wird das Passwort nicht geändert."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Wiederholen Sie das Passwort für den MySQL-»root«-Benutzer:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Konnte für den MySQL-»root«-Benutzer kein Passwort setzen"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Beim setzen des Passworts für den administrativen MySQL-Benutzer ist ein "
+"Fehler aufgetreten. Dies könnte daran liegen, dass der Benutzer bereits ein "
+"Passwort hat oder dass es ein Problem mit der Kommunikation mit dem MySQL-"
+"Server gibt."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"Sie sollten das Passwort des administrativen Benutzers nach der "
+"Paketinstallation prüfen."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Für weitere Informationen lesen Sie /usr/share/doc/mysql-server-5.6/README."
+"Debian."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Passwort-Eingabefehler"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+"Die beiden von Ihnen eingegebenen Passwörter sind nicht identisch. Bitte "
+"erneut versuchen."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "NDB-Cluster scheint gerade benutzt zu werden"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.6 bietet keine NDB-Clusterunterstützung mehr. Bitte migrieren Sie "
+"Ihr System zum neuen »mysql-cluster-server«-Paket und entfernen Sie alle "
+"Zeilen, die mit »ndb« beginnen aus allen Konfigurationsdateien im "
+"Verzeichnis /etc/mysql/."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/es.po b/mysql-wsrep-5.6/packaging/deb-in/po/es.po
new file mode 100644 (file)
index 0000000..10f715c
--- /dev/null
@@ -0,0 +1,382 @@
+# mysql-5.6 translation to spanish
+# Copyright (C) 2005-2012 Software in the Public Interest, SPI Inc.
+# This file is distributed under the same license as the mysql-5.6 package.
+#
+# Changes:
+# - Initial translation
+#       Jesus Aneiros, 2006
+# - Updated
+#       Javier Fernandez-Sanguino, 2006-2012
+# - Revision
+#       Nacho Barrientos Arias
+#       Fernando Cerezal
+#       David Martínez Moreno
+#       Ricardo Mones
+#       Carlos Galisteo
+#       Javier Fernandez-Sanguino
+#       Fernando C. Estrada
+#
+#  Traductores, si no conoce el formato PO, merece la pena leer la 
+#  documentación de gettext, especialmente las secciones dedicadas a este
+#  formato, por ejemplo ejecutando:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+# Equipo de traducción al español, por favor lean antes de traducir
+# los siguientes documentos:
+#
+# - El proyecto de traducción de Debian al español
+#   http://www.debian.org/intl/spanish/
+#   especialmente las notas y normas de traducción en
+#   http://www.debian.org/intl/spanish/notas
+#
+# - La guía de traducción de po's de debconf:
+#   /usr/share/doc/po-debconf/README-trans
+#   o http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+# Si tiene dudas o consultas sobre esta traducción consulte con el último
+# traductor (campo Last-Translator) y ponga en copia a la lista de
+# traducción de Debian al español (<debian-l10n-spanish@lists.debian.org>)
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-5.6\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2012-06-17 09:49-0500\n"
+"Last-Translator: Javier Fernández-Sanguino <jfs@debian.org>\n"
+"Language-Team: Debian l10 Spanish <debian-l10n-spanish@lists.debian.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Virtaal 0.7.1\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "¿Desea realmente continuar con la desactualización?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+"Existe un fichero con el nombre /var/lib/mysql/debian-*.flag en este sistema."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Este fichero indica que se instaló previamente una versión superior del "
+"paquete mysql-server."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"No se puede garantizar que la versión que está instalando pueda usar la base "
+"de datos actual."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Nota importante para los usuarios de NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Utilizar MySQL con NIS/YP requiere que una cuenta de usuario de mysql sea "
+"agregada en el sistema local como:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"También debería comprobar los permisos y el propietario del directorio: /var/"
+"lib/mysql"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "¿Desea eliminar todas las bases de datos MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"El directorio /var/lib/mysql contiene bases de datos MySQL que van a "
+"eliminarse."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Debería mantener los datos si tiene planificado instalar una versión de "
+"MySQL más reciente o si hay un paquete «mysql-server» distinto que los está "
+"utilizando."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "¿Desea que el servidor MySQL se ejecute al iniciar el sistema?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"El servidor MySQL puede iniciarse en el momento de arranque del sistema o "
+"manualmente si escribe la orden «/etc/init.d/mysql start»."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nueva contraseña para el usuario «root» de MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Se recomienda que configure una contraseña para el usuario "
+"«root» (administrador) de MySQL, aunque no es obligatorio."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "No se modificará la contraseña si deja el espacio en blanco."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Nueva contraseña para el usuario «root» de MySQL:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "No se pudo fijar la contraseña para el usuario «root» de MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Se produjo un error mientras intentaba fijar la contraseña para el usuario "
+"administrador de MySQL. Esto puede haber sucedido porque la cuenta ya tenía "
+"una contraseña o porque se produjo un error de comunicación con el servidor "
+"MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"Debería comprobar la contraseña de la cuenta después de la instalación del "
+"paquete."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Consulte /usr/share/doc/mysql-server-5.6/README.Debian para más información."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Se ha producido un error al introducir la contraseña"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+"Las dos contraseñas que ha introducido son distintas. Intente de nuevo."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "NDB Cluster parece estar en uso"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.6 ya no brinda soporte para NDB Cluster. Migre al nuevo paquete "
+"mysql-cluster-server y elimine todas las líneas que empiecen con \"ndb\" de "
+"todos los ficheros de configuración bajo /etc/mysql/."
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "Deben añadirse las siguientes entradas para usuarios y grupos en el "
+#~ "sistema para poder utilizar MySQL:"
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "¡No se puede actualizar si ya hay tablas ISAM!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.6 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "Las versiones recientes de MySQL ya no soportan el antiguo formato de "
+#~ "tabla ISAM. Antes de realizar la actualización es necesario convertir sus "
+#~ "tablas a por ejemplo, MyISAM, usando «mysql_convert_table_format» o "
+#~ "«ALTER TABLE x ENGINE=MyISAM». Se va a interrumpir ahora la instalación "
+#~ "de mysql-server-5.6. Si aún así su mysql-server-4.1 se elimina aún así, "
+#~ "puede reinstalarlo para convertir ese tipo de tablas."
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "¿Soportar las conexiones MySQL establecidadas desde sistemas que ejecutan "
+#~ "Debian Sarge o versiones anteriores?"
+
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "No era muy segura la forma en la que se almacenaban las contraseñas en "
+#~ "versiones anteriores del cliente de MySQL en Debian. Este problema se ha "
+#~ "mejorado posteriormente con el inconveniente, sin embargo, de que "
+#~ "clientes (por ejemplo, PHP) en sistemas que ejecutan Debian 3.1 «Sarge» "
+#~ "no podrán conectarse a cuentas que son nuevas o a las que se le haya "
+#~ "cambiado la contraseña."
+
+#~ msgid ""
+#~ "To use mysql you must install an equivalent user and group to the "
+#~ "following and ensure yourself that /var/lib/mysql has the right "
+#~ "permissions (the uid/gid may be different)."
+#~ msgstr ""
+#~ "Para utilizar mysql debe instalar un usuario y grupo equivalente al "
+#~ "siguiente y asegurarse de que /var/lib/mysql tiene los permisos correctos "
+#~ "(los valores del «uid» y del «gid» pueden ser diferentes)."
+
+#~ msgid ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+#~ msgstr ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#~ msgid "/etc/group:       mysql:x:101:"
+#~ msgstr "/etc/group:       mysql:x:101:"
+
+#~ msgid "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+#~ msgstr "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+
+#~ msgid "Remove the databases used by all MySQL versions?"
+#~ msgstr ""
+#~ "¿Eliminar las bases de datos utilizadas por todas las versiones de MySQL?"
+
+#~ msgid ""
+#~ "If you do not provide a password no changes will be made to the account."
+#~ msgstr ""
+#~ "No se hará ningún cambio en la cuenta si no introduce una contraseña."
+
+#~ msgid ""
+#~ "When installation finishes, you should verify that the account is "
+#~ "properly protected with a password (see README.Debian for more "
+#~ "information)."
+#~ msgstr ""
+#~ "Debería confirmar que la contraseña está correctamente protegida con una "
+#~ "contraseña cuando termine la instalación (consulte el fichero README."
+#~ "Debian si desea más información)."
+
+#~ msgid "Install Hints"
+#~ msgstr "Sugerencias para la instalación"
+
+#~ msgid ""
+#~ "On upgrades from MySQL 3.23, as shipped with Debian Woody, symlinks in "
+#~ "place of /var/lib/mysql or /var/log/mysql gets accidently removed and "
+#~ "have manually be restored."
+#~ msgstr ""
+#~ "Al actualizar a la versión de MySQL 3.23, la vrsión proporcionada en "
+#~ "Debian Woody, se eliminan de manera accidental, los enlaces simbólicos a "
+#~ "«/var/lib/mysql» o «/var/log/mysql» y tienen que restaurarse manualmente."
+
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "Sólo se instalará MySQL si tiene un nombre de equipo que no sea una "
+#~ "dirección IP y pueda resolverse a través del fichero /etc/hosts. Por "
+#~ "ejemplo, si la orden «hostname» devuelve «MiNombreEquipo» entonces deberá "
+#~ "existir una línea «10.0.0.1 MiNombreEquipo» en dicho fichero."
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Se creará un nuevo usuario «debian-sys-maint». Esta cuenta de mysql se "
+#~ "utilizará en los scripts de inicio y parada y en los scripts «cron». No "
+#~ "la elimine."
+
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "¡Por favor, recuerde crear una CONTRASEÑA para el usuario «root» de "
+#~ "MySQL! ¡Si utiliza /root/.my.cnf debe escribir las líneas «user» y "
+#~ "«password» en dicho fichero, no incluya sólo la contraseña!"
+
+#~ msgid ""
+#~ "Should I remove the complete /var/lib/mysql directory tree which is used "
+#~ "by all MySQL versions, not necessarily only the one you are about to "
+#~ "purge?"
+#~ msgstr ""
+#~ "¿Debería eliminar el árbol de directorio /var/lib/mysql completo? Tenga "
+#~ "en cuenta que lo utilizan todas las versiones de MySQL y no sólo la que "
+#~ "está a punto de purgar."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/eu.po b/mysql-wsrep-5.6/packaging/deb-in/po/eu.po
new file mode 100644 (file)
index 0000000..e9878c0
--- /dev/null
@@ -0,0 +1,236 @@
+# translation of eu.po to Euskara
+# Piarres BEobide <pi@beobide.net>, 2006.
+# Piarres Beobide <pi@beobide.net>, 2009.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+msgid ""
+msgstr ""
+"Project-Id-Version: eu\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2009-07-29 11:59+0200\n"
+"Last-Translator: Piarres Beobide <pi@beobide.net>\n"
+"Language-Team: Euskara <debian-l10n-eu@lists.debian.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Benetan bertsio zaharragora itzuli nahi duzu?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "Sisteman badago /var/lib/mysql/debian-*.flag izeneko fitxategi bat."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid ""
+#| "Such file is an indication that a mysql-server package with a higher "
+#| "version has been installed earlier."
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Fitxategi honek aurretik bertsio berriagoko mysql-zerbitzari pakete bat "
+"instalatu dela adierazten du."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Ezin da ziurtatu instalatzen ari zaren bertsio honek dauden datubaseak "
+"erabili ahal izango dituenik."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "NIS/YP erabiltzaileentzat ohar garrantzitsua"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid ""
+#| "You should also check the permissions and the owner of the /var/lib/mysql "
+#| "directory:"
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Honetaz gain /var/lib/mysql direktorioaren jabea eta baimenak egiaztatu "
+"beharko zenituzke:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Ezabatu MySQL datubase guztiak?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr "MySQL datubaseak dituen /var/lib/mysql direktorioa ezabatua izango da."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"MySQL paketea beranduago bertsio berriago bat instalatzeko kentzen ari "
+"bazara, edo beste mysql-server pakete bat berau erabiltzen ari bada, datuak "
+"mantendu egin beharko lirateke."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Abioan MySQL zerbitzaria abiarazi?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"Sistema abioan MySQL automatikoki abiarazi daiteke edo eskuz '/etc/init.d/"
+"mysql start' eginaz."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "MySQL \"root\" erabiltzailearen pasahitz berria:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Derrigorrezkoa ez denean, oso gomendagarria da MySQL administratzaile \"root"
+"\" erabiltzaileari pasahitz bat ezartzea."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid "If that field is left blank, the password will not be changed."
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Eremua hau zurian utziaz gero ez da pasahitza aldatuko."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Errepikatu MySQL \"root\" erabiltzailearen pasahitza:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Ezin da MySQL \"root\" erabiltzailearen pasahitza ezarri"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Errore bat gertatu da MySQL administratzaile kontuaren pasahitza ezartzean.  "
+"Hau erabiltzaileak dagoeneko pasahitz bat duelako edo MySQL "
+"zerbitzariarekiko konexioan erroreak daudelako gertatu daiteke."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"Kontuaren pasahitza egiaztatu beharko zenuke paketea instalatu aurretik."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Mesedez irakurri /usr/share/doc/mysql-server-5.6/README.Debian fitxategia "
+"xehetasun gehiagorako."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Pasahitz sarrera errorea"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr "Idatzi dituzun bi pasahitzak ez dira berdina. Mesedez saiatu berriz."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "Dirudienez NDB Cluster-a erabilia dago"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+#, fuzzy
+#| msgid ""
+#| "MySQL-5.6 has orphaned NDB Cluster support. Please migrate to the new "
+#| "mysql-cluster package and remove all lines starting with \"ndb\" from all "
+#| "config files below /etc/mysql/."
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.6-ek NDB cluster euskarri umezurtz bat behar du. Mesedez migratu "
+"mysql-cluster pakete berrira eta /etc/mysql/ azpiko konfigurazio fitxategi "
+"guztietan \"ndb\"-ez hasten diren lerro guztiak ezabatu."
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "MySQL erabili ahal izateko, hurrengo erabiltzaile eta taldeak gehitu "
+#~ "behar dira sisteman:"
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/fr.po b/mysql-wsrep-5.6/packaging/deb-in/po/fr.po
new file mode 100644 (file)
index 0000000..9ced0c0
--- /dev/null
@@ -0,0 +1,242 @@
+# Translation of mysql-dfsg-* debconf templates to French
+# Copyright (C) 2004-2009 Debian French l10n team <debian-l10n-french@lists.debian.org>
+# This file is distributed under the same license as the mysql-dfsg-* packages.
+#
+# Translators:
+# Christian Perrier <bubulle@debian.org>, 2004, 2006, 2007, 2009, 2012.
+msgid ""
+msgstr ""
+"Project-Id-Version: fr\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2012-05-22 08:30+0200\n"
+"Last-Translator: Christian Perrier <bubulle@debian.org>\n"
+"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"debian.org>\n"
+"X-Generator: Lokalize 1.2\n"
+"Plural-Forms: Plural-Forms: nplurals=2; plural=n>1;\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Faut-il vraiment revenir à la version précédente ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "Un fichier /var/lib/mysql/debian-*.flag est présent sur ce système."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Cela indique qu'une version plus récente du paquet mysql-server a été "
+"précédemment installée."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr "Il n'est pas garanti que cette version puisse en utiliser les données."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Note importante pour les utilisateurs NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"L'utilisation de MySQL avec NIS/YP impose l'ajout d'un compte local "
+"« mysql » avec la commande :"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Vous devez également vérifier le propriétaire et les permissions du "
+"répertoire /var/lib/mysql :"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Faut-il supprimer toutes les bases de données MySQL ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"Le répertoire /var/lib/mysql qui contient les bases de données de MySQL va "
+"être supprimé."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Si vous prévoyez d'installer une version plus récente de MySQL ou si un "
+"autre paquet mysql-server les utilise déjà, vous devriez les conserver."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Faut-il lancer MySQL au démarrage ?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL peut être lancé soit au démarrage, soit en entrant la commande « /etc/"
+"init.d/mysql start »."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nouveau mot de passe du superutilisateur de MySQL :"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Il est très fortement recommandé d'établir un mot de passe pour le compte "
+"d'administration de MySQL (« root »)."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Si ce champ est laissé vide, le mot de passe ne sera pas changé."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Confirmation du mot de passe du superutilisateur de MySQL :"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr ""
+"Impossible de changer le mot de passe de l'utilisateur « root » de MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Une erreur s'est produite lors du changement de mot de passe du compte "
+"d'administration. Un mot de passe existait peut-être déjà ou il n'a pas été "
+"possible de communiquer avec le serveur MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"Vous devriez vérifier le mot de passe de ce compte après l'installation du "
+"paquet."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Veuillez consulter le fichier /usr/share/doc/mysql-server-5.6/README.Debian "
+"pour plus d'informations."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Erreur de saisie du mot de passe"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+"Le mot de passe et sa confirmation ne sont pas identiques. Veuillez "
+"recommencer."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "Abandon de la gestion de NDB"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"La version 5.6 de MySQL ne gère plus les grappes NDB. Vous devriez utiliser "
+"le paquet mysql-cluster-server et supprimer toutes les lignes commençant par "
+"« ndb » des fichiers de configuration situés dans /etc/mysql."
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "Pour pouvoir utiliser MySQL, les utilisateurs et les groupes suivants "
+#~ "doivent être ajoutés au système :"
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "Gérer les connexions d'hôtes qui utilisent les versions Debian « sarge » "
+#~ "ou antérieures  ?"
+
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "La méthode de stockage des mots de passe n'était pas très sûre dans les "
+#~ "version précédentes de ce paquet. Cette méthode a été améliorée mais les "
+#~ "modifications empêchent la connexion avec de nouveaux comptes ou des "
+#~ "comptes dont le mot de passe a été modifié, pour les clients (p. ex. PHP) "
+#~ "depuis des hôtes qui utilisent Debian 3.1 « sarge »."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/gl.po b/mysql-wsrep-5.6/packaging/deb-in/po/gl.po
new file mode 100644 (file)
index 0000000..6bb1407
--- /dev/null
@@ -0,0 +1,249 @@
+# Galician translation of mysql-dfsg-5.6's debconf templates
+# This file is distributed under the same license as the mysql-dfsg-5.6 package.
+# Jacobo Tarrio <jtarrio@debian.org>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.6\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2007-04-20 09:44+0200\n"
+"Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n"
+"Language-Team: Galician <proxecto@trasno.net>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "¿Quere pasar a unha versión anterior?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "Neste sistema hai un ficheiro chamado /var/lib/mysql/debian-*.flag."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid ""
+#| "Such file is an indication that a mysql-server package with a higher "
+#| "version has been installed earlier."
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Este ficheiro indica que antes se instalou un paquete mysql-server cunha "
+"versión superior."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Non se pode garantir que a versión que está a instalar poida empregar as "
+"bases de datos actuais."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Nota importante para os usuarios de NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid ""
+#| "You should also check the permissions and the owner of the /var/lib/mysql "
+#| "directory:"
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Tamén debería comprobar os permisos e o propietario do directorio /var/lib/"
+"mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "¿Eliminar tódalas bases de datos de MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"Hase eliminar o directorio /var/lib/mysql, que contén as bases de datos de "
+"MySQL."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Se está a eliminar o paquete MySQL para instalar despois unha versión máis "
+"recente ou se xa hai un paquete mysql-server diferente a empregalo, debería "
+"conservar os datos."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "¿Iniciar o servidor MySQL co ordenador?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"Pódese iniciar automaticamente o servidor MySQL ao iniciar o ordenador, ou "
+"manualmente coa orde \"/etc/init.d/mysql start\"."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Novo contrasinal para o usuario \"root\" de MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Aínda que non é obrigatorio, recoméndase encarecidamente que estableza un "
+"contrasinal para o usuario administrativo \"root\" de MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid "If that field is left blank, the password will not be changed."
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Se deixa o campo en branco, non se ha cambiar o contrasinal."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+#, fuzzy
+#| msgid "New password for the MySQL \"root\" user:"
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Novo contrasinal para o usuario \"root\" de MySQL:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Non se puido establecer o contrasinal do usuario \"root\" de MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Houbo un erro ao establecer o contrasinal do usuario administrativo de "
+"MySQL. Puido ocorrer porque o usuario xa teña un contrasinal ou debido a un "
+"problema de comunicacións co servidor MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "You should check the account's password after tha package installation."
+msgid "You should check the account's password after the package installation."
+msgstr "Debería comprobar o contrasinal da conta trala instalación do paquete."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Consulte o ficheiro /usr/share/doc/mysql-server-5.6/README.Debian para máis "
+"información."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "Para empregar MySQL deberían engadirse ao sistema as seguintes entradas "
+#~ "de usuarios e grupos:"
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "¿Soportar as conexións a MySQL de máquinas que empreguen Debian \"sarge\" "
+#~ "ou anterior?"
+
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "Nas versións antigas dos clientes MySQL de Debian, os contrasinais non se "
+#~ "armacenaban de xeito seguro. Isto mellorouse desde aquela; nembargantes, "
+#~ "os clientes (tales coma PHP) das máquinas que executen Debian 3.1 Sarge "
+#~ "non se han poder conectar a contas recentes ou a contas nas que se "
+#~ "cambiara o contrasinal."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/it.po b/mysql-wsrep-5.6/packaging/deb-in/po/it.po
new file mode 100644 (file)
index 0000000..b0567e5
--- /dev/null
@@ -0,0 +1,223 @@
+# Italian (it) translation of debconf templates for mysql-dfsg-5.6\r
+# Copyright (C) 2009 Software in the Public Interest\r
+# This file is distributed under the same license as the mysql-dfsg-5.6 package.\r
+# Luca Monducci <luca.mo@tiscali.it>, 2006 - 2009.\r
+# \r
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.6 5.6.8 italian debconf templates\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2009-08-08 11:03+0200\n"
+"Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n"
+"Language-Team: Italian <debian-l10n-italian@lists.debian.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Procedere realmente con l'abbassamento di versione?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+"Su questo sistema esiste un file con nome /var/lib/mysql/debian-*.flag."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Quel file indica che in precedenza è stata installata una versione superiore "
+"del pacchetto mysql-server."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Non è garantito che la versione che si sta installando sia in grado di usare "
+"i database presenti."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Nota importante per gli utenti NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Per usare MySQL con NIS/YP è necessario aggiungere al sistema locale un "
+"account utente per mysql con:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Inoltre si devono verificare i permessi e la proprietà della directory /var/"
+"lib/mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Eliminare tutti i database MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"La directory /var/lib/mysql contenente i database di MySQL sta per essere "
+"eliminata."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Se si rimuove il pacchetto MySQL per poi installare una versione più recente "
+"oppure se sono già in uso da un altro pacchetto mysql-server, i dati non "
+"devono essere eliminati."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Lanciare il server MySQL all'avvio?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"Il server MySQL può essere lanciato automaticamente all'avvio del sistema "
+"oppure manualmente con il comando «/etc/init.d/mysql start»."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nuova password per l'utente «root» di MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Sebbene non sia obbligatoria, si raccomanda d'impostare una password per "
+"l'utente d'amministrazione «root» di MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Se questo campo è lasciato vuoto, la password non viene cambiata."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Ripetere la password per l'utente «root» di MySQL:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Impossibile impostare la password per l'utente «root» di MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Si è verificato un errore durante l'impostazione della password per l'utente "
+"d'amministrazione di MySQL. Questo può essere accaduto perché l'utente ha "
+"già una password oppure a causa di un problema di connessione con il server "
+"MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"Al termine dell'installazione si deve verificare la password dell'account."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Per maggiori informazioni si consulti il file /usr/share/doc/mysql-"
+"server-5.6/README.Debian."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Errore di inserimento della password"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr "Le due password inserite sono diverse. Riprovare."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "È in uso un cluster NDB"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+#, fuzzy
+#| msgid ""
+#| "MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the "
+#| "new mysql-cluster package and remove all lines starting with \"ndb\" from "
+#| "all config files below /etc/mysql/."
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.6 non fornisce più il supporto per i cluster NDB. Si dovrebbe "
+"migrare al nuovo pacchetto mysql-cluster e rimuovere tutte le righe che "
+"iniziano per \"ndb\" da tutti i file di configurazione sotto /etc/mysql/."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/ja.po b/mysql-wsrep-5.6/packaging/deb-in/po/ja.po
new file mode 100644 (file)
index 0000000..796d5e3
--- /dev/null
@@ -0,0 +1,229 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.6 5.6.8-1\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2009-09-01 08:25+0900\n"
+"Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\n"
+"Language-Team: Japanese <debian-japanese@lists.debian.org>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "本当にダウングレードを実行しますか?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+"このシステムには  /var/lib/mysql/debian-*.flag という名前のファイルが存在して"
+"います。"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"このファイルが意味するのは、以前により新しいバージョンの mysql-server パッ"
+"ケージがインストールされていたことを示します。"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"このデータベースを現在インストールしようとしているバージョンで使えるかどうか"
+"は保証できません。"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "NIS/YP ユーザへの重要な注意"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"NIS/YP 配下で MySQL を使うにはローカルのシステムに mysql のユーザアカウントを"
+"追加するのが必要です。"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr "/var/lib/mysql の所有者権限をチェックする必要もあります。"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "すべての MySQL データベースを削除しますか?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"MySQL データベースを含んでいるディレクトリ /var/lib/mysql を削除しようとして"
+"います。"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"後でより新しいバージョンのものをインストールしようとするために MySQL パッケー"
+"ジを削除しようとしている、あるいは別の mysql-server パッケージを既に使ってい"
+"る場合、データは保持する必要があります。"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "MySQL をシステム起動時に開始しますか?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL の起動方法について、システム起動時に自動的に開始するか、あるいは '/etc/"
+"init.d/mysql start' と手で入力して起動するかを選べます。"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "MySQL の \"root\" ユーザに対する新しいパスワード:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"強制ではありませんが、MySQL を管理する \"root\" ユーザのパスワードを設定する"
+"ことを強くお勧めします。"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "この値を空のままにしておいた場合は、パスワードは変更されません。"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "MySQL の \"root\" ユーザに対する新しいパスワード:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "MySQL の \"root\" ユーザのパスワードを設定できません"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"MySQL の管理者ユーザに対してパスワードを設定しようとした際、エラーが発生しま"
+"した。これは既に管理者ユーザにパスワードが設定されていたか、MySQL サーバとの"
+"接続に問題があったためだと思われます。"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"パッケージのインストール後、アカウントのパスワードを確認する必要があります。"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"詳細は /usr/share/doc/mysql-server-5.6/README.Debian を参照してください。"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "パスワード入力エラー"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr "入力された二つのパスワードが一致しません。再入力してください。"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "NDB クラスタが利用されているようです"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+#, fuzzy
+#| msgid ""
+#| "MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the "
+#| "new mysql-cluster package and remove all lines starting with \"ndb\" from "
+#| "all config files below /etc/mysql/."
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.6 では NDB クラスタのサポートを提供しなくなっています。新たな mysql-"
+"cluster パッケージに移行して、/etc/mysql 以下の設定ファイルすべてから「ndb」"
+"で始まる行を削除してください。"
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/nb.po b/mysql-wsrep-5.6/packaging/deb-in/po/nb.po
new file mode 100644 (file)
index 0000000..d3c9d0e
--- /dev/null
@@ -0,0 +1,297 @@
+# translation of mysql_nb.po to Norwegian Bokmål
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Bjørn Steensrud <bjornst@powertech.no>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql_nb\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2007-02-18 12:13+0100\n"
+"Last-Translator: Bjørn Steensrud <bjornst@powertech.no>\n"
+"Language-Team: Norwegian Bokmål <i18n-nb@lister.ping.uio.no>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.2\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid "Do you really want to downgrade?"
+msgid "Really proceed with downgrade?"
+msgstr "Er du sikker på at du vil nedgradere?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid ""
+#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates "
+#| "that a mysql-server package with a higher version has been installed "
+#| "before. It can not be guaranteed that this version can use its data."
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"ADVARSEL: Fila /var/lib/mysql/debian-*.flag finnes. Dette viser at en mysql-"
+"server-pakke med et høyere versjonsnummer har vært installert før. Det kan "
+"ikke garanteres at denne versjonen kan bruke data fra den høyere versjonen."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid "Important note for NIS/YP users!"
+msgid "Important note for NIS/YP users"
+msgstr "Viktig merknad for NIS/YP-brukere!"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+#, fuzzy
+#| msgid ""
+#| "The script is about to remove the data directory /var/lib/mysql. If it is "
+#| "planned to just install a higher MySQL version or if a different mysql-"
+#| "server package is already using it, the data should be kept."
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Dette skriptet skal til å fjerne data-mappa /var/lib/mysql. Denne mappa bør "
+"beholdes hvis det bare skal installeres en høyere MySQL-versjon, eller hvis "
+"en annen mysql-server-pakke allerede bruker den."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+#, fuzzy
+#| msgid "Should MySQL start on boot?"
+msgid "Start the MySQL server on boot?"
+msgstr "Skal MySQL startes ved maskinoppstart?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+#, fuzzy
+#| msgid ""
+#| "The MySQL can start automatically on boot time or only if you manually "
+#| "type '/etc/init.d/mysql start'."
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL kan startes automatisk når maskinen starter, eller bare hvis du "
+"skriver «/etc/init.d/mysql start»."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid "New password for MySQL \"root\" user:"
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nytt passord for MySQLs «root»-bruker:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid ""
+#| "It is highly recommended that you set a password for the MySQL "
+#| "administrative \"root\" user."
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Det anbefales sterkt at du oppgir et passord for den administrative «root»-"
+"brukeren i MySQl."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+#, fuzzy
+#| msgid "New password for MySQL \"root\" user:"
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Nytt passord for MySQLs «root»-bruker:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid "Unable to set password for MySQL \"root\" user"
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Klarer ikke angi passord for MySQLs «root»-bruker"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "It seems an error occurred while setting the password for the MySQL "
+#| "administrative user.  This may have happened because the user already has "
+#| "a password, or because there was a problem communicating with the MySQL "
+#| "server."
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Det ser ut til at det oppsto en feil mens det ble satt et passord for MySQLs "
+"administrative bruker. Dette kan være fordi brukeren allerede har et "
+"passord, eller fordi det var et kommunikasjonsproblem med MySQL-tjeneren."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "Skal MySQL-tilkoblinger støttes fra vertsmaskiner som kjører Debian "
+#~ "«sarge» eller eldre?"
+
+#, fuzzy
+#~| msgid ""
+#~| "The way passwords were stored was not very secure. This has been "
+#~| "improved with the drawback that clients (e.g. PHP) from hosts running "
+#~| "Debian 3.1 Sarge will not be able to connect to account which are new or "
+#~| "whose password have been changed. See /usr/share/doc/mysql-server-5.6/"
+#~| "README.Debian."
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "Passord ble tidligere lagret på en lite sikker måte. Dette er nå "
+#~ "forbedret, med den ulempen at klienter (f.eks. PHP) fra verter som kjører "
+#~ "Debian 3.1 Sarge ikke vil kunne koble til en konto som er ny eller har "
+#~ "fått endret passordet. Se /usr/share/doc/mysql-server-5.6/README.Debian."
+
+#~ msgid ""
+#~ "To use mysql you must install an equivalent user and group to the "
+#~ "following and ensure yourself that /var/lib/mysql has the right "
+#~ "permissions (the uid/gid may be different)."
+#~ msgstr ""
+#~ "For å bruke MySQL må du installere en bruker og gruppe tilsvarende den "
+#~ "nedenfor og se til at /var/lib/mysql har riktige rettigheter (uid/gid kan "
+#~ "være forskjellig)."
+
+#~ msgid ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+#~ msgstr ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#~ msgid "/etc/group:       mysql:x:101:"
+#~ msgstr "/etc/group:       mysql:x:101:"
+
+#~ msgid "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+#~ msgstr "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+
+#~ msgid "Remove the databases used by all MySQL versions?"
+#~ msgstr "Skal databasene brukt av alle MySQL-versjoner fjernes?"
+
+#~ msgid ""
+#~ "If you do not provide a password no changes will be made to the account."
+#~ msgstr ""
+#~ "Hvis du ikke oppgir et passord blir det ikke gjort noen endringer med "
+#~ "kontoen."
+
+#~ msgid ""
+#~ "When installation finishes, you should verify that the account is "
+#~ "properly protected with a password (see README.Debian for more "
+#~ "information)."
+#~ msgstr ""
+#~ "Når installasjonen er ferdig bør det sjekkes at kontoen er ordentlig "
+#~ "beskyttet med et passord (mer informasjon finnes i README.Debian)."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/nl.po b/mysql-wsrep-5.6/packaging/deb-in/po/nl.po
new file mode 100644 (file)
index 0000000..8ddab3c
--- /dev/null
@@ -0,0 +1,219 @@
+# Dutch mysql-dfsg-5.6 po-debconf translation,
+# Copyright (C) 2006 THE PACKAGE'S COPYRIGHT HOLDER
+#
+# Vincent Zweije <zweije@xs4all.nl>, 2006.
+# Eric Spreen <erispre@gmail.com, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-5.6 5.6.6-1\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2012-05-23 10:26+0200\n"
+"Last-Translator: Jeroen Schot <schot@a-eskwadraat.nl>\n"
+"Language-Team: Debian l10n Dutch <debian-l10n-dutch@lists.debian.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Wilt u echt een oude versie herstellen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+"Er bestaat een bestand genaamd /var/lib/mysql/debian-*.flag op dit systeem."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Zulk een bestand geeft aan dat er eerder een pakket mysql-server met een "
+"hogere versie is geïnstalleerd."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Er is geen garantie dat de versie die u op dit moment installeert de huidige "
+"databases kan gebruiken."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Belangrijke opmerking voor gebruikers van NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Het gebruik van MySQL onder NIS/YP vereist dat een MySQL gebruikersaccount "
+"wordt toegevoegd aan het lokale systeem met:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"U dient ook de permissies en eigenaren van de map /var/lib/mysql te "
+"controleren:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Wilt u alle MySQL-databases verwijderen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"De map /var/lib/mysql die de MySQL-databases bevat staat op het punt om "
+"verwijderd te worden."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Als u het MySQL-pakket verwijdert om later een meer recente versie te "
+"installeren of als een ander mysql-server pakket het al gebruikt, zou de "
+"data behouden moeten worden."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Moet MySQL starten als de computer start?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"De MySQL-server kan automatisch worden gestart bij het starten van de "
+"computer of slechts wanneer u '/etc/init.d/mysql start' handmatig uitvoert."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nieuw wachtwoord voor de MySQL \"root\"-gebruiker:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Hoewel niet verplicht, wordt het sterk aangeraden een wachtwoord in te "
+"stellen voor de administratieve MySQL \"root\"-gebruiker."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr ""
+"Als dit veld leeg wordt gelaten, zal het wachtwoord niet worden veranderd."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Herhaal het wachtwoord voor de MySQL \"root\"-gebruiker:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Kan het wachtwoord voor de MySQL \"root\"-gebruiker niet instellen"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Er is een fout opgetreden bij het instellen van het wachtwoord voor de MySQL "
+"administratieve gebruiker. Dat kan komen doordat de gebruiker al een "
+"wachtwoord heeft, of omdat er een probleem was bij het communiceren met de "
+"MySQL-server."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"U zou het wachtwoord van het account moeten controleren nadat het pakket is "
+"geïnstalleerd."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Leest u het bestand /usr/share/doc/mysql-server-5.6/README.Debian voor meer "
+"informatie."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Fout bij invoer wachtwoord"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+"De twee wachtwoorden die u hebt ingevoerd zijn niet gelijk. Probeert u het "
+"opnieuw."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "De NDB-cluster lijkt in gebruik te zijn"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.6 biedt niet langer ondersteuning voor NDB Cluster. Migreer naar het "
+"nieuwe pakket mysql-cluster en verwijder alle regels die beginnen met \"ndb"
+"\" van alle configuratiebestanden onder /etc/mysql/."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/pt.po b/mysql-wsrep-5.6/packaging/deb-in/po/pt.po
new file mode 100644 (file)
index 0000000..f142e86
--- /dev/null
@@ -0,0 +1,296 @@
+# Portuguese translation for mysql-dfsg-5.6's debconf messages
+# Copyright (C) 2006 Miguel Figueiredo <elmig@debianpt.org>
+# This file is distributed under the same license as the mysql-dfsg-5.6 package.
+# Miguel Figueiredo <elmig@debianpt.org>, 2012
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.6\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2012-05-28 22:40+0100\n"
+"Last-Translator: Miguel Figueiredo <elmig@debianpt.org>\n"
+"Language-Team: Portuguese <traduz@debianpt.org>\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Deseja mesmo fazer downgrade?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+"Existe, neste sistema, um ficheiro chamado /var/lib/mysql/debian-*.flag."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"A existência de tal ficheiro é um indicador que anteriormente foi instalado "
+"um pacote mysql-server com um número de versão superior."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Não existe nenhuma garantia que a versão que está actualmente a instalar "
+"seja capaz de utilizar as bases de dados actuais."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Nota importante para utilizadores de NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Utilizar MySQL com NIS/YP necessita que seja adicionada uma conta de "
+"utilizador de mysql ao sistema local com:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Deve também verificar as permissões e o dono do directório /var/lib/mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Remover todas as bases de dados MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"O directório /var/lib/mysql que contém as bases de dados MySQL está prestes "
+"a ser removido."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Se está a remover o pacote MySQL de modo a posteriormente instalar uma "
+"versão mais recente ou se um pacote mysql-server já está os está a utilizar, "
+"os dados devem ser mantidos."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Iniciar o servidor MySQL no arranque?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"O MySQL pode ser automaticamente lançado no arranque ou manualmente através "
+"do comando '/etc/init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nova palavra-passe para o utilizador \"root\" do MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Embora não seja obrigatório, é fortemente recomendado que defina uma palavra-"
+"passe para o utilizador administrativo \"root\" do MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr ""
+"Se este campo for deixado em branco, a palavra-passe não irá ser alterada."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Repita a palavra-passe para o utilizador \"root\" de MySQL:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr ""
+"Não foi possível definir a palavra-passe para o utilizador \"root\" do MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Ocorreu um erro enquanto era definida a palavra-passe para o utilizador "
+"administrativo do MySQL. Isto pode ter acontecido porque a conta já tem uma "
+"palavra-passe, ou porque ocorreu um problema ao comunicação com o servidor "
+"MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+"Você deve verificar a palavra-passe da conta após a instalação do pacote."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Para mais informações, por favor leia o ficheiro /usr/share/doc/mysql-"
+"server-5.6/README.Debian."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Erro de entrada da palavra-passe"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+"As duas palavras-passe que introduziu não são as mesmas. Por favor tente "
+"novamente."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "NDB Cluster parece estar a ser utilizado"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.6 já não disponibiliza suporte para NDB Cluster. Por favor migre "
+"para o novo pacote mysql-cluster-server e remova todas as linhas que comecem "
+"por \"ndb\" em todos os ficheiros de configuração em /etc/mysql/."
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "Para utilizar o MySQL, têm de ser acrescentadas as seguintes entradas "
+#~ "para os utilizadores e grupos:"
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Não é possível actualizar se estiverem presentes tabelas ISAM!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.6 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "As versões recentes de MySQL já não podem utilizar o antigo formato de "
+#~ "tabelas ISAM e é por isso necessário converter as suas tabelas pra e.g. "
+#~ "MyISAM antes da actualização, utilizando \"mysql_convert_table_format\" "
+#~ "ou \"ALTER TABLE x ENGINE=MyISAM\". A instalação de mysql-server-5.6 irá "
+#~ "agora ser cancelada. Se o seu antigo mysql-server-4.1 for removido apenas "
+#~ "reinstale para converter essas tabelas."
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "Suportar ligações MySQL de máquinas que corram Debian \"sarge\" ou mais "
+#~ "antigos?"
+
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "Nas versões antigas de clientes de MySQL em Debian, as palavras-passe não "
+#~ "eram guardadas de forma segura. Isto foi melhorado desde aí, no entanto "
+#~ "os clientes (como o PHP) de máquinas que corram Debian 3.1 Sarge não irão "
+#~ "conseguir ligar-se a contas novas ou cuja palavra-passe foi alterada."
+
+#~ msgid ""
+#~ "To use mysql you must install an equivalent user and group to the "
+#~ "following and ensure yourself that /var/lib/mysql has the right "
+#~ "permissions (the uid/gid may be different)."
+#~ msgstr ""
+#~ "Para utilizar mysql e instalar um utilizador e grupo equivalentes para o "
+#~ "seguinte e assegurar-se que /var/lib/mysql têm as permissões correctas (o "
+#~ "uid/gid podem ser diferentes)."
+
+#~ msgid ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+#~ msgstr ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#~ msgid "/etc/group:       mysql:x:101:"
+#~ msgstr "/etc/group:       mysql:x:101:"
+
+#~ msgid "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+#~ msgstr "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+
+#~ msgid "Remove the databases used by all MySQL versions?"
+#~ msgstr "Remover as bases de dados utilizadas por todas as versões de MySQL?"
+
+#~ msgid ""
+#~ "If you do not provide a password no changes will be made to the account."
+#~ msgstr ""
+#~ "Se não disponibilizar uma password não serão feitas alterações nesta "
+#~ "conta."
+
+#~ msgid ""
+#~ "When installation finishes, you should verify that the account is "
+#~ "properly protected with a password (see README.Debian for more "
+#~ "information)."
+#~ msgstr ""
+#~ "Quando terminar a instalação, deve verificar se a conta está devidamente "
+#~ "protegida com uma password (para mais informações veja README.Debian)."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/pt_BR.po b/mysql-wsrep-5.6/packaging/deb-in/po/pt_BR.po
new file mode 100644 (file)
index 0000000..e5fa5ee
--- /dev/null
@@ -0,0 +1,443 @@
+# Brazilian Portuguese (pt_BR) debconf template translation for
+# Debian's mysql-dfsg source package.
+# Debian-BR Project <debian-l10n-portuguese@lists.debian.org>
+# André Luís Lopes, <andrelop@debian.org> , 2004
+# André Luís Lopes, <andrelop@debian.org> , 2006
+# André Luís Lopes, <andrelop@debian.org> , 2007
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.6\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2007-04-21 15:59-0300\n"
+"Last-Translator: André Luís Lopes <andrelop@debian.org>\n"
+"Language-Team: Debian-BR Project <debian-l10n-portuguese@lists.debian.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"pt_BR utf-8\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Realmente proceder com o rebaixamento de versão?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "Um arquivo de nome /var/lib/mysql/debian-*.flag existe no sistema."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid ""
+#| "Such file is an indication that a mysql-server package with a higher "
+#| "version has been installed earlier."
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"A presença de um arquivo como este é uma indicação de que um pacote mysql-"
+"server com um número de versão mais alto já foi instalado anteriormente."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Não há garantias de que a versão que você está instalando no momento "
+"conseguirá utilizar as bases de dados existentes."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Aviso importante para usuários NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid ""
+#| "You should also check the permissions and the owner of the /var/lib/mysql "
+#| "directory:"
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Você deverá também checar as permissões e o dono do diretório /var/lib/mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Remover todas as bases de dados do MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"O diretório /var/lib/mysql, o qual contém as bases de dados do MySQL, está "
+"prestes a ser removido."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Caso você esteja removendo o pacote MySQL para posteriormente instalar uma "
+"versão mais recente ou, caso uma versão diferente do pacote mysql-server "
+"esteja sendo utilizada, os dados deverão ser mantidos."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Iniciar o servidor MySQL junto a inicialização da máquina?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"O servidor MySQL pode ser iniciado automaticamente junto a inicialização da "
+"máquina ou manualmente com o comando '/etc/init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nova senha para o usuário \"root\" do MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Apesar de não ser mandatório, é altamente recomendado que você defina uma "
+"senha para o usuário administrativo \"root\" do MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid "If that field is left blank, the password will not be changed."
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Caso este campo seja deixado em branco, a senha não sera mudada."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+#, fuzzy
+#| msgid "New password for the MySQL \"root\" user:"
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Nova senha para o usuário \"root\" do MySQL:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Impossível definir senha para o usuário \"root\" do MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Um erro ocorreu durante a definição da senha para o usuário administrativo "
+"do MySQL. Isso pode ter acontecido devido a esse usuário já possuir uma "
+"senha definida ou devido a ocorrência de um problema de comunicação com o "
+"servidor MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "You should check the account's password after tha package installation."
+msgid "You should check the account's password after the package installation."
+msgstr "Você deverá checar a senha dessa conta após a instalação deste pacote."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Por favor, leia o arquivo /usr/share/doc/mysql-server-5.6/README.Debian para "
+"maiores informações."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "Para utilizar o MySQL, as seguintes entradas para usuários e grupos devem "
+#~ "ser adicionadas ao sistema:"
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "Suportar conexões MySQL originadas de hosts executando o Debian \"sarge\" "
+#~ "ou mais antigos ?"
+
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "Em versões antigas dos clientes MySQL no Debian, as senhas não eram "
+#~ "armazenadas de forma segura. Isto foi corrigido desde então, porém, "
+#~ "clientes (como o PHP) em hosts executando o Debian 3.1 Sarge não serão "
+#~ "capazes de conectar em contas recentes ou contas as quais as senhas "
+#~ "tenham sido modificadas."
+
+#~ msgid ""
+#~ "To use mysql you must install an equivalent user and group to the "
+#~ "following and ensure yourself that /var/lib/mysql has the right "
+#~ "permissions (the uid/gid may be different)."
+#~ msgstr ""
+#~ "Para utilizar o MySQL, você deve instalar um usuário e um grupo "
+#~ "equivalentes ao usuário e grupo a seguir para se certificar de que o "
+#~ "diretório /var/lib/mysql possua as permissões correctas (o uid/gid podem "
+#~ "ser diferentes)."
+
+#~ msgid ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+#~ msgstr ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#~ msgid "/etc/group:       mysql:x:101:"
+#~ msgstr "/etc/group:       mysql:x:101:"
+
+#~ msgid "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+#~ msgstr "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+
+#~ msgid "Remove the databases used by all MySQL versions?"
+#~ msgstr "Remover as bases de dados utilizadas por todas as versões do MySQL?"
+
+#~ msgid ""
+#~ "If you do not provide a password no changes will be made to the account."
+#~ msgstr ""
+#~ "Caso você não forneça uma senha, nenhuma mudança será feita na conta."
+
+#~ msgid ""
+#~ "When installation finishes, you should verify that the account is "
+#~ "properly protected with a password (see README.Debian for more "
+#~ "information)."
+#~ msgstr ""
+#~ "Quando a instalação finalizar, você deverá verificar se a conta está "
+#~ "apropriadamente protegida com uma senha (consulte o arquivo README.Debian "
+#~ "para maiores informações)."
+
+#~ msgid "internal"
+#~ msgstr "interno"
+
+#~ msgid "Only internally used."
+#~ msgstr "Somente utilizado internamente."
+
+#, fuzzy
+#~ msgid "Update Hints"
+#~ msgstr "Dicas de atualização"
+
+#, fuzzy
+#~ msgid ""
+#~ "Rarely, e.g. on new major versions, the privilege system is improved. To "
+#~ "make use of it mysql_fix_privilege_tables must be executed manually. The "
+#~ "script is not supposed to give any user more rights that he had before,"
+#~ msgstr ""
+#~ "Raramente, por exemplo, em novas versões maiores, o sistema de "
+#~ "privilégios é melhorado. Para fazer uso disso, o script "
+#~ "mysql_fix_privilege_tables deve ser executado manualmente. O script não "
+#~ "atribuirá a nenhum usuário mais direitos do que os mesmos já possuíam "
+#~ "anteriormente."
+
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Por favor, leia http://www.mysql.com/doc/en/Upgrade.html"
+
+#, fuzzy
+#~ msgid "Install Hints"
+#~ msgstr "Dicas de instalação"
+
+#, fuzzy
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "O MySQL será instalado somente caso você possua um nome de host NÃO "
+#~ "NUMÉRICO que possa ser resolvido através do arquivo /etc/hosts, ou seja, "
+#~ "caso o comando \"hostname\" retorne \"myhostname\", uma linha como "
+#~ "\"10.0.0.1 myhostname\" deverá existir no arquivo /etc/hosts."
+
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Um novo usuário MySQL de nome \"debian-sys-maint\" será criado. Essa "
+#~ "conta MySQL é utilizada pelos scripts de inicialização/parada e pelos "
+#~ "scripts cron. Não remova esse usuário."
+
+#, fuzzy
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Por favor, lembre-se de definir uma SENHA para o usuário root do MySQL ! "
+#~ "Caso você utilize um arquivo /root/.my.cnf, sempre inclua as linhas \"user"
+#~ "\" e \"password\" nesse arquivo, nunca somente a senha ! Consulte o "
+#~ "arquivo /usr/share/doc/mysql-server/README.Debian para mais informações."
+
+#~ msgid ""
+#~ "Should I remove all databases below /var/lib/mysql as you are purging the "
+#~ "mysql-server package?"
+#~ msgstr ""
+#~ "Todas as base de dados sob o diretório /var/lib/mysql devem ser removidas "
+#~ "quando você remover o pacote pacote mysql-server ?"
+
+#~ msgid ""
+#~ "Networking is disabled by default for security reasons. You can enable it "
+#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf."
+#~ msgstr ""
+#~ "O suporte ao funcionamento em rede está desativado por padrão por "
+#~ "questões de segurança. Você poderá ativá-lo comentando a opção 'skip-"
+#~ "networking' no arquivo /etc/mysql/my.cnf."
+
+#~ msgid "security and update notice"
+#~ msgstr "aviso de segurança e actualização"
+
+#~ msgid ""
+#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-"
+#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. "
+#~ "remove everything including the configuration) somewhen? (default is not)"
+#~ msgstr ""
+#~ "Devo remover tudo abaixo de /var/lib/mysql quando fizer o purge do pacote "
+#~ "mysql-server com o comando \"dpkg --purge mysql-server\" (ou seja, "
+#~ "remover tudo incluíndo a configuração)? (o padrão é não remover)"
+
+#~ msgid "Make MySQL reachable via network?"
+#~ msgstr "Fazer com que o MySQL seja acessível via rede?"
+
+#~ msgid ""
+#~ "Should MySQL listen on a network reachable TCP port? This is not "
+#~ "necessary for use on a single computer and could be a security problem."
+#~ msgstr ""
+#~ "O MySQL deve aguardar ligações numa porta TCP acessível via rede? Isto "
+#~ "não é necessário para uso num único computador e pode ser um problema de "
+#~ "segurança."
+
+#~ msgid "Enable chroot mode?"
+#~ msgstr "Activar o modo chroot?"
+
+#~ msgid ""
+#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so "
+#~ "that users cannot modify any files outside this directory. This improves "
+#~ "resistence against crackers, too, as they are not able to modify system "
+#~ "files."
+#~ msgstr ""
+#~ "O MySQL é capaz de se prender no diretório /var/lib/mysql_jail, assim os "
+#~ "utilizadores não poderão modificar ficheiros fora deste directório. Isto "
+#~ "aumenta também a resistência contra crackers, pois eles não poderão "
+#~ "modificar arquivos de sistema."
+
+#~ msgid "Please run mysql_fix_privilege_tables !"
+#~ msgstr "Por favor execute mysql_fix_privilege_tables !"
+
+#~ msgid ""
+#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs "
+#~ "other than root and mysql with mysql."
+#~ msgstr ""
+#~ "Permissões seguras para o diretório /var/lib/mysql serão asseguradas "
+#~ "substituíndo GIDs diferentes de root e mysql por mysql."
+
+#~ msgid ""
+#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/"
+#~ msgstr ""
+#~ "Instruções sobre como activar o suporte de SSL estão disponíveis no "
+#~ "directório /usr/share/doc/mysql-server/."
+
+#, fuzzy
+#~ msgid "mysql_fix_privileges_tables should be executed"
+#~ msgstr "mysql_fix_privileges_tables será executado"
+
+#, fuzzy
+#~ msgid ""
+#~ "The latest MySQL versions have an enhanced, more fine grained, privilege "
+#~ "system. To make use of it, some new fields must be added to the tables "
+#~ "in  the \"mysql\" database. This will not happen automatically."
+#~ msgstr ""
+#~ "As últimas versões do MySQL possuem um sistema de privilégios melhorado e "
+#~ "mais refinado. Para utilizá-lo, alguns novos campos devem ser adicionados "
+#~ "as tabelas na base de dados \"mysql\". Isto é feito pelo script "
+#~ "mysql_fix_privileges_tables durante esta actualização independente do "
+#~ "servidor estar a correr ou não !"
+
+#~ msgid ""
+#~ "This script is not supposed to give any user more rights that he had "
+#~ "before, if you encounter such a case, please contact me."
+#~ msgstr ""
+#~ "Este script não deverá fornecer mais direitos a um utilizador além dos "
+#~ "quais ele já possua anteriormente. SE encontrar um caso desses, por favor "
+#~ "entre em contacto com o mantainer deste pacote Debian."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/ro.po b/mysql-wsrep-5.6/packaging/deb-in/po/ro.po
new file mode 100644 (file)
index 0000000..0e48225
--- /dev/null
@@ -0,0 +1,319 @@
+# Romanian translation of mysql-dfsg.
+# Copyright (C) 2006 THE mysql-dfsg'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the mysql-dfsg package.
+#
+# Stan Ioan-Eugen <stan.ieugen@gmail.com>, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: po-debconf://mysql-dfsg\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2006-12-20 21:27+0200\n"
+"Last-Translator: stan ioan-eugen <stan.ieugen@gmail.com>\n"
+"Language-Team: romanian <debian-l10n-romanian@lists.debian.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid "Do you really want to downgrade?"
+msgid "Really proceed with downgrade?"
+msgstr "Sunteţi sigur că doriţi să instalaţi o versiune mai veche?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+#, fuzzy
+#| msgid ""
+#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates "
+#| "that a mysql-server package with a higher version has been installed "
+#| "before. It can not be guaranteed that this version can use its data."
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"AVERTISMENT: Fişierul /var/lib/mysql/debian-*.flag există. Acest lucru "
+"indică faptul că anterior a fost instalată o versiune nouă a pachetului "
+"mysql-server. Nu se poate garanta că versiunea instalată acum poate folosi "
+"datele versiunii instalate anterior."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid "Important note for NIS/YP users!"
+msgid "Important note for NIS/YP users"
+msgstr "Notă importantă pentru utilizatorii NIS/YP!"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+#, fuzzy
+#| msgid ""
+#| "The script is about to remove the data directory /var/lib/mysql. If it is "
+#| "planned to just install a higher MySQL version or if a different mysql-"
+#| "server package is already using it, the data should be kept."
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Scriptul urmează să şteargă directorul de date /var/lib/mysql. Dacă plănuiţi "
+"doar să instalaţi o versiune nouă MySQL sau datele sunt folosite de către un "
+"alt pachet mysql-server, atunci ar trebui păstraţi datele."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+#, fuzzy
+#| msgid "Should MySQL start on boot?"
+msgid "Start the MySQL server on boot?"
+msgstr "Doriţi ca MySQL să pornească la initializarea sistemului?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+#, fuzzy
+#| msgid ""
+#| "The MySQL can start automatically on boot time or only if you manually "
+#| "type '/etc/init.d/mysql start'."
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL poate porni automat la iniţializarea sistemului sau doar dacă rulaţi "
+"comanda „/etc/init.d/mysql start”."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid "New password for MySQL \"root\" user:"
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Noua parolă pentru utilizatorul „root” al MySQL:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+#, fuzzy
+#| msgid ""
+#| "It is highly recommended that you set a password for the MySQL "
+#| "administrative \"root\" user."
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Este recomandat să stabiliţi o parolă pentru utilizatorul administrativ "
+"„root” al MySQL."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+#, fuzzy
+#| msgid "New password for MySQL \"root\" user:"
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Noua parolă pentru utilizatorul „root” al MySQL:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid "Unable to set password for MySQL \"root\" user"
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Nu s-a putut stabili parola pentru utilizatorul „root” al MySQL"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "It seems an error occurred while setting the password for the MySQL "
+#| "administrative user.  This may have happened because the user already has "
+#| "a password, or because there was a problem communicating with the MySQL "
+#| "server."
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Se pare că a intervenit o eroare în stabilirea parolei pentru utilizatorul "
+"administrativ al MySQL. Acest lucru se poate întâmpla dacă utilizatorul are "
+"deja o parolă, sau a existat o problemă în comunicarea cu serverul MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+
+#~ msgid "Cannot upgrade if ISAM tables are present!"
+#~ msgstr "Nu se poate face actualizarea dacă sunt prezente tabele ISAM!"
+
+#~ msgid ""
+#~ "Recent versions of MySQL can no longer use the old ISAM table format and "
+#~ "it is necessary to convert your tables to e.g. MyISAM before upgrading by "
+#~ "using \"mysql_convert_table_format\" or \"ALTER TABLE x ENGINE=MyISAM\". "
+#~ "The installation of mysql-server-5.6 will now abort. In case your old "
+#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert "
+#~ "those tables."
+#~ msgstr ""
+#~ "Versiunile recente MySQL nu mai pot folosi vechiul format de tabele ISAM "
+#~ "şieste necesar să convertiţi tabelele dumneavoastră de ex. la formatul "
+#~ "MyISAM înainte de a face actualizarea folosind comanda "
+#~ "„mysql_convert_table_format” sau „ALTER TABLE x ENGINE=MyISAM”. "
+#~ "Instalarea mysql-server-5.6 va eşua. În caz că ştergeţiversiunea "
+#~ "anterioară mysql-server-4.1 va trebui reinstalată pentru a converti "
+#~ "tabelele."
+
+#~ msgid ""
+#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?"
+#~ msgstr ""
+#~ "Suportaţi conexiuni MySQL de la staţii ce rulează sistemul Debian „sarge” "
+#~ "sau mai vechi?"
+
+#, fuzzy
+#~| msgid ""
+#~| "The way passwords were stored was not very secure. This has been "
+#~| "improved with the drawback that clients (e.g. PHP) from hosts running "
+#~| "Debian 3.1 Sarge will not be able to connect to account which are new or "
+#~| "whose password have been changed. See /usr/share/doc/mysql-server-5.6/"
+#~| "README.Debian."
+#~ msgid ""
+#~ "In old versions of MySQL clients on Debian, passwords were not stored "
+#~ "securely. This has been improved since then, however clients (such as "
+#~ "PHP) from hosts running Debian 3.1 Sarge will not be able to connect to "
+#~ "recent accounts or accounts whose password have been changed."
+#~ msgstr ""
+#~ "Modul în care erau păstrate parolele nu era foarte sigur. Acest lucru a "
+#~ "fost îmbunătăţitcu dezajantajul că clienţii (de ex. PHP) de pe staţii ce "
+#~ "rulează sistemul Debian 3.1 Sargenu se vor putea conecta la conturi noi "
+#~ "sau ale căror parole au fost schimbate. Citiţi /usr/share/doc/mysql-"
+#~ "server-5.6/README.Debian."
+
+#~ msgid ""
+#~ "To use mysql you must install an equivalent user and group to the "
+#~ "following and ensure yourself that /var/lib/mysql has the right "
+#~ "permissions (the uid/gid may be different)."
+#~ msgstr ""
+#~ "Pentru a folosi mysql trebuie să adăugaţi un utilizator şi grup "
+#~ "echivalent şi să vă asiguraţi că /var/lib/mysql are permisiunile "
+#~ "stabilite corect (uid/gid pot aveavalori diferite)."
+
+#~ msgid ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+#~ msgstr ""
+#~ "/etc/passwd:\tmysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#~ msgid "/etc/group:       mysql:x:101:"
+#~ msgstr "/etc/group:\tmysql:x:101:"
+
+#~ msgid "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+#~ msgstr "/var/lib/mysql:\tdrwxr-xr-x\tmysql\tmysql"
+
+#~ msgid "Remove the databases used by all MySQL versions?"
+#~ msgstr "Doriţi să ştergeţi bazele de date folosite de toate versiune MySQL?"
+
+#~ msgid ""
+#~ "If you do not provide a password no changes will be made to the account."
+#~ msgstr ""
+#~ "Dacă nu introduceţi nici o parolă, nici o schimbare nu va fi luată în "
+#~ "considerare."
+
+#~ msgid ""
+#~ "When installation finishes, you should verify that the account is "
+#~ "properly protected with a password (see README.Debian for more "
+#~ "information)."
+#~ msgstr ""
+#~ "După finalizarea instalării, ar trebui să verificaţi dacă contul este "
+#~ "protejat cu o parolă (citiţi fişierul README.Debian pentru informaţii "
+#~ "suplimentare)."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/ru.po b/mysql-wsrep-5.6/packaging/deb-in/po/ru.po
new file mode 100644 (file)
index 0000000..59fbe33
--- /dev/null
@@ -0,0 +1,220 @@
+# translation of ru.po to Russian
+# Russian messages:
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans#
+#    Developers do not need to manually edit POT or PO files.
+#
+# Ilgiz Kalmetev <translator@ilgiz.pp.ru>, 2003.
+# Yuriy Talakan' <yt@amur.elektra.ru>, 2005, 2006.
+# Yuriy Talakan' <yt@drsk.ru>, 2007.
+# Yuri Kozlov <yuray@komyakino.ru>, 2009, 2012.
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.6 5.6.8-1\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2012-05-23 21:14+0400\n"
+"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n"
+"Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.2\n"
+"Plural-Forms:  nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Действительно установить более старую версию?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "В системе найден файл /var/lib/mysql/debian-*.flag."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Это означает, что ранее уже был установлен пакет mysql-server более новой "
+"версии."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Нет гарантий, что версия, которая устанавливается сейчас, будет способна "
+"работать с имеющимися базами данных."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Важное замечание для пользователей NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Использование MySQL в NIS/YP требует добавления учётной записи mysql в "
+"локальную систему с:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr "Также проверьте права доступа и владельца каталога /var/lib/mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Удалить все базы данных MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"Запрос на удаление каталога /var/lib/mysql, содержащий базы данных MySQL."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Если вы удаляете пакет MySQL для установки более новой версии MySQL, или "
+"есть другие пакеты mysql-server, использующие этот каталог, то данные лучше "
+"сохранить."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Запускать MySQL при загрузке системы?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"Сервер MySQL можно запускать автоматически при загрузке системы или вручную "
+"по команде '/etc/init.d/mysql start'."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Новый пароль для MySQL пользователя «root»:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Хотя и необязательно, но настоятельно рекомендуется установить пароль для "
+"административного пользователя MySQL «root»."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Если оставить поле пустым, то пароль изменён не будет."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Повторите ввод пароля для MySQL пользователя «root»:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Невозможно задать пароль MySQL пользователю «root»"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"В процессе задания пароля административного MySQL пользователя произошла "
+"ошибка. Это могло произойти, если у пользователя уже был задан пароль, или "
+"из-за проблем соединения с сервером MySQL."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr "Проверьте пароль учётной записи после установки пакета."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr "Подробности см. в файле /usr/share/doc/mysql-server-5.6/README.Debian."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Ошибка ввода пароля"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr "Два введённых пароля не одинаковы. Повторите ввод."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "NDB Cluster уже используется"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.6 больше не поддерживает NDB Cluster. Переходите на новый пакет "
+"mysql-cluster-server и удалите все строки, начинающиеся с «ndb», из всех "
+"файлов настройки в каталоге /etc/mysql/."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/sk.po b/mysql-wsrep-5.6/packaging/deb-in/po/sk.po
new file mode 100644 (file)
index 0000000..630a9a1
--- /dev/null
@@ -0,0 +1,219 @@
+# Slovak translations for mysql-5.1 package
+# Slovenské preklady pre balík mysql-5.1.
+# Copyright (C) 2011 THE mysql-5.1'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the mysql-5.1 package.
+# Slavko <linux@slavino.sk>, 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-5.1 5.1.49-3\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2011-01-04 12:55+0100\n"
+"Last-Translator: Slavko <linux@slavino.sk>\n"
+"Language-Team: Slovak <nomail>\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Naozaj pokračovať v znížení verzie?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "Súbor s menom /var/lib/mysql/debian-*.flag už v systéme existuje."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"Takýto súbor udáva, že už bol predtým nainštalovaný balík mysql-server s "
+"vyššou verziou."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Neexistuje žiadna záruka, že aktuálne inštalovaná verzia dokáže pracovať s "
+"existujúcimi databázami."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Dôležitá poznámka pre používateľov NIS/YP"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"Používanie MySQL pod NIS/YP vyžaduje aby bol používateľský účet mysql "
+"pridaný do lokálneho systému pomocou:"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Mali by ste tiež skontrolovať vlastníctvo a práva k adresáru /var/lib/mysql:"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Odstrániť všetky databázy MySQL?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"Adresár /var/lib/mysql, ktorý obsahuje databázy MySQL, bude odstránený."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Ak odstraňujete balík MySQL kvôli neskoršej inštalácii najnovšej verzie "
+"alebo ak ich používa aj iný balík mysql-server, mali by ste údaje ponechať."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Spúšťať MySQL server pri štarte systému?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL server môže byť automaticky spúšťaný pri štarte systému alebo manuálne "
+"príkazom „/etc/init.d/mysql start”."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nové heslo MySQL používateľa „root”:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Hoci to nie je vyslovene nutné, je silne odporúčané nastaviť heslo "
+"správcovského MySQL účtu \"root\"."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Ak toto pole ponecháte prázdne, heslo nebude zmenené."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Zopakujte heslo MySQL používateľa „root“:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Nemožno nastaviť heslo MySQL používateľa „root“"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Pri nastavovaní hesla správcu MySQL nastala chyba. Toto môže nastať, ak už "
+"účet má nastavené heslo alebo kvôli problémom pri komunikácii s MySQL "
+"serverom."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr "Po inštalácii balíka by ste mali skontrolovať heslo účtu."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+#, fuzzy
+#| msgid ""
+#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for "
+#| "more information."
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Ďalšie podrobností nájdete v súbore /usr/share/doc/mysql-server-5.1/README."
+"Debian."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Chyba pri zadávaní hesla"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr "Heslá, ktoré ste zadali sa nezhodujú. Skúste prosím znova."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "Vyzerá to, že používate NDB Cluster"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+#, fuzzy
+#| msgid ""
+#| "MySQL-5.1 no longer provides NDB Cluster support. Please migrate to the "
+#| "new mysql-cluster package and remove all lines starting with \"ndb\" from "
+#| "all config files below /etc/mysql/."
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"MySQL-5.1 už nepodporuje NDB Cluster. Použite prosím nový balík mysql-"
+"cluster a zo všetkých konfiguračných súborov v /etc/mysql/ odstráňte všetky "
+"riadky, ktoré začínajú na „ndb”."
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/sv.po b/mysql-wsrep-5.6/packaging/deb-in/po/sv.po
new file mode 100644 (file)
index 0000000..ebbb497
--- /dev/null
@@ -0,0 +1,220 @@
+# Translation of mysql-5.6 debconf template to Swedish\r
+# Copyright (C) 2009, 2012 Martin Bagge <brother@bsnet.se>\r
+# This file is distributed under the same license as the mysql-5.6 package.\r
+# \r
+# Andreas Henriksson <andreas@fatal.se>, 2007\r
+# Martin Bagge <brother@bsnet.se>, 2009, 2012\r
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-5.6 5.0.21-3\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2012-05-30 00:29+0100\n"
+"Last-Translator: Martin Bagge / brother <brother@bsnet.se>\n"
+"Language-Team: Swedish <debian-l10n-swedish@lists.debian.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Swedish\n"
+"X-Poedit-Country: Sweden\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr "Vill du verkligen genomföra nedgraderingen?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr "En fil med namnet /var/lib/mysql/debian-*.flag hittades i systemet."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+"En sådan fil är en indikation på att paketet mysql-server med ett högre "
+"versionsnummer har installerats tidigare."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+"Det finns ingen garanti för att den version som du håller på att installera "
+"kommer att kunna använda de aktuella databaserna."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr "Viktig information för NIS/YP-användare"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+"För att kunna använda MySQL under NIS/YP måste ett användarkonto för MySQL "
+"läggas till i systemet."
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+"Du bör också kontrollera rättigheterna och ägaren av katalogen /var/lib/"
+"mysql."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr "Ta bort alla MySQL-databaser?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+"Katalogen /var/lib/mysql som innehåller MySQL-databaser kommer att tas bort."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+"Om avinstallationen av MySQL-paketet görs för att senare kunna installera en "
+"nyare version eller om en annan MySQL-server redan använder filerna ska de "
+"inte raderas."
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr "Ska MySQL startas vid systemets uppstart?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL-servern kan startas vid systemets uppstart eller manuellt med "
+"kommandot \"/etc/init.d/mysql start\"."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr "Nytt lösenord för MySQLs \"root\"-användare:"
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+"Det är inte obligatoriskt men starkt rekommenderat att du sätter ett "
+"lösenord för MySQLs administrativa \"root\"-användare."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr "Om detta fält lämnas tom kommer lösenordet inte att ändras."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr "Repetera lösenordet för MySQLs \"root\"-användare:"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr "Kunde inte sätta lösenord för MySQLs \"root\"-användare"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+"Ett fel uppstod när det skulle sättas ett lösenord för MySQLs administrativa "
+"användare (\"root\"). Detta kan ha skett för att användaren redan har ett "
+"lösenord satt, eller på grund av problem med att kommunicera med MySQL-"
+"servern."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr "Du bör kontrollera kontots lösenord efter installationen av paketet."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+"Läs filen /usr/share/doc/mysql-server-5.6/README.Debian för mer information."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr "Fel vid inmatning av lösenord"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr "De två lösenorden du angav stämde inte överrens. Prova igen."
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr "NDB-kluster används inte"
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+"Stödet för NDB-kluster har tagits bort i MySQL-5.6. Migrera till det nya "
+"paketet mysql-cluster-server  och ta bort alla rader som inleds med \"ndb\" "
+"från alla inställlningsfiler i /etc/mysql/."
+
+#~ msgid ""
+#~ "To use MySQL, the following entries for users and groups should be added "
+#~ "to the system:"
+#~ msgstr ""
+#~ "För att använda MySQL måste följande användare och grupper läggas till i "
+#~ "systemet:"
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/templates.pot b/mysql-wsrep-5.6/packaging/deb-in/po/templates.pot
new file mode 100644 (file)
index 0000000..f9b2dca
--- /dev/null
@@ -0,0 +1,187 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-wsrep-5.6\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid "Important note for NIS/YP users"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid "Start the MySQL server on boot?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
diff --git a/mysql-wsrep-5.6/packaging/deb-in/po/tr.po b/mysql-wsrep-5.6/packaging/deb-in/po/tr.po
new file mode 100644 (file)
index 0000000..f721a65
--- /dev/null
@@ -0,0 +1,342 @@
+# Turkish translation of mysql-server.
+# This file is distributed under the same license as the mysql-server package.
+# Gürkan Aslan <gurkan@iaslan.com>, 2004
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: mysql-dfsg-4.1\n"
+"Report-Msgid-Bugs-To: mysql-wsrep-5.6@packages.debian.org\n"
+"POT-Creation-Date: 2014-11-23 01:05+0200\n"
+"PO-Revision-Date: 2004-06-05 08:53+0300\n"
+"Last-Translator: Gürkan Aslan <gurkan@iaslan.com>\n"
+"Language-Team: Turkish <debian-l10n-turkish@lists.debian.org>\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms:  nplurals=1; plural=0;\n"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "Really proceed with downgrade?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"Such a file is an indication that a mysql-server package with a higher "
+"version has been installed previously."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:2001
+msgid ""
+"There is no guarantee that the version you're currently installing will be "
+"able to use the current databases."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+#, fuzzy
+#| msgid "Important note for NIS/YP users!"
+msgid "Important note for NIS/YP users"
+msgstr "NIS/YP kullanıcıları için önemli not!"
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"Using MySQL under NIS/YP requires a mysql user account to be added on the "
+"local system with:"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:3001
+msgid ""
+"You should also check the permissions and ownership of the /var/lib/mysql "
+"directory:"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid "Remove all MySQL databases?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"The /var/lib/mysql directory which contains the MySQL databases is about to "
+"be removed."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:4001
+msgid ""
+"If you're removing the MySQL package in order to later install a more recent "
+"version or if a different mysql-server package is already using it, the data "
+"should be kept."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+#, fuzzy
+#| msgid "Should MySQL start on boot?"
+msgid "Start the MySQL server on boot?"
+msgstr "MySQL açılış sırasında başlatılsın mı?"
+
+#. Type: boolean
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:5001
+#, fuzzy
+msgid ""
+"The MySQL server can be launched automatically at boot time or manually with "
+"the '/etc/init.d/mysql start' command."
+msgstr ""
+"MySQL açılış sırasında veya '/etc/init.d/mysql start' komutunu vermeniz "
+"halinde elle başlatılabilir. Eğer açılışta otomatik olarak başlatılmasını "
+"istiyorsanız burada 'evet'i seçin."
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "New password for the MySQL \"root\" user:"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid ""
+"While not mandatory, it is highly recommended that you set a password for "
+"the MySQL administrative \"root\" user."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:6001
+msgid "If this field is left blank, the password will not be changed."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:7001
+msgid "Repeat password for the MySQL \"root\" user:"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "Unable to set password for the MySQL \"root\" user"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"An error occurred while setting the password for the MySQL administrative "
+"user. This may have happened because the account already has a password, or "
+"because of a communication problem with the MySQL server."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid "You should check the account's password after the package installation."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:8001
+msgid ""
+"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
+"information."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "Password input error"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:9001
+msgid "The two passwords you entered were not the same. Please try again."
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid "NDB Cluster seems to be in use"
+msgstr ""
+
+#. Type: error
+#. Description
+#: ../mysql-wsrep-server-5.6.templates:10001
+msgid ""
+"MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the new "
+"mysql-cluster-server package and remove all lines starting with \"ndb\" from "
+"all config files below /etc/mysql/."
+msgstr ""
+
+#~ msgid ""
+#~ "To use mysql you must install an equivalent user and group to the "
+#~ "following and ensure yourself that /var/lib/mysql has the right "
+#~ "permissions (the uid/gid may be different)."
+#~ msgstr ""
+#~ "Mysql'i kullanmak için aşağıdakiyle eşdeğer bir kullanıcı ve grup "
+#~ "tanımlamalı, ve /var/lib/mysql izinlerinin uygun şekilde ayarlandığından "
+#~ "emin olmalısınız (uid/gid farklı olabilir)."
+
+#~ msgid ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+#~ msgstr ""
+#~ "/etc/passwd:      mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false"
+
+#~ msgid "/etc/group:       mysql:x:101:"
+#~ msgstr "/etc/group:       mysql:x:101:"
+
+#~ msgid "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+#~ msgstr "/var/lib/mysql:   drwxr-xr-x   mysql    mysql"
+
+#, fuzzy
+#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html"
+#~ msgstr "Lütfen http://www.mysql.com/doc/en/Upgrade.html belgesini okuyun"
+
+#, fuzzy
+#~ msgid ""
+#~ "MySQL will only install if you have a non-numeric hostname that is "
+#~ "resolvable via the /etc/hosts file. E.g. if the \"hostname\" command "
+#~ "returns \"myhostname\" then there must be a line like \"10.0.0.1 "
+#~ "myhostname\"."
+#~ msgstr ""
+#~ "MySQL sadece /etc/hosts dosyası yoluyla çözülebilir NUMERİK OLMAYAN bir "
+#~ "makine adına sahipseniz kurulacaktır. Örneğin, eğer \"hostname\" komutu "
+#~ "\"makinem\" ismini döndürüyorsa, bu dosya içinde \"10.0.0.1 makinem\" "
+#~ "gibi bir satır olmalıdır."
+
+#, fuzzy
+#~ msgid ""
+#~ "A new mysql user \"debian-sys-maint\" will be created. This mysql account "
+#~ "is used in the start/stop and cron scripts. Don't delete."
+#~ msgstr ""
+#~ "Yeni mysql kullanıcısı \"debian-sys-maint\" yaratılacak. Bu hesap, "
+#~ "başlangıç betiklerinde ve cron içinde kullanılıyor. Bu hesabı silmeyin."
+
+#, fuzzy
+#~ msgid ""
+#~ "Please remember to set a PASSWORD for the MySQL root user! If you use a /"
+#~ "root/.my.cnf, always write the \"user\" and the \"password\" lines in "
+#~ "there, never only the password!"
+#~ msgstr ""
+#~ "Lütfen MySQL root kullanıcısı için bir PAROLA girmeyi unutmayın! Eğer /"
+#~ "root/.my.cnf kullanıyorsanız, \"user\" ve \"password\" satırlarını her "
+#~ "zaman buraya ekleyin, sadece parolayı değil! Daha fazla bilgi için /usr/"
+#~ "share/doc/mysql-server/README.Debian dosyasını okuyun."
+
+#, fuzzy
+#~ msgid ""
+#~ "Should I remove all databases below /var/lib/mysql as you are purging the "
+#~ "mysql-server package?"
+#~ msgstr ""
+#~ "mysql-server paketi kaldırıldıktan sonra bütün veritabanları silinsin mi?"
+
+#~ msgid ""
+#~ "Networking is disabled by default for security reasons. You can enable it "
+#~ "by commenting out the skip-networking option in /etc/mysql/my.cnf."
+#~ msgstr ""
+#~ "Ağ, öntanımlı olarak güvenlik gerekçeleriyle devre dışı bırakıldı. Bu "
+#~ "özelliği /etc/mysql/my.cnf dosyası içindeki \"skip-networking\" "
+#~ "seçeneğini kaldırarak etkinleştirebilirsiniz."
+
+#~ msgid "security and update notice"
+#~ msgstr "güvenlik ve güncelleme duyurusu"
+
+#~ msgid ""
+#~ "Should I remove everything below /var/lib/mysql when you purge the mysql-"
+#~ "server package with the \"dpkg --purge mysql-server\" command (i.e. "
+#~ "remove everything including the configuration) somewhen? (default is not)"
+#~ msgstr ""
+#~ "mysql-server paketini temizlemek için \"dpkg --purge mysql-server\" "
+#~ "komutunu kullandığınızda (yani yapılandırma dahil herşeyi silmek) /var/"
+#~ "lib/mysql altındaki herşeyi sileyim mi? (öntanımlı cevap hayır'dır)."
+
+#~ msgid "Please run mysql_fix_privilege_tables !"
+#~ msgstr "Lütfen mysql_fix_privilege_tables komutunu çalıştırın!"
+
+#~ msgid ""
+#~ "I will ensure secure permissions of /var/lib/mysql by replacing GIDs "
+#~ "other than root and mysql with mysql."
+#~ msgstr ""
+#~ "/var/lib/mysql'in izinlerinin güvenli olmasını sağlamak amacıyla, buna "
+#~ "ait GID'leri root ve mysql'den farklı olacak şekilde değiştireceğim."
+
+#~ msgid ""
+#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/"
+#~ msgstr ""
+#~ "SSL desteğini nasıl etkinleştirebileceğinize ilişkin talimatlar /usr/"
+#~ "share/doc/mysql-server/ içinde."
+
+#~ msgid "mysql_fix_privileges_tables will be executed"
+#~ msgstr "mysql_fix_privileges_tables çalıştırılacak"
+
+#~ msgid ""
+#~ "The latest MySQL versions have an enhanced, more fine grained, privilege "
+#~ "system. To make use of it, some new fields must be added to the tables "
+#~ "in  the \"mysql\" database. This is done by the "
+#~ "mysql_fix_privilege_tables script during this upgrade regardless of if "
+#~ "the server is currently running or not!"
+#~ msgstr ""
+#~ "En son MySQL sürümleri zenginleştirilmiş, daha ayrıntılandırılmış bir "
+#~ "ayrıcalık (privilege) sistemine sahiptir. Yeni sistemi kullanmak için, "
+#~ "\"mysql\" veritabanındaki tablolara bazı yeni alanlar eklenmelidir. Bu "
+#~ "işlem, sunucunun çalışıp çalışmamasına bağlı olmaksızın "
+#~ "mysql_fix_privilege_tables betiği tarafından bu yükseltme sırasında "
+#~ "yapılır."
+
+#~ msgid ""
+#~ "This script is not supposed to give any user more rights that he had "
+#~ "before, if you encounter such a case, please contact me."
+#~ msgstr ""
+#~ "Bu betiğin hiç bir kullanıcıya öncekinden daha fazla hak kazandırmadığı "
+#~ "varsayılıyor. Eğer bunun aksinde bir durumla karşılaşırsanız, lütfen "
+#~ "benimle bağlantıya geçin."
+
+#~ msgid "Make MySQL reachable via network?"
+#~ msgstr "MySQL network üzerinden ulaşılabilir olsun mu?"
+
+#~ msgid ""
+#~ "Should MySQL listen on a network reachable TCP port? This is not "
+#~ "necessary for use on a single computer and could be a security problem."
+#~ msgstr ""
+#~ "MySQL ağ üzerinde ulaşılabilen bir TCP portunu dinlesin mi? Tek olan bir "
+#~ "bilgisayar için bu ayar gerekli değildir ve bir güvenlik sorunu "
+#~ "oluşturabilir."
+
+#~ msgid "Enable chroot mode?"
+#~ msgstr "chroot kipi etkinleştirilsin mi?"
+
+#~ msgid ""
+#~ "MySQL is able to jail itself into the /var/lib/mysql_jail directory so "
+#~ "that users cannot modify any files outside this directory. This improves "
+#~ "resistence against crackers, too, as they are not able to modify system "
+#~ "files."
+#~ msgstr ""
+#~ "MySQL kendini /var/lib/mysql_jail dizinine hapsederek kullanıcıların bu "
+#~ "dizin dışındaki hiç bir dosyayı değiştirmemesini sağlayabilir. Bu "
+#~ "düzenleme, sistem dosyalarını değiştirmelerini engelleyeceğinden, "
+#~ "cracker'lara karşı dayanıklılığı arttırır."
index e9f9e166b52473b3c06670fff1ad515b2a1b8926..09dffea0bf970673259c87c79940b10948b13568 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
+ifneq (,$(findstring SYSTEMD,@DEB_STARTUP@))
+CMAKE_SYSTEMD_OPTIONS := -DWITH_SYSTEMD=1 -DSYSTEMD_SERVICE_NAME="@DEB_SYSTEMD_SERVICE_NAME@"
+endif
+
 %:
        dh $@
 
@@ -26,6 +30,9 @@ override_dh_auto_configure:
        @echo "RULES.$@"
        cmake . \
                -DBUILD_CONFIG=mysql_release \
+               $(CMAKE_SYSTEMD_OPTIONS) \
+               -DWITH_WSREP=1 \
+               -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp \
                -DCMAKE_INSTALL_PREFIX=/usr \
                -DINSTALL_DOCDIR=share/mysql/docs \
                -DINSTALL_DOCREADMEDIR=share/mysql \
@@ -37,14 +44,13 @@ override_dh_auto_configure:
                -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
                -DINSTALL_PLUGINDIR=lib/mysql/plugin \
                -DINSTALL_SBINDIR=sbin \
-               -DINSTALL_SCRIPTDIR=bin \
-               -DINSTALL_SQLBENCHDIR=lib/mysql \
                -DINSTALL_SUPPORTFILESDIR=share/mysql \
                -DSYSCONFDIR=/etc/mysql \
                -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
                -DWITH_SSL=bundled \
                -DWITH_INNODB_MEMCACHED=1 \
                -DWITH_MECAB=system \
+               -DWITH_NUMA=ON \
                -DCOMPILATION_COMMENT="MySQL @DEB_PRODUCTNAMEC@ Server (@DEB_LICENSENAME@)" \
                -DINSTALL_LAYOUT=DEB \
                -DDEB_PRODUCT=@DEB_PRODUCT@ \
@@ -66,83 +72,110 @@ override_dh_auto_install:
        # complete install first
        $(MAKE) install DESTDIR=debian/tmp
        # remove all redundant files
-       rm debian/tmp/usr/lib/*/*_r*
        rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
        rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
        rm debian/tmp/usr/lib/mysql-test/Makefile
        # add missing man pages
-       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+       install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
        # add MySQL Server debug binary and library to package
-       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
-       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+       install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+       install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
        # add debug plugin libraries to package
+       install -m 0644 support-files/wsrep.cnf debian/tmp/usr/share/mysql
+       # SysV init stuff, or Systemd files ? On Debian 8, we need both!
+#ifneq (,$(findstring SYSV,@DEB_STARTUP@))
+       install -D -m 0755 support-files/mysql.server debian/tmp/etc/init.d/mysql
+#endif
+#ifneq (,$(findstring SYSTEMD,@DEB_STARTUP@))
+#      install -m 0755 scripts/mysqld_bootstrap debian/tmp/usr/bin/
+#endif
+       # This seems to be the only safe place to fix permissions issues
+       # not handled by dh_fixperms.
+       # install -m 0755 debian/additions/echo_stderr debian/tmp/usr/share/mysql/
+       mkdir -p debian/tmp/etc/mysql
+       install -m 0755 debian/extra/debian-start debian/tmp/etc/mysql/
+       install -m 0755 debian/extra/debian-start.inc.sh debian/tmp/usr/share/mysql/
        install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
-       for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
-       install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
-       install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
+       #install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+       #install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
        # Add helper functions for maintainer scripts
        install -m 0644 debian/extra/mysql-helpers debian/tmp/usr/share/mysql/
        # add apparmor profile
        @DEB_RULES_INSTALL_APPARMOR@
        # add systemd script
-       @DEB_RULES_INSTALL_SYSTEMD@
+       #@DEB_RULES_INSTALL_SYSTEMD@
        # add directory for legal docs
        install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
-       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@
        install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
-       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-client
-       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@
        install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
        install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
-       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
-       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-bench
+       # install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
        install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
-       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test
-       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@
+       install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@
+       @DEB_NDB_RULES_DOCDIRS@
        # add @DEB_INSTALL_LICENSEFILE@ file to each package
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-server/@DEB_INSTALL_LICENSEFILE@
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server/@DEB_INSTALL_LICENSEFILE@
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-client/@DEB_INSTALL_LICENSEFILE@
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-client/@DEB_INSTALL_LICENSEFILE@
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-common/@DEB_INSTALL_LICENSEFILE@
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/libmysqlclient18/@DEB_INSTALL_LICENSEFILE@
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/libmysqlclient-dev/@DEB_INSTALL_LICENSEFILE@
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/libmysqld-dev/@DEB_INSTALL_LICENSEFILE@
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-bench/@DEB_INSTALL_LICENSEFILE@
+       # install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/libmysqld-dev/@DEB_INSTALL_LICENSEFILE@
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-testsuite/@DEB_INSTALL_LICENSEFILE@
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test/@DEB_INSTALL_LICENSEFILE@
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source/@DEB_INSTALL_LICENSEFILE@
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/@DEB_INSTALL_LICENSEFILE@ debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/@DEB_INSTALL_LICENSEFILE@
+       @DEB_NDB_RULES_LICENSE@
        # add README file to each package
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README-wsrep debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-client/README
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-client@DEB_PRODUCTSERIES@/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-common@DEB_PRODUCTSERIES@/README
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-bench/README
+       # install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
        install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test/README
-       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-test@DEB_PRODUCTSERIES@/README
+       install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-@DEB_PRODUCTNAME@-source@DEB_PRODUCTSERIES@/README
+       @DEB_NDB_RULES_README@
        touch $@
 
+
+override_dh_installlogrotate-arch:
+       dh_installlogrotate --name mysql-server
+
+ifneq (,$(findstring SYSTEMD,@DEB_STARTUP@))
+#use upstream init to bypass systemd for 5.6.36 release
+INSTALLINITOPTS=""
+else
+INSTALLINITOPTS="--onlyscripts"
+endif
+
 override_dh_installinit:
        @echo "RULES.$@"
        @DEB_RULES_APPARMOR_LOAD@
        @DEB_RULES_SYSTEMD_ENABLE@
-       dh_installinit --name=mysql -- defaults 19 21
+
+       dh_installinit $(INSTALLINITOPTS) -pmysql-@DEB_PRODUCTNAME@-server@DEB_PRODUCTSERIES@ --name=mysql -- defaults 19 21
        @DEB_RULES_SYSTEMD_START@
        touch $@
 
 override_dh_install:
-       dh_install --fail-missing \
+       dh_install --list-missing \
                -Xusr/bin/i_mysql_client_test \
                -Xusr/share/mysql/mysql.server \
-               -Xusr/share/man/man1/mysql.server.1 \
-               -Xusr/share/mysql/binary-configure \
                -Xusr/share/mysql/@DEB_INSTALL_LICENSEFILE@ \
                -Xusr/share/mysql/README \
                -Xusr/share/mysql/docs/mysql.info \
-               -Xusr/share/man/man1/mysqlman.1 \
-               -X.h.pp
+               -Xusr/share/mysql/docs/INSTALL-BINARY \
+               -Xusr/share/man/man1/mysqlman.1
+ifneq (,@DEB_RULES_APPARMOR_LOAD@)
+       # non-empty command = apparmor is handled
+       dh_apparmor -pmysql-server@DEB_PRODUCTSERIES@ --profile-name=usr.sbin.mysqld
+endif
index ca1410153aa5c02f53092ba6e7b0f2b343b997ac..351ff82a0b3c0c6135d596fd9b589f2a8f1cad82 100644 (file)
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 # obscured filename for mysqld-debug, libmysqld-debug.a
-debian/extra/server-binary
-debian/extra/embedded-server
+debian/extra/server-binary
+debian/extra/embedded-server
 # obscured filenames for debug plugins
 debian/extra/adt_null-plugin
 debian/extra/auth-plugin
 debian/extra/auth_socket-plugin
 debian/extra/auth_test_plugin-plugin
-debian/extra/component_example_component1-plugin
-debian/extra/component_example_component2-plugin
-debian/extra/component_example_component3-plugin
-debian/extra/connection_control-plugin
+debian/extra/group_replication-plugin
 debian/extra/ha_example-plugin
 debian/extra/innodb_engine-plugin
 debian/extra/keyring_file-plugin
@@ -65,9 +62,9 @@ debian/extra/rewriter-plugin
 debian/extra/rewrite_example-plugin
 debian/extra/semisync_master-plugin
 debian/extra/semisync_slave-plugin
-debian/extra/test_udf_services-plugin
 debian/extra/test_security_context-plugin
-debian/extra/test_services_plugin_registry-plugin
+debian/extra/test_udf_services-plugin
 debian/extra/validate_password-plugin
 debian/extra/version_token-plugin
+debian/extra/connection_control-plugin
 @DEB_INCLUDE_BINARIES_EXTRA@
index d02518d875c6ef31fd5b177c628cc367fcfbde04..96cf525ce2a261966e011a95b6caaddada5df611 100644 (file)
@@ -180,7 +180,7 @@ for f in msql2mysql mysqlaccess mysqlaccess.conf mysqlbug mysql_convert_table_fo
 done
 
 for f in innochecksum myisamchk myisam_ftdump myisamlog myisampack \
-         mysqlbinlog mysqlcheck mysql_client_test mysql_config_editor \
+         mysqlbinlog mysql_client_test mysql_config_editor \
          mysqld_multi mysqld_safe mysqldumpslow mysql_embedded mysqlimport \
          mysql_plugin mysql_secure_installation mysqlshow mysqlslap  mysqltest \
          perror replace  resolveip  resolve_stack_dump; do
@@ -235,6 +235,7 @@ rm -r $(readlink var) var
 %attr(755, root, root) %{_sbindir}/mysqld
 %attr(755, root, root) %{_bindir}/mysql
 %attr(755, root, root) %{_bindir}/mysqladmin
+%attr(755, root, root) %{_bindir}/mysqlcheck
 %attr(755, root, root) %{_bindir}/mysqldump
 %attr(755, root, root) %{_bindir}/mysql_config
 %attr(755, root, root) %{_bindir}/mysql_install_db
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/.gitignore b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/.gitignore
deleted file mode 100644 (file)
index 685f686..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-# Keep the entries sorted to reduce the risk for a merge conflict
-*.[ao]
-*.exe
-*.gcda
-*.gcno
-*.gcov
-*.l[ao]
-*.tcov
-*.pyc
-*~
-.deps
-/.libs/
-/INSTALL
-/aclocal.m4
-/autom4te.cache
-/breakdancer_testsuite.c
-/config.h
-/config.h.in
-/config.log
-/config.status
-/config/Doxyfile
-/config/Doxyfile-api
-/config/compile
-/config/config.guess
-/config/config.sub
-/config/depcomp
-/config/install-sh
-/config/ltmain.sh
-/config/missing
-/configure
-/doc/doxy
-/doc/doxy-api
-/doc/engine-interface.txt
-/doc/protocol-binary-range.txt
-/doc/protocol-binary.txt
-/engine_testapp
-/libtool
-/m4/version.m4
-/mcstat
-/memcached
-/memcached-*.tar.gz
-/memcached-debug
-/memcached-debug.profile
-/memcached.spec
-/memcached_dtrace.h
-/mkinstalldirs
-/sizes
-/stamp-h1
-/t/binary-sasl.t
-/testapp
-/timedrun
-/version.num
-Makefile
-Makefile.in
-TAGS
-cscope.out
-tags
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/config.h b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/config.h
new file mode 100644 (file)
index 0000000..a04bac4
--- /dev/null
@@ -0,0 +1,192 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Set to nonzero if you want to include DTRACE */
+/* #undef ENABLE_DTRACE */
+
+/* Set to nonzero if you want to include ISASL */
+/* #undef ENABLE_ISASL */
+
+/* Set to nonzero if you want to include SASL */
+/* #undef ENABLE_SASL */
+
+/* Set to nonzero if you want to enable a SASL pwdb */
+/* #undef ENABLE_SASL_PWDB */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define this if you have an implementation of drop_privileges() */
+/* #undef HAVE_DROP_PRIVILEGES */
+
+/* Define to 1 if you have the `getpagesizes' function. */
+/* #undef HAVE_GETPAGESIZES */
+
+/* Have ntohll */
+/* #undef HAVE_HTONLL */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <link.h> header file. */
+#define HAVE_LINK_H 1
+
+/* Define to 1 if you have the `memcntl' function. */
+/* #undef HAVE_MEMCNTL */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mlockall' function. */
+#define HAVE_MLOCKALL 1
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define HAVE_NETINET_TCP_H 1
+
+/* Define to 1 if you have the <priv.h> header file. */
+/* #undef HAVE_PRIV_H */
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#define HAVE_PWD_H 1
+
+/* Set to nonzero if your SASL implementation supports SASL_CB_GETCONF */
+/* #undef HAVE_SASL_CB_GETCONF */
+
+/* Define to 1 if you have the <sasl/sasl.h> header file. */
+/* #undef HAVE_SASL_SASL_H */
+
+/* Define to 1 if you have the `setppriv' function. */
+/* #undef HAVE_SETPPRIV */
+
+/* Define to 1 if you have the `sigignore' function. */
+#define HAVE_SIGIGNORE 1
+
+/* Define to 1 if stdbool.h conforms to C99. */
+/* #undef HAVE_STDBOOL_H */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sysexits.h> header file. */
+#define HAVE_SYSEXITS_H 1
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#define HAVE_SYSLOG_H 1
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#define HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#define HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#define HAVE_SYS_UN_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define this if you have umem.h */
+/* #undef HAVE_UMEM_H */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <windows.h> header file. */
+/* #undef HAVE_WINDOWS_H */
+
+/* Define to 1 if the system has the type `_Bool'. */
+#define HAVE__BOOL 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Machine need alignment */
+#define NEED_ALIGN 1
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "memcached"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "memcached@googlegroups.com"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "memcached"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "memcached 1.6.0_beta1"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "memcached"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.6.0_beta1"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.6.0_beta1"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* #  undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* find sigignore on Linux */
+#define _GNU_SOURCE 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* define to int if socklen_t not available */
+/* #undef socklen_t */
+
+#include "config_static.h"
+#endif
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/t/binary-sasl.t b/mysql-wsrep-5.6/plugin/innodb_memcached/daemon_memcached/t/binary-sasl.t
new file mode 100644 (file)
index 0000000..fa81328
--- /dev/null
@@ -0,0 +1,638 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Cwd;
+use FindBin qw($Bin);
+use lib "$Bin/lib";
+use MemcachedTest;
+
+my $supports_sasl = supports_sasl();
+my $saslpasswd2 = '';
+my $sasldb;
+my $expected_mechs = 'PLAIN';
+
+# If sasl, then use saslpasswd
+unless ($saslpasswd2 eq "isasl") {
+    $sasldb = '/tmp/test-memcached.sasldb';
+    $expected_mechs = "CRAM-MD5 $expected_mechs";
+}
+# if isasl, use plain text file
+else {
+    $sasldb = '/tmp/isasl.txt';
+    $ENV{'ISASL_PWFILE'} = $sasldb;
+}
+
+use Test::More;
+
+if (supports_sasl()) {
+    if ($saslpasswd2 eq '') {
+         plan skip_all => "The binary 'saslpasswd' is missing from your system";
+    }
+    else {
+       plan tests => 25;
+    }
+} else {
+    plan tests => 1;
+    eval {
+        my $server = new_memcached("-S");
+    };
+    ok($@, "Died with illegal -S args when SASL is not supported.");
+    exit 0;
+}
+
+eval {
+    my $server = new_memcached("-S -B auto");
+};
+ok($@, "SASL shouldn't be used with protocol auto negotiate");
+
+eval {
+    my $server = new_memcached("-S -B ascii");
+};
+ok($@, "SASL isn't implemented in the ascii protocol");
+
+eval {
+    my $server = new_memcached("-S -B binary -B ascii");
+};
+ok($@, "SASL isn't implemented in the ascii protocol");
+
+# Based almost 100% off testClient.py which is:
+# Copyright (c) 2007  Dustin Sallings <dustin@spy.net>
+
+# Command constants
+use constant CMD_GET        => 0x00;
+use constant CMD_SET        => 0x01;
+use constant CMD_ADD        => 0x02;
+use constant CMD_REPLACE    => 0x03;
+use constant CMD_DELETE     => 0x04;
+use constant CMD_INCR       => 0x05;
+use constant CMD_DECR       => 0x06;
+use constant CMD_QUIT       => 0x07;
+use constant CMD_FLUSH      => 0x08;
+use constant CMD_GETQ       => 0x09;
+use constant CMD_NOOP       => 0x0A;
+use constant CMD_VERSION    => 0x0B;
+use constant CMD_GETK       => 0x0C;
+use constant CMD_GETKQ      => 0x0D;
+use constant CMD_APPEND     => 0x0E;
+use constant CMD_PREPEND    => 0x0F;
+use constant CMD_STAT       => 0x10;
+use constant CMD_SETQ       => 0x11;
+use constant CMD_ADDQ       => 0x12;
+use constant CMD_REPLACEQ   => 0x13;
+use constant CMD_DELETEQ    => 0x14;
+use constant CMD_INCREMENTQ => 0x15;
+use constant CMD_DECREMENTQ => 0x16;
+use constant CMD_QUITQ      => 0x17;
+use constant CMD_FLUSHQ     => 0x18;
+use constant CMD_APPENDQ    => 0x19;
+use constant CMD_PREPENDQ   => 0x1A;
+
+use constant CMD_SASL_LIST_MECHS    => 0x20;
+use constant CMD_SASL_AUTH          => 0x21;
+use constant CMD_SASL_STEP          => 0x22;
+use constant ERR_AUTH_ERROR   => 0x20;
+
+
+# REQ and RES formats are divided even though they currently share
+# the same format, since they _could_ differ in the future.
+use constant REQ_PKT_FMT      => "CCnCCnNNNN";
+use constant RES_PKT_FMT      => "CCnCCnNNNN";
+use constant INCRDECR_PKT_FMT => "NNNNN";
+use constant MIN_RECV_BYTES   => length(pack(RES_PKT_FMT));
+use constant REQ_MAGIC        => 0x80;
+use constant RES_MAGIC        => 0x81;
+
+my $pwd=getcwd;
+$ENV{'SASL_CONF_PATH'} = "$pwd/t/sasl";
+
+my $server = new_memcached('-B binary -S ');
+
+my $mc = MC::Client->new;
+
+my $check = sub {
+    my ($key, $orig_val) = @_;
+    my ($status, $val, $cas) = $mc->get($key);
+
+    if ($val =~ /^\d+$/) {
+        cmp_ok($val,'==', $orig_val, "$val = $orig_val");
+    }
+    else {
+        cmp_ok($val, 'eq', $orig_val, "$val = $orig_val");
+    }
+};
+
+my $set = sub {
+    my ($key, $orig_value, $exp) = @_;
+    $exp = defined $exp ? $exp : 0;
+    my ($status, $rv)= $mc->set($key, $orig_value, $exp);
+    $check->($key, $orig_value);
+};
+
+my $empty = sub {
+    my $key = shift;
+    my ($status,$rv) =()= eval { $mc->get($key) };
+    #if ($status == ERR_AUTH_ERROR) {
+    #    ok($@->auth_error, "Not authorized to connect");
+    #}
+    #else {
+    #    ok($@->not_found, "We got a not found error when we expected one");
+    #}
+    if ($status) {
+        ok($@->not_found, "We got a not found error when we expected one");
+    }
+};
+
+my $delete = sub {
+    my ($key, $when) = @_;
+    $mc->delete($key, $when);
+    $empty->($key);
+};
+
+# BEGIN THE TEST
+ok($server, "started the server");
+
+my $v = $mc->version;
+ok(defined $v && length($v), "Proper version: $v");
+
+# list mechs
+my $mechs= $mc->list_mechs();
+Test::More::cmp_ok($mechs, 'eq', $expected_mechs, "list_mechs $mechs");
+
+# this should fail, not authenticated
+{
+    my ($status, $val)= $mc->set('x', "somevalue");
+    ok($status, "this fails to authenticate");
+    cmp_ok($status,'==',ERR_AUTH_ERROR, "error code matches");
+}
+$empty->('x');
+{
+    my $mc = MC::Client->new;
+    my ($status, $val) = $mc->delete('x');
+    ok($status, "this fails to authenticate");
+    cmp_ok($status,'==',ERR_AUTH_ERROR, "error code matches");
+}
+$empty->('x');
+{
+    my $mc = MC::Client->new;
+    my ($status, $val)= $mc->set('x', "somevalue");
+    ok($status, "this fails to authenticate");
+    cmp_ok($status,'==',ERR_AUTH_ERROR, "error code matches");
+}
+$empty->('x');
+{
+    my $mc = MC::Client->new;
+    my ($status, $val)=  $mc->flush('x');
+    ok($status, "this fails to authenticate");
+    cmp_ok($status,'==',ERR_AUTH_ERROR, "error code matches");
+}
+$empty->('x');
+
+unlink $sasldb;
+my ($testuser, $testpass) = ('testuser', 'testpass');
+unless ($saslpasswd2 eq "isasl") {
+    system("echo $testpass | $saslpasswd2 -a memcached -f $sasldb -c -p $testuser");
+}
+else {
+    my $isasl_fh;
+    open($isasl_fh, ">$sasldb") or die "unable to open $sasldb\n";
+    print $isasl_fh "$testuser $testpass";
+    close($isasl_fh);
+}
+
+$mc = MC::Client->new;
+
+# Attempt a bad auth mech.
+is ($mc->authenticate('testuser', 'testpass', "X" x 40), 0x4, "bad mech");
+
+# Attempt bad authentication.
+is ($mc->authenticate('testuser', 'wrongpassword'), 0x20, "bad auth");
+
+# Now try good authentication and make the tests work.
+is ($mc->authenticate('testuser', 'testpass'), 0, "authenticated");
+# these should work
+{
+    my ($status, $val)= $mc->set('x', "somevalue");
+    ok(! $status);
+}
+$check->('x','somevalue');
+
+{
+    my ($status, $val)= $mc->delete('x');
+    ok(! $status);
+}
+$empty->('x');
+
+{
+    my ($status, $val)= $mc->set('x', "somevalue");
+    ok(! $status);
+}
+$check->('x','somevalue');
+
+{
+    my ($status, $val)=  $mc->flush('x');
+    ok(! $status);
+}
+$empty->('x');
+
+# check the SASL stats, make sure they track things correctly
+# note: the enabled or not is presence checked in stats.t
+
+# while authenticated, get current counter
+#
+# My initial approach was going to be to get current counts, reauthenticate
+# and fail, followed by a reauth successfully so I'd know what happened.
+# Reauthentication is currently unsupported, so it doesn't work that way at the
+# moment.  Adding tests may break this.
+
+{
+    my %stats = $mc->stats('');
+    is ($stats{'auth_cmds'}, 2, "auth commands counted");
+    is ($stats{'auth_errors'}, 1, "auth errors correct");
+}
+
+
+# Along with the assertion added to the code to verify we're staying
+# within bounds when we do a stats detail dump (detail turned on at
+# the top).
+# my %stats = $mc->stats('detail dump');
+
+# ######################################################################
+# Test ends around here.
+# ######################################################################
+
+package MC::Client;
+
+use strict;
+use warnings;
+use fields qw(socket);
+use IO::Socket::INET;
+
+use constant ERR_AUTH_ERROR   => 0x20;
+
+sub new {
+    my $self = shift;
+    my ($s) = @_;
+    $s = $server unless defined $s;
+    my $sock = $s->sock;
+    $self = fields::new($self);
+    $self->{socket} = $sock;
+    return $self;
+}
+
+sub authenticate {
+    my ($self, $user, $pass, $mech)= @_;
+    $mech ||= 'PLAIN';
+    my $buf = sprintf("%c%s%c%s", 0, $user, 0, $pass);
+    my ($status, $rv, undef) = $self->_do_command(::CMD_SASL_AUTH, $mech, $buf, '');
+    return $status;
+}
+sub list_mechs {
+    my ($self)= @_;
+    my ($status, $rv, undef) = $self->_do_command(::CMD_SASL_LIST_MECHS, '', '', '');
+    return join(" ", sort(split(/\s+/, $rv)));
+}
+
+sub build_command {
+    my $self = shift;
+    die "Not enough args to send_command" unless @_ >= 4;
+    my ($cmd, $key, $val, $opaque, $extra_header, $cas) = @_;
+
+    $extra_header = '' unless defined $extra_header;
+    my $keylen    = length($key);
+    my $vallen    = length($val);
+    my $extralen  = length($extra_header);
+    my $datatype  = 0;  # field for future use
+    my $reserved  = 0;  # field for future use
+    my $totallen  = $keylen + $vallen + $extralen;
+    my $ident_hi  = 0;
+    my $ident_lo  = 0;
+
+    if ($cas) {
+        $ident_hi = int($cas / 2 ** 32);
+        $ident_lo = int($cas % 2 ** 32);
+    }
+
+    my $msg = pack(::REQ_PKT_FMT, ::REQ_MAGIC, $cmd, $keylen, $extralen,
+                   $datatype, $reserved, $totallen, $opaque, $ident_hi,
+                   $ident_lo);
+    my $full_msg = $msg . $extra_header . $key . $val;
+    return $full_msg;
+}
+
+sub send_command {
+    my $self = shift;
+    die "Not enough args to send_command" unless @_ >= 4;
+    my ($cmd, $key, $val, $opaque, $extra_header, $cas) = @_;
+
+    my $full_msg = $self->build_command($cmd, $key, $val, $opaque, $extra_header, $cas);
+
+    my $sent = $self->{socket}->send($full_msg);
+    die("Send failed:  $!") unless $sent;
+    if($sent != length($full_msg)) {
+        die("only sent $sent of " . length($full_msg) . " bytes");
+    }
+}
+
+sub flush_socket {
+    my $self = shift;
+    $self->{socket}->flush;
+}
+
+# Send a silent command and ensure it doesn't respond.
+sub send_silent {
+    my $self = shift;
+    die "Not enough args to send_silent" unless @_ >= 4;
+    my ($cmd, $key, $val, $opaque, $extra_header, $cas) = @_;
+
+    $self->send_command($cmd, $key, $val, $opaque, $extra_header, $cas);
+    $self->send_command(::CMD_NOOP, '', '', $opaque + 1);
+
+    my ($ropaque, $status, $data) = $self->_handle_single_response;
+    Test::More::is($ropaque, $opaque + 1);
+}
+
+sub silent_mutation {
+    my $self = shift;
+    my ($cmd, $key, $value) = @_;
+
+    $empty->($key);
+    my $extra = pack "NN", 82, 0;
+    $mc->send_silent($cmd, $key, $value, 7278552, $extra, 0);
+    $check->($key, $value);
+}
+
+sub _handle_single_response {
+    my $self = shift;
+    my $myopaque = shift;
+
+    $self->{socket}->recv(my $response, ::MIN_RECV_BYTES);
+
+    my ($magic, $cmd, $keylen, $extralen, $datatype, $status, $remaining,
+        $opaque, $ident_hi, $ident_lo) = unpack(::RES_PKT_FMT, $response);
+
+    return ($opaque, '', '', '', 0) if not defined $remaining;
+    return ($opaque, '', '', '', 0) if ($remaining == 0);
+
+    # fetch the value
+    my $rv="";
+    while($remaining - length($rv) > 0) {
+        $self->{socket}->recv(my $buf, $remaining - length($rv));
+        $rv .= $buf;
+    }
+    if(length($rv) != $remaining) {
+        my $found = length($rv);
+        die("Expected $remaining bytes, got $found");
+    }
+
+    my $cas = ($ident_hi * 2 ** 32) + $ident_lo;
+
+    #if ($status) {
+        #die MC::Error->new($status, $rv);
+    #}
+
+    return ($opaque, $status, $rv, $cas, $keylen);
+}
+
+sub _do_command {
+    my $self = shift;
+    die unless @_ >= 3;
+    my ($cmd, $key, $val, $extra_header, $cas) = @_;
+
+    $extra_header = '' unless defined $extra_header;
+    my $opaque = int(rand(2**32));
+    $self->send_command($cmd, $key, $val, $opaque, $extra_header, $cas);
+    my (undef, $status, $rv, $rcas) = $self->_handle_single_response($opaque);
+    return ($status, $rv, $rcas);
+}
+
+sub _incrdecr_header {
+    my $self = shift;
+    my ($amt, $init, $exp) = @_;
+
+    my $amt_hi = int($amt / 2 ** 32);
+    my $amt_lo = int($amt % 2 ** 32);
+
+    my $init_hi = int($init / 2 ** 32);
+    my $init_lo = int($init % 2 ** 32);
+
+    my $extra_header = pack(::INCRDECR_PKT_FMT, $amt_hi, $amt_lo, $init_hi,
+                            $init_lo, $exp);
+
+    return $extra_header;
+}
+
+sub _incrdecr {
+    my $self = shift;
+    my ($cmd, $key, $amt, $init, $exp) = @_;
+
+    my ($status, $data, undef) = $self->_do_command($cmd, $key, '',
+                                           $self->_incrdecr_header($amt, $init, $exp));
+
+    my $header = substr $data, 0, 8, '';
+    my ($resp_hi, $resp_lo) = unpack "NN", $header;
+    my $resp = ($resp_hi * 2 ** 32) + $resp_lo;
+
+    return $resp;
+}
+
+sub silent_incrdecr {
+    my $self = shift;
+    my ($cmd, $key, $amt, $init, $exp) = @_;
+    my $opaque = 8275753;
+
+    $mc->send_silent($cmd, $key, '', $opaque,
+                     $mc->_incrdecr_header($amt, $init, $exp));
+}
+
+sub stats {
+    my $self = shift;
+    my $key  = shift;
+    my $cas = 0;
+    my $opaque = int(rand(2**32));
+    $self->send_command(::CMD_STAT, $key, '', $opaque, '', $cas);
+
+    my %rv = ();
+    my $found_key = '';
+    my $found_val = '';
+    my $status= 0;
+    do {
+        my ($op, $status, $data, $cas, $keylen) = $self->_handle_single_response($opaque);
+        if ($keylen > 0) {
+            $found_key = substr($data, 0, $keylen);
+            $found_val = substr($data, $keylen);
+            $rv{$found_key} = $found_val;
+        } else {
+            $found_key = '';
+        }
+    } while($found_key ne '');
+    return %rv;
+}
+
+sub get {
+    my $self = shift;
+    my $key  = shift;
+    my ($status, $rv, $cas) = $self->_do_command(::CMD_GET, $key, '', '');
+
+    my $header = substr $rv, 0, 4, '';
+    my $flags  = unpack("N", $header);
+
+    return ($status, $rv);
+}
+
+sub get_multi {
+    my $self = shift;
+    my @keys = @_;
+
+    for (my $i = 0; $i < @keys; $i++) {
+        $self->send_command(::CMD_GETQ, $keys[$i], '', $i, '', 0);
+    }
+
+    my $terminal = @keys + 10;
+    $self->send_command(::CMD_NOOP, '', '', $terminal);
+
+    my %return;
+    my $status = 0;
+    while (1) {
+        my ($opaque, $status, $data) = $self->_handle_single_response;
+        last if $opaque == $terminal;
+
+        my $header = substr $data, 0, 4, '';
+        my $flags  = unpack("N", $header);
+
+        $return{$keys[$opaque]} = [$flags, $data];
+    }
+
+    return %return if wantarray;
+    return \%return;
+}
+
+sub version {
+    my $self = shift;
+    return $self->_do_command(::CMD_VERSION, '', '');
+}
+
+sub flush {
+    my $self = shift;
+    return $self->_do_command(::CMD_FLUSH, '', '');
+}
+
+sub add {
+    my $self = shift;
+    my ($key, $val, $flags, $expire) = @_;
+    my $extra_header = pack "NN", $flags, $expire;
+    my $cas = 0;
+    return $self->_do_command(::CMD_ADD, $key, $val, $extra_header, $cas);
+}
+
+sub set {
+    my $self = shift;
+    my $flags = 0;
+    my $cas = 0;
+    my ($key, $val, $expire) = @_;
+    $expire = defined $expire ? $expire : 0;
+    my $extra_header = pack "NN", $flags, $expire;
+    return $self->_do_command(::CMD_SET, $key, $val, $extra_header, $cas);
+}
+
+sub _append_prepend {
+    my $self = shift;
+    my ($cmd, $key, $val, $cas) = @_;
+    return $self->_do_command($cmd, $key, $val, '', $cas);
+}
+
+sub replace {
+    my $self = shift;
+    my ($key, $val, $flags, $expire) = @_;
+    my $extra_header = pack "NN", $flags, $expire;
+    my $cas = 0;
+    return $self->_do_command(::CMD_REPLACE, $key, $val, $extra_header, $cas);
+}
+
+sub delete {
+    my $self = shift;
+    my ($key) = @_;
+    return $self->_do_command(::CMD_DELETE, $key, '');
+}
+
+sub incr {
+    my $self = shift;
+    my ($key, $amt, $init, $exp) = @_;
+    $amt = 1 unless defined $amt;
+    $init = 0 unless defined $init;
+    $exp = 0 unless defined $exp;
+
+    return $self->_incrdecr(::CMD_INCR, $key, $amt, $init, $exp);
+}
+
+sub decr {
+    my $self = shift;
+    my ($key, $amt, $init, $exp) = @_;
+    $amt = 1 unless defined $amt;
+    $init = 0 unless defined $init;
+    $exp = 0 unless defined $exp;
+
+    return $self->_incrdecr(::CMD_DECR, $key, $amt, $init, $exp);
+}
+
+sub noop {
+    my $self = shift;
+    return $self->_do_command(::CMD_NOOP, '', '');
+}
+
+package MC::Error;
+
+use strict;
+use warnings;
+
+use constant ERR_UNKNOWN_CMD  => 0x81;
+use constant ERR_NOT_FOUND    => 0x1;
+use constant ERR_EXISTS       => 0x2;
+use constant ERR_TOO_BIG      => 0x3;
+use constant ERR_EINVAL       => 0x4;
+use constant ERR_NOT_STORED   => 0x5;
+use constant ERR_DELTA_BADVAL => 0x6;
+use constant ERR_AUTH_ERROR   => 0x20;
+
+use overload '""' => sub {
+    my $self = shift;
+    return "Memcache Error ($self->[0]): $self->[1]";
+};
+
+sub new {
+    my $class = shift;
+    my $error = [@_];
+    my $self = bless $error, (ref $class || $class);
+
+    return $self;
+}
+
+sub not_found {
+    my $self = shift;
+    return $self->[0] == ERR_NOT_FOUND;
+}
+
+sub exists {
+    my $self = shift;
+    return $self->[0] == ERR_EXISTS;
+}
+
+sub too_big {
+    my $self = shift;
+    return $self->[0] == ERR_TOO_BIG;
+}
+
+sub delta_badval {
+    my $self = shift;
+    return $self->[0] == ERR_DELTA_BADVAL;
+}
+
+sub auth_error {
+    my $self = shift;
+    return $self->[0] == ERR_AUTH_ERROR;
+}
+
+unlink $sasldb;
+
+# vim: filetype=perl
+
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/.gitignore b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/.gitignore
deleted file mode 100644 (file)
index 12dc37f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-*.build
-xcode/ndbmemcache.xcodeproj/jdd.perspectivev3
-xcode/ndbmemcache.xcodeproj/jdd.mode1v3
-xcode/ndbmemcache.xcodeproj/*.mode1v3
-xcode/ndbmemcache.xcodeproj/*.pbxuser
-.DS_Store
-Makefile.in
-junkbin
-aclocal.m4
-compile
-configure
-depcomp
-install-sh
-ltmain.sh
-missing
-autom4te.cache/
-config.guess
-config.h.in
-config.sub
-Makefile
-config.h
-config.log
-config.status
-libtool
-src/.deps/
-src/Makefile
-stamp-h1
-unit/.deps/
-unit/test_workqueue
-unit/Makefile
-unit/casbits_test
-unit/ndbapi_interp_test
-unit/test_interp
-.libs
-.deps
-*.la
-*.lo
-
diff --git a/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/config.h b/mysql-wsrep-5.6/plugin/innodb_memcached/innodb_memcache/config.h
new file mode 100644 (file)
index 0000000..e2cbff5
--- /dev/null
@@ -0,0 +1,222 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* Enable debug log */
+/* #undef DEBUG_OUTPUT */
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Darwin libkern OSAtomic functions. */
+/* #undef HAVE_DARWIN_ATOMICS */
+
+/* Define to 1 if you have the <dispatch/dispatch.h> header file. */
+/* #undef HAVE_DISPATCH_DISPATCH_H */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* GCC atomic builtins. */
+#define HAVE_GCC_ATOMIC_BUILTINS 1
+
+/* Define to 1 if you have the `gethrtime' function. */
+/* #undef HAVE_GETHRTIME */
+
+/* Define to 1 if you have the `gethrvtime' function. */
+/* #undef HAVE_GETHRVTIME */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `dispatch' library (-ldispatch). */
+/* #undef HAVE_LIBDISPATCH */
+
+/* Define to 1 if you have the <mach/mach_time.h> header file. */
+/* #undef HAVE_MACH_MACH_TIME_H */
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+   to 0 otherwise. */
+#define HAVE_MALLOC 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+   and to 0 otherwise. */
+#define HAVE_REALLOC 1
+
+/* Solaris Atomic functions. */
+/* #undef HAVE_SOLARIS_ATOMICS */
+
+/* Define to 1 if you have the `srandomdev' function. */
+/* #undef HAVE_SRANDOMDEV */
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if the system has the type `_Bool'. */
+#define HAVE__BOOL 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Machine need alignment */
+#define NEED_ALIGN 1
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "innodbmemcache"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "innodbmemcache"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "innodbmemcache proto4"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "innodbmemcache"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "proto4"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "proto4"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* #  undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* find sigignore on Linux */
+#define _GNU_SOURCE 1
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT64_T */
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT8_T */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int32_t */
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int64_t */
+
+/* Define to rpl_malloc if the replacement function should be used. */
+/* #undef malloc */
+
+/* Define to rpl_realloc if the replacement function should be used. */
+/* #undef realloc */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint16_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint64_t */
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint8_t */
+
+#if HAVE_STDBOOL_H
+#include <stdbool.h>
+#else
+#define bool char
+#define false 0
+#define true 1
+#endif 
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
index e013d6b2cd776545667ee24cf2b43287fe1f3993..51d005273b6685e266f0c5ab18f54fcc1703f87d 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
 
-Copyright (c) 2011, 2016, 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 General Public License as published by the
@@ -700,7 +700,7 @@ innodb_conn_clean(
                                UT_LIST_REMOVE(conn_list, engine->conn_data,
                                               conn_data);
 
-                               if (thd) {
+                               if (thd && conn_data->thd ) {
                                        handler_thd_attach(conn_data->thd,
                                                           NULL);
                                }
old mode 100644 (file)
new mode 100755 (executable)
index a2cbc1d2cfb701c6517b82917e974d45693a2306..98fe35ba2ab7f24b5458ca0f8042614d4064d1b4 100644 (file)
@@ -256,7 +256,16 @@ wsrep_recover_position() {
     wsrep_start_position_opt="--wsrep_start_position=$start_pos"
   fi
 
-  rm $wr_logfile
+  if [ $ret -eq 0 ] ; then
+    local wr_logfile_permanent="$DATADIR/wsrep_recovery.ok"
+  else
+    local wr_logfile_permanent="$DATADIR/wsrep_recovery.fail"
+  fi
+  touch $wr_logfile_permanent
+  [ "$euid" = "0" ] && chown $user $wr_logfile_permanent
+  chmod 600 $wr_logfile_permanent
+  cat "$wr_logfile" >> $wr_logfile_permanent
+  rm -f "$wr_logfile"
 
   return $ret
 }
index 25ec0baae803e28e9a3ae4aebd31be2b078df1b8..6906bcbc31541dabb5323c9788cbe7bce7a8c6b9 100644 (file)
@@ -30,6 +30,22 @@ while [ $# -gt 0 ]; do
 case "$1" in
     '--address')
         readonly WSREP_SST_OPT_ADDR="$2"
+        #
+        # Break address string into host:port/path parts
+        #
+        if echo $WSREP_SST_OPT_ADDR | grep -qe '^\[.*\]'
+        then
+            # IPv6 notation
+            readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR/\]*/\]}
+            readonly WSREP_SST_OPT_HOST_UNESCAPED=$(echo $WSREP_SST_OPT_HOST | \
+                 cut -d '[' -f 2 | cut -d ']' -f 1)
+        else
+            # "traditional" notation
+            readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
+        fi
+        readonly WSREP_SST_OPT_PORT=$(echo $WSREP_SST_OPT_ADDR | \
+                cut -d ']' -f 2 | cut -s -d ':' -f 2 | cut -d '/' -f 1)
+        readonly WSREP_SST_OPT_PATH=${WSREP_SST_OPT_ADDR#*/}
         shift
         ;;
     '--bypass')
@@ -169,6 +185,11 @@ wsrep_log_error()
     wsrep_log "[ERROR] $*"
 }
 
+wsrep_log_warning()
+{
+    wsrep_log "[WARNING] $*"
+}
+
 wsrep_log_info()
 {
     wsrep_log "[INFO] $*"
@@ -202,3 +223,39 @@ wsrep_check_programs()
 
     return $ret
 }
+
+#
+# user can specify xtrabackup specific settings that will be used during sst
+# process like encryption, etc.....
+# parse such configuration option. (group for xb settings is [sst] in my.cnf
+#
+# 1st param: group : name of the config file section, e.g. mysqld
+# 2nd param: var : name of the variable in the section, e.g. server-id
+# 3rd param: - : default value for the param
+parse_cnf()
+{
+    local group=$1
+    local var=$2
+    local reval=""
+
+    # print the default settings for given group using my_print_default.
+    # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
+    # then grep for needed variable
+    # finally get the variable value (if variables has been specified multiple time use the last value only)
+
+    # look in group+suffix
+    if [[ -n $WSREP_SST_OPT_CONF_SUFFIX ]]; then
+        reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF "${group}${WSREP_SST_OPT_CONF_SUFFIX}" | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
+    fi
+
+    # look in group
+    if [[ -z $reval ]]; then
+        reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
+    fi
+
+    # use default if we haven't found a value
+    if [[ -z $reval ]]; then
+        [[ -n $3 ]] && reval=$3
+    fi
+    echo $reval
+}
index af3950d4080faaa5ed0e322d7de53fa67ba005c9..733ea1a3181554daf1c253fc1e559c780428f5d3 100644 (file)
@@ -27,6 +27,7 @@ local_ip()
 
     [ "$1" = "127.0.0.1" ]      && return 0
     [ "$1" = "localhost" ]      && return 0
+    [ "$1" = "[::1]" ]          && return 0
     [ "$1" = "$(hostname -s)" ] && return 0
     [ "$1" = "$(hostname -f)" ] && return 0
     [ "$1" = "$(hostname -d)" ] && return 0
@@ -104,8 +105,8 @@ DROP PREPARE stmt;"
 SET_START_POSITION="SET GLOBAL wsrep_start_position='$WSREP_SST_OPT_GTID';"
 
 MYSQL="$MYSQL_CLIENT --defaults-extra-file=$WSREP_SST_OPT_CONF "\
-"$AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\
-"--disable-reconnect --connect_timeout=10"
+"$AUTH -h${WSREP_SST_OPT_HOST_UNESCAPED:-$WSREP_SST_OPT_HOST} "\
+"-P$WSREP_SST_OPT_PORT --disable-reconnect --connect_timeout=10"
 
 # need to disable logging when loading the dump
 # reason is that dump contains ALTER TABLE for log tables, and
index d6dd04f7af7b3b50e9b1d49596011efdeb6d50a1..cfff524c8fdc5949333e799a293b5b08822ca353 100644 (file)
@@ -57,6 +57,11 @@ check_pid_and_port()
     local rsync_pid=$2
     local rsync_port=$3
 
+    if ! which lsof > /dev/null; then
+        wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
+        exit 2 # ENOENT
+    fi
+
     local port_info=$(lsof -i :$rsync_port -Pn 2>/dev/null | \
         grep "(LISTEN)")
     local is_rsync=$(echo $port_info | \
@@ -87,10 +92,13 @@ fi
 WSREP_LOG_DIR=${WSREP_LOG_DIR:-""}
 # if WSREP_LOG_DIR env. variable is not set, try to get it from my.cnf
 if [ -z "$WSREP_LOG_DIR" ]; then
-    WSREP_LOG_DIR=$($MY_PRINT_DEFAULTS --defaults-file \
-                   "$WSREP_SST_OPT_CONF" mysqld server mysqld-5.6 \
-                    | grep -- '--innodb[-_]log[-_]group[-_]home[-_]dir=' \
-                    | cut -b 29- )
+    WSREP_LOG_DIR=$(parse_cnf mysqld-5.6 innodb_log_group_home_dir "")
+fi
+if [ -z "$WSREP_LOG_DIR" ]; then
+    WSREP_LOG_DIR=$(parse_cnf mysqld innodb_log_group_home_dir "")
+fi
+if [ -z "$WSREP_LOG_DIR" ]; then
+    WSREP_LOG_DIR=$(parse_cnf server innodb_log_group_home_dir "")
 fi
 
 if [ -n "$WSREP_LOG_DIR" ]; then
@@ -198,7 +206,8 @@ then
         [ "$OS" == "Linux" ] && count=$(grep -c processor /proc/cpuinfo)
         [ "$OS" == "Darwin" -o "$OS" == "FreeBSD" ] && count=$(sysctl -n hw.ncpu)
 
-        find . -maxdepth 1 -mindepth 1 -type d -print0 | xargs -I{} -0 -P $count \
+        find . -maxdepth 1 -mindepth 1 -type d -not -name "lost+found" \
+             -print0 | xargs -I{} -0 -P $count \
              rsync --owner --group --perms --links --specials \
              --ignore-times --inplace --recursive --delete --quiet \
              $WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \
@@ -241,25 +250,24 @@ then
     fi
     rm -rf "$RSYNC_PID"
 
-    ADDR=$WSREP_SST_OPT_ADDR
-    RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }')
-    if [ -z "$RSYNC_PORT" ]
-    then
-        RSYNC_PORT=4444
-        ADDR="$(echo $ADDR | awk -F ':' '{ print $1 }'):$RSYNC_PORT"
-    fi
-
     trap "exit 32" HUP PIPE
     trap "exit 3"  INT TERM ABRT
     trap cleanup_joiner EXIT
 
     RSYNC_CONF="$WSREP_SST_OPT_DATA/$MODULE.conf"
 
+    if [ -n "${MYSQL_TMP_DIR:-}" ] ; then
+        SILENT="log file = $MYSQL_TMP_DIR/rsyncd.log"
+    else
+        SILENT=""
+    fi
+
 cat << EOF > "$RSYNC_CONF"
 pid file = $RSYNC_PID
 use chroot = no
 read only = no
 timeout = 300
+$SILENT
 [$MODULE]
     path = $WSREP_SST_OPT_DATA
 [$MODULE-log_dir]
@@ -269,6 +277,7 @@ EOF
 #    rm -rf "$DATA"/ib_logfile* # we don't want old logs around
 
     # listen at all interfaces (for firewalled setups)
+    readonly RSYNC_PORT=${WSREP_SST_OPT_PORT:-4444}
     rsync --daemon --no-detach --port $RSYNC_PORT --config "$RSYNC_CONF" &
     RSYNC_REAL_PID=$!
 
@@ -277,7 +286,7 @@ EOF
         sleep 0.2
     done
 
-    echo "ready $ADDR/$MODULE"
+    echo "ready $WSREP_SST_OPT_HOST:$RSYNC_PORT/$MODULE"
 
     # wait for SST to complete by monitoring magic file
     while [ ! -r "$MAGIC_FILE" ] && check_pid "$RSYNC_PID" && \
index 079ef8b158115a3cf628fea07df68901fd65c5fe..11edc6225c30ef8e66be5093f80aba591f557287 100644 (file)
@@ -34,8 +34,8 @@ ssystag=""
 XTRABACKUP_PID=""
 SST_PORT=""
 REMOTEIP=""
+tca=""
 tcert=""
-tpem=""
 tkey=""
 sockopt=""
 progress=""
@@ -47,7 +47,6 @@ rlimit=""
 # Initially
 stagemsg="${WSREP_SST_OPT_ROLE}"
 cpat=""
-speciald=1
 ib_home_dir=""
 ib_log_dir=""
 ib_undo_dir=""
@@ -71,6 +70,11 @@ xtmpdir=""
 
 scomp=""
 sdecomp=""
+ssl_dhparams=""
+
+ssl_cert=""
+ssl_ca=""
+ssl_key=""
 
 # Required for backup locks
 # For backup locks it is 1 sent by joiner
@@ -150,6 +154,10 @@ get_keys()
     if [[ -z $ekey ]];then
         ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key-file=$ekeyfile"
     else
+        wsrep_log_warning "Using the 'encrypt-key' option causes the encryption key"
+        wsrep_log_warning "to be set via the command-line and is considered insecure."
+        wsrep_log_warning "It is recommended to use the 'encrypt-key-file' option instead."
+
         ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key=$ekey"
     fi
 
@@ -160,6 +168,86 @@ get_keys()
     stagemsg+="-XB-Encrypted"
 }
 
+#
+# If the ssl_dhparams variable is already set, uses that as a source
+# of dh parameters for OpenSSL. Otherwise, looks for dhparams.pem in the
+# datadir, and creates it there if it can't find the file.
+# No input parameters
+#
+check_for_dhparams()
+{
+    if [[ -z "$ssl_dhparams" ]]; then
+        if ! [[ -r "$DATA/dhparams.pem" ]]; then
+            wsrep_check_programs openssl
+            wsrep_log_info "Could not find dhparams file, creating $DATA/dhparams.pem"
+
+            if ! openssl dhparam -out "$DATA/dhparams.pem" 2048 >/dev/null 2>&1
+            then
+                wsrep_log_error "******** FATAL ERROR ********************************* "
+                wsrep_log_error "* Could not create the dhparams.pem file with OpenSSL. "
+                wsrep_log_error "****************************************************** "
+                exit 22
+            fi
+        fi
+        ssl_dhparams="$DATA/dhparams.pem"
+    fi
+}
+
+#
+# verifies that the certificate matches the private key
+# doing this will save us having to wait for a timeout that would
+# otherwise occur.
+#
+# 1st param: path to the cert
+# 2nd param: path to the private key
+#
+verify_cert_matches_key()
+{
+    local cert_path=$1
+    local key_path=$2
+
+    wsrep_check_programs openssl diff
+
+    # generate the public key from the cert and the key
+    # they should match (otherwise we can't create an SSL connection)
+    if ! diff <(openssl x509 -in "$cert_path" -pubkey -noout) <(openssl rsa -in "$key_path" -pubout 2>/dev/null) >/dev/null 2>&1
+    then
+        wsrep_log_error "******** FATAL ERROR ************************* "
+        wsrep_log_error "* The certifcate and private key do not match. "
+        wsrep_log_error "* Please check your certificate and key files. "
+        wsrep_log_error "********************************************** "
+        exit 22
+    fi
+}
+
+# Checks to see if the file exists
+# If the file does not exist (or cannot be read), issues an error
+# and exits
+#
+# 1st param: file name to be checked (for read access)
+# 2nd param: 1st error message (header)
+# 3rd param: 2nd error message (footer, optional)
+#
+verify_file_exists()
+{
+    local file_path=$1
+    local error_message1=$2
+    local error_message2=$3
+
+    if ! [[ -r "$file_path" ]]; then
+        wsrep_log_error "******** FATAL ERROR ************************* "
+        wsrep_log_error "* $error_message1 "
+        wsrep_log_error "* Could not find/access : $file_path "
+
+        if ! [[ -z "$error_message2" ]]; then
+            wsrep_log_error "* $error_message2 "
+        fi
+
+        wsrep_log_error "********************************************** "
+        exit 22
+    fi
+}
+
 get_transfer()
 {
     if [[ -z $SST_PORT ]];then 
@@ -173,15 +261,25 @@ get_transfer()
             wsrep_log_error "nc(netcat) not found in path: $PATH"
             exit 2
         fi
+
+        if [[ $encrypt -eq 2 || $encrypt -eq 3 || $encrypt -eq 4 ]]; then
+            wsrep_log_error "******** FATAL ERROR *********************** "
+            wsrep_log_error "* Using SSL encryption (encrypt= 2, 3, or 4) "
+            wsrep_log_error "* is not supported when using nc(netcat).    "
+            wsrep_log_error "******************************************** "
+            exit 22
+        fi
+
         wsrep_log_info "Using netcat as streamer"
         if [[ "$WSREP_SST_OPT_ROLE"  == "joiner" ]];then
-            if nc -h | grep -q ncat;then 
-                tcmd="nc -l ${TSST_PORT}"
+            if nc -h 2>&1 | grep -q ncat; then
+                tcmd="nc $sockopt -l ${TSST_PORT}"
             else 
-                tcmd="nc -dl ${TSST_PORT}"
+                tcmd="nc $sockopt -dl ${TSST_PORT}"
             fi
         else
-            tcmd="nc ${REMOTEIP} ${TSST_PORT}"
+            # netcat doesn't understand [] around IPv6 address
+            tcmd="nc ${REMOTEIP//[\[\]]/} ${TSST_PORT}"
         fi
     else
         tfmt='socat'
@@ -191,64 +289,111 @@ get_transfer()
             exit 2
         fi
 
-        if [[ $encrypt -eq 2 || $encrypt -eq 3 ]] && ! socat -V | grep -q WITH_OPENSSL;then 
-            wsrep_log_info "NOTE: socat is not openssl enabled, falling back to plain transfer"
-            encrypt=-1
-        fi
+        donor_extra=""
+        joiner_extra=""
+        if [[ $encrypt -eq 2 || $encrypt -eq 3 || $encrypt -eq 4 ]]; then
+            if ! socat -V | grep -q WITH_OPENSSL; then
+                wsrep_log_error "******** FATAL ERROR ****************** "
+                wsrep_log_error "* socat is not openssl enabled.         "
+                wsrep_log_error "* Unable to encrypt SST communications. "
+                wsrep_log_error "*************************************** "
+                exit 2
+            fi
 
-        if [[ $encrypt -eq 2 ]];then 
-            wsrep_log_info "Using openssl based encryption with socat: with crt and pem"
-            if [[ -z $tpem || -z $tcert ]];then 
-                wsrep_log_error "Both PEM and CRT files required"
-                exit 22
+            # Determine the socat version
+            SOCAT_VERSION=`socat -V 2>&1 | grep -oe '[0-9]\.[0-9][\.0-9]*' | head -n1`
+            if [[ -z "$SOCAT_VERSION" ]]; then
+                wsrep_log_error "******** FATAL ERROR **************** "
+                wsrep_log_error "* Cannot determine the socat version. "
+                wsrep_log_error "************************************* "
+                exit 2
+            fi
+
+            # socat versions < 1.7.3 will have 512-bit dhparams (too small)
+            #       so create 2048-bit dhparams and send that as a parameter
+            # socat version >= 1.7.3, checks to see if the peername matches the hostname
+            #       set commonname="" to disable the peername checks
+            #
+            if ! check_for_version "$SOCAT_VERSION" "1.7.3"; then
+                if [[ "$WSREP_SST_OPT_ROLE"  == "joiner" ]]; then
+                    # dhparams check (will create ssl_dhparams if needed)
+                    check_for_dhparams
+                    joiner_extra=",dhparam=$ssl_dhparams"
+                fi
+            fi
+            if check_for_version "$SOCAT_VERSION" "1.7.3"; then
+                donor_extra=',commonname=""'
             fi
+        fi
+
+        if [[ $encrypt -eq 2 ]]; then
+            wsrep_log_warning "**** WARNING **** encrypt=2 is deprecated and will be removed in a future release"
+            wsrep_log_info "Using openssl based encryption with socat: with crt and ca"
+
+            verify_file_exists "$tcert" "Both certificate and CA files are required." \
+                                        "Please check the 'tcert' option.           "
+            verify_file_exists "$tca" "Both certificate and CA files are required." \
+                                      "Please check the 'tca' option.             "
+
             stagemsg+="-OpenSSL-Encrypted-2"
             if [[ "$WSREP_SST_OPT_ROLE"  == "joiner" ]];then
-                wsrep_log_info "Decrypting with PEM $tpem, CA: $tcert"
-                tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=$tpem,cafile=${tcert}${sockopt} stdio"
+                wsrep_log_info "Decrypting with CERT: $tcert, CA: $tca"
+                tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tcert},cafile=${tca}${joiner_extra}${sockopt} stdio"
             else
-                wsrep_log_info "Encrypting with PEM $tpem, CA: $tcert"
-                tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=$tpem,cafile=${tcert}${sockopt}"
+                wsrep_log_info "Encrypting with CERT: $tcert, CA: $tca"
+                tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tcert},cafile=${tca}${donor_extra}${sockopt}"
             fi
         elif [[ $encrypt -eq 3 ]];then
+            wsrep_log_warning "**** WARNING **** encrypt=3 is deprecated and will be removed in a future release"
             wsrep_log_info "Using openssl based encryption with socat: with key and crt"
-            if [[ -z $tpem || -z $tkey ]];then 
-                wsrep_log_error "Both certificate and key files required"
-                exit 22
-            fi
+
+            verify_file_exists "$tcert" "Both certificate and key files are required." \
+                                        "Please check the 'tcert' option.            "
+            verify_file_exists "$tkey" "Both certificate and key files are required." \
+                                       "Please check the 'tkey' option.             "
+
             stagemsg+="-OpenSSL-Encrypted-3"
             if [[ "$WSREP_SST_OPT_ROLE"  == "joiner" ]];then
-                wsrep_log_info "Decrypting with certificate $tpem, key $tkey"
-                tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=$tpem,key=${tkey},verify=0${sockopt} stdio"
+                wsrep_log_info "Decrypting with CERT: $tcert, KEY: $tkey"
+                tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${tcert},key=${tkey},verify=0${joiner_extra}${sockopt} stdio"
             else
-                wsrep_log_info "Encrypting with certificate $tpem, key $tkey"
-                tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=$tpem,key=${tkey},verify=0${sockopt}"
+                wsrep_log_info "Encrypting with CERT: $tcert, KEY: $tkey"
+                tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tcert},key=${tkey},verify=0${sockopt}"
+            fi
+        elif [[ $encrypt -eq 4 ]]; then
+            wsrep_log_info "Using openssl based encryption with socat: with key, crt, and ca"
+
+            verify_file_exists "$ssl_ca" "CA, certificate, and key files are required." \
+                                         "Please check the 'ssl-ca' option.           "
+            verify_file_exists "$ssl_cert" "CA, certificate, and key files are required." \
+                                           "Please check the 'ssl-cert' option.         "
+            verify_file_exists "$ssl_key" "CA, certificate, and key files are required." \
+                                          "Please check the 'ssl-key' option.          "
+
+            # Check to see that the key matches the cert
+            verify_cert_matches_key $ssl_cert $ssl_key
+
+            stagemsg+="-OpenSSL-Encrypted-4"
+            if [[ "$WSREP_SST_OPT_ROLE"  == "joiner" ]]; then
+                wsrep_log_info "Decrypting with CERT: $ssl_cert, KEY: $ssl_key, CA: $ssl_ca"
+                tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=${ssl_cert},key=${ssl_key},cafile=${ssl_ca},verify=1${joiner_extra}${sockopt} stdio"
+            else
+                wsrep_log_info "Encrypting with CERT: $ssl_cert, KEY: $ssl_key, CA: $ssl_ca"
+                tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${ssl_cert},key=${ssl_key},cafile=${ssl_ca},verify=1${donor_extra}${sockopt}"
             fi
 
-        else 
-            if [[ "$WSREP_SST_OPT_ROLE"  == "joiner" ]];then
+        else
+            if [[ $encrypt -eq 1 ]]; then
+                wsrep_log_warning "**** WARNING **** encrypt=1 is deprecated and will be removed in a future release"
+            fi
+
+            if [[ "$WSREP_SST_OPT_ROLE"  == "joiner" ]]; then
                 tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio"
             else
                 tcmd="socat -u stdio TCP:${REMOTEIP}:${TSST_PORT}${sockopt}"
             fi
         fi
     fi
-
-}
-
-parse_cnf()
-{
-    local group=$1
-    local var=$2
-    # print the default settings for given group using my_print_default.
-    # normalize the variable names specified in cnf file (user can use _ or - for example log-bin or log_bin)
-    # then grep for needed variable
-    # finally get the variable value (if variables has been specified multiple time use the last value only)
-    reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
-    if [[ -z $reval ]];then 
-        [[ -n $3 ]] && reval=$3
-    fi
-    echo $reval
 }
 
 get_footprint()
@@ -298,15 +443,15 @@ read_cnf()
 {
     sfmt=$(parse_cnf sst streamfmt "xbstream")
     tfmt=$(parse_cnf sst transferfmt "socat")
-    tcert=$(parse_cnf sst tca "")
-    tpem=$(parse_cnf sst tcert "")
+    tca=$(parse_cnf sst tca "")
+    tcert=$(parse_cnf sst tcert "")
     tkey=$(parse_cnf sst tkey "")
     encrypt=$(parse_cnf sst encrypt 0)
     sockopt=$(parse_cnf sst sockopt "")
     progress=$(parse_cnf sst progress "")
     rebuild=$(parse_cnf sst rebuild 0)
     ttime=$(parse_cnf sst time 0)
-    cpat=$(parse_cnf sst cpat '.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$')
+    cpat=$(parse_cnf sst cpat '.*\.pem$\|.*init\.ok$\|.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$')
     ealgo=$(parse_cnf xtrabackup encrypt "")
     ekey=$(parse_cnf xtrabackup encrypt-key "")
     ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "")
@@ -320,9 +465,23 @@ read_cnf()
         ekey=$(parse_cnf sst encrypt-key "")
         ekeyfile=$(parse_cnf sst encrypt-key-file "")
     fi
+
+    # Pull the parameters needed for encrypt=4
+    ssl_ca=$(parse_cnf sst ssl-ca "")
+    if [[ -z "$ssl_ca" ]]; then
+        ssl_ca=$(parse_cnf mysqld ssl-ca "")
+    fi
+    ssl_cert=$(parse_cnf sst ssl-cert "")
+    if [[ -z "$ssl_cert" ]]; then
+        ssl_cert=$(parse_cnf mysqld ssl-cert "")
+    fi
+    ssl_key=$(parse_cnf sst ssl-key "")
+    if [[ -z "$ssl_key" ]]; then
+        ssl_key=$(parse_cnf mysqld ssl-key "")
+    fi
+
     rlimit=$(parse_cnf sst rlimit "")
     uextra=$(parse_cnf sst use-extra 0)
-    speciald=$(parse_cnf sst sst-special-dirs 1)
     iopts=$(parse_cnf sst inno-backup-opts "")
     iapts=$(parse_cnf sst inno-apply-opts "")
     impts=$(parse_cnf sst inno-move-opts "")
@@ -331,13 +490,8 @@ read_cnf()
     ssystag=$(parse_cnf mysqld_safe syslog-tag "${SST_SYSLOG_TAG:-}")
     ssystag+="-"
 
-    if [[ $speciald -eq 0 ]];then 
-        wsrep_log_error "sst-special-dirs equal to 0 is not supported, falling back to 1"
-        speciald=1
-    fi 
-
     if [[ $ssyslog -ne -1 ]];then 
-        if my_print_defaults -c $WSREP_SST_OPT_CONF mysqld_safe | tr '_' '-' | grep -q -- "--syslog";then 
+        if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF mysqld_safe | tr '_' '-' | grep -q -- "--syslog";then
             ssyslog=1
         fi
     fi
@@ -483,28 +637,35 @@ kill_xtrabackup()
 setup_ports()
 {
     if [[ "$WSREP_SST_OPT_ROLE"  == "donor" ]];then
-        SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }')
-        REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }')
-        lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }')
-        sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }')
+        SST_PORT=$WSREP_SST_OPT_PORT
+        REMOTEIP=$WSREP_SST_OPT_HOST
+        lsn=$(echo $WSREP_SST_OPT_PATH | awk -F '[/]' '{ print $2 }')
+        sst_ver=$(echo $WSREP_SST_OPT_PATH | awk -F '[/]' '{ print $3 }')
     else
-        SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }')
+        SST_PORT=$WSREP_SST_OPT_PORT
     fi
 }
 
-# waits ~10 seconds for nc to open the port and then reports ready
+# waits ~1 minute for nc/socat to open the port and then reports ready
 # (regardless of timeout)
 wait_for_listen()
 {
-    local PORT=$1
-    local ADDR=$2
+    local HOST=$1
+    local PORT=$2
     local MODULE=$3
-    for i in {1..50}
+
+    for i in {1..300}
     do
-        ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break
+        if [ "`uname`" = "FreeBSD" ] ; then
+            get_listening_on_port_cmd="sockstat -l -P tcp -p $PORT"
+        else
+            get_listening_on_port_cmd="ss -p state listening ( sport = :$PORT )"
+        fi
+        $get_listening_on_port_cmd | grep -qE 'socat|nc' && break
         sleep 0.2
     done
-    echo "ready ${ADDR}/${MODULE}//$sst_ver"
+
+    echo "ready ${HOST}:${PORT}/${MODULE}//$sst_ver"
 }
 
 check_extra()
@@ -512,7 +673,7 @@ check_extra()
     local use_socket=1
     if [[ $uextra -eq 1 ]];then 
         if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--thread-handling=" | grep -q 'pool-of-threads';then 
-            local eport=$(my_print_defaults -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--extra-port=" | cut -d= -f2)
+            local eport=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--extra-port=" | cut -d= -f2)
             if [[ -n $eport ]];then 
                 # Xtrabackup works only locally.
                 # Hence, setting host to 127.0.0.1 unconditionally. 
@@ -607,11 +768,64 @@ send_donor()
 
 }
 
+# Returns the version string in a standardized format
+# Input "1.2.3" => echoes "010203"
+# Wrongly formatted values => echoes "000000"
+normalize_version()
+{
+    local major=0
+    local minor=0
+    local patch=0
+
+    # Only parses purely numeric version numbers, 1.2.3 
+    # Everything after the first three values are ignored
+    if [[ $1 =~ ^([0-9]+)\.([0-9]+)\.?([0-9]*)([\.0-9])*$ ]]; then
+        major=${BASH_REMATCH[1]}
+        minor=${BASH_REMATCH[2]}
+        patch=${BASH_REMATCH[3]}
+    fi
+
+    printf %02d%02d%02d $major $minor $patch
+}
+
+# Compares two version strings
+# The first parameter is the version to be checked
+# The second parameter is the minimum version required
+# Returns 1 (failure) if $1 >= $2, 0 (success) otherwise
+check_for_version()
+{
+    local local_version_str="$( normalize_version $1 )"
+    local required_version_str="$( normalize_version $2 )"
+
+    if [[ "$local_version_str" < "$required_version_str" ]]; then
+        return 1
+    else
+        return 0
+    fi
+}
+
+
 if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then 
     wsrep_log_error "innobackupex not in path: $PATH"
     exit 2
 fi
 
+# check the version, we require XB-2.4 to ensure that we can pass the
+# datadir via the command-line option
+XB_REQUIRED_VERSION="2.3.5"
+
+XB_VERSION=`$INNOBACKUPEX_BIN --version 2>&1 | grep -oe '[0-9]\.[0-9][\.0-9]*' | head -n1`
+if [[ -z $XB_VERSION ]]; then
+    wsrep_log_error "FATAL: Cannot determine the $INNOBACKUPEX_BIN version. Needs xtrabackup-$XB_REQUIRED_VERSION or higher to perform SST"
+    exit 2
+fi
+
+if ! check_for_version $XB_VERSION $XB_REQUIRED_VERSION; then
+    wsrep_log_error "FATAL: The $INNOBACKUPEX_BIN version is $XB_VERSION. Needs xtrabackup-$XB_REQUIRED_VERSION or higher to perform SST"
+    exit 2
+fi
+
+
 rm -f "${MAGIC_FILE}"
 
 if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then 
@@ -655,13 +869,13 @@ if [[ $ssyslog -eq 1 ]];then
         }
 
         INNOAPPLY="${INNOBACKUPEX_BIN} $disver $iapts --apply-log \$rebuildcmd \${DATA} 2>&1  | logger -p daemon.err -t ${ssystag}innobackupex-apply "
-        INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $impts  --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move "
+        INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $impts --datadir=${DATA} --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move "
         INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
     fi
 
 else 
     INNOAPPLY="${INNOBACKUPEX_BIN} $disver $iapts --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log"
-    INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF}  --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $impts  --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log"
+    INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF}  --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $impts --datadir=${DATA} --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log"
     INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF}  --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log"
 fi
 
@@ -703,15 +917,6 @@ then
         fi
 
         get_keys
-        if [[ $encrypt -eq 1 ]];then
-            if [[ -n $ekey ]];then
-                INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey "
-            else 
-                INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile "
-            fi
-        fi
-
-
         check_extra
 
         wsrep_log_info "Streaming GTID file before SST"
@@ -722,17 +927,17 @@ then
 
         if [[ $encrypt -eq 1 ]];then
             if [[ -n $scomp ]];then 
-                tcmd=" $ecmd | $scomp | $tcmd "
+                tcmd=" \$ecmd | $scomp | $tcmd "
             else 
-                tcmd=" $ecmd | $tcmd "
+                tcmd=" \$ecmd | $tcmd "
             fi
         elif [[ -n $scomp ]];then 
             tcmd=" $scomp | $tcmd "
         fi
 
-
         send_donor $DATA "${stagemsg}-gtid"
 
+        # Restore the transport commmand to its original state
         tcmd="$ttcmd"
         if [[ -n $progress ]];then 
             get_footprint
@@ -747,10 +952,16 @@ then
 
         wsrep_log_info "Streaming the backup to joiner at ${REMOTEIP} ${SST_PORT:-4444}"
 
-        if [[ -n $scomp ]];then 
+        # Add compression to the head of the stream (if specified)
+        if [[ -n $scomp ]]; then
             tcmd="$scomp | $tcmd"
         fi
 
+        # Add encryption to the head of the stream (if specified)
+        if [[ $encrypt -eq 1 ]]; then
+            tcmd=" \$ecmd | $tcmd "
+        fi
+
         set +e
         timeit "${stagemsg}-SST" "$INNOBACKUP | $tcmd; RC=( "\${PIPESTATUS[@]}" )"
         set -e
@@ -777,9 +988,9 @@ then
         get_keys
         if [[ $encrypt -eq 1 ]];then
             if [[ -n $scomp ]];then 
-                tcmd=" $ecmd | $scomp | $tcmd "
+                tcmd=" \$ecmd | $scomp | $tcmd "
             else
-                tcmd=" $ecmd | $tcmd "
+                tcmd=" \$ecmd | $tcmd "
             fi
         elif [[ -n $scomp ]];then 
             tcmd=" $scomp | $tcmd "
@@ -804,7 +1015,6 @@ then
 
     stagemsg="Joiner-Recv"
 
-
     sencrypted=1
     nthreads=1
 
@@ -815,14 +1025,7 @@ then
     # May need xtrabackup_checkpoints later on
     rm -f ${DATA}/xtrabackup_binary ${DATA}/xtrabackup_galera_info  ${DATA}/xtrabackup_logfile
 
-    ADDR=${WSREP_SST_OPT_ADDR}
-    if [ -z "${SST_PORT}" ]
-    then
-        SST_PORT=4444
-        ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}"
-    fi
-
-    wait_for_listen ${SST_PORT} ${ADDR} ${MODULE} &
+    wait_for_listen ${WSREP_SST_OPT_HOST} ${WSREP_SST_OPT_PORT:-4444} ${MODULE} &
 
     trap sig_joiner_cleanup HUP PIPE INT TERM
     trap cleanup_joiner EXIT
@@ -835,9 +1038,9 @@ then
     get_keys
     if [[ $encrypt -eq 1 && $sencrypted -eq 1 ]];then
         if [[ -n $sdecomp ]];then 
-            strmcmd=" $sdecomp | $ecmd | $strmcmd"
+            strmcmd=" $sdecomp | \$ecmd | $strmcmd"
         else 
-            strmcmd=" $ecmd | $strmcmd"
+            strmcmd=" \$ecmd | $strmcmd"
         fi
     elif [[ -n $sdecomp ]];then 
             strmcmd=" $sdecomp | $strmcmd"
index a7c545107e4b968e474ff07685e05fb0ee2d565c..1664d6b1626143ac37757389637261e7996f9670 100644 (file)
@@ -1482,23 +1482,35 @@ end:
       thd->tx_read_only= false;
 
 #ifdef WITH_WSREP
-      if (WSREP(thd)) {
-          // sql_print_information("sizeof(LEX) = %d", sizeof(struct LEX));
-          // sizeof(LEX) = 4512, so it's relatively safe to allocate it on stack.
-          LEX lex;
-          LEX* saved = thd->lex;
-          lex.sql_command = SQLCOM_DROP_EVENT;
-          thd->lex = &lex;
-          WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
-          thd->lex = saved;
+      /*
+         This code is processing event execution and does not have client
+         connection. Here, event execution will now execute a prepared
+         DROP EVENT statement, but thd->lex->sql_command is set to
+         SQLCOM_CREATE_PROCEDURE
+         DROP EVENT will be logged in binlog, and we have to
+         replicate it to make all nodes have consistent event definitions
+         Wsrep DDL replication is triggered inside Events::drop_event(),
+         and here we need to prepare the THD so that DDL replication is
+         possible, essentially it requires setting sql_command to
+         SQLCOMM_DROP_EVENT, we will switch sql_command for the duration
+         of DDL replication only.
+      */
+      enum_sql_command sql_command_save= SQLCOM_END;
+      if (WSREP(thd))
+      {
+        sql_command_save= thd->lex->sql_command;
+        thd->lex->sql_command = SQLCOM_DROP_EVENT;
       }
 #endif
      
       ret= Events::drop_event(thd, dbname, name, FALSE);
 
 #ifdef WITH_WSREP
-      WSREP_TO_ISOLATION_END;
-  error:
+      if (WSREP(thd))
+      {
+        WSREP_TO_ISOLATION_END;
+        thd->lex->sql_command = sql_command_save;
+      }
 #endif      
       thd->tx_read_only= save_tx_read_only;
       thd->security_ctx->master_access= saved_master_access;
index 66a0eadf7827b4c780986779fc20a89a950fede1..d5b80fc34d331f0cc8a87c0281e27513373bc9b6 100644 (file)
@@ -327,6 +327,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
 
   if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
     DBUG_RETURN(TRUE);
+  WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
 
   if (check_db_dir_existence(parse_data->dbname.str))
   {
@@ -413,6 +414,10 @@ err:
   thd->variables.binlog_format= save_binlog_format;
 
   DBUG_RETURN(ret);
+#ifdef WITH_WSREP
+ error:
+  DBUG_RETURN(TRUE);
+#endif /* WITH_WSREP */
 }
 
 
@@ -454,6 +459,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
 
   if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
     DBUG_RETURN(TRUE);
+  WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
 
   if (new_dbname)                               /* It's a rename */
   {
@@ -540,6 +546,10 @@ err:
   thd->variables.binlog_format= save_binlog_format;
 
   DBUG_RETURN(ret);
+#ifdef WITH_WSREP
+ error:
+  DBUG_RETURN(TRUE);
+#endif /* WITH_WSREP */
 }
 
 
@@ -579,6 +589,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
 
   if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0))
     DBUG_RETURN(TRUE);
+  WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
 
   /*
     Turn off row binlogging of this statement and use statement-based so
@@ -606,6 +617,10 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
   if (save_binlog_row_based)
     thd->set_current_stmt_binlog_format_row();
   DBUG_RETURN(ret);
+#ifdef WITH_WSREP
+ error:
+  DBUG_RETURN(TRUE);
+#endif /* WITH_WSREP */
 }
 
 
index 268558f4eaa626ed30796be1f3c1c5251aea1aad..9ee8847d87c9ff399df34609df14f61e507bd0f3 100644 (file)
@@ -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
@@ -8691,13 +8691,13 @@ String *Field_set::val_str(String *val_buffer,
   ulonglong tmp=(ulonglong) Field_enum::val_int();
   uint bitnr=0;
 
+  /*
+    Some callers expect *val_buffer to contain the result,
+    so we assign to it, rather than doing 'return &empty_set_string.
+  */
+  *val_buffer= empty_set_string;
   if (tmp == 0)
   {
-    /*
-      Some callers expect *val_buffer to contain the result,
-      so we assign to it, rather than doing 'return &empty_set_string.
-     */
-    *val_buffer= empty_set_string;
     return val_buffer;
   }
 
index 60070198397cf302af1d6477ba8266fd36e6f44a..ae4c5f0c8fe08bf6d97faa95636f05b692e86c2e 100644 (file)
@@ -709,7 +709,7 @@ int ha_partition::create(const char *name, TABLE *table_arg,
                         HA_CREATE_INFO *create_info)
 {
   int error;
-  char name_buff[FN_REFLEN], name_lc_buff[FN_REFLEN];
+  char name_buff[FN_REFLEN + 1], name_lc_buff[FN_REFLEN + 1];
   char *name_buffer_ptr;
   const char *path;
   uint i;
@@ -751,8 +751,10 @@ int ha_partition::create(const char *name, TABLE *table_arg,
       for (j= 0; j < m_part_info->num_subparts; j++)
       {
         part_elem= sub_it++;
-        create_partition_name(name_buff, path, name_buffer_ptr,
-                              NORMAL_PART_NAME, FALSE);
+        if ((error= create_partition_name(name_buff, path, name_buffer_ptr,
+                                          NORMAL_PART_NAME, FALSE)))
+          goto create_error;
+
         if ((error= set_up_table_before_create(table_arg, name_buff,
                                                create_info, part_elem)) ||
             ((error= (*file)->ha_create(name_buff, table_arg, create_info))))
@@ -764,8 +766,10 @@ int ha_partition::create(const char *name, TABLE *table_arg,
     }
     else
     {
-      create_partition_name(name_buff, path, name_buffer_ptr,
-                            NORMAL_PART_NAME, FALSE);
+      if ((create_partition_name(name_buff, path, name_buffer_ptr,
+                                 NORMAL_PART_NAME, FALSE)))
+        goto create_error;
+
       if ((error= set_up_table_before_create(table_arg, name_buff,
                                              create_info, part_elem)) ||
           ((error= (*file)->ha_create(name_buff, table_arg, create_info))))
@@ -781,9 +785,9 @@ create_error:
   name_buffer_ptr= m_name_buffer_ptr;
   for (abort_file= file, file= m_file; file < abort_file; file++)
   {
-    create_partition_name(name_buff, path, name_buffer_ptr, NORMAL_PART_NAME,
-                          FALSE);
-    (void) (*file)->ha_delete_table((const char*) name_buff);
+    if (!create_partition_name(name_buff, path, name_buffer_ptr, NORMAL_PART_NAME,
+                               FALSE))
+      (void) (*file)->ha_delete_table((const char*) name_buff);
     name_buffer_ptr= strend(name_buffer_ptr) + 1;
   }
   handler::delete_table(name);
@@ -810,7 +814,7 @@ create_error:
 int ha_partition::drop_partitions(const char *path)
 {
   List_iterator<partition_element> part_it(m_part_info->partitions);
-  char part_name_buff[FN_REFLEN];
+  char part_name_buff[FN_REFLEN + 1];
   uint num_parts= m_part_info->partitions.elements;
   uint num_subparts= m_part_info->num_subparts;
   uint i= 0;
@@ -843,9 +847,12 @@ int ha_partition::drop_partitions(const char *path)
         {
           partition_element *sub_elem= sub_it++;
           part= i * num_subparts + j;
-          create_subpartition_name(part_name_buff, path,
-                                   part_elem->partition_name,
-                                   sub_elem->partition_name, name_variant);
+          if ((ret_error= create_subpartition_name(part_name_buff, path,
+                                                   part_elem->partition_name,
+                                                   sub_elem->partition_name,
+                                                   name_variant)))
+            error= ret_error;
+
           file= m_file[part];
           DBUG_PRINT("info", ("Drop subpartition %s", part_name_buff));
           if ((ret_error= file->ha_delete_table(part_name_buff)))
@@ -856,9 +863,11 @@ int ha_partition::drop_partitions(const char *path)
       }
       else
       {
-        create_partition_name(part_name_buff, path,
-                              part_elem->partition_name, name_variant,
-                              TRUE);
+        if ((ret_error= create_partition_name(part_name_buff, path,
+                                              part_elem->partition_name,
+                                              name_variant, TRUE)))
+          error= ret_error;
+
         file= m_file[i];
         DBUG_PRINT("info", ("Drop partition %s", part_name_buff));
         if ((ret_error= file->ha_delete_table(part_name_buff)))
@@ -943,10 +952,12 @@ int ha_partition::rename_partitions(const char *path)
         {
           sub_elem= sub_it++;
           file= m_reorged_file[part_count++];
-          create_subpartition_name(norm_name_buff, path,
-                                   part_elem->partition_name,
-                                   sub_elem->partition_name,
-                                   NORMAL_PART_NAME);
+          if ((ret_error= create_subpartition_name(norm_name_buff, path,
+                                                   part_elem->partition_name,
+                                                   sub_elem->partition_name,
+                                                   NORMAL_PART_NAME)))
+           error= ret_error;
+
           DBUG_PRINT("info", ("Delete subpartition %s", norm_name_buff));
           if ((ret_error= file->ha_delete_table(norm_name_buff)))
             error= ret_error;
@@ -959,9 +970,11 @@ int ha_partition::rename_partitions(const char *path)
       else
       {
         file= m_reorged_file[part_count++];
-        create_partition_name(norm_name_buff, path,
-                              part_elem->partition_name, NORMAL_PART_NAME,
-                              TRUE);
+        if ((ret_error= create_partition_name(norm_name_buff, path,
+                                              part_elem->partition_name,
+                                              NORMAL_PART_NAME, TRUE)))
+          error= ret_error;
+
         DBUG_PRINT("info", ("Delete partition %s", norm_name_buff));
         if ((ret_error= file->ha_delete_table(norm_name_buff)))
           error= ret_error;
@@ -1011,10 +1024,12 @@ int ha_partition::rename_partitions(const char *path)
         {
           sub_elem= sub_it++;
           part= i * num_subparts + j;
-          create_subpartition_name(norm_name_buff, path,
-                                   part_elem->partition_name,
-                                   sub_elem->partition_name,
-                                   NORMAL_PART_NAME);
+          if ((ret_error= create_subpartition_name(norm_name_buff, path,
+                                                   part_elem->partition_name,
+                                                   sub_elem->partition_name,
+                                                   NORMAL_PART_NAME)))
+            error= ret_error;
+
           if (part_elem->part_state == PART_IS_CHANGED)
           {
             file= m_reorged_file[part_count++];
@@ -1026,10 +1041,12 @@ int ha_partition::rename_partitions(const char *path)
             (void) sync_ddl_log();
           }
           file= m_new_file[part];
-          create_subpartition_name(part_name_buff, path,
-                                   part_elem->partition_name,
-                                   sub_elem->partition_name,
-                                   TEMP_PART_NAME);
+          if ((ret_error= create_subpartition_name(part_name_buff, path,
+                                                   part_elem->partition_name,
+                                                   sub_elem->partition_name,
+                                                   TEMP_PART_NAME)))
+            error= ret_error;
+
           DBUG_PRINT("info", ("Rename subpartition from %s to %s",
                      part_name_buff, norm_name_buff));
           if ((ret_error= file->ha_rename_table(part_name_buff,
@@ -1043,9 +1060,11 @@ int ha_partition::rename_partitions(const char *path)
       }
       else
       {
-        create_partition_name(norm_name_buff, path,
-                              part_elem->partition_name, NORMAL_PART_NAME,
-                              TRUE);
+        if ((ret_error= create_partition_name(norm_name_buff, path,
+                                              part_elem->partition_name,
+                                              NORMAL_PART_NAME, TRUE)))
+          error= ret_error;
+
         if (part_elem->part_state == PART_IS_CHANGED)
         {
           file= m_reorged_file[part_count++];
@@ -1057,9 +1076,10 @@ int ha_partition::rename_partitions(const char *path)
           (void) sync_ddl_log();
         }
         file= m_new_file[i];
-        create_partition_name(part_name_buff, path,
-                              part_elem->partition_name, TEMP_PART_NAME,
-                              TRUE);
+        if ((error= create_partition_name(part_name_buff, path,
+                                          part_elem->partition_name,
+                                          TEMP_PART_NAME, TRUE)))
+          error= ret_error;
         DBUG_PRINT("info", ("Rename partition from %s to %s",
                    part_name_buff, norm_name_buff));
         if ((ret_error= file->ha_rename_table(part_name_buff,
@@ -1682,7 +1702,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
 {
   List_iterator<partition_element> part_it(m_part_info->partitions);
   List_iterator <partition_element> t_it(m_part_info->temp_partitions);
-  char part_name_buff[FN_REFLEN];
+  char part_name_buff[FN_REFLEN + 1];
   uint num_parts= m_part_info->partitions.elements;
   uint num_subparts= m_part_info->num_subparts;
   uint i= 0;
@@ -1910,10 +1930,15 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
         do
         {
           partition_element *sub_elem= sub_it++;
-          create_subpartition_name(part_name_buff, path,
-                                   part_elem->partition_name,
-                                   sub_elem->partition_name,
-                                   name_variant);
+          if ((error= create_subpartition_name(part_name_buff, path,
+                                               part_elem->partition_name,
+                                               sub_elem->partition_name,
+                                               name_variant)))
+          {
+            cleanup_new_partition(part_count);
+            DBUG_RETURN(error);
+          }
+
           part= i * num_subparts + j;
           DBUG_PRINT("info", ("Add subpartition %s", part_name_buff));
           if ((error= prepare_new_partition(table, create_info,
@@ -1931,9 +1956,14 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
       }
       else
       {
-        create_partition_name(part_name_buff, path,
-                              part_elem->partition_name, name_variant,
-                              TRUE);
+        if ((error= create_partition_name(part_name_buff, path,
+                                          part_elem->partition_name,
+                                          name_variant, TRUE)))
+        {
+          cleanup_new_partition(part_count);
+          DBUG_RETURN(error);
+        }
+
         DBUG_PRINT("info", ("Add partition %s", part_name_buff));
         if ((error= prepare_new_partition(table, create_info,
                                           new_file_array[i],
@@ -2302,8 +2332,8 @@ int ha_partition::del_ren_table(const char *from, const char *to)
 {
   int save_error= 0;
   int error= HA_ERR_INTERNAL_ERROR;
-  char from_buff[FN_REFLEN], to_buff[FN_REFLEN], from_lc_buff[FN_REFLEN],
-       to_lc_buff[FN_REFLEN], buff[FN_REFLEN];
+  char from_buff[FN_REFLEN + 1], to_buff[FN_REFLEN + 1], from_lc_buff[FN_REFLEN + 1],
+       to_lc_buff[FN_REFLEN + 1], buff[FN_REFLEN + 1];
   char *name_buffer_ptr;
   const char *from_path;
   const char *to_path= NULL;
@@ -2343,13 +2373,16 @@ int ha_partition::del_ren_table(const char *from, const char *to)
   i= 0;
   do
   {
-    create_partition_name(from_buff, from_path, name_buffer_ptr,
-                          NORMAL_PART_NAME, FALSE);
+    if ((error= create_partition_name(from_buff, from_path, name_buffer_ptr,
+                                      NORMAL_PART_NAME, FALSE)))
+      goto rename_error;
 
     if (to != NULL)
     {                                           // Rename branch
-      create_partition_name(to_buff, to_path, name_buffer_ptr,
-                            NORMAL_PART_NAME, FALSE);
+      if ((error= create_partition_name(to_buff, to_path, name_buffer_ptr,
+                                        NORMAL_PART_NAME, FALSE)))
+        goto rename_error;
+
       error= (*file)->ha_rename_table(from_buff, to_buff);
       if (error)
         goto rename_error;
@@ -2390,12 +2423,12 @@ rename_error:
   for (abort_file= file, file= m_file; file < abort_file; file++)
   {
     /* Revert the rename, back from 'to' to the original 'from' */
-    create_partition_name(from_buff, from_path, name_buffer_ptr,
-                          NORMAL_PART_NAME, FALSE);
-    create_partition_name(to_buff, to_path, name_buffer_ptr,
-                          NORMAL_PART_NAME, FALSE);
-    /* Ignore error here */
-    (void) (*file)->ha_rename_table(to_buff, from_buff);
+    if (!create_partition_name(from_buff, from_path, name_buffer_ptr,
+                               NORMAL_PART_NAME, FALSE))
+       if (!create_partition_name(to_buff, to_path, name_buffer_ptr,
+                                  NORMAL_PART_NAME, FALSE))
+         /* Ignore error here */
+         (void) (*file)->ha_rename_table(to_buff, from_buff);
     name_buffer_ptr= strend(name_buffer_ptr) + 1;
   }
   DBUG_RETURN(error);
@@ -3272,7 +3305,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
   char *name_buffer_ptr;
   int error= HA_ERR_INITIALIZATION;
   handler **file;
-  char name_buff[FN_REFLEN];
+  char name_buff[FN_REFLEN + 1];
   ulonglong check_table_flags;
   DBUG_ENTER("ha_partition::open");
 
@@ -3326,8 +3359,13 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
     file= m_is_clone_of->m_file;
     for (i= 0; i < m_tot_parts; i++)
     {
-      create_partition_name(name_buff, name, name_buffer_ptr, NORMAL_PART_NAME,
-                            FALSE);
+      if ((error= create_partition_name(name_buff, name, name_buffer_ptr,
+                                        NORMAL_PART_NAME, FALSE)))
+      {
+        file= &m_file[i];
+        goto err_handler;
+      }
+
       /* ::clone() will also set ha_share from the original. */
       if (!(m_file[i]= file[i]->clone(name_buff, m_clone_mem_root)))
       {
@@ -3343,8 +3381,10 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
    file= m_file;
    do
    {
-      create_partition_name(name_buff, name, name_buffer_ptr, NORMAL_PART_NAME,
-                            FALSE);
+      if ((error= create_partition_name(name_buff, name, name_buffer_ptr,
+                                        NORMAL_PART_NAME, FALSE)))
+        goto err_handler;
+
       if ((error= (*file)->ha_open(table, name_buff, mode,
                                    test_if_locked | HA_OPEN_NO_PSI_CALL)))
         goto err_handler;
@@ -4922,14 +4962,11 @@ int ha_partition::rnd_pos(uchar * buf, uchar *pos)
 int ha_partition::rnd_pos_by_record(uchar *record)
 {
   DBUG_ENTER("ha_partition::rnd_pos_by_record");
-
   if (unlikely(get_part_for_delete(record, m_rec0, m_part_info, &m_last_part)))
     DBUG_RETURN(1);
-
-  DBUG_RETURN(handler::rnd_pos_by_record(record));
+  DBUG_RETURN(m_file[m_last_part]->rnd_pos_by_record(record));
 }
 
-
 /****************************************************************************
                 MODULE index scan
 ****************************************************************************/
index 36dfc275cf64fa9fe6ec0fa2232723b4d98f53da..1336a0b23aa635bc1436f78d4aa0bfa681205c3e 100644 (file)
@@ -1595,9 +1595,11 @@ int ha_rollback_low(THD *thd, bool all)
       { // cannot happen
         my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err);
         error= 1;
+#ifdef WITH_WSREP
         WSREP_WARN("handlerton rollback failed, thd %lu %lld conf %d SQL %s",
                    thd->thread_id, thd->query_id, thd->wsrep_conflict_state,
                    thd->query());
+#endif /* WITH_WSREP */
       }
       status_var_increment(thd->status_var.ha_rollback_count);
       ha_info_next= ha_info->next();
@@ -7675,6 +7677,11 @@ void ha_wsrep_fake_trx_id(THD *thd)
     DBUG_VOID_RETURN;
   }
 
+  if (thd->wsrep_ws_handle.trx_id != WSREP_UNDEFINED_TRX_ID)
+  {
+    WSREP_DEBUG("fake trx id skipped: %lu", thd->wsrep_ws_handle.trx_id);
+    DBUG_VOID_RETURN;
+  }
   handlerton *hton= installed_htons[DB_TYPE_INNODB];
   if (hton && hton->wsrep_fake_trx_id)
   {
index 144208e57313669217547e2cf5ca4e058a7b4fe6..2dae921960982d4c174bdb5e0c034a3d52fabd17 100644 (file)
@@ -2249,10 +2249,19 @@ public:
   */
   virtual int rnd_pos_by_record(uchar *record)
     {
+      int error;
       DBUG_ASSERT(table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION);
+
+      error = ha_rnd_init(false);
+      if (error != 0)
+          return error;
+
       position(record);
-      return ha_rnd_pos(record, ref);
+      error = ha_rnd_pos(record, ref);
+      ha_rnd_end();
+      return error;
     }
+
   virtual int read_first_row(uchar *buf, uint primary_key);
   /**
     The following function is only needed for tables that may be temporary
index b999be8c7d25388eaad366ad0575009eca98b264..61c363bdb63e07c59ea5bcd85cbc32c3a45d00ba 100644 (file)
@@ -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
@@ -33,6 +33,7 @@
                                                 // sql_print_information
 #include "violite.h"                            // vio_getnameinfo,
                                                 // vio_get_normalized_ip_string
+#include <string>
 #ifdef __cplusplus
 extern "C" {                                   // Because of SCO 3.2V4.2
 #endif
@@ -551,6 +552,14 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
                   }
                   );
 
+  DBUG_EXECUTE_IF ("getnameinfo_fake_max_length",
+                  {
+                    std::string s(NI_MAXHOST-1, 'a');
+                    strcpy(hostname_buffer, s.c_str());
+                    err_code= 0;
+                  }
+                  );
+
   /*
   ===========================================================================
   DEBUG code only (end)
index 99404bf25ef326296ccde09c517fe1043f6bc846..0ad01712a79499224bbb2477c27af26fad85cdbb 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ITEM_INCLUDED
 #define ITEM_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
@@ -2017,6 +2017,12 @@ public:
     return value_item->result_type();
   }
 
+  virtual bool cache_const_expr_analyzer(uchar **arg)
+  {
+    // Item_name_const always wraps a literal, so there is no need to cache it.
+    return false;
+  }
+
   type_conversion_status save_in_field(Field *field, bool no_conversions)
   {
     return  value_item->save_in_field(field, no_conversions);
index fee2d692f78c51d3aebbff5d906897e3a5313515..ccc78cd85b0b418590423e6c7fd1100beb8f552b 100644 (file)
@@ -6188,7 +6188,17 @@ void Item_func_get_system_var::cleanup()
 }
 
 
-void Item_func_match::init_search(bool no_order)
+/**
+  Initialize searching within full-text index.
+
+  @param thd      Thread handler
+  @param no_order Flag to indicate whether it is GROUP BY
+                  clause without ORDER BY.
+
+  @returns false if success, true if error
+*/
+
+bool Item_func_match::init_search(THD *thd, bool no_order)
 {
   DBUG_ENTER("Item_func_match::init_search");
 
@@ -6197,7 +6207,7 @@ void Item_func_match::init_search(bool no_order)
     with fix_field
   */
   if (!fixed)
-    DBUG_VOID_RETURN;
+    DBUG_RETURN(false);
 
   /* Check if init_search() has been called before */
   if (ft_handler)
@@ -6210,16 +6220,19 @@ void Item_func_match::init_search(bool no_order)
     */
     if (join_key)
       table->file->ft_handler= ft_handler;
-    DBUG_VOID_RETURN;
+    DBUG_RETURN(false);
   }
 
   if (key == NO_SUCH_KEY)
   {
     List<Item> fields;
-    fields.push_back(new Item_string(" ",1, cmp_collation.collation));
+    if (fields.push_back(new Item_string(" ",1, cmp_collation.collation)))
+      DBUG_RETURN(true);
     for (uint i=1; i < arg_count; i++)
       fields.push_back(args[i]);
     concat_ws=new Item_func_concat_ws(fields);
+    if (concat_ws == NULL)
+       DBUG_RETURN(true);
     /*
       Above function used only to get value and do not need fix_fields for it:
       Item_string - basic constant
@@ -6232,10 +6245,11 @@ void Item_func_match::init_search(bool no_order)
   if (master)
   {
     join_key=master->join_key=join_key|master->join_key;
-    master->init_search(no_order);
+    if (master->init_search(thd, no_order))
+      DBUG_RETURN(true);
     ft_handler=master->ft_handler;
     join_key=master->join_key;
-    DBUG_VOID_RETURN;
+    DBUG_RETURN(false);
   }
 
   String *ft_tmp= 0;
@@ -6258,11 +6272,13 @@ void Item_func_match::init_search(bool no_order)
   if (join_key && !no_order)
     flags|=FT_SORTED;
   ft_handler=table->file->ft_init_ext(flags, key, ft_tmp);
+  if (thd->is_error())
+    DBUG_RETURN(true);
 
   if (join_key)
     table->file->ft_handler=ft_handler;
 
-  DBUG_VOID_RETURN;
+  DBUG_RETURN(false);
 }
 
 /**
@@ -7089,8 +7105,6 @@ Item_func_sp::fix_fields(THD *thd, Item **ref)
 
   /* These is reset/set by Item_func::fix_fields. */
   with_stored_program= true;
-  if (!m_sp->m_chistics->detistic || !tables_locked_cache)
-    const_item_cache= false;
 
   if (res)
     DBUG_RETURN(res);
@@ -7128,9 +7142,6 @@ void Item_func_sp::update_used_tables()
 {
   Item_func::update_used_tables();
 
-  if (!m_sp->m_chistics->detistic)
-    const_item_cache= false;
-
   /* This is reset by Item_func::update_used_tables(). */
   with_stored_program= true;
 }
index 079daa03a521245a87d56cdb738d83e736060a9a..7d5911c76585769e537bf18593faa2d396cf593f 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ITEM_FUNC_INCLUDED
 #define ITEM_FUNC_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
@@ -1898,7 +1898,7 @@ public:
   virtual void print(String *str, enum_query_type query_type);
 
   bool fix_index();
-  void init_search(bool no_order);
+  bool init_search(THD *thd, bool no_order);
 
   /**
      Get number of matching rows from FT handler.
@@ -2198,6 +2198,22 @@ public:
   }
 
   virtual void update_null_value();
+
+  /**
+    Ensure that deterministic functions are not evaluated in preparation phase
+    by returning false before tables are locked and true after they are locked.
+    (can_be_evaluated_now() handles this because a function has the
+    has_subquery() property).
+
+     @retval true if tables are locked for deterministic functions
+     @retval false Otherwise
+  */
+  bool const_item() const
+  {
+    if (used_tables() == 0)
+      return can_be_evaluated_now();
+    return false;
+  }
 };
 
 
index c336729ebe0e2bc30accb51cb9355e553f74cd6d..768c4484b97727453d54e2b583d69e1074075074 100644 (file)
@@ -10415,20 +10415,19 @@ Rows_log_event::next_record_scan(bool first_read)
     if (!first_read)
     {
       /*
-        if we fail to fetch next record corresponding to an index value, we
+        if we fail to fetch next record corresponding to a key value, we
         move to the next key value. If we are out of key values as well an error
         will be returned.
        */
-      error= table->file->ha_index_next(table->record[0]);
+      error= table->file->ha_index_next_same(table->record[0], m_key,
+                                             m_key_info->key_length);
       if(m_rows_lookup_algorithm == ROW_LOOKUP_HASH_SCAN)
+      {
         /*
-          if we are out of rows for this particular key value
-          or we have jumped to the next key value, we reposition the
-          marker according to the next key value that we have in the
-          list.
+          if we are out of rows for this particular key value, we reposition the
+          marker according to the next key value that we have in the list.
          */
-        if ((error) ||
-            (key_cmp(m_key_info->key_part, m_key, m_key_info->key_length) != 0))
+        if (error)
         {
           if (m_itr != m_distinct_keys.end())
           {
@@ -10439,6 +10438,7 @@ Rows_log_event::next_record_scan(bool first_read)
           else
             error= HA_ERR_KEY_NOT_FOUND;
         }
+      }
     }
 
     if (first_read)
@@ -10641,12 +10641,7 @@ int Rows_log_event::do_index_scan_and_update(Relay_log_info const *rli)
     if (m_table->file->inited && (error= m_table->file->ha_index_end()))
       goto end;
 
-    if ((error= m_table->file->ha_rnd_init(FALSE)))
-      goto end;
-
     error= m_table->file->rnd_pos_by_record(m_table->record[0]);
-
-    m_table->file->ha_rnd_end();
     if (error)
     {
       DBUG_PRINT("info",("rnd_pos returns error %d",error));
index 4ce88f9ff2ce6ec7ccfccc3f17c3251fab822ed5..9511ce7e4a19f122302631d55c6e84e6f912cda8 100644 (file)
@@ -8801,7 +8801,7 @@ SHOW_VAR status_vars[]= {
 #endif
 #ifdef WITH_WSREP
   {"wsrep_connected",          (char*) &wsrep_connected,         SHOW_BOOL},
-  {"wsrep_ready",              (char*) &wsrep_ready,             SHOW_BOOL},
+  {"wsrep_ready",              (char*) &wsrep_show_ready,        SHOW_FUNC},
   {"wsrep_cluster_state_uuid", (char*) &wsrep_cluster_state_uuid,SHOW_CHAR_PTR},
   {"wsrep_cluster_conf_id",    (char*) &wsrep_cluster_conf_id,   SHOW_LONGLONG},
   {"wsrep_cluster_status",     (char*) &wsrep_cluster_status,    SHOW_CHAR_PTR},
index 26a348de887252d51ff2d3cfe665ca94b7c8cdbe..2a5ee6c719dc83f93f97d32cb2d09e4ebd8d0f10 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2013, 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
@@ -362,8 +362,7 @@ int opt_sum_query(THD *thd,
                  !((Item_sum_count*) item)->get_arg(0)->maybe_null)       // 4
         {
           Item_func_match* fts_item= static_cast<Item_func_match*>(conds); 
-          fts_item->init_search(true);
-          if (thd->is_error())
+          if (fts_item->init_search(thd, true))
             break;
           count= fts_item->get_count();
         }
index 2d660eb3619593b8e674e0934b43dd4b3fcc1b66..e2ded25db4b4ba728bf1eab7dce951e306db7737 100644 (file)
@@ -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
@@ -912,10 +912,11 @@ partition_element *partition_info::get_part_elem(const char *partition_name,
                            sub_part_elem->partition_name, partition_name))
         {
           if (file_name)
-            create_subpartition_name(file_name, "",
-                                     part_elem->partition_name,
-                                     partition_name,
-                                     NORMAL_PART_NAME);
+            if (create_subpartition_name(file_name, "",
+                                         part_elem->partition_name,
+                                         partition_name,
+                                         NORMAL_PART_NAME))
+              DBUG_RETURN(NULL);
           *part_id= j + (i * num_subparts);
           DBUG_RETURN(sub_part_elem);
         }
@@ -930,8 +931,9 @@ partition_element *partition_info::get_part_elem(const char *partition_name,
                             part_elem->partition_name, partition_name))
     {
       if (file_name)
-        create_partition_name(file_name, "", partition_name,
-                              NORMAL_PART_NAME, TRUE);
+        if (create_partition_name(file_name, "", partition_name,
+                                  NORMAL_PART_NAME, TRUE))
+          DBUG_RETURN(NULL);
       *part_id= i;
       DBUG_RETURN(part_elem);
     }
index 7e8a36849634d39a218ed5a5ca078b0a51f500c4..3d9c0809dc9594523976573f6c73711edfd84b40 100644 (file)
@@ -152,8 +152,11 @@ enum_return_status Group_cache::generate_automatic_gno(THD *thd)
             Replace sidno with wsrep_sidno
             if transaction went through wsrep commit
           */
-          if (WSREP(thd) && thd->wsrep_trx_meta.gtid.seqno != -1)
+          if (WSREP(thd) && thd->wsrep_trx_meta.gtid.seqno != -1 &&
+              !thd->wsrep_skip_wsrep_GTID)
           {
+            WSREP_DEBUG("using wsrep_sidno, seqno %lu %s",
+                        thd->wsrep_trx_meta.gtid.seqno,  thd->query());
             automatic_gtid.sidno= wsrep_sidno;
           }
           else
index 033670253ab069a8129e8b527d2786358d22825a..058fb06001a8a4d3c4cad36a9fe339c6b3caaca0 100644 (file)
@@ -2212,7 +2212,17 @@ int reset_master(THD* thd)
                ER(ER_FLUSH_MASTER_BINLOG_CLOSED), MYF(ME_BELL+ME_WAITTANG));
     return 1;
   }
-
+#ifdef WITH_WSREP
+  if (WSREP_ON && gtid_mode > 0)
+  {
+    /* RESET MASTER will initialize GTID sequence, and that would happen locally
+       in this node, so better reject it
+    */
+    my_message(ER_NOT_ALLOWED_COMMAND,
+               "RESET MASTER not allowed when node is in cluster", MYF(0));
+    return 1;
+  }
+#endif
   if (mysql_bin_log.reset_logs(thd))
     return 1;
   (void) RUN_HOOK(binlog_transmit, after_reset_master, (thd, 0 /* flags */));
index 207bab03bd31ea66a852c9132830ea5605719adc..945b6d6b359bc789e9a0bf31d6d88b1f1423ecbf 100644 (file)
@@ -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
@@ -3426,7 +3426,6 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
   thd->slave_thread = 1;
   thd->enable_slow_log= opt_log_slow_slave_statements;
   set_slave_thread_options(thd);
-  thd->client_capabilities = CLIENT_LOCAL_FILES;
   mysql_mutex_lock(&LOCK_thread_count);
   thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
   mysql_mutex_unlock(&LOCK_thread_count);
@@ -6061,10 +6060,10 @@ int slave_start_workers(Relay_log_info *rli, ulong n, bool *mts_inited)
   {
     if ((error= slave_start_single_worker(rli, i)))
       goto err;
+    rli->slave_parallel_workers++;
   }
 
 end:
-  rli->slave_parallel_workers= n;
   // Effective end of the recovery right now when there is no gaps
   if (!error && rli->mts_recovery_group_cnt == 0)
   {
@@ -6624,7 +6623,7 @@ llstr(rli->get_group_master_log_pos(), llbuff));
   */
   if (wsrep_node_dropped && wsrep_restart_slave)
   {
-    if (wsrep_ready)
+    if (wsrep_ready_get())
     {
       WSREP_INFO("Slave error due to node temporarily non-primary"
                  "SQL slave will continue");
index c32a4d556f930bf551600ce7f9a11eac99e6f549..147bb4dddf418841b3ad625fe75b76773dfc2e00 100644 (file)
@@ -2671,7 +2671,7 @@ bool change_password(THD *thd, const char *host, const char *user,
   Acl_table_intact table_intact;
   /* Buffer should be extended when password length is extended. */
   char buff[2048];
-  ulong query_length=0;
+  ulong query_length;
   bool save_binlog_row_based;
   uchar user_key[MAX_KEY_LENGTH];
   char *plugin_temp= NULL;
@@ -11360,6 +11360,10 @@ static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param,
   It transparently extracts the client plugin data, if embedded into
   a client authentication handshake packet, and handles plugin negotiation
   with the client, if necessary.
+
+  RETURN
+    -1          Protocol failure
+    >= 0        Success and also the packet length
 */
 static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
 {
@@ -12565,8 +12569,12 @@ http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Proto
   /*
     If first packet is a 0 byte then the client isn't sending any password
     else the client will send a password.
+
+    The original intention was that the password is a string[NUL] but this
+    never got enforced properly so now we have to accept that an empty packet
+    is a blank password, thus the check for pkt_len == 0 has to be made too.
   */
-  if (pkt_len == 1 && *pkt == 0)
+  if ((pkt_len == 0 || pkt_len == 1) && *pkt == 0)
   {
     info->password_used= PASSWORD_USED_NO;
     /*
index f2c36787b6cb897fe02c9e62a41706898531fb11..c24e22cd77c8989e74d0dd0a9da746eb5ae02296 100644 (file)
@@ -9398,19 +9398,20 @@ int setup_ftfuncs(SELECT_LEX *select_lex)
 }
 
 
-int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order)
+bool init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order)
 {
-  if (select_lex->ftfunc_list->elements)
-  {
-    List_iterator<Item_func_match> li(*(select_lex->ftfunc_list));
-    Item_func_match *ifm;
-    DBUG_PRINT("info",("Performing FULLTEXT search"));
-    THD_STAGE_INFO(thd, stage_fulltext_initialization);
+  DBUG_ASSERT(select_lex->has_ft_funcs());
+  List_iterator<Item_func_match> li(*(select_lex->ftfunc_list));
+  DBUG_PRINT("info",("Performing FULLTEXT search"));
+  THD_STAGE_INFO(thd, stage_fulltext_initialization);
 
-    while ((ifm=li++))
-      ifm->init_search(no_order);
+  Item_func_match *ifm;
+  while ((ifm=li++))
+  {
+    if (ifm->init_search(thd, no_order))
+      return true;
   }
-  return 0;
+  return false;
 }
 
 
index 0daf368726bdc0a8c309215d913b08f1b003733c..6c4a060fb210c8110c5ccd263da49a0a8350f895 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2013, 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
@@ -238,7 +238,7 @@ void update_non_unique_table_error(TABLE_LIST *update,
 int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
                Item **conds);
 int setup_ftfuncs(SELECT_LEX* select);
-int init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order);
+bool init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order);
 bool lock_table_names(THD *thd, TABLE_LIST *table_list,
                       TABLE_LIST *table_list_end, ulong lock_wait_timeout,
                       uint flags);
index f6c53f10c744f57ff92ac41435a424612b3aff25..ff84ef2dca6c81621f9dadb9756580c4a09cc5aa 100644 (file)
@@ -1221,6 +1221,7 @@ THD::THD(bool enable_plugins)
   wsrep_sync_wait_gtid    = WSREP_GTID_UNDEFINED;
   wsrep_affected_rows     = 0;
   wsrep_replicate_GTID    = false;
+  wsrep_skip_wsrep_GTID   = false;
 #endif
   /* Call to init() below requires fully initialized Open_tables_state. */
   reset_open_tables_state();
@@ -1639,6 +1640,7 @@ void THD::init(void)
   wsrep_sync_wait_gtid    = WSREP_GTID_UNDEFINED;
   wsrep_affected_rows     = 0;
   wsrep_replicate_GTID    = false;
+  wsrep_skip_wsrep_GTID   = false;
 #endif
   binlog_row_event_extra_data= 0;
 
@@ -1841,7 +1843,11 @@ void THD::release_resources()
   mysql_mutex_lock(&LOCK_wsrep_thd);
   mysql_mutex_unlock(&LOCK_wsrep_thd);
   mysql_mutex_destroy(&LOCK_wsrep_thd);
-  if (wsrep_rli) delete wsrep_rli;
+  mysql_cond_destroy(&COND_wsrep_thd);
+  if (wsrep_rli != NULL) {
+    delete wsrep_rli;
+    wsrep_rli = NULL;
+  }
   wsrep_free_status(this);
 #endif
 }
@@ -4525,12 +4531,14 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
 extern "C" int thd_binlog_format(const MYSQL_THD thd)
 {
 #ifdef WITH_WSREP
-  if (((WSREP(thd) && wsrep_emulate_bin_log) || mysql_bin_log.is_open()) &&
-      (thd->variables.option_bits & OPTION_BIN_LOG))
-#else
-  if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
-#endif
+  if (WSREP(thd))
+  {
+    /* for wsrep binlog format is meaningful also when binlogging is off */
     return (int) WSREP_BINLOG_FORMAT(thd->variables.binlog_format);
+  }
+#endif /* WITH_WSREP */
+  if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
+    return (int) thd->variables.binlog_format;
   else
     return BINLOG_FORMAT_UNSPEC;
 }
index 6a31d4c53205bb30a42dbeba83dd04195e1107c2..7f917c03b51d2ba1a4d4ee6f88ea6b46704d7cc7 100644 (file)
@@ -3243,6 +3243,7 @@ public:
   wsrep_gtid_t              wsrep_sync_wait_gtid;
   ulong                     wsrep_affected_rows;
   bool                      wsrep_replicate_GTID;
+  bool                      wsrep_skip_wsrep_GTID;
 #endif /* WITH_WSREP */
   /**
     Internal parser state.
index 1b9ef9b87cd5c8bf1f18e5d754c4c8dfe551ee5b..b3ea8bc91bd24ca1e61fb2d0c550d91ecc450275 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2014, 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
@@ -322,6 +322,10 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, Item *conds,
     table->file->print_error(error, MYF(0));
     goto exit_without_my_ok;
   }
+
+  if (select_lex->has_ft_funcs() && init_ftfuncs(thd, select_lex, 1))
+    goto exit_without_my_ok;
+
   if (usable_index==MAX_KEY || (select && select->quick))
     error= init_read_record(&info, thd, table, select, 1, 1, FALSE);
   else
@@ -329,7 +333,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, Item *conds,
 
   if (error)
     goto exit_without_my_ok;
-  init_ftfuncs(thd, select_lex, 1);
+
   THD_STAGE_INFO(thd, stage_updating);
 
   if (table->triggers &&
@@ -764,7 +768,10 @@ multi_delete::initialize_tables(JOIN *join)
                                  table->file->ref_length,
                                  MEM_STRIP_BUF_SIZE);
   }
-  init_ftfuncs(thd, thd->lex->current_select, 1);
+  if (thd->lex->current_select->has_ft_funcs() &&
+      init_ftfuncs(thd, thd->lex->current_select, 1))
+     DBUG_RETURN(true);
+
   DBUG_RETURN(thd->is_fatal_error != 0);
 }
 
index 2808dc32b34011e4ce6549e64def58bf7dfde516..865945117b3db1acb2b9a13f97e7b9011237d306 100644 (file)
@@ -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
@@ -116,7 +116,7 @@ JOIN::exec()
   if (prepare_result(&columns_list))
     DBUG_VOID_RETURN;
 
-  if (select_lex->materialized_table_count)
+  if (select_lex->materialized_table_count && select_lex->has_ft_funcs())
     init_ftfuncs(thd, select_lex, order);
 
   if (!tables_list && (tables || !select_lex->with_sum_func))
index 31fbf8b386d021fd3b68a1dcc82e91d36c4c5e78..9d5315b2ce56b87f473be8032420e9f60b653be5 100644 (file)
@@ -4442,9 +4442,38 @@ bool select_create::send_eof()
     */
     if (!table->s->tmp_table)
     {
+ #ifdef WITH_WSREP
+      /*
+         append table level exclusive key for CTAS
+      */
+      wsrep_key_arr_t key_arr= {0, 0};
+      wsrep_prepare_keys_for_isolation(thd,
+                                       create_table->db,
+                                       create_table->table_name,
+                                       table_list,
+                                       &key_arr);
+      int rcode = wsrep->append_key(
+                                wsrep,
+                                &thd->wsrep_ws_handle,
+                                key_arr.keys, //&wkey,
+                                key_arr.keys_len,
+                                WSREP_KEY_EXCLUSIVE,
+                                false);
+      wsrep_keys_free(&key_arr);
+      if (rcode) {
+        DBUG_PRINT("wsrep", ("row key failed: %d", rcode));
+        WSREP_ERROR("Appending table key for CTAS failed: %s, %d",
+                    (wsrep_thd_query(thd)) ?
+                    wsrep_thd_query(thd) : "void", rcode);
+        return true;
+      }
+      /* If commit fails, we should be able to reset the OK status. */
+      thd->get_stmt_da()->set_overwrite_status(true);
+#endif /* WITH_WSREP */
       trans_commit_stmt(thd);
       trans_commit_implicit(thd);
 #ifdef WITH_WSREP
+      thd->get_stmt_da()->set_overwrite_status(false);
       mysql_mutex_lock(&thd->LOCK_wsrep_thd);
       if (thd->wsrep_conflict_state != NO_CONFLICT)
       {
index fdbf285c3eb97935a5b15e6c4dae538f82637265..302b121abf218df83a9177de431185a516e56156 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2015, 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
@@ -902,6 +902,11 @@ public:
   {
     return &link_next;
   }
+
+  /// @return true if query block references full-text functions
+  bool has_ft_funcs() const
+  { return ftfunc_list->elements > 0; }
+
   void invalidate();
   void mark_as_dependent(st_select_lex *last);
 
index cf241ad3af724c754bf88690cb84fa855ec6fcd5..3cb0c2ae1cc5273930ce6fcf257267ea345ea3e7 100644 (file)
@@ -745,9 +745,11 @@ JOIN::optimize()
 
   /* Perform FULLTEXT search before all regular searches */
   if (!(select_options & SELECT_DESCRIBE) &&
-      !select_lex->materialized_table_count)
+      !select_lex->materialized_table_count &&
+      select_lex->has_ft_funcs())
   {
-    init_ftfuncs(thd, select_lex, order);
+    if (init_ftfuncs(thd, select_lex, order))
+      DBUG_RETURN(1);
     optimize_fts_query();
   }
 
@@ -3022,7 +3024,7 @@ bool JOIN::update_equalities_for_sjm()
         uint fieldno= 0;
         while ((old= it++))
         {
-          if (old->real_item()->eq(keyuse->val, false))
+          if (old->real_item()->eq(keyuse->val->real_item(), false))
           {
             /*
               Replace the expression selected from the subquery with the
index f321695256a76832202346ec54e1f14a28cef6e0..38301bdc185b81e75cc5a2cd1e2ebdb2970070f3 100644 (file)
@@ -1132,17 +1132,18 @@ bool do_command(THD *thd)
                      command_name[command].str));
 
 #ifdef WITH_WSREP
-  if (WSREP(thd)) {
+  if (WSREP(thd))
+  {
     /*
      * bail out if DB snapshot has not been installed. We however,
      * allow queries "SET" and "SHOW", they are trapped later in execute_command
      */
-    if (thd->variables.wsrep_on && !thd->wsrep_applier &&
-        (!wsrep_ready || wsrep_reject_queries != WSREP_REJECT_NONE) &&
-        (server_command_flags[command] & CF_SKIP_WSREP_CHECK) == 0
-    {
+    if (!thd->wsrep_applier &&
+        (!wsrep_ready_get() || wsrep_reject_queries != WSREP_REJECT_NONE) &&
+        (server_command_flags[command] & CF_SKIP_WSREP_CHECK) == 0)
+    {
       my_message(ER_UNKNOWN_COM_ERROR,
-              "WSREP has not yet prepared node for application use", MYF(0));
+                 "WSREP has not yet prepared node for application use", MYF(0));
       thd->protocol->end_statement();
 
       /* Performance Schema Interface instrumentation end */
@@ -1167,7 +1168,7 @@ bool do_command(THD *thd)
     while (thd->wsrep_conflict_state== RETRY_AUTOCOMMIT)
     {
       return_value= dispatch_command(command, thd, thd->wsrep_retry_query,
-                                    thd->wsrep_retry_query_len);
+                                     thd->wsrep_retry_query_len);
     }
   }
   if (thd->wsrep_retry_query && thd->wsrep_conflict_state != REPLAYING)
@@ -2101,6 +2102,7 @@ done:
   thd->reset_query();
   thd->set_command(COM_SLEEP);
   thd->proc_info= 0;
+  thd->lex->sql_command= SQLCOM_END;
 
   /* Performance Schema Interface instrumentation, end */
   MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
@@ -2842,7 +2844,8 @@ mysql_execute_command(THD *thd)
   Opt_trace_object trace_command(&thd->opt_trace);
   Opt_trace_array trace_command_steps(&thd->opt_trace, "steps");
 #ifdef WITH_WSREP
-  if (WSREP(thd)) {
+  if (WSREP(thd))
+  {
     /*
       change LOCK TABLE WRITE to transaction
     */
@@ -2871,9 +2874,8 @@ mysql_execute_command(THD *thd)
      * allow SET and SHOW queries and reads from information schema
      * and dirty reads (if configured)
      */
-    if (thd->variables.wsrep_on                                            &&
-        !thd->wsrep_applier                                                &&
-        !(wsrep_ready && wsrep_reject_queries == WSREP_REJECT_NONE)        &&
+    if (!thd->wsrep_applier                                                &&
+        !(wsrep_ready_get() && wsrep_reject_queries == WSREP_REJECT_NONE)  &&
         !(thd->variables.wsrep_dirty_reads &&
           (sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) == 0)    &&
         !wsrep_tables_accessible_when_detached(all_tables)                 &&
@@ -2986,9 +2988,7 @@ mysql_execute_command(THD *thd)
   {
     system_status_var old_status_var= thd->status_var;
     thd->initial_status_var= &old_status_var;
-#ifdef WITH_WSREP
-    if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
     if (!(res= select_precheck(thd, lex, all_tables, first_table)))
       res= execute_sqlcom_select(thd, all_tables);
 
@@ -3021,23 +3021,19 @@ mysql_execute_command(THD *thd)
   case SQLCOM_SHOW_PLUGINS:
   case SQLCOM_SHOW_FIELDS:
   case SQLCOM_SHOW_KEYS:
-#ifndef WITH_WSREP
   case SQLCOM_SHOW_VARIABLES:
   case SQLCOM_SHOW_CHARSETS:
   case SQLCOM_SHOW_COLLATIONS:
   case SQLCOM_SHOW_STORAGE_ENGINES:
   case SQLCOM_SHOW_PROFILE:
-#endif /* WITH_WSREP */
   case SQLCOM_SELECT:
+  {
 #ifdef WITH_WSREP
-    if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-  case SQLCOM_SHOW_VARIABLES:
-  case SQLCOM_SHOW_CHARSETS:
-  case SQLCOM_SHOW_COLLATIONS:
-  case SQLCOM_SHOW_STORAGE_ENGINES:
-  case SQLCOM_SHOW_PROFILE:
+      if (lex->sql_command == SQLCOM_SELECT)
+        WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_READ)
+      else
+        WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW)
 #endif /* WITH_WSREP */
-  {
     thd->status_var.last_query_cost= 0.0;
     thd->status_var.last_query_partial_plans= 0;
 
@@ -3157,6 +3153,7 @@ case SQLCOM_PREPARE:
   }
   case SQLCOM_SHOW_BINLOG_EVENTS:
   {
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
     if (check_global_access(thd, REPL_SLAVE_ACL))
       goto error;
     res = mysql_show_binlog_events(thd);
@@ -3620,6 +3617,7 @@ end_with_restore_list:
     {
       if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL))
        goto error;
+      WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
       res = show_binlogs(thd);
       break;
     }
@@ -3633,9 +3631,7 @@ end_with_restore_list:
     goto error;
 #else
     {
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+      WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
 
      /*
         Access check:
@@ -3699,9 +3695,7 @@ end_with_restore_list:
   case SQLCOM_CHECKSUM:
   {
     DBUG_ASSERT(first_table == all_tables && first_table != 0);
-#ifdef WITH_WSREP
-    if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_READ);
 
     if (check_table_access(thd, SELECT_ACL, all_tables,
                            FALSE, UINT_MAX, FALSE))
@@ -3711,11 +3705,8 @@ end_with_restore_list:
     break;
   }
   case SQLCOM_UPDATE:
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) &&
-          wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error;
-#endif /* WITH_WSREP */      
   {
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE);
     ha_rows found= 0, updated= 0;
     DBUG_ASSERT(first_table == all_tables && first_table != 0);
     if (update_precheck(thd, all_tables))
@@ -3754,10 +3745,7 @@ end_with_restore_list:
     /* if we switched from normal update, rights are checked */
     if (up_result != 2)
     {
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) &&
-          wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error;
-#endif /* WITH_WSREP */
+      WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE);
       if ((res= multi_update_precheck(thd, all_tables)))
         break;
     }
@@ -3827,10 +3815,6 @@ end_with_restore_list:
     break;
   }
   case SQLCOM_REPLACE:
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) &&
-          wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error;
-#endif /* WITH_WSREP */
 #ifndef DBUG_OFF
     if (mysql_bin_log.is_open())
     {
@@ -3865,11 +3849,8 @@ end_with_restore_list:
     }
 #endif
   case SQLCOM_INSERT:
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) &&
-          wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error;
-#endif /* WITH_WSREP */      
   {
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE);
     DBUG_ASSERT(first_table == all_tables && first_table != 0);
 
     /*
@@ -3914,11 +3895,8 @@ end_with_restore_list:
   }
   case SQLCOM_REPLACE_SELECT:
   case SQLCOM_INSERT_SELECT:
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) &&
-          wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error;
-#endif /* WITH_WSREP */      
   {
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE);
     select_insert *sel_result;
     DBUG_ASSERT(first_table == all_tables && first_table != 0);
     if ((res= insert_precheck(thd, all_tables)))
@@ -4016,11 +3994,8 @@ end_with_restore_list:
     break;
   }
   case SQLCOM_DELETE:
-#ifdef WITH_WSREP
-    if (WSREP_CLIENT(thd) && 
-        wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error;
-#endif /* WITH_WSREP */
   {
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE);
     DBUG_ASSERT(first_table == all_tables && first_table != 0);
     if ((res= delete_precheck(thd, all_tables)))
       break;
@@ -4035,11 +4010,8 @@ end_with_restore_list:
     break;
   }
   case SQLCOM_DELETE_MULTI:
-#ifdef WITH_WSREP
-    if (WSREP_CLIENT(thd) && 
-        wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error;
-#endif /* WITH_WSREP */
   {
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE);
     DBUG_ASSERT(first_table == all_tables && first_table != 0);
     TABLE_LIST *aux_tables= thd->lex->auxiliary_table_list.first;
     uint del_table_count;
@@ -4401,9 +4373,7 @@ end_with_restore_list:
   {
     DBUG_EXECUTE_IF("4x_server_emul",
                     my_error(ER_UNKNOWN_ERROR, MYF(0)); goto error;);
-#ifdef WITH_WSREP
-    if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
     if (check_and_convert_db_name(&lex->name, TRUE) != IDENT_NAME_OK)
       break;
     res= mysqld_show_create_db(thd, lex->name.str, &lex->create_info);
@@ -4426,7 +4396,6 @@ end_with_restore_list:
     if (res)
       break;
 
-    WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
     switch (lex->sql_command) {
     case SQLCOM_CREATE_EVENT:
     {
@@ -4457,14 +4426,11 @@ end_with_restore_list:
   /* lex->unit.cleanup() is called outside, no need to call it here */
   break;
   case SQLCOM_SHOW_CREATE_EVENT:
-#ifdef WITH_WSREP
-    if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+    WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
     res= Events::show_create_event(thd, lex->spname->m_db,
                                    lex->spname->m_name);
     break;
   case SQLCOM_DROP_EVENT:
-    WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
     if (!(res= Events::drop_event(thd,
                                   lex->spname->m_db, lex->spname->m_name,
                                   lex->drop_if_exists)))
@@ -4797,6 +4763,7 @@ end_with_restore_list:
     if (!strcmp(thd->security_ctx->priv_user, grant_user->user.str) ||
         !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 0))
     {
+      WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
       res = mysql_show_grants(thd, grant_user);
     }
     break;
@@ -5355,18 +5322,14 @@ create_sp_error:
     }
   case SQLCOM_SHOW_CREATE_PROC:
     {
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+      WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
       if (sp_show_create_routine(thd, SP_TYPE_PROCEDURE, lex->spname))
         goto error;
       break;
     }
   case SQLCOM_SHOW_CREATE_FUNC:
     {
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+      WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
       if (sp_show_create_routine(thd, SP_TYPE_FUNCTION, lex->spname))
        goto error;
       break;
@@ -5379,9 +5342,7 @@ create_sp_error:
       enum_sp_type sp_type= (lex->sql_command == SQLCOM_SHOW_PROC_CODE) ?
                             SP_TYPE_PROCEDURE : SP_TYPE_FUNCTION;
 
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+      WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
       if (sp_cache_routine(thd, sp_type, lex->spname, false, &sp))
         goto error;
       if (!sp || sp->show_routine_code(thd))
@@ -5406,9 +5367,7 @@ create_sp_error:
         goto error;
       }
 
-#ifdef WITH_WSREP
-      if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
-#endif /* WITH_WSREP */
+      WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
       if (show_create_trigger(thd, lex->spname))
         goto error; /* Error has been already logged. */
 
@@ -5420,7 +5379,6 @@ create_sp_error:
         Note: SQLCOM_CREATE_VIEW also handles 'ALTER VIEW' commands
         as specified through the thd->lex->create_view_mode flag.
       */
-      WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
       res= mysql_create_view(thd, first_table, thd->lex->create_view_mode);
       break;
     }
@@ -5436,7 +5394,6 @@ create_sp_error:
   case SQLCOM_CREATE_TRIGGER:
   {
     /* Conditionally writes to binlog. */
-    WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
     res= mysql_create_or_drop_trigger(thd, all_tables, 1);
 
     break;
@@ -5444,7 +5401,6 @@ create_sp_error:
   case SQLCOM_DROP_TRIGGER:
   {
     /* Conditionally writes to binlog. */
-    WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
     res= mysql_create_or_drop_trigger(thd, all_tables, 0);
     break;
   }
@@ -5509,13 +5465,11 @@ create_sp_error:
       my_ok(thd);
     break;
   case SQLCOM_INSTALL_PLUGIN:
-    WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
     if (! (res= mysql_install_plugin(thd, &thd->lex->comment,
                                      &thd->lex->ident)))
       my_ok(thd);
     break;
   case SQLCOM_UNINSTALL_PLUGIN:
-    WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
     if (! (res= mysql_uninstall_plugin(thd, &thd->lex->comment)))
       my_ok(thd);
     break;
@@ -5645,6 +5599,24 @@ finish:
     }
     if (thd->is_error() || (thd->variables.option_bits & OPTION_MASTER_SQL_ERROR))
       trans_rollback_stmt(thd);
+#ifdef WITH_WSREP
+    else if (thd->sp_runtime_ctx &&
+             (thd->wsrep_conflict_state == MUST_ABORT ||
+              thd->wsrep_conflict_state == CERT_FAILURE))
+    {
+      /*
+        The error was cleared, but THD was aborted by wsrep and
+        wsrep_conflict_state is still set accordingly. This
+        situation is expected if we are running a stored procedure
+        that declares a handler that catches ER_LOCK_DEADLOCK error.
+        In which case the error may have been cleared in method
+        sp_rcontext::handle_sql_condition().
+      */
+      trans_rollback_stmt(thd);
+      thd->wsrep_conflict_state= NO_CONFLICT;
+      thd->killed= THD::NOT_KILLED;
+    }
+#endif /* WITH_WSREP */
     else
     {
       /* If commit fails, we should be able to reset the OK status. */
index 7c10ac4a9733dff2e0e3e6e47e49b40d3d3d69fd..cae773cb511680df5367adcba0c639da5c1e90cf 100644 (file)
@@ -227,11 +227,16 @@ inline bool is_supported_parser_charset(const CHARSET_INFO *cs)
   if (WSREP(thd) && !thd->lex->no_write_to_binlog                                   \
          && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
 
+#define WSREP_SYNC_WAIT(thd_, before_)                                           \
+    { if (WSREP_CLIENT(thd_) &&                                                  \
+          wsrep_sync_wait(thd_, before_)) goto error; }
+
 #else
 
 #define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
-#define WSREP_TO_ISOLATION_END 
+#define WSREP_TO_ISOLATION_END
 #define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
+#define WSREP_SYNC_WAIT(thd_, before_)
 
 #endif /* WITH_WSREP */
 
index d0fd86f81d2c4a9e22a56a94288f8088118140c5..47106c93dc4c35f2e10e10693667dd784c7da0ac 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005, 2015, 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
@@ -6100,8 +6100,8 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
   DDL_LOG_ENTRY ddl_log_entry;
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
-  char tmp_path[FN_REFLEN];
-  char normal_path[FN_REFLEN];
+  char tmp_path[FN_REFLEN + 1];
+  char normal_path[FN_REFLEN + 1];
   List_iterator<partition_element> part_it(part_info->partitions);
   uint temp_partitions= part_info->temp_partitions.elements;
   uint num_elements= part_info->partitions.elements;
@@ -6125,14 +6125,18 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
           ddl_log_entry.next_entry= *next_entry;
           ddl_log_entry.handler_name=
                ha_resolve_storage_engine_name(sub_elem->engine_type);
-          create_subpartition_name(tmp_path, path,
-                                   part_elem->partition_name,
-                                   sub_elem->partition_name,
-                                   TEMP_PART_NAME);
-          create_subpartition_name(normal_path, path,
-                                   part_elem->partition_name,
-                                   sub_elem->partition_name,
-                                   NORMAL_PART_NAME);
+          if (create_subpartition_name(tmp_path, path,
+                                       part_elem->partition_name,
+                                       sub_elem->partition_name,
+                                       TEMP_PART_NAME))
+            DBUG_RETURN(TRUE);
+
+          if (create_subpartition_name(normal_path, path,
+                                       part_elem->partition_name,
+                                       sub_elem->partition_name,
+                                       NORMAL_PART_NAME))
+             DBUG_RETURN(TRUE);
+
           ddl_log_entry.name= normal_path;
           ddl_log_entry.from_name= tmp_path;
           if (part_elem->part_state == PART_IS_CHANGED)
@@ -6153,12 +6157,16 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
         ddl_log_entry.next_entry= *next_entry;
         ddl_log_entry.handler_name=
                ha_resolve_storage_engine_name(part_elem->engine_type);
-        create_partition_name(tmp_path, path,
-                              part_elem->partition_name,
-                              TEMP_PART_NAME, TRUE);
-        create_partition_name(normal_path, path,
-                              part_elem->partition_name,
-                              NORMAL_PART_NAME, TRUE);
+        if (create_partition_name(tmp_path, path,
+                                  part_elem->partition_name,
+                                  TEMP_PART_NAME, TRUE))
+          DBUG_RETURN(TRUE);
+
+        if (create_partition_name(normal_path, path,
+                                  part_elem->partition_name,
+                                  NORMAL_PART_NAME, TRUE))
+          DBUG_RETURN(TRUE);
+
         ddl_log_entry.name= normal_path;
         ddl_log_entry.from_name= tmp_path;
         if (part_elem->part_state == PART_IS_CHANGED)
@@ -6197,7 +6205,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
   DDL_LOG_ENTRY ddl_log_entry;
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
-  char tmp_path[FN_LEN];
+  char tmp_path[FN_REFLEN + 1];
   List_iterator<partition_element> part_it(part_info->partitions);
   List_iterator<partition_element> temp_it(part_info->temp_partitions);
   uint num_temp_partitions= part_info->temp_partitions.elements;
@@ -6236,10 +6244,12 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
           ddl_log_entry.next_entry= *next_entry;
           ddl_log_entry.handler_name=
                ha_resolve_storage_engine_name(sub_elem->engine_type);
-          create_subpartition_name(tmp_path, path,
-                                   part_elem->partition_name,
-                                   sub_elem->partition_name,
-                                   name_variant);
+          if (create_subpartition_name(tmp_path, path,
+                                       part_elem->partition_name,
+                                       sub_elem->partition_name,
+                                       name_variant))
+             DBUG_RETURN(TRUE);
+
           ddl_log_entry.name= tmp_path;
           if (write_ddl_log_entry(&ddl_log_entry, &log_entry))
           {
@@ -6255,9 +6265,11 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
         ddl_log_entry.next_entry= *next_entry;
         ddl_log_entry.handler_name=
                ha_resolve_storage_engine_name(part_elem->engine_type);
-        create_partition_name(tmp_path, path,
+        if (create_partition_name(tmp_path, path,
                               part_elem->partition_name,
-                              name_variant, TRUE);
+                              name_variant, TRUE))
+          DBUG_RETURN(TRUE);
+
         ddl_log_entry.name= tmp_path;
         if (write_ddl_log_entry(&ddl_log_entry, &log_entry))
         {
@@ -8366,29 +8378,28 @@ static uint32 get_next_subpartition_via_walking(PARTITION_ITERATOR *part_iter)
 }
 
 
-/*
-  Create partition names
-
-  SYNOPSIS
-    create_partition_name()
-    out:out                   Created partition name string
-    in1                       First part
-    in2                       Second part
-    name_variant              Normal, temporary or renamed partition name
-
-  RETURN VALUE
-    NONE
-
-  DESCRIPTION
-    This method is used to calculate the partition name, service routine to
-    the del_ren_cre_table method.
+/**
+  Create partition names.This method is used to calculate the partition name,
+  service routine to the del_ren_cre_table method.The output buffer size
+  should be FN_REFLEN + 1(terminating '\0').
+
+    @param [out] out          Created partition name string
+    @param in1                First part
+    @param in2                Second part
+    @param in3                Third part
+    @param name_variant       Normal, temporary or renamed partition name
+    @param translate          Flag to determine whether to convert a table name
+                              to it its corresponding filename.
+
+    @retval true              Error.
+    @retval false             Success.
 */
 
-void create_partition_name(char *out, const char *in1,
+bool create_partition_name(char *out, const char *in1,
                            const char *in2, uint name_variant,
                            bool translate)
 {
-  char transl_part_name[FN_REFLEN];
+  char transl_part_name[FN_REFLEN + 1];
   const char *transl_part;
 
   if (translate)
@@ -8398,35 +8409,50 @@ void create_partition_name(char *out, const char *in1,
   }
   else
     transl_part= in2;
+
+  // Check if the path name for partition exceeds maximum path length.
+  if (name_variant == NORMAL_PART_NAME)
+  {
+    if ((strlen(in1) + strlen(transl_part) + 3) > FN_REFLEN)
+    {
+      my_error(ER_PATH_LENGTH, MYF(0), in2);
+      return true;
+    }
+  }
+  else
+    if ((strlen(in1) + strlen(transl_part) + 8) > FN_REFLEN)
+    {
+      my_error(ER_PATH_LENGTH, MYF(0), in2);
+      return true;
+    }
+
   if (name_variant == NORMAL_PART_NAME)
-    strxmov(out, in1, "#P#", transl_part, NullS);
+    strxnmov(out, FN_REFLEN, in1, "#P#", transl_part, NullS);
   else if (name_variant == TEMP_PART_NAME)
-    strxmov(out, in1, "#P#", transl_part, "#TMP#", NullS);
+    strxnmov(out, FN_REFLEN, in1, "#P#", transl_part, "#TMP#", NullS);
   else if (name_variant == RENAMED_PART_NAME)
-    strxmov(out, in1, "#P#", transl_part, "#REN#", NullS);
-}
+    strxnmov(out, FN_REFLEN, in1, "#P#", transl_part, "#REN#", NullS);
 
+  return false;
+}
 
-/*
-  Create subpartition name
 
-  SYNOPSIS
-    create_subpartition_name()
-    out:out                   Created partition name string
-    in1                       First part
-    in2                       Second part
-    in3                       Third part
-    name_variant              Normal, temporary or renamed partition name
-
-  RETURN VALUE
-    NONE
-
-  DESCRIPTION
-  This method is used to calculate the subpartition name, service routine to
-  the del_ren_cre_table method.
+/**
+  Create subpartition name. This method is used to calculate the
+  subpartition name, service routine to the del_ren_cre_table method.
+  The output buffer size should be FN_REFLEN + 1(terminating '\0').
+
+   @param [out] out          Created partition name string
+   @param in1                First part
+   @param in2                Second part
+   @param in3                Third part
+   @param name_variant       Normal, temporary or renamed partition name
+
+   @retval true              Error.
+   @retval false             Success.
 */
 
-void create_subpartition_name(char *out, const char *in1,
+bool create_subpartition_name(char *out, const char *in1,
                               const char *in2, const char *in3,
                               uint name_variant)
 {
@@ -8434,15 +8460,36 @@ void create_subpartition_name(char *out, const char *in1,
 
   tablename_to_filename(in2, transl_part_name, FN_REFLEN);
   tablename_to_filename(in3, transl_subpart_name, FN_REFLEN);
+
+   // Check if the path name for subpartition exceeds maximum path length.
+   if (name_variant == NORMAL_PART_NAME)
+   {
+    if ((strlen(in1) + strlen(transl_part_name) +
+         strlen(transl_subpart_name) + 7) > FN_REFLEN)
+    {
+      my_error(ER_PATH_LENGTH, MYF(0), in3);
+      return true;
+    }
+  }
+  else
+    if ((strlen(in1) + strlen(transl_part_name) +
+         strlen(transl_subpart_name) + 12) > FN_REFLEN)
+    {
+      my_error(ER_PATH_LENGTH, MYF(0), in3);
+      return true;
+    }
+
   if (name_variant == NORMAL_PART_NAME)
-    strxmov(out, in1, "#P#", transl_part_name,
-            "#SP#", transl_subpart_name, NullS);
+    strxnmov(out, FN_REFLEN, in1, "#P#", transl_part_name,
+             "#SP#", transl_subpart_name, NullS);
   else if (name_variant == TEMP_PART_NAME)
-    strxmov(out, in1, "#P#", transl_part_name,
-            "#SP#", transl_subpart_name, "#TMP#", NullS);
+    strxnmov(out, FN_REFLEN, in1, "#P#", transl_part_name,
+             "#SP#", transl_subpart_name, "#TMP#", NullS);
   else if (name_variant == RENAMED_PART_NAME)
-    strxmov(out, in1, "#P#", transl_part_name,
-            "#SP#", transl_subpart_name, "#REN#", NullS);
+    strxnmov(out, FN_REFLEN, in1, "#P#", transl_part_name,
+             "#SP#", transl_subpart_name, "#REN#", NullS);
+
+  return false;
 }
 
 uint get_partition_field_store_length(Field *field)
index db2004103d2e3a9e33e9054bca4a817996c7cff2..25bde2f4f913eebcf0bcb6c5bf58cedbb56bafe3 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQL_PARTITION_INCLUDED
 #define SQL_PARTITION_INCLUDED
 
-/* Copyright (c) 2006, 2015, 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
@@ -271,10 +271,10 @@ bool compare_partition_options(HA_CREATE_INFO *table_create_info,
                                partition_element *part_elem);
 #endif
 
-void create_partition_name(char *out, const char *in1,
+bool create_partition_name(char *out, const char *in1,
                            const char *in2, uint name_variant,
                            bool translate);
-void create_subpartition_name(char *out, const char *in1,
+bool create_subpartition_name(char *out, const char *in1,
                               const char *in2, const char *in3,
                               uint name_variant);
 
index 857f050c68a8dd3e6c152bd2e7272a24be4e1dfd..2331224902ef7049d7a2beb3319f239cc4c7e091 100644 (file)
@@ -88,9 +88,15 @@ bool Sql_cmd_alter_table_exchange_partition::execute(THD *thd)
 
   /* Not allowed with EXCHANGE PARTITION */
   DBUG_ASSERT(!create_info.data_file_name && !create_info.index_file_name);
+  WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
 
   thd->enable_slow_log= opt_log_slow_admin_statements;
   DBUG_RETURN(exchange_partition(thd, first_table, &alter_info));
+#ifdef WITH_WSREP
+ error:
+  /* handle errors in TO_ISOLATION here */
+  DBUG_RETURN(true);
+#endif /* WITH_WSREP */
 }
 
 
@@ -773,7 +779,7 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd)
   if (WSREP(thd) && (!thd->is_current_stmt_binlog_format_row() ||
        !find_temporary_table(thd, first_table))  &&
       wsrep_to_isolation_begin(
-        thd, first_table->db, first_table->table_name, NULL)
+          thd, first_table->db, first_table->table_name, NULL)
       )
   {
     WSREP_WARN("ALTER TABLE isolation failure");
index 36e9bb3f63b9f043399c32a4162a5e7bf76ff291..f5bdd6163fc21e045d0a76b4ac78caf9696c435d 100644 (file)
@@ -1854,6 +1854,7 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl
   tables.init_one_table("mysql", 5, "plugin", 6, "plugin", TL_WRITE);
   if (check_table_access(thd, INSERT_ACL, &tables, FALSE, 1, FALSE))
     DBUG_RETURN(TRUE);
+  WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
 
   /* need to open before acquiring LOCK_plugin or it will deadlock */
   if (! (table = open_ltable(thd, &tables, TL_WRITE,
@@ -1942,6 +1943,9 @@ deinit:
   reap_plugins();
 err:
   mysql_mutex_unlock(&LOCK_plugin);
+#ifdef WITH_WSREP
+ error:
+#endif /* WITH_WSREP */
   DBUG_RETURN(TRUE);
 }
 
@@ -1963,6 +1967,7 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
 
   if (check_table_access(thd, DELETE_ACL, &tables, FALSE, 1, FALSE))
     DBUG_RETURN(TRUE);
+  WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
 
   /* need to open before acquiring LOCK_plugin or it will deadlock */
   if (! (table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT)))
@@ -2100,6 +2105,9 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
   DBUG_RETURN(FALSE);
 err:
   mysql_mutex_unlock(&LOCK_plugin);
+#ifdef WITH_WSREP
+ error:
+#endif /* WITH_WSREP */
   DBUG_RETURN(TRUE);
 }
 
index 00b34e63942503af502e0e93481c4a6a47736d1b..1090843e71a1bd7b0517fcdc0f04a298c7d74086 100644 (file)
@@ -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
@@ -788,8 +788,8 @@ void JOIN::reset()
       func->clear();
   }
 
-  if (!(select_options & SELECT_DESCRIBE))
-    init_ftfuncs(thd, select_lex, MY_TEST(order));
+  if (!(select_options & SELECT_DESCRIBE) && select_lex->has_ft_funcs())
+    (void) init_ftfuncs(thd, select_lex, MY_TEST(order));
 
   DBUG_VOID_RETURN;
 }
index b0e86ce41a52accd4b13ab2b47e14909552ec47b..27891927422f915706012b43c195ec33b2fffef4 100644 (file)
@@ -2215,8 +2215,8 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
     DBUG_RETURN(TRUE);
   my_ok(thd);
   DBUG_RETURN(FALSE);
-}
 
+}
 
 /**
   Execute the drop of a normal or temporary table.
@@ -2658,6 +2658,9 @@ err:
         /* Chop of the last comma */
         built_non_trans_tmp_query.chop();
         built_non_trans_tmp_query.append(" /* generated by server */");
+#ifdef WITH_WSREP
+        thd->wsrep_skip_wsrep_GTID = true;
+#endif /* WITH_WSREP */
         error |= thd->binlog_query(THD::STMT_QUERY_TYPE,
                                    built_non_trans_tmp_query.ptr(),
                                    built_non_trans_tmp_query.length(),
@@ -2684,6 +2687,9 @@ err:
         /* Chop of the last comma */
         built_trans_tmp_query.chop();
         built_trans_tmp_query.append(" /* generated by server */");
+#ifdef WITH_WSREP
+        thd->wsrep_skip_wsrep_GTID = true;
+#endif /* WITH_WSREP */
         error |= thd->binlog_query(THD::STMT_QUERY_TYPE,
                                    built_trans_tmp_query.ptr(),
                                    built_trans_tmp_query.length(),
@@ -2714,6 +2720,9 @@ err:
         built_query.append(" /* generated by server */");
         int error_code = (non_tmp_error ?
           (foreign_key_error ? ER_ROW_IS_REFERENCED : ER_BAD_TABLE_ERROR) : 0);
+#ifdef WITH_WSREP
+        thd->wsrep_skip_wsrep_GTID = false;
+#endif /* WITH_WSREP */
         error |= thd->binlog_query(THD::STMT_QUERY_TYPE,
                                    built_query.ptr(),
                                    built_query.length(),
@@ -2761,6 +2770,9 @@ err:
   }
 
 end:
+#ifdef WITH_WSREP
+  thd->wsrep_skip_wsrep_GTID = false;
+#endif /* WITH_WSREP */
   DBUG_RETURN(error);
 }
 
index 3ba1cb2fda706a666ffe8b45216bc312fd105bf6..795f868951b64319fd6b0a28cf984328439730d9 100644 (file)
@@ -507,6 +507,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
     if (err_status)
       goto end;
   }
+  WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
 
   /* We should have only one table in table list. */
   DBUG_ASSERT(tables->next_global == 0);
@@ -612,6 +613,10 @@ end:
     my_ok(thd);
 
   DBUG_RETURN(result);
+#ifdef WITH_WSREP
+ error:
+  DBUG_RETURN(TRUE);
+#endif /* WITH_WSREP */
 }
 
 
index 4818e5a9cd62481f296b0c9a3728901df5d11052..4cd6fdd16e17444652e8913af8ca5e4fe9d50c65 100644 (file)
@@ -472,8 +472,8 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref)
 
 #ifdef WITH_WSREP
     if (WSREP(thd) && wsrep_to_isolation_begin(thd, 
-                                                table_ref->db, 
-                                                table_ref->table_name, NULL))
+                                               table_ref->db, 
+                                               table_ref->table_name, NULL))
         DBUG_RETURN(TRUE);
 #endif /* WITH_WSREP */
     if (lock_table(thd, table_ref, &hton_can_recreate))
index 5305fae6989cceac6befeb8421715aa6caa53aa7..1d6568a65d749f5c1ceea8b382160dd4457d8574 100644 (file)
@@ -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
@@ -502,7 +502,9 @@ int mysql_update(THD *thd,
       goto exit_without_my_ok;
     }
   }
-  init_ftfuncs(thd, select_lex, 1);
+
+  if (select_lex->has_ft_funcs() && init_ftfuncs(thd, select_lex, 1))
+    goto exit_without_my_ok;
 
   table->update_const_key_parts(conds);
   order= simple_remove_const(order, conds);
index 804076548b5ad3fd48046cba5bb15a4eba8471e2..d574de93cc4284d1036cdf55d8cafb65bcbe47a3 100644 (file)
@@ -434,6 +434,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
 
   lex->link_first_table_back(view, link_to_local);
   view->open_type= OT_BASE_ONLY;
+  WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
 
   /*
     No pre-opening of temporary tables is possible since must
@@ -748,7 +749,10 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
   lex->link_first_table_back(view, link_to_local);
   DBUG_RETURN(0);
 
-err:
+#ifdef WITH_WSREP
+ error:
+#endif /* WITH_WSREP */
+ err:
   THD_STAGE_INFO(thd, stage_end);
   lex->link_first_table_back(view, link_to_local);
   unit->cleanup();
index 078b861f069c4d75d7d1ee1d1571f2187813a159..525db472ad6b10739c5d608b845b3a7c76261f09 100644 (file)
@@ -4319,7 +4319,7 @@ static Sys_var_ulong Sys_wsrep_slave_threads(
        GLOBAL_VAR(wsrep_slave_threads), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(1, 512), DEFAULT(1), BLOCK_SIZE(1),
        &PLock_wsrep_slave_threads, NOT_IN_BINLOG,
-       ON_CHECK(wsrep_slave_threads_check), 
+       ON_CHECK(NULL),
        ON_UPDATE(wsrep_slave_threads_update));
 
 static Sys_var_charptr Sys_wsrep_dbug_option(
index e87b0a23f8d942f843e6d08693882f3a02c343fa..326d63907e23af963c8a93a466e008bcbafdc05a 100644 (file)
@@ -361,7 +361,17 @@ void Table_cache_manager::free_table(THD *thd,
 
 #ifndef DBUG_OFF
       if (remove_type == TDC_RT_REMOVE_ALL)
+#ifdef WITH_WSREP
+      {
+        /* following assert may cause false posivive fire for CTAS */
+        if (thd->lex->sql_command != SQLCOM_CREATE_TABLE)
+        {
+#endif /* WITH_WSREP */
         DBUG_ASSERT(cache_el[i]->used_tables.is_empty());
+#ifdef WITH_WSREP
+        }
+      }
+#endif /* WITH_WSREP */
       else if (remove_type == TDC_RT_REMOVE_NOT_OWN ||
                remove_type == TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE)
       {
index 3932478163c355c767dcf7d1b95fdaf4817f1a52..0161161367f2947710085bd1fa3b7d68436c8e46 100644 (file)
@@ -200,12 +200,15 @@ wsrep_cb_status_t wsrep_apply_cb(void* const             ctx,
 {
   THD* const thd((THD*)ctx);
 
+  assert(thd->wsrep_apply_toi == false);
+
 // Allow tests to block the applier thread using the DBUG facilities
   DBUG_EXECUTE_IF("sync.wsrep_apply_cb",
                  {
                    const char act[]=
                      "now "
-                     "wait_for signal.wsrep_apply_cb";
+                     "SIGNAL sync.wsrep_apply_cb_reached "
+                     "WAIT_FOR signal.wsrep_apply_cb";
                    DBUG_ASSERT(!debug_sync_set_action(thd,
                                                       STRING_WITH_LEN(act)));
                  };);
@@ -363,7 +366,7 @@ wsrep_cb_status_t wsrep_commit_cb(void*         const     ctx,
     mysql_mutex_unlock(&LOCK_wsrep_slave_threads);
   }
 
-  if (*exit == false && thd->wsrep_applier)
+  if (thd->wsrep_applier)
   {
     /* From trans_begin() */
     thd->variables.option_bits|= OPTION_BEGIN;
index b2be924593099e94d27f58272e87c3f179036e3c..ca2df1c7d44acb870939926ce4cec338978d7929 100644 (file)
@@ -46,6 +46,7 @@ void wsrep_cleanup_transaction(THD *thd)
   thd->wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED;
   thd->wsrep_exec_mode= LOCAL_STATE;
   thd->wsrep_affected_rows= 0;
+  thd->wsrep_skip_wsrep_GTID= false;
   return;
 }
 
@@ -320,9 +321,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all)
   }
 
   DBUG_ENTER("wsrep_run_wsrep_commit");
-#ifdef WITH_WSREP
   DEBUG_SYNC(thd, "wsrep_before_replication");
-#endif /* WITH_WSREP */
 
   if (thd->slave_thread && !opt_log_slave_updates) DBUG_RETURN(WSREP_TRX_OK);
 
@@ -506,6 +505,9 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all)
   }
 
   mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+
+  DEBUG_SYNC(thd, "wsrep_after_replication");
+
   switch(rcode) {
   case 0:
     /*
index ded6d871a8ca1568521dad44edac63c836657595..f1cafcf9bad951379bbed040991013b254956785 100644 (file)
@@ -2,7 +2,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
+   the Free Software Foundation; version 2 of the License.x1
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
+#include <sql_plugin.h> // SHOW_MY_BOOL
 #include <mysqld.h>
 #include <sql_class.h>
 #include <sql_parse.h>
+#include <sql_base.h> /* find_temporary_table() */
 #include "wsrep_priv.h"
 #include "wsrep_thd.h"
 #include "wsrep_sst.h"
@@ -226,7 +228,7 @@ wsrep_view_handler_cb (void*                    app_ctx,
       // version change
       if (view->proto_ver != wsrep_protocol_version)
       {
-          my_bool wsrep_ready_saved= wsrep_ready;
+          my_bool wsrep_ready_saved= wsrep_ready_get();
           wsrep_ready_set(FALSE);
           WSREP_INFO("closing client connections for "
                      "protocol change %ld -> %d",
@@ -339,16 +341,34 @@ out:
   return WSREP_CB_SUCCESS;
 }
 
-void wsrep_ready_set (my_bool x)
+my_bool wsrep_ready_set (my_bool x)
 {
   WSREP_DEBUG("Setting wsrep_ready to %d", x);
   if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort();
-  if (wsrep_ready != x)
+  my_bool ret= (wsrep_ready != x);
+  if (ret)
   {
     wsrep_ready= x;
     mysql_cond_signal (&COND_wsrep_ready);
   }
   mysql_mutex_unlock (&LOCK_wsrep_ready);
+  return ret;
+}
+
+my_bool wsrep_ready_get (void)
+{
+  if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort();
+  my_bool ret= wsrep_ready;
+  mysql_mutex_unlock (&LOCK_wsrep_ready);
+  return ret;
+}
+
+int wsrep_show_ready(THD *thd, SHOW_VAR *var, char *buff)
+{
+  var->type= SHOW_MY_BOOL;
+  var->value= buff;
+  *((my_bool *)buff)= wsrep_ready_get();
+  return 0;
 }
 
 // Wait until wsrep has reached ready state
@@ -367,17 +387,8 @@ void wsrep_ready_wait ()
 static void wsrep_synced_cb(void* app_ctx)
 {
   WSREP_INFO("Synchronized with group, ready for connections");
-  bool signal_main= false;
-  if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort();
-  if (!wsrep_ready)
-  {
-    wsrep_ready= TRUE;
-    mysql_cond_signal (&COND_wsrep_ready);
-    signal_main= true;
-
-  }
+  my_bool signal_main= wsrep_ready_set(TRUE);
   local_status.set(WSREP_MEMBER_SYNCED);
-  mysql_mutex_unlock (&LOCK_wsrep_ready);
 
   if (signal_main)
   {
@@ -541,27 +552,17 @@ int wsrep_init()
       size_t const node_addr_len= strlen(node_addr);
       if (node_addr_len > 0)
       {
-        const char* const colon= strrchr(node_addr, ':');
-        if (strchr(node_addr, ':') == colon) // 1 or 0 ':'
+        size_t const ip_len= wsrep_host_len(node_addr, node_addr_len);
+        if (ip_len + 7 /* :55555\0 */ < inc_addr_max)
         {
-          size_t const ip_len= colon ? colon - node_addr : node_addr_len;
-          if (ip_len + 7 /* :55555\0 */ < inc_addr_max)
-          {
-            memcpy (inc_addr, node_addr, ip_len);
-            snprintf(inc_addr + ip_len, inc_addr_max - ip_len, ":%u",
-                     (int)mysqld_port);
-          }
-          else
-          {
-            WSREP_WARN("Guessing address for incoming client connections: "
-                       "address too long.");
-            inc_addr[0]= '\0';
-          }
+          memcpy (inc_addr, node_addr, ip_len);
+          snprintf(inc_addr + ip_len, inc_addr_max - ip_len, ":%u",
+                   (int)mysqld_port);
         }
         else
         {
           WSREP_WARN("Guessing address for incoming client connections: "
-                     "too many colons :) .");
+                     "address too long.");
           inc_addr[0]= '\0';
         }
       }
@@ -851,17 +852,7 @@ bool wsrep_sync_wait (THD* thd, uint mask)
   return false;
 }
 
-/*
- * Helpers to deal with TOI key arrays
- */
-typedef struct wsrep_key_arr
-{
-    wsrep_key_t* keys;
-    size_t       keys_len;
-} wsrep_key_arr_t;
-
-
-static void wsrep_keys_free(wsrep_key_arr_t* key_arr)
+void wsrep_keys_free(wsrep_key_arr_t* key_arr)
 {
     for (size_t i= 0; i < key_arr->keys_len; ++i)
     {
@@ -926,90 +917,72 @@ static bool wsrep_prepare_key_for_isolation(const char* db,
 }
 
 /* Prepare key list from db/table and table_list */
-static bool wsrep_prepare_keys_for_isolation(THD*              thd,
-                                             const char*       db,
-                                             const char*       table,
-                                             const TABLE_LIST* table_list,
-                                             wsrep_key_arr_t*  ka)
+bool wsrep_prepare_keys_for_isolation(THD*              thd,
+                                      const char*       db,
+                                      const char*       table,
+                                      const TABLE_LIST* table_list,
+                                      wsrep_key_arr_t*  ka)
 {
-    ka->keys= 0;
-    ka->keys_len= 0;
+  ka->keys= 0;
+  ka->keys_len= 0;
 
-    extern TABLE* find_temporary_table(THD*, const TABLE_LIST*);
-
-    if (db || table)
+  if (db || table)
+  {
+    if (!(ka->keys= (wsrep_key_t*)my_malloc(sizeof(wsrep_key_t), MYF(0))))
     {
-        TABLE_LIST tmp_table;
-       MDL_request mdl_request;
-
-        memset(&tmp_table, 0, sizeof(tmp_table));
-        tmp_table.table_name= (char*)table;
-        tmp_table.db= (char*)db;
-       tmp_table.mdl_request.init(MDL_key::GLOBAL, (db) ? db :  "",
-                                  (table) ? table : "",
-                                  MDL_INTENTION_EXCLUSIVE, MDL_STATEMENT);
-
-        if (!table || !find_temporary_table(thd, &tmp_table))
-        {
-            if (!(ka->keys= (wsrep_key_t*)my_malloc(sizeof(wsrep_key_t), MYF(0))))
-            {
-                WSREP_ERROR("Can't allocate memory for key_array");
-                goto err;
-            }
-            ka->keys_len= 1;
-            if (!(ka->keys[0].key_parts= (wsrep_buf_t*)
-                  my_malloc(sizeof(wsrep_buf_t)*2, MYF(0))))
-            {
-                WSREP_ERROR("Can't allocate memory for key_parts");
-                goto err;
-            }
-            ka->keys[0].key_parts_num= 2;
-            if (!wsrep_prepare_key_for_isolation(
-                    db, table,
-                    (wsrep_buf_t*)ka->keys[0].key_parts,
-                    &ka->keys[0].key_parts_num))
-            {
-                WSREP_ERROR("Preparing keys for isolation failed");
-                goto err;
-            }
-        }
+      WSREP_ERROR("Can't allocate memory for key_array");
+      goto err;
     }
+    ka->keys_len= 1;
+    if (!(ka->keys[0].key_parts= (wsrep_buf_t*)
+          my_malloc(sizeof(wsrep_buf_t)*2, MYF(0))))
+    {
+      WSREP_ERROR("Can't allocate memory for key_parts");
+      goto err;
+    }
+    ka->keys[0].key_parts_num= 2;
+    if (!wsrep_prepare_key_for_isolation(
+                                         db, table,
+                                         (wsrep_buf_t*)ka->keys[0].key_parts,
+                                         &ka->keys[0].key_parts_num))
+    {
+      WSREP_ERROR("Preparing keys for isolation failed (1)");
+      goto err;
+    }
+  }
 
-    for (const TABLE_LIST* table= table_list; table; table= table->next_global)
+  for (const TABLE_LIST* table= table_list; table; table= table->next_global)
+  {
+    wsrep_key_t* tmp;
+    tmp= (wsrep_key_t*)my_realloc(ka->keys,
+                                  (ka->keys_len + 1) * sizeof(wsrep_key_t),
+                                  MYF(0));
+    if (!tmp)
     {
-        if (!find_temporary_table(thd, table))
-        {
-            wsrep_key_t* tmp;
-            tmp= (wsrep_key_t*)my_realloc(
-                ka->keys, (ka->keys_len + 1) * sizeof(wsrep_key_t), MYF(0));
-            if (!tmp)
-            {
-                WSREP_ERROR("Can't allocate memory for key_array");
-                goto err;
-            }
-            ka->keys= tmp;
-            if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*)
-                  my_malloc(sizeof(wsrep_buf_t)*2, MYF(0))))
-            {
-                WSREP_ERROR("Can't allocate memory for key_parts");
-                goto err;
-            }
-            ka->keys[ka->keys_len].key_parts_num= 2;
-            ++ka->keys_len;
-            if (!wsrep_prepare_key_for_isolation(
-                    table->db, table->table_name,
-                    (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts,
-                    &ka->keys[ka->keys_len - 1].key_parts_num))
-            {
-                WSREP_ERROR("Preparing keys for isolation failed");
-                goto err;
-            }
-        }
+      WSREP_ERROR("Can't allocate memory for key_array");
+      goto err;
     }
-    return true;
+    ka->keys= tmp;
+    if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*)
+          my_malloc(sizeof(wsrep_buf_t)*2, MYF(0))))
+    {
+      WSREP_ERROR("Can't allocate memory for key_parts");
+      goto err;
+    }
+    ka->keys[ka->keys_len].key_parts_num= 2;
+    ++ka->keys_len;
+    if (!wsrep_prepare_key_for_isolation(table->db, table->table_name,
+                                         (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts,
+                                         &ka->keys[ka->keys_len - 1].key_parts_num))
+    {
+      WSREP_ERROR("Preparing keys for isolation failed (2)");
+      goto err;
+    }
+  }
+    return 0;
 err:
     wsrep_keys_free(ka);
-    return false;
+    return 1;
 }
 
 
@@ -1171,6 +1144,146 @@ create_view_query(THD *thd, uchar** buf, size_t* buf_len)
     return wsrep_to_buf_helper(thd, buff.ptr(), buff.length(), buf, buf_len);
 }
 
+/*
+  Rewrite DROP TABLE for TOI. Temporary tables are eliminated from
+  the query as they are visible only to client connection.
+
+  TODO: See comments for sql_base.cc:drop_temporary_table() and refine
+  the function to deal with transactional locked tables.
+ */
+static int wsrep_drop_table_query(THD* thd, uchar** buf, size_t* buf_len)
+{
+
+  LEX* lex= thd->lex;
+  SELECT_LEX* select_lex= &lex->select_lex;
+  TABLE_LIST* first_table= select_lex->table_list.first;
+  String buff;
+
+  DBUG_ASSERT(!lex->drop_temporary);
+
+  bool found_temp_table= false;
+  for (TABLE_LIST* table= first_table; table; table= table->next_global)
+  {
+    if (find_temporary_table(thd, table->db, table->table_name))
+    {
+      found_temp_table= true;
+      break;
+    }
+  }
+
+  if (found_temp_table)
+  {
+    buff.append("DROP TABLE ");
+    if (lex->drop_if_exists)
+      buff.append("IF EXISTS ");
+
+    for (TABLE_LIST* table= first_table; table; table= table->next_global)
+    {
+      if (!find_temporary_table(thd, table->db, table->table_name))
+      {
+        append_identifier(thd, &buff, table->db, strlen(table->db),
+                          system_charset_info, thd->charset());
+        buff.append(".");
+        append_identifier(thd, &buff, table->table_name,
+                          strlen(table->table_name),
+                          system_charset_info, thd->charset());
+        buff.append(",");
+      }
+    }
+
+    /* Chop the last comma */
+    buff.chop();
+    buff.append(" /* generated by wsrep */");
+
+    WSREP_DEBUG("Rewrote '%s' as '%s'", thd->query(), buff.ptr());
+
+    return wsrep_to_buf_helper(thd, buff.ptr(), buff.length(), buf, buf_len);
+  }
+  else
+  {
+    return wsrep_to_buf_helper(thd, thd->query(), thd->query_length(),
+                               buf, buf_len);
+  }
+}
+
+/*
+  Decide if statement should run in TOI.
+
+  Look if table or table_list contain temporary tables. If the
+  statement affects only temporary tables,   statement should not run
+  in TOI. If the table list contains mix of regular and temporary tables
+  (DROP TABLE, OPTIMIZE, ANALYZE), statement should be run in TOI but
+  should be rewritten at later time for replication to contain only
+  non-temporary tables.
+ */
+static bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table,
+                                 const TABLE_LIST *table_list)
+{
+  DBUG_ASSERT(!table || db);
+  DBUG_ASSERT(table_list || db);
+
+  LEX* lex= thd->lex;
+  SELECT_LEX* select_lex= &lex->select_lex;
+  TABLE_LIST* first_table= select_lex->table_list.first;
+
+  switch (lex->sql_command)
+  {
+  case SQLCOM_CREATE_TABLE:
+    DBUG_ASSERT(!table_list);
+    if (thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)
+    {
+      return false;
+    }
+    return true;
+
+  case SQLCOM_CREATE_VIEW:
+
+    DBUG_ASSERT(!table_list);
+    DBUG_ASSERT(first_table); /* First table is view name */
+    /*
+      If any of the remaining tables refer to temporary table error
+      is returned to client, so TOI can be skipped
+    */
+    for (TABLE_LIST* it= first_table->next_global; it; it= it->next_global)
+    {
+      if (find_temporary_table(thd, it))
+      {
+        return false;
+      }
+    }
+    return true;
+
+  case SQLCOM_CREATE_TRIGGER:
+
+    DBUG_ASSERT(!table_list);
+    DBUG_ASSERT(first_table);
+
+    if (find_temporary_table(thd, first_table))
+    {
+      return false;
+    }
+    return true;
+
+  default:
+    if (table && !find_temporary_table(thd, db, table))
+    {
+      return true;
+    }
+
+    if (table_list)
+    {
+      for (TABLE_LIST* table= first_table; table; table= table->next_global)
+      {
+        if (!find_temporary_table(thd, table->db, table->table_name))
+        {
+          return true;
+        }
+      }
+    }
+    return !(table || table_list);
+  }
+}
+
 /*
   returns: 
    0: statement was replicated as TOI
@@ -1185,6 +1298,12 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
   size_t buf_len(0);
   int buf_err;
 
+  if (wsrep_can_run_in_toi(thd, db_, table_, table_list) == false)
+  {
+    WSREP_DEBUG("No TOI for %s", WSREP_QUERY(thd));
+    return 1;
+  }
+
   WSREP_DEBUG("TO BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd),
               thd->wsrep_exec_mode, WSREP_QUERY(thd));
   switch (thd->lex->sql_command)
@@ -1205,17 +1324,20 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
   case SQLCOM_ALTER_EVENT:
     buf_err= wsrep_alter_event_query(thd, &buf, &buf_len);
     break;
+  case SQLCOM_DROP_TABLE:
+    buf_err= wsrep_drop_table_query(thd, &buf, &buf_len);
+    break;
   default:
-    buf_err= wsrep_to_buf_helper(thd, thd->query(), thd->query_length(), &buf,
-                                 &buf_len);
+    buf_err= wsrep_to_buf_helper(thd, thd->query(), thd->query_length(),
+                                 &buf, &buf_len);
     break;
   }
 
   wsrep_key_arr_t key_arr= {0, 0};
   struct wsrep_buf buff = { buf, buf_len };
-  if (!buf_err                                                                &&
-      wsrep_prepare_keys_for_isolation(thd, db_, table_, table_list, &key_arr)&&
-      key_arr.keys_len > 0                                                    &&
+  if (!buf_err                                                                  &&
+      !wsrep_prepare_keys_for_isolation(thd, db_, table_, table_list, &key_arr) &&
+      key_arr.keys_len > 0                                                      &&
       WSREP_OK == (ret = wsrep->to_execute_start(wsrep, thd->thread_id,
                                                 key_arr.keys, key_arr.keys_len,
                                                 &buff, 1,
@@ -1403,9 +1525,12 @@ int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_,
   if (thd->variables.wsrep_on && thd->wsrep_exec_mode==LOCAL_STATE)
   {
     switch (thd->variables.wsrep_OSU_method) {
-    case WSREP_OSU_TOI: ret =  wsrep_TOI_begin(thd, db_, table_,
-                                               table_list); break;
-    case WSREP_OSU_RSU: ret =  wsrep_RSU_begin(thd, db_, table_); break;
+    case WSREP_OSU_TOI:
+      ret =  wsrep_TOI_begin(thd, db_, table_, table_list);
+      break;
+    case WSREP_OSU_RSU:
+      ret =  wsrep_RSU_begin(thd, db_, table_);
+      break;
     default:
       WSREP_ERROR("Unsupported OSU method: %lu",
                   thd->variables.wsrep_OSU_method);
@@ -1500,7 +1625,7 @@ wsrep_grant_mdl_exception(MDL_context *requestor_ctx,
     }
     else if (request_thd->lex->sql_command == SQLCOM_DROP_TABLE)
     {
-      WSREP_DEBUG("DROP caused BF abort");
+      WSREP_DEBUG("DROP caused BF abort, conf %d", granted_thd->wsrep_conflict_state);
       ticket->wsrep_report(wsrep_debug);
       mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd);
       wsrep_abort_thd((void*)request_thd, (void*)granted_thd, 1);
index 098ae79a86882f646a5183370c19fa5c90a050c6..2f64dc91ed1bd06e391c7212b5f48812248ca879 100644 (file)
@@ -115,16 +115,16 @@ enum enum_wsrep_OSU_method {
 
 enum enum_wsrep_sync_wait {
     WSREP_SYNC_WAIT_NONE = 0x0,
-    // show, select, begin
+    // select, begin
     WSREP_SYNC_WAIT_BEFORE_READ = 0x1,
     WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE = 0x2,
     WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE = 0x4,
-    WSREP_SYNC_WAIT_MAX = 0x7
+    WSREP_SYNC_WAIT_BEFORE_SHOW = 0x8,
+    WSREP_SYNC_WAIT_MAX = 0xF
 };
 
 // MySQL status variables
 extern my_bool     wsrep_connected;
-extern my_bool     wsrep_ready;
 extern const char* wsrep_cluster_state_uuid;
 extern long long   wsrep_cluster_conf_id;
 extern const char* wsrep_cluster_status;
@@ -136,6 +136,7 @@ extern const char* wsrep_provider_version;
 extern const char* wsrep_provider_vendor;
 
 int  wsrep_show_status(THD *thd, SHOW_VAR *var, char *buff);
+int  wsrep_show_ready(THD *thd, SHOW_VAR *var, char *buff);
 void wsrep_free_status(THD *thd);
 
 /* Filters out --wsrep-new-cluster oprtion from argv[]
@@ -263,6 +264,7 @@ extern wsrep_seqno_t wsrep_locked_seqno;
   ((!opt_log_raw) && thd->rewritten_query.length()      \
    ? thd->rewritten_query.c_ptr_safe() : thd->query())
 
+extern my_bool wsrep_ready_get();
 extern void wsrep_ready_wait();
 
 enum wsrep_trx_status {
@@ -342,4 +344,15 @@ bool wsrep_node_is_donor();
 bool wsrep_node_is_synced();
 bool wsrep_replicate_GTID(THD* thd);
 
+typedef struct wsrep_key_arr
+{
+    wsrep_key_t* keys;
+    size_t       keys_len;
+} wsrep_key_arr_t;
+bool wsrep_prepare_keys_for_isolation(THD*              thd,
+                                      const char*       db,
+                                      const char*       table,
+                                      const TABLE_LIST* table_list,
+                                      wsrep_key_arr_t*  ka);
+void wsrep_keys_free(wsrep_key_arr_t* key_arr);
 #endif /* WSREP_MYSQLD_H */
index 30dce78c1a487debe2e1d7289a069dbd095b8d52..58d8cc4f86d0ad3816d1782761d8c8ec7df411fd 100644 (file)
@@ -26,7 +26,7 @@
 #include <pthread.h>
 #include <cstdio>
 
-void    wsrep_ready_set (my_bool x);
+my_bool wsrep_ready_set (my_bool x);
 
 ssize_t wsrep_sst_prepare   (void** msg);
 wsrep_cb_status wsrep_sst_donate_cb (void* app_ctx,
index 8042339ae150f692c40d6bd66388a5931fda87ac..6ead01b89d2d2bd2703fd40a26095f9380d14b73 100644 (file)
@@ -361,8 +361,7 @@ static int generate_binlog_opt_val(char** ret)
   if (opt_bin_log && gtid_mode > 0)
   {
     assert(opt_bin_logname);
-    *ret= strcmp(opt_bin_logname, "0") ?
-        my_strdup(opt_bin_logname, MYF(0)) : my_strdup("", MYF(0));
+    *ret= my_strdup(opt_bin_logname, MYF(0));
   }
   else
   {
@@ -631,18 +630,19 @@ ssize_t wsrep_sst_prepare (void** msg)
 
   // Figure out SST address. Common for all SST methods
   if (wsrep_sst_receive_address &&
-    strcmp (wsrep_sst_receive_address, WSREP_SST_ADDRESS_AUTO))
+      strcmp (wsrep_sst_receive_address, WSREP_SST_ADDRESS_AUTO))
   {
     addr_in= wsrep_sst_receive_address;
   }
   else if (wsrep_node_address && strlen(wsrep_node_address))
   {
-    const char* const colon= strchr (wsrep_node_address, ':');
-    if (colon)
+    size_t const addr_len= strlen(wsrep_node_address);
+    size_t const host_len= wsrep_host_len(wsrep_node_address, addr_len);
+
+    if (host_len < addr_len)
     {
-      ptrdiff_t const len= colon - wsrep_node_address;
-      strncpy (ip_buf, wsrep_node_address, len);
-      ip_buf[len]= '\0';
+      strncpy (ip_buf, wsrep_node_address, host_len);
+      ip_buf[host_len]= '\0';
       addr_in= ip_buf;
     }
     else
@@ -769,25 +769,6 @@ static int sst_donate_mysqldump (const char*         addr,
                                  bool                bypass,
                                  char**              env) // carries auth info
 {
-  size_t host_len;
-  const char* port = strchr (addr, ':');
-
-  if (port)
-  {
-    port += 1;
-    host_len = port - addr;
-  }
-  else
-  {
-    port = "";
-    host_len = strlen (addr) + 1;
-  }
-
-  char *host= (char*) malloc(host_len);
-
-  strncpy (host, addr, host_len - 1);
-  host[host_len - 1] = '\0';
-
   int const cmd_len= 4096;
   wsp::string  cmd_str(cmd_len);
 
@@ -802,14 +783,13 @@ static int sst_donate_mysqldump (const char*         addr,
 
   int ret= snprintf (cmd_str(), cmd_len,
                      "wsrep_sst_mysqldump "
-                     WSREP_SST_OPT_HOST" '%s' "
-                     WSREP_SST_OPT_PORT" '%s' "
+                     WSREP_SST_OPT_ADDR" '%s' "
                      WSREP_SST_OPT_LPORT" '%u' "
                      WSREP_SST_OPT_SOCKET" '%s' "
                      WSREP_SST_OPT_CONF" '%s' "
                      WSREP_SST_OPT_GTID" '%s:%lld'"
                      "%s",
-                     host, port, mysqld_port, mysqld_unix_port,
+                     addr, mysqld_port, mysqld_unix_port,
                      wsrep_defaults_file, uuid_str,
                      (long long)seqno, bypass ? " " WSREP_SST_OPT_BYPASS : "");
 
@@ -827,8 +807,6 @@ static int sst_donate_mysqldump (const char*         addr,
 
   wsrep->sst_sent (wsrep, &state_id, ret);
 
-  free(host);
-
   return ret;
 }
 
@@ -1109,7 +1087,6 @@ wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx,
 {
   /* This will be reset when sync callback is called.
    * Should we set wsrep_ready to FALSE here too? */
-//  wsrep_notify_status(WSREP_MEMBER_DONOR);
   local_status.set(WSREP_MEMBER_DONOR);
 
   const char* method = (char*)msg;
index 53ebb99372587a7fabe23a11ab8ef2363cd5e3b1..18da3dbbe02dec4367f306510005c410d27cce2e 100644 (file)
@@ -554,3 +554,18 @@ size_t wsrep_guess_ip (char* buf, size_t buf_len)
 
   return 0;
 }
+
+/* returns the length of the host part of the address string */
+size_t wsrep_host_len(const char* const addr, size_t const addr_len)
+{
+  // check for IPv6 notation first
+  const char* const bracket= ('[' == addr[0] ? strchr(addr, ']') : NULL);
+
+  if (bracket) { // IPv6
+    return (bracket - addr + 1);
+  }
+  else { // host part ends at ':' or end of string
+    const char* const colon= strchr(addr, ':');
+    return (colon ? colon - addr : addr_len);
+  }
+}
index 7d864603c7f1c30b68d9022415d69a4fc8b87581..0ae5c68df217c264d2a860162f80b5151d468d79 100644 (file)
@@ -21,6 +21,9 @@
 unsigned int wsrep_check_ip (const char* addr);
 size_t wsrep_guess_ip (char* buf, size_t buf_len);
 
+/* returns the length of the host part of the address string */
+size_t wsrep_host_len(const char* addr, size_t addr_len);
+
 namespace wsp {
 class node_status
 {
index cb7c4fdac0eee1459a548531ad48ca623782d36e..f32561d5b6011d89863bf5dc3ed84c4c543b843f 100644 (file)
@@ -40,6 +40,8 @@ const  char* wsrep_node_incoming_address = 0;
 const  char* wsrep_start_position   = 0;
 ulong   wsrep_reject_queries;
 
+static long wsrep_prev_slave_threads = wsrep_slave_threads;
+
 int wsrep_init_vars()
 {
   wsrep_provider        = my_strdup(WSREP_NONE, MYF(MY_WME));
@@ -297,6 +299,12 @@ bool wsrep_provider_update (sys_var *self, THD* thd, enum_var_type type)
   wsrep_stop_replication(thd);
   mysql_mutex_lock(&LOCK_global_system_variables);
 
+  /* provider status variables are allocated in provider library
+     and need to freed here, otherwise a dangling reference to
+     wsrep_status_vars would remain in THD
+  */
+  wsrep_free_status(thd);
+
   wsrep_deinit();
 
   char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider 
@@ -529,17 +537,15 @@ void wsrep_node_address_init (const char* value)
   wsrep_node_address = (value) ? my_strdup(value, MYF(0)) : NULL;
 }
 
-bool wsrep_slave_threads_check (sys_var *self, THD* thd, set_var* var)
+static void wsrep_slave_count_change_update ()
 {
-  mysql_mutex_lock(&LOCK_wsrep_slave_threads);
-  wsrep_slave_count_change = var->value->val_int() - wsrep_slave_threads;
-  mysql_mutex_unlock(&LOCK_wsrep_slave_threads);
-
-  return 0;
+  wsrep_slave_count_change += (wsrep_slave_threads - wsrep_prev_slave_threads);
+  wsrep_prev_slave_threads = wsrep_slave_threads;
 }
 
 bool wsrep_slave_threads_update (sys_var *self, THD* thd, enum_var_type type)
 {
+  wsrep_slave_count_change_update();
   if (wsrep_slave_count_change > 0)
   {
     wsrep_create_appliers(wsrep_slave_count_change);
index 6c830205e2b777d465b141c6ea4b28c505fbdd07..ab6d9c8242011bb2d9f10cbed69440a9b0d25f51 100644 (file)
@@ -40,6 +40,9 @@ Created April 08, 2011 Vasil Dimov
 #include "sync0rw.h" /* rw_lock_s_lock() */
 #include "ut0byte.h" /* ut_ull_create() */
 #include "ut0sort.h" /* UT_SORT_FUNCTION_BODY */
+#ifdef WITH_WSREP
+extern my_bool wsrep_recovery;
+#endif /* WITH_WSREP */
 
 enum status_severity {
        STATUS_INFO,
@@ -606,7 +609,13 @@ DECLARE_THREAD(buf_dump_thread)(
        buf_load_status(STATUS_INFO, "not started");
 
        if (srv_buffer_pool_load_at_startup) {
+#ifdef WITH_WSREP
+               if (!wsrep_recovery) {
+#endif /* WITH_WSREP */
                buf_load();
+#ifdef WITH_WSREP
+                }
+#endif /* WITH_WSREP */
        }
 
        while (!SHUTTING_DOWN()) {
@@ -627,8 +636,14 @@ DECLARE_THREAD(buf_dump_thread)(
        }
 
        if (srv_buffer_pool_dump_at_shutdown && srv_fast_shutdown != 2) {
+#ifdef WITH_WSREP
+               if (!wsrep_recovery) {
+#endif /* WITH_WSREP */
                buf_dump(FALSE /* ignore shutdown down flag,
                keep going even if we are in a shutdown state */);
+#ifdef WITH_WSREP
+               }
+#endif /* WITH_WSREP */
        }
 
        srv_buf_dump_thread_active = FALSE;
index 975c8a50803bdb46d95b2eff1207289185b65eba..bc8fbe6ece4ec398867803290d0438d09955cbb5 100644 (file)
@@ -195,7 +195,7 @@ dict_stats_wait_bg_to_stop_using_table(
                                unlocking/locking the data dict */
 {
        while (!dict_stats_stop_bg(table)) {
-               DICT_STATS_BG_YIELD(trx);
+               DICT_BG_YIELD(trx);
        }
 }
 
index a0f0fab5566b01ee9887869483a89b11dadcdf30..a29e046eb842248dd266bfeeaebacca09820b78a 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2011, 2016, 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 General Public License as published by the Free Software
@@ -25,6 +25,7 @@ Full Text Search interface
 #include "row0mysql.h"
 #include "row0upd.h"
 #include "dict0types.h"
+#include "dict0stats_bg.h"
 #include "row0sel.h"
 
 #include "fts0fts.h"
@@ -867,18 +868,37 @@ fts_drop_index(
 
                        err = fts_drop_index_tables(trx, index);
 
-                       fts_free(table);
-
+                       for(;;) {
+                               bool retry = false;
+                               if (index->index_fts_syncing) {
+                                       retry = true;
+                               }
+                               if (!retry){
+                                       fts_free(table);
+                                       break;
+                               }
+                               DICT_BG_YIELD(trx);
+                       }
                        return(err);
                }
 
-               current_doc_id = table->fts->cache->next_doc_id;
-               first_doc_id = table->fts->cache->first_doc_id;
-               fts_cache_clear(table->fts->cache);
-               fts_cache_destroy(table->fts->cache);
-               table->fts->cache = fts_cache_create(table);
-               table->fts->cache->next_doc_id = current_doc_id;
-               table->fts->cache->first_doc_id = first_doc_id;
+               for(;;) {
+                       bool retry = false;
+                       if (index->index_fts_syncing) {
+                               retry = true;
+                       }
+                       if (!retry){
+                               current_doc_id = table->fts->cache->next_doc_id;
+                               first_doc_id = table->fts->cache->first_doc_id;
+                               fts_cache_clear(table->fts->cache);
+                               fts_cache_destroy(table->fts->cache);
+                               table->fts->cache = fts_cache_create(table);
+                               table->fts->cache->next_doc_id = current_doc_id;
+                               table->fts->cache->first_doc_id = first_doc_id;
+                               break;
+                       }
+                       DICT_BG_YIELD(trx);
+               }
        } else {
                fts_cache_t*            cache = table->fts->cache;
                fts_index_cache_t*      index_cache;
@@ -888,9 +908,17 @@ fts_drop_index(
                index_cache = fts_find_index_cache(cache, index);
 
                if (index_cache != NULL) {
-                       if (index_cache->words) {
-                               fts_words_free(index_cache->words);
-                               rbt_free(index_cache->words);
+                       for(;;) {
+                               bool retry = false;
+                               if (index->index_fts_syncing) {
+                                       retry = true;
+                               }
+                               if (!retry && index_cache->words) {
+                                       fts_words_free(index_cache->words);
+                                       rbt_free(index_cache->words);
+                                       break;
+                               }
+                               DICT_BG_YIELD(trx);
                        }
 
                        ib_vector_remove(cache->indexes, *(void**) index_cache);
@@ -4611,10 +4639,16 @@ begin_sync:
                index_cache = static_cast<fts_index_cache_t*>(
                        ib_vector_get(cache->indexes, i));
 
-               if (index_cache->index->to_be_dropped) {
+               if (index_cache->index->to_be_dropped
+                  || index_cache->index->table->to_be_dropped) {
                        continue;
                }
 
+               index_cache->index->index_fts_syncing = true;
+               DBUG_EXECUTE_IF("fts_instrument_sync_sleep_drop_waits",
+                               os_thread_sleep(10000000);
+                               );
+
                error = fts_sync_index(sync, index_cache);
 
                if (error != DB_SUCCESS && !sync->interrupted) {
@@ -4647,11 +4681,33 @@ begin_sync:
 end_sync:
        if (error == DB_SUCCESS && !sync->interrupted) {
                error = fts_sync_commit(sync);
+               if (error == DB_SUCCESS) {
+                       for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
+                               fts_index_cache_t*      index_cache;
+                               index_cache = static_cast<fts_index_cache_t*>(
+                                       ib_vector_get(cache->indexes, i));
+                               if (index_cache->index->index_fts_syncing) {
+                                       index_cache->index->index_fts_syncing
+                                                               = false;
+                               }
+                       }
+               }
        }  else {
                fts_sync_rollback(sync);
        }
 
        rw_lock_x_lock(&cache->lock);
+       /* Clear fts syncing flags of any indexes incase sync is
+       interrupeted */
+       for (i = 0; i < ib_vector_size(cache->indexes); ++i) {
+               fts_index_cache_t*      index_cache;
+               index_cache = static_cast<fts_index_cache_t*>(
+                      ib_vector_get(cache->indexes, i));
+               if (index_cache->index->index_fts_syncing == true) {
+                       index_cache->index->index_fts_syncing = false;
+                  }
+       }
+
        sync->interrupted = false;
        sync->in_progress = false;
        os_event_set(sync->event);
index 6ea529971d2c8b42346b78666d156dbcf648ec8a..c424f6ca120211259d89e9f5400489ea8b8bcc23 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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 the Free Software
@@ -2972,13 +2972,6 @@ fts_optimize_sync_table(
 {
        dict_table_t*   table = NULL;
 
-       /* Prevent DROP INDEX etc. from running when we are syncing
-       cache in background. */
-       if (!rw_lock_s_lock_nowait(&dict_operation_lock, __FILE__, __LINE__)) {
-               /* Exit when fail to get dict operation lock. */
-               return;
-       }
-
        table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL);
 
        if (table) {
@@ -2988,8 +2981,6 @@ fts_optimize_sync_table(
 
                dict_table_close(table, FALSE, FALSE);
        }
-
-       rw_lock_s_unlock(&dict_operation_lock);
 }
 
 /**********************************************************************//**
index 2c44a21a8f2948ca3dd1428e6da75e3de2a188ff..fd1199ac4349c237c2b91dc428e16b4c3f290d90 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 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 the Free Software
@@ -3632,6 +3632,11 @@ fts_query_free(
                fts_doc_ids_free(query->deleted);
        }
 
+       if (query->intersection) {
+               fts_query_free_doc_ids(query, query->intersection);
+               query->intersection = NULL;
+       }
+
        if (query->doc_ids) {
                fts_query_free_doc_ids(query, query->doc_ids);
        }
index 4bd548947941dd97682882adbd2189a22752745e..3ddfc9ae6660b0bfc4ba0d29737b9a34c9054520 100644 (file)
@@ -1513,8 +1513,8 @@ innobase_release_temporary_latches(
 }
 
 #ifdef WITH_WSREP
-static int 
-wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, 
+static int
+wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd,
                        my_bool signal);
 static void
 wsrep_fake_trx_id(handlerton* hton, THD *thd);
@@ -5397,7 +5397,6 @@ get_field_offset(
 UNIV_INTERN
 int
 wsrep_innobase_mysql_sort(
-/*===============*/
                                        /* out: str contains sort string */
        int             mysql_type,     /* in: MySQL type */
        uint            charset_number, /* in: number of the charset */
@@ -6015,7 +6014,6 @@ Stores a key value for a row to a buffer.
 UNIV_INTERN
 uint
 wsrep_store_key_val_for_row(
-/*===============================*/
        THD*            thd,
        TABLE*          table,
        uint            keynr,  /*!< in: key number */
@@ -6027,7 +6025,7 @@ wsrep_store_key_val_for_row(
 {
        KEY*            key_info        = table->key_info + keynr;
        KEY_PART_INFO*  key_part        = key_info->key_part;
-       KEY_PART_INFO*  end             = 
+       KEY_PART_INFO*  end             =
                key_part + key_info->user_defined_key_parts;
        char*           buff_start      = buff;
        enum_field_types mysql_type;
@@ -6046,7 +6044,7 @@ wsrep_store_key_val_for_row(
 
                if (key_part->null_bit) {
                        if (buff_space > 0) {
-                               if (record[key_part->null_offset] 
+                               if (record[key_part->null_offset]
                                    & key_part->null_bit) {
                                        *buff = 1;
                                        part_is_null = TRUE;
@@ -7478,8 +7476,9 @@ report_error:
                                                   user_thd);
 #ifdef WITH_WSREP
        if (!error_result && wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
-           wsrep_on(user_thd) && !wsrep_consistency_check(user_thd) &&
-           (sql_command != SQLCOM_LOAD || 
+           wsrep_on(user_thd) && !wsrep_consistency_check(user_thd)      &&
+           (sql_command != SQLCOM_CREATE_TABLE)                          &&
+           (sql_command != SQLCOM_LOAD ||
             thd_binlog_format(user_thd) == BINLOG_FORMAT_ROW)) {
 
                if (wsrep_append_keys(user_thd, false, record, NULL)) {
@@ -7510,7 +7509,6 @@ func_exit:
 static
 int
 wsrep_calc_row_hash(
-/*================*/
        byte*           digest,         /*!< in/out: md5 sum */
        const uchar*    row,            /*!< in: row in MySQL format */
        TABLE*          table,          /*!< in: table in MySQL data
@@ -9257,18 +9255,17 @@ wsrep_dict_foreign_find_index(
 extern
 dberr_t
 wsrep_append_foreign_key(
-/*===========================*/
        trx_t*          trx,            /*!< in: trx */
        dict_foreign_t* foreign,        /*!< in: foreign key constraint */
-       const rec_t*    rec,            /*!<in: clustered index record */
-       dict_index_t*   index,          /*!<in: clustered index */
-       ibool           referenced,     /*!<in: is check for referenced table */
-       ibool           shared)         /*!<in: is shared access */
-{
-       THD*    thd             = (THD*)trx->mysql_thd;
-       int rcode               = 0;
-       char    cache_key[513]  = {'\0'};
-       int   cache_key_len;
+       const rec_t*    rec,            /*!< in: clustered index record */
+       dict_index_t*   index,          /*!< in: clustered index */
+       ibool           referenced,     /*!< in: is check for referenced table */
+       ibool           shared)         /*!< in: is shared access */
+{
+       THD* thd = (THD*)trx->mysql_thd;
+       int rcode = 0;
+       char cache_key[513] = {'\0'};
+       int cache_key_len;
        bool const copy = true;
        ut_a(trx);
 
@@ -9306,7 +9303,7 @@ wsrep_append_foreign_key(
                                        wsrep_dict_foreign_find_index(
                                                foreign->referenced_table, NULL,
                                                foreign->referenced_col_names,
-                                               foreign->n_fields, 
+                                               foreign->n_fields,
                                                foreign->foreign_index,
                                                TRUE, FALSE);
                        }
@@ -9323,14 +9320,14 @@ wsrep_append_foreign_key(
                                                foreign->foreign_table, NULL,
                                                foreign->foreign_col_names,
                                                foreign->n_fields,
-                                               foreign->referenced_index, 
+                                               foreign->referenced_index,
                                                TRUE, FALSE);
                        }
                }
                mutex_exit(&(dict_sys->mutex));
        }
 
-       if ( !((referenced) ?
+       if (!((referenced) ?
                foreign->referenced_table : foreign->foreign_table))
        {
                WSREP_WARN("FK: %s missing in query: %s",
@@ -9431,7 +9428,6 @@ wsrep_append_foreign_key(
 
 static int
 wsrep_append_key(
-/*==================*/
        THD             *thd,
        trx_t           *trx,
        TABLE_SHARE     *table_share,
@@ -9508,7 +9504,6 @@ wsrep_is_FK_index(dict_table_t* table,
 
 int
 ha_innobase::wsrep_append_keys(
-/*==================*/
        THD             *thd,
        bool            shared,
        const uchar*    record0,        /* in: row in MySQL format */
@@ -9521,10 +9516,10 @@ ha_innobase::wsrep_append_keys(
        trx_t *trx = thd_to_trx(thd);
 
        if (table_share && table_share->tmp_table  != NO_TMP_TABLE) {
-               WSREP_DEBUG("skipping tmp table DML: THD: %lu tmp: %d SQL: %s", 
+               WSREP_DEBUG("skipping tmp table DML: THD: %lu tmp: %d SQL: %s",
                            wsrep_thd_thread_id(thd),
                            table_share->tmp_table,
-                           (wsrep_thd_query(thd)) ? 
+                           (wsrep_thd_query(thd)) ?
                            wsrep_thd_query(thd) : "void");
                DBUG_RETURN(0);
        }
@@ -9536,18 +9531,18 @@ ha_innobase::wsrep_append_keys(
                ibool    is_null;
 
                len = wsrep_store_key_val_for_row(
-                       thd, table, 0, key, WSREP_MAX_SUPPORTED_KEY_LENGTH, 
+                       thd, table, 0, key, WSREP_MAX_SUPPORTED_KEY_LENGTH,
                        record0, &is_null);
 
                if (!is_null) {
                        rcode = wsrep_append_key(
-                               thd, trx, table_share, table, keyval, 
+                               thd, trx, table_share, table, keyval,
                                len, shared);
                        if (rcode) DBUG_RETURN(rcode);
                }
                else
                {
-                       WSREP_DEBUG("NULL key skipped (proto 0): %s", 
+                       WSREP_DEBUG("NULL key skipped (proto 0): %s",
                                    wsrep_thd_query(thd));
                }
        } else {
@@ -9579,22 +9574,22 @@ ha_innobase::wsrep_append_keys(
 
                        if (!tab) {
                                WSREP_WARN("MySQL-InnoDB key mismatch %s %s",
-                                          table->s->table_name.str, 
+                                          table->s->table_name.str,
                                           key_info->name);
                        }
-                       /* !hasPK == table with no PK, 
+                       /* !hasPK == table with no PK,
                            must append all non-unique keys */
                        if (!hasPK || key_info->flags & HA_NOSAME ||
                            ((tab && wsrep_is_FK_index(tab, idx)) ||
                             (!tab && referenced_by_foreign_key()))) {
 
                                len = wsrep_store_key_val_for_row(
-                                       thd, table, i, key0, 
-                                       WSREP_MAX_SUPPORTED_KEY_LENGTH, 
+                                       thd, table, i, key0,
+                                       WSREP_MAX_SUPPORTED_KEY_LENGTH,
                                        record0, &is_null);
                                if (!is_null) {
                                        rcode = wsrep_append_key(
-                                               thd, trx, table_share, table, 
+                                               thd, trx, table_share, table,
                                                keyval0, len+1, shared);
                                        if (rcode) DBUG_RETURN(rcode);
 
@@ -9603,18 +9598,18 @@ ha_innobase::wsrep_append_keys(
                                }
                                else
                                {
-                                       WSREP_DEBUG("NULL key skipped: %s", 
+                                       WSREP_DEBUG("NULL key skipped: %s",
                                                    wsrep_thd_query(thd));
                                }
                                if (record1) {
                                        len = wsrep_store_key_val_for_row(
-                                               thd, table, i, key1, 
+                                               thd, table, i, key1,
                                                WSREP_MAX_SUPPORTED_KEY_LENGTH,
                                                record1, &is_null);
                                        if (!is_null && memcmp(key0, key1, len)) {
                                                rcode = wsrep_append_key(
-                                                       thd, trx, table_share, 
-                                                       table, 
+                                                       thd, trx, table_share,
+                                                       table,
                                                        keyval1, len+1, shared);
                                                if (rcode) DBUG_RETURN(rcode);
                                        }
@@ -9629,8 +9624,8 @@ ha_innobase::wsrep_append_keys(
                int rcode;
 
                wsrep_calc_row_hash(digest, record0, table, prebuilt, thd);
-               if ((rcode = wsrep_append_key(thd, trx, table_share, table, 
-                                             (const char*) digest, 16, 
+               if ((rcode = wsrep_append_key(thd, trx, table_share, table,
+                                             (const char*) digest, 16,
                                              shared))) {
                        DBUG_RETURN(rcode);
                }
@@ -9638,9 +9633,9 @@ ha_innobase::wsrep_append_keys(
                if (record1) {
                        wsrep_calc_row_hash(
                                digest, record1, table, prebuilt, thd);
-                       if ((rcode = wsrep_append_key(thd, trx, table_share, 
+                       if ((rcode = wsrep_append_key(thd, trx, table_share,
                                                      table,
-                                                     (const char*) digest, 
+                                                     (const char*) digest,
                                                      16, shared))) {
                                DBUG_RETURN(rcode);
                        }
@@ -16999,7 +16994,7 @@ buffer_pool_load_now(
        const void*                     save)   /*!< in: immediate result from
                                                check function */
 {
-       if (*(my_bool*) save) {
+       if (*(my_bool*) save && !srv_read_only_mode) {
                buf_load_start();
        }
 }
@@ -17103,8 +17098,10 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
                    (long long)wsrep_thd_thread_id(thd),
                    (long long)victim_trx->id);
 
-       WSREP_DEBUG("Aborting query: %s", 
-                 (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void");
+       WSREP_DEBUG("Aborting query: %s conf %d trx: %lu",
+                   (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void",
+                   wsrep_thd_conflict_state(thd),
+                   wsrep_thd_ws_handle(thd)->trx_id);
 
        wsrep_thd_LOCK(thd);
         DBUG_EXECUTE_IF("sync.wsrep_after_BF_victim_lock",
@@ -17165,9 +17162,8 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
                } else {
                        rcode = wsrep->abort_pre_commit(
                                wsrep, bf_seqno,
-                               (wsrep_trx_id_t)victim_trx->id
+                               (wsrep_trx_id_t)wsrep_thd_ws_handle(thd)->trx_id
                        );
-                       
                        switch (rcode) {
                        case WSREP_WARNING:
                                WSREP_DEBUG("cancel commit warning: %llu",
@@ -17280,19 +17276,20 @@ wsrep_innobase_kill_one_trx(void * const bf_thd_ptr,
                break;
        }
        wsrep_thd_UNLOCK(thd);
-     
+
        DBUG_RETURN(0);
 }
-static int 
-wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, 
+static int
+wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd,
                        my_bool signal)
 {
        DBUG_ENTER("wsrep_innobase_abort_thd");
        trx_t* victim_trx = thd_to_trx(victim_thd);
        trx_t* bf_trx     = (bf_thd) ? thd_to_trx(bf_thd) : NULL;
-       WSREP_DEBUG("abort transaction: BF: %s victim: %s", 
+       WSREP_DEBUG("abort transaction: BF: %s victim: %s victim conf: %d",
                    wsrep_thd_query(bf_thd),
-                   wsrep_thd_query(victim_thd));
+                   wsrep_thd_query(victim_thd),
+                   wsrep_thd_conflict_state(victim_thd));
 
        if (victim_trx)
        {
@@ -17340,12 +17337,13 @@ static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid)
 
 static void
 wsrep_fake_trx_id(
-/*==================*/
        handlerton      *hton,
        THD             *thd)   /*!< in: user thread handle */
 {
+       mutex_enter(&trx_sys->mutex);
        trx_id_t trx_id = trx_sys_get_new_trx_id();
-
+       mutex_exit(&trx_sys->mutex);
+       WSREP_DEBUG("innodb fake trx id: %lu thd: %s", trx_id, wsrep_thd_query(thd));
        (void *)wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id);
 }
 
index 836c30d4365c3392744581384d77fb552f5d6a59..d7dad764a71092e61af360943fd2426cb9e19d1f 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-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 the Free Software
@@ -5611,7 +5611,47 @@ ha_innobase::commit_inplace_alter_table(
                        break;
                }
 
-               DICT_STATS_BG_YIELD(trx);
+               DICT_BG_YIELD(trx);
+       }
+
+       /* Make a concurrent Drop fts Index to wait until sync of that
+       fts index is happening in the background */
+       for (;;) {
+               bool    retry = false;
+
+               for (inplace_alter_handler_ctx** pctx = ctx_array;
+                   *pctx; pctx++) {
+                       int count =0;
+                       ha_innobase_inplace_ctx*        ctx
+                               = static_cast<ha_innobase_inplace_ctx*>(*pctx);
+                       DBUG_ASSERT(new_clustered == ctx->need_rebuild());
+
+                       if (dict_fts_index_syncing(ctx->old_table)) {
+                               count++;
+                               if (count == 100) {
+                                       fprintf(stderr,
+                                       "Drop index waiting for background sync"
+                                       "to finish\n");
+                               }
+                               retry = true;
+                       }
+
+                       if (new_clustered && dict_fts_index_syncing(ctx->new_table)) {
+                               count++;
+                               if (count == 100) {
+                                       fprintf(stderr,
+                                        "Drop index waiting for background sync"
+                                        "to finish\n");
+                               }
+                               retry = true;
+                       }
+               }
+
+                if (!retry) {
+                        break;
+               }
+
+               DICT_BG_YIELD(trx);
        }
 
        /* Apply the changes to the data dictionary tables, for all
@@ -5927,8 +5967,13 @@ foreign_fail:
 
                ut_d(dict_table_check_for_dup_indexes(
                             ctx->new_table, CHECK_ABORTED_OK));
-               ut_a(fts_check_cached_index(ctx->new_table));
 
+#ifdef UNIV_DEBUG
+               if (!(ctx->new_table->fts != NULL
+                       && ctx->new_table->fts->cache->sync->in_progress)) {
+                       ut_a(fts_check_cached_index(ctx->new_table));
+               }
+#endif
                if (new_clustered) {
                        /* Since the table has been rebuilt, we remove
                        all persistent statistics corresponding to the
index 6fc6098f3d9c397acea9f252ec2cf8c993725fdd..9a53dae10ab3d5af2c74e6d52d0f5ff199db2305 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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 the Free Software
@@ -909,6 +909,27 @@ dict_table_x_lock_indexes(
        }
 }
 
+/*********************************************************************//**
+Returns true if the particular FTS index in the table is still syncing
+in the background, false otherwise.
+@param [in] table      Table containing FTS index
+@return True if sync of fts index is still going in the background  */
+UNIV_INLINE
+bool
+dict_fts_index_syncing(
+       dict_table_t*   table)
+{
+        dict_index_t*   index;
+
+       for (index = dict_table_get_first_index(table);
+           index != NULL;
+           index = dict_table_get_next_index(index)) {
+               if (index->index_fts_syncing) {
+                        return(true);
+               }
+       }
+       return(false);
+}
 /*********************************************************************//**
 Release the exclusive locks on all index tree. */
 UNIV_INLINE
index 1dd7fda1661e4388dfbc10616f89912bf5fd36f0..d99adf284ccd7a5b7865f9bf64638682d8fe0a80 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
 
 This program is free software; you can redistribute it and/or modify it under
@@ -609,6 +609,8 @@ struct dict_index_t{
                                dict_sys->mutex. Other changes are
                                protected by index->lock. */
        dict_field_t*   fields; /*!< array of field descriptions */
+       bool            index_fts_syncing;/*!< Whether the fts index is
+                                       still syncing in the background */
 #ifndef UNIV_HOTBACKUP
        UT_LIST_NODE_T(dict_index_t)
                        indexes;/*!< list of indexes of the table */
index 82cd2b468b9f7e2f6c1366ea19bebe287b506896..bf77cd125fb80b3ff434983cd87e15951f8b9975 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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 the Free Software
@@ -59,7 +59,7 @@ dict_stats_recalc_pool_del(
 /** Yield the data dictionary latch when waiting
 for the background thread to stop accessing a table.
 @param trx     transaction holding the data dictionary locks */
-#define DICT_STATS_BG_YIELD(trx)       do {    \
+#define DICT_BG_YIELD(trx)     do {    \
        row_mysql_unlock_data_dictionary(trx);  \
        os_thread_sleep(250000);                \
        row_mysql_lock_data_dictionary(trx);    \
index 5e97dfa9553f196a149842389d19a72ad086b545..e072872939bd0ef4fe5c36b133c682b2a8a349d5 100644 (file)
@@ -1705,6 +1705,9 @@ os_file_create_func(
 #else /* __WIN__ */
        int             create_flag;
        const char*     mode_str        = NULL;
+       if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW)
+               WAIT_ALLOW_WRITES();
+
        on_error_no_exit = create_mode & OS_FILE_ON_ERROR_NO_EXIT
                ? TRUE : FALSE;
        on_error_silent = create_mode & OS_FILE_ON_ERROR_SILENT
index 12ca0a328f23ca19697641c632ea91bc99d35746..3dcb1fd508a52a85b0e8b3a529f7f4708c3d0835 100644 (file)
@@ -1281,11 +1281,11 @@ row_ins_foreign_check_on_constraint(
 
 #ifdef WITH_WSREP
        err = wsrep_append_foreign_key(
-                                      thr_get_trx(thr),
-                                      foreign,
-                                      clust_rec, 
-                                      clust_index,
-                                      FALSE, FALSE);
+                                       thr_get_trx(thr),
+                                       foreign,
+                                       clust_rec,
+                                       clust_index,
+                                       FALSE, FALSE);
        if (err != DB_SUCCESS) {
                fprintf(stderr, 
                        "WSREP: foreign key append failed: %d\n", err);
@@ -1446,6 +1446,9 @@ row_ins_check_foreign_constraint(
        ulint*          offsets         = offsets_;
        rec_offs_init(offsets_);
 
+#ifdef WITH_WSREP
+       upd_node= NULL;
+#endif /* WITH_WSREP */
 run_again:
 #ifdef UNIV_SYNC_DEBUG
        ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED));
@@ -1627,9 +1630,10 @@ run_again:
                                        err = wsrep_append_foreign_key(
                                                thr_get_trx(thr),
                                                foreign,
-                                               rec, 
-                                               check_index, 
-                                               check_ref, TRUE);
+                                               rec,
+                                               check_index,
+                                               check_ref,
+                                               (upd_node) ? TRUE : FALSE);
 #endif /* WITH_WSREP */
                                        goto end_scan;
                                } else if (foreign->type != 0) {
index 09c20911ec9e377690189f059385cdb446842062..8d2d9e1c76b734997b4d7f64d760bcc22fe2013b 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-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 the Free Software
@@ -56,6 +56,7 @@ Created 9/17/2000 Heikki Tuuri
 #include "log0log.h"
 #include "btr0sea.h"
 #include "fil0fil.h"
+#include "srv0srv.h"
 #include "ibuf0ibuf.h"
 #include "fts0fts.h"
 #include "fts0types.h"
@@ -3870,6 +3871,16 @@ row_drop_table_for_mysql(
                        ut_ad(!table->fts->add_wq);
                        ut_ad(lock_trx_has_sys_table_locks(trx) == 0);
 
+                       for (;;) {
+                               bool retry = false;
+                               if (dict_fts_index_syncing(table)) {
+                                       retry = true;
+                               }
+                               if (!retry) {
+                                       break;
+                               }
+                               DICT_BG_YIELD(trx);
+                       }
                        row_mysql_unlock_data_dictionary(trx);
                        fts_optimize_remove_table(table);
                        row_mysql_lock_data_dictionary(trx);
index f321e0ba94a89f1e229876e7dfa19fbc0e4b35a7..bd311a99b77567d332bde326e9bafd92d3e3d6a4 100644 (file)
@@ -2964,8 +2964,8 @@ row_sel_store_mysql_rec(
        const ulint*    offsets,
        bool            clust_templ_for_sec)
 {
-       ulint                   i;
-       std::vector<ulint>      template_col;
+       ulint                           i;
+       std::vector<const dict_col_t*>  template_col;
 
        ut_ad(rec_clust || index == prebuilt->index);
        ut_ad(!rec_clust || dict_index_is_clust(index));
@@ -2976,13 +2976,24 @@ row_sel_store_mysql_rec(
        }
 
        if (clust_templ_for_sec) {
-               /* Store all clustered index field of
+               /* Store all clustered index column of
                secondary index record. */
                for (i = 0; i < dict_index_get_n_fields(
                                prebuilt->index); i++) {
                        ulint   sec_field = dict_index_get_nth_field_pos(
                                index, prebuilt->index, i);
-                       template_col.push_back(sec_field);
+
+                       if (sec_field == ULINT_UNDEFINED) {
+                               template_col.push_back(NULL);
+                               continue;
+                       }
+
+                       const dict_field_t*     field =
+                               dict_index_get_nth_field(index, sec_field);
+                       const dict_col_t*       col =
+                               dict_field_get_col(field);
+
+                       template_col.push_back(col);
                }
        }
 
@@ -3000,9 +3011,13 @@ row_sel_store_mysql_rec(
                      == 0);
 
                if (clust_templ_for_sec) {
-                       std::vector<ulint>::iterator    it;
+                       std::vector<const dict_col_t*>::iterator it;
+                       const dict_field_t*     field =
+                                       dict_index_get_nth_field(index, field_no);
+                       const dict_col_t*       col = dict_field_get_col(
+                                                               field);
                        it = std::find(template_col.begin(),
-                                      template_col.end(), field_no);
+                                      template_col.end(), col);
 
                        if (it == template_col.end()) {
                                continue;
@@ -4345,6 +4360,10 @@ rec_loop:
 
        if (page_rec_is_supremum(rec)) {
 
+               DBUG_EXECUTE_IF("compare_end_range",
+                               if (end_loop < 100) {
+                                       end_loop = 100;
+                               });
                /** Compare the last record of the page with end range
                passed to InnoDB when there is no ICP and number of loops
                in row_search_for_mysql for rows found but not
@@ -4385,7 +4404,7 @@ rec_loop:
 
                                        /** In case of prebuilt->fetch,
                                        set the error in prebuilt->end_range. */
-                                       if (prebuilt->n_fetch_cached > 0) {
+                                       if (next_buf != NULL) {
                                                prebuilt->end_range = true;
                                        }
 
index 6a79b1ecbd1a2cd3b39a3c2930db4b96ac4b5eab..a6a3cc085ed0f184ab7d70af2a7c1b0483e60554 100644 (file)
@@ -1977,7 +1977,9 @@ row_upd_sec_index_entry(
                                        index, offsets, thr, &mtr);
                        }
 #ifdef WITH_WSREP
-                       if (err == DB_SUCCESS && !referenced                  &&
+                       if (wsrep_on(trx->mysql_thd)                          &&
+                           !wsrep_thd_is_BF(trx->mysql_thd, FALSE)           &&
+                           err == DB_SUCCESS && !referenced                  &&
                            !(parent && que_node_get_type(parent) ==
                                QUE_NODE_UPDATE                               &&
                              ((upd_node_t*)parent)->cascade_node == node)    &&
@@ -2263,7 +2265,7 @@ err_exit:
                        }
                }
 #ifdef WITH_WSREP
-               if (!referenced                                              &&
+               if (wsrep_on(trx->mysql_thd) && !referenced                  &&
                    !(parent && que_node_get_type(parent) == QUE_NODE_UPDATE &&
                      ((upd_node_t*)parent)->cascade_node == node)           &&
                    foreign
@@ -2493,6 +2495,7 @@ row_upd_del_mark_clust_rec(
 #ifdef WITH_WSREP
        rec_t*          rec;
        que_node_t *parent = que_node_get_parent(node);
+       trx_t* trx = thr_get_trx(thr);
 #endif /* WITH_WSREP */
 
        ut_ad(node);
@@ -2528,10 +2531,10 @@ row_upd_del_mark_clust_rec(
                        node, pcur, index->table, index, offsets, thr, mtr);
        }
 #ifdef WITH_WSREP
-       if (err == DB_SUCCESS && !referenced                         &&
+       if (trx && wsrep_on(trx->mysql_thd)                          &&
+            (err == DB_SUCCESS) && !referenced                       &&
            !(parent && que_node_get_type(parent) == QUE_NODE_UPDATE &&
              ((upd_node_t*)parent)->cascade_node == node)           &&
-           thr_get_trx(thr)                                         &&
            foreign
        ) {
                err = wsrep_row_upd_check_foreign_constraints(
index 18c58294b5c573e883f1d0dc6854ede487a0f437..b8848d108ff3557865dc9f115b5d4d21a3de5a65 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 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
@@ -41,6 +41,7 @@
 #include "sp_head.h"
 #include "pfs_digest.h"
 
+using std::min;
 /**
   @page PAGE_PERFORMANCE_SCHEMA The Performance Schema main page
   MySQL PERFORMANCE_SCHEMA implementation.
@@ -2018,7 +2019,8 @@ static void set_thread_account_v1(const char *user, int user_len,
   DBUG_ASSERT((uint) user_len <= sizeof(pfs->m_username));
   DBUG_ASSERT((host != NULL) || (host_len == 0));
   DBUG_ASSERT(host_len >= 0);
-  DBUG_ASSERT((uint) host_len <= sizeof(pfs->m_hostname));
+
+  host_len= min<size_t>(host_len, sizeof(pfs->m_hostname));
 
   if (unlikely(pfs == NULL))
     return;
index 4d193eda3769530d48354b936447138d45404db7..e6301ce6dad88a9aa11a81e82175b52a4cce5c18 100644 (file)
@@ -471,8 +471,10 @@ Obsoletes:      MySQL-shared-classic MySQL-shared-community MySQL-shared-enterpr
 Obsoletes:      MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
 # RHEL uses other names:
 Obsoletes:      mysql-libs mysql-community-libs
+Provides:      mysql-libs mysql-community-libs
 # Necessary on RHEL 7, no harm on other platforms:
-Obsoletes:      mariadb-libs
+Provides:      mariadb-libs
+Obsoletes:     mariadb-libs
 
 %description -n mysql-wsrep-shared%{product_suffix}
 This package contains the shared libraries (*.so*) which certain languages